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

  • SocksSocks London, UK.Posts: 12,822
    edited June 2014 Accepted Answer

    @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 timer

    If 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 it

    You 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

  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870

    Use a "timer" behavior, and put your rule inside of it, and set how long you want them to spawn.

  • macman123macman123 Member Posts: 98

    @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

  • SocksSocks London, UK.Member Posts: 12,822

    @macman123 said:
    . . . so i cant put a timer in a timer . . .

    What happened when you tried ?

  • macman123macman123 Member Posts: 98

    nothin because it wouldnt allow me.

  • macman123macman123 Member Posts: 98

    @Socks‌ well no i tried to put a rule in a timer and that didnt work. i will try the timer in timer

  • macman123macman123 Member Posts: 98

    but i wouldnt know which behavior to use to stop it

  • macman123macman123 Member Posts: 98

    @Socks‌ thanks. and its proobably not my creator copy its me im kinda new this is my second game.

  • ookami007ookami007 Member Posts: 581

    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

  • macman123macman123 Member Posts: 98

    @ookami007‌ isnt that method more complicated because it dealing with all those attributes?

  • ookami007ookami007 Member Posts: 581

    More complicated, possibly... but it will use less resources plus you have more granular control over it.

  • macman123macman123 Member Posts: 98

    @ookami007‌ ok i will try it.

Sign In or Register to comment.