is there a way to make waves of men come out of spawners and stop spawning after a period of time?
in my game men are spawned out and i want to make it to where they stop spawning after a period of time how would i do that?
Best Answer
-
Socks London, UK.Posts: 12,822
@macman123 said:
nothin because it wouldnt allow me.Can you say exactly what happened when you tried, did you get an error message or something ?
@macman123 said:
Socks well no i tried to put a rule in a timer and that didnt work. i will try the timer in timerIf you can't put rules into timers then I suspect there is something wrong with your copy of Creator ? What exactly happens when you drag a rule into a timer ?
@macman123 said:
but i wouldnt know which behavior to use to stop itYou don't need a behaviour to stop a timer, just set it to how long you want it to run - and once the time is up it will stop. So if you tell it to do something for 12 seconds then after 12 seconds it will stop doing whatever you told it to do.
Answers
Use a "timer" behavior, and put your rule inside of it, and set how long you want them to spawn.
@SlickZero i have a timer on them to spawn so i cant put a timer in a timer so how would i go on to change that
What happened when you tried ?
nothin because it wouldnt allow me.
@Socks well no i tried to put a rule in a timer and that didnt work. i will try the timer in timer
but i wouldnt know which behavior to use to stop it
@Socks thanks. and its proobably not my creator copy its me im kinda new this is my second game.
Don't use timers.... try this...
Set a attribute in your actor called "time to spawn" and set it initially to -999
Set a attribute in your actor called "spawn interval" and set it to however often your want to spawn one
Set a attribute in your actor called "time to stop" and set it initially to -999
Then, test to see if the time to spawn attribute is set to -999, if yes then set it to self.time + (attribute) spawn interval AND set (attribute) time to stop to self.time + however long you want it to run
Then, test to see if self.time >= time to spawn and if it is... spawn something
If self.time >= time to stop then destroy self - or just stop spawning by putting the spawn routine inside the check and making it <= instead
@ookami007 isnt that method more complicated because it dealing with all those attributes?
More complicated, possibly... but it will use less resources plus you have more granular control over it.
@ookami007 ok i will try it.