Create a Timed Loop

Get help using Construct 2

Post » Fri Jun 15, 2012 4:28 pm

I have a boss moving around in a Sin Movement fashion, I want it so that he stops his movement pauses for a second then fires a shot, pauses again for a second then fires a second shot and finally continues on with his movement.

I have tried using the Every X second event while activating and deactivating groups, this actually seems to cause the event to run immediately on activation no matter what the X seconds is set to. I have tried the Repeat event with a Wait X seconds action. I have also tried using a While Loop. Nothing seems to give me a consistent timed loop.

I get the feeling that the "For loop" is exactly what I'm looking for but I guess I don't fully understand how to use it. I have read the Loop/Arrays help page but I'm still a little confused on what the start index and end index mean, and how I would control the system to prevent it from going through the index every tick.

I'm sorry but I don't have a good CAPX to upload because I have tried so many combinations, and haven't been saving them individually, that at this point I don't a completed event sheet.

Thank you for taking the time to read this and any help is greatly appreciated
B
5
Posts: 16
Reputation: 609

Post » Fri Jun 15, 2012 4:35 pm

Can't you just do it in one event?

Wait 1 second
Shoot
Wait 1 second
Shoot

?
B
16
S
6
G
6
Posts: 100
Reputation: 4,840

Post » Fri Jun 15, 2012 6:58 pm

I tried this and unfortunately it seems that while the conditions of the event are met the actions are sent every tick, so instead of it waiting 1 second to shot 1 bullet it waits 1 second then begins to fire a constant stream of bullets because of how many times the action was sent while waiting for the first bullet.

**EDIT**

So to fix this problem of the actions being sent to much I just added another variable called ShotCooldown that does not have a Wait action infront so that the conditions are not met right away.

Thank you so much for the help this was exactly what I needed.Mr4272012-06-15 19:20:34
B
5
Posts: 16
Reputation: 609


Return to How do I....?

Who is online

Users browsing this forum: zenox98 and 24 guests