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

Get help using Construct 2

Post » Mon May 19, 2014 9:51 pm

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 !
You do not have the required permissions to view the files attached to this post.
Last edited by anthonydsf on Tue May 20, 2014 11:28 am, edited 3 times in total.
B
4
G
1
Posts: 35
Reputation: 595

Post » Mon May 19, 2014 10:05 pm

Your For Each was in the wrong place :)
You do not have the required permissions to view the files attached to this post.
B
48
S
16
G
9
Posts: 1,098
Reputation: 11,197

Post » Mon May 19, 2014 10:09 pm

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 :)
B
4
G
1
Posts: 35
Reputation: 595

Post » Mon May 19, 2014 10:18 pm

@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
B
4
G
1
Posts: 35
Reputation: 595

Post » Mon May 19, 2014 10:32 pm

@Ashley could i ask you to check about my problem please ? i'm sure you'll get the answer
B
4
G
1
Posts: 35
Reputation: 595

Post » Tue May 20, 2014 2:45 am

Like this?
You do not have the required permissions to view the files attached to this post.
B
24
S
4
G
2
Posts: 96
Reputation: 2,467

Post » Tue May 20, 2014 11:02 am

@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 :)
B
4
G
1
Posts: 35
Reputation: 595

Post » Tue May 20, 2014 10:46 pm

still no one ?
B
4
G
1
Posts: 35
Reputation: 595

Post » Wed May 21, 2014 9:08 am

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.
You do not have the required permissions to view the files attached to this post.
B
17
S
4
G
1
Posts: 203
Reputation: 1,583

Post » Wed May 21, 2014 11:54 am

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 :) so again thank, i will back to you soon if i meet any other kind of problem :) , you're in my helper list now :p
B
4
G
1
Posts: 35
Reputation: 595

Next

Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 36 guests