30 on 30 off loop
Brundi
Member Posts: 60
Hi, I hope this doesn't get to complicated and someone can help me with this. I want to make a game where for thirty seconds every one second it spawns an actor. After the thirty seconds are done I want there to be a thirty second pause where nothing is spawned for 30 seconds. After that I want it yo loop again and spawn for 30 seconds and wait for 30 seconds ect. I have tried to accomplish this with timers and a Boolean attribute but I can't seem to get it to work
Thanks thanks thanks, Brandon
Comments
No real need for attributes of any kind - just compound a few timers in the right order . . . .
. . . . .
A confusion often arises with timers, in that people expect an 'every' timer to produce a result instantly - and then one again at X seconds later (X being whatever time - in seconds - you have you timer set to) - and so on . . . . but an 'every' timer doesn't do anything until X seconds have elapsed . . . so in a situation like the above, you would want to place a spawn behaviour outside of the timers - as well as one inside, the outside one does the initial spawn (at 0 seconds) and the one inside handles everything else from there onwards.
This initial pause (especially on long timers like 30 seconds) can make people think their code is not working when it's doing exactly what it should be doing (waiting 30 seconds).
So to take into account this initial - one off spawn - the logic should look like this:
. . . then . . . .
I'll make you a quick demo . . . . back soon . . .
Here you go:
https://www.mediafire.com/?8sy9y99kuinjxdm
. . .
Woah, Thanks a ton. I didn't expect these forums to be so helpful. You really helped me out socks! Thanks!