0 Favourites

How do I "i manage monsters multi-instance" FOR CONSTRUCTOR

  • Hi guys,

    i really need an urgent help from veteran of construct, i think there is something in the way i code some action who should be incorrect or i've missed something

    anyway, i'm not able to understand correctly the "for each" when i have multiple instance of the same monsters.

    Attached a very detailled but simple example.

    i have multiple instance of the same monster "this monster is composed of a monster box (having platform behavior) and a monster sprite (for all animation) both are in the same container and monster sprite are linked to a "monsters Family".

    Now try my sample ,

    -On Mouse left button or touch screen, you will spawn bullet

    -By default monsters are in "stand action" and "sleep state" (when you're mouse cursor is 200px close a monster it should swtich to "move_left" action and "awake" state)

    if you shoot a monsters (request 2 bullets), each monster, should :

    IF MOVING

    1- Stop

    2- jump (simulate by a vector y, in case monster are not on the ground)

    3 -then fall through the ground.

    Current problem :

    1 - Killing monster when they are in stand action not work

    hope someone could help me very soon to fix this problem, i'm pretty sure it's nothing. but it will be a big help for my construct understanding.

    thanks again for your time guys !

  • Your For Each was in the wrong place

  • hey spongehammer ! first at all thanks a lot for your so fast help ! let me just download firstly the last Construct 2 version as i have the 168 and you seem to have the 169, then i will test and answer you in a couple of minutes

  • spongehammer ! i"ve just tested and unfortunately it not work for me , i have the same result as before :'( mean if you hold the button and kill more than one you could see the others instance reach the top of the layout or some simply stop

  • Ashley could i ask you to check about my problem please ? i'm sure you'll get the answer

  • Like this?

  • spongehammer moebios Ashley , first at all thanks for your help & time, so i've just tested your caps, but unfortunately even if we could think it work quickly , the problem have just moved. if you could download my last attached & updated caps and check. you could see that : if a monster is not moving "stand action" or switch from move_left or right to stand, then the die action not work too for all instance (as your fix suppose an "on stopped action to enable die) then it not work anymore.

    All your help will be welcome

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • still no one ?

  • the problem is the trigger once condition,it will not trigger again until the condition become false again.

    In your problem,the action will not be triggered again until there is no monster which its action is "die".

    So I added a condition so that it will become false,and so the action will be triggered again.

  • hi StormHo what could i say more ? other than thank you very much storm for your help, your time, and your skill !!!! i've just tested your solution and it fix my problem and also another one i was fighting with , you're in my helper list now :p

  • anthonydsf you are welcomed

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