increasing chance of creating monster

0 favourites
  • 7 posts
From the Asset Store
This pack of sounds for monsters consists of 107 sounds, among which you can find different sounds of Attack, Death, Ste
  • I have 75 monsters in my game that are randomly created in an area each level

    I want to make it so that that level 1 picks from monster 1-2 to create, level 2 picks from monster 1-3 to create, level 3 picks from monster 1-4 to create, level 4 monsters 1-5 and so on through the first 75 levels.

    I could create individual events for all this but that would be hundreds of events and seems a little overkill.

    I tried playing around with rex's nickname plugin but I'm either getting just monster 1, or all 75 monsters, any help or ideas would be appreciated.

  • Pretty easy:

    • I hope your monsters have an Id or are they a part of an animation ? If you haven just:

    Right click on family

    Add an instance variable id = 0

    Set for every monster the correct id (1-75)

    • You need to have your actual level saved in a global variable, if you haven't done this yet just do:

    + On start of Layout

    • Set Level to 1-75

    + Every tick //I?m not sure how often you spawn them, so change this line how you like

    ++ = random(1, level)

    • spawn family

    if you want to spawn all the choosen monsters at the same time do:

    + Every tick

    ++ for from 1 to level

    +++ = loopindex("")

    • spawn family

    + = event

    ++ = subevent

    • = action
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks for the question. Really had to think a bit. Here is another way of doing it without using families. You can use the animation frames and set each frame as a monster. Had fun making this capx for you. If you need your monsters animated then you can select an animation instead, and let the animation run.

    Credit must go to Yann in this post I was a little stumped and so went looking for help and found the idea there.

    Happy creating

  • I also asked him if he uses animation frames, but the most newbies using families instead of animation frames. Cause Animation Frames are better for the performance but they are harder to understand and instances need to be defined over loops.

  • You had already created a topic on this.

    Anyway here's an example using rexrainbow nickname to create from what I suggested on your earlier topic.

    rexrainbow plugin and behaviour:


  • Wow, great replies guys...anyway I can give you reputation or thank you?

    Going to go with darklinki's solution I think as I aready assigned i'ds 1-75 to the monsters so all I have to do it assign the 'level' global variable to use as the top figure in the random spawn (feel kinda an idiot for not figuring that out myself) I can also assign 'levellower' global so the weaker monster are removed as the game continues.

    Thank you all again, so nice to see such active and helpful forum members.

  • Inserting levellower sounds very good to remove weaker monster ;)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)