Bug? Reload time system

Get help using Construct 2

Post » Tue Sep 04, 2012 10:36 am

Hey all, again!

I'm starting to develope a 2d shooter sidescroller with construct2 and of course for that I need a "reload time" for the ranged weapons.

I've created it but I have a problem, all goes fine before the reload time, when the reload time is active (2 sec, a pistol test) it goes well and the ammo is set to 9 again. I've set that when you shoot, the ammo substract 1 when is shooted to the ammo, BUT after the reload time (2sec) it waits another aditional 4 seconds by the face to allow the bullets to substract again.

So after the reload time (2 seconds) the ammo indicator goes 9 AGAIN BUT if I shoot the 9 ammo doesn't go low after 4 seconds by the face.

I don't know if I mean it correct.. so I've uploaded the capx. Test it and see what happens and after that, please. Answer me!

http://devmidgard.com/games/unsurvive/source/source.zipdevMidgard2012-09-04 10:37:52
B
17
S
4
G
4
Posts: 104
Reputation: 3,950

Post » Tue Sep 04, 2012 2:22 pm

Put in a 'System: Trigger Once' into event 4 so it only happens one time when ammo = 0. And then you can have 'System: Set testgunammo to 5' right after the 'wait 2 seconds'. And get rid of the testgunammomoreloadtime stuff.

ramones2012-09-04 14:23:12
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Wed Sep 05, 2012 9:50 am

@ramones Thanks! Working fine now :D

But can yo explain me how it works?devMidgard2012-09-05 09:51:18
B
17
S
4
G
4
Posts: 104
Reputation: 3,950

Post » Wed Sep 05, 2012 11:06 am

It's fairly self explanatory I think. Event 3: when the ammo reaches 0, wait 2 seconds and then set it back to 5. The 'trigger once' ensures the event doesn't fire repeatedly when the ammo is 0.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 20 guests