Controlling Spawning actors

Hi guys, I'd like to ask a bit of help. I want to learn how to control spawn by numbers. Let's say, I can control spawns every 2.5 seconds, but I would like to to stop after it spawned 30 actors.

Also how do you create a rule that says, after all the 30 actors have left, spawn another actor after etc seconds?

Thanks!

Comments

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

    @zajinakajazz said:
    Let's say, I can control spawns every 2.5 seconds, but I would like to to stop after it spawned 30 actors.

    When A < 30
    --Timer Every 2.5 seconds
    ----Change A to A+1
    ----Spawn Actor

  • zajinakajazzzajinakajazz Member Posts: 43

    @Socks Thanks mate it worked beautifully. =) Do you mind if I ask how can I connect the second rule "after all the 30 actors have left/destroyed, spawn another actor after etc seconds?"

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

    @zajinakajazz said:
    . . . how can I connect the second rule "after all the 30 actors have left/destroyed, spawn another actor after etc seconds?"

    So, once all 30 actors have been destroyed - wait for a certain amount of time - and then spawn another actor (just one single actor) ?

  • zajinakajazzzajinakajazz Member Posts: 43

    @Socks yes sir. I was thinking of spawning another batch of a different actor after the 30 hits 0.

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2015

    @zajinakajazz said:
    Socks yes sir. I was thinking of spawning another batch of a different actor after the 30 hits 0.

    Do you want this to happen after "the 30 hit 0" or "after etc seconds" ?

    Are you wanting to 'spawn another actor (just one single actor)" or "another batch of a different actor" ?

  • zajinakajazzzajinakajazz Member Posts: 43

    @Socks so the first one worked, and I tried working on the second one with this, but didn't work. Wave 2 didn't work.

  • zajinakajazzzajinakajazz Member Posts: 43

    @Socks, another wave preferably. 5 actors.

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

    @zajinakajazz said:
    Socks, another wave preferably. 5 actors.

    Sorry, I don't understand anything of what you are saying (I'm easily confused ! lol :smile: ) hopefully someone else can jump in and suggest some ideas. Good luck !

  • zajinakajazzzajinakajazz Member Posts: 43

    @Socks Okay exclude the first batch since it's done. What I wanted next is to spawn another batch actors like what I've previously, but this time I wanted to make sure that the first batch has been wiped out before the second batch comes in. The second batch can be any number. I gave it 5.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    You need another attribute that keeps track of how many enemies there is alive. Then when that gets to 0, you can switch to the next wave.

    I'll make you a small demo soon...

    Mental Donkey Games
    Website - Facebook - Twitter

  • zajinakajazzzajinakajazz Member Posts: 43

    @NipaDidIt I made an integer which I called wave2, but I'd like to see how you do it...

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    Click the enemies to destroy them. When a wave is completely spawned, and all enemies are destroyed, the next wave will begin.

    There is now 2 waves, but you can copy / paste the "wave" -rule and just change the values to your liking for the next wave...

    Hope this helps!

    Mental Donkey Games
    Website - Facebook - Twitter

  • zajinakajazzzajinakajazz Member Posts: 43

    @NipaDidIt Thanks mate! hehe

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    You're welcome!

    Mental Donkey Games
    Website - Facebook - Twitter

  • zajinakajazzzajinakajazz Member Posts: 43

    @NipaDidIt

    Hey Nipa, I can't seem to make the second wave come after the first wave was killed by bullets. Can you check out what went wrong with my logic? :'(

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    In the "monster 1" -actor, the "bullet" -rule:

    You need to add a behavior that changes game.enemy count to game.enemy count-1 in the "when self.hp selfX = 0" -rule. And also in the rule where it gets destroyed by the wall.

    If you don´t, the game.enemy count never gets to 0, and the next wave does not trigger.

    Same for the "monster 2" -actor.

    Fixed project file attached...

    Mental Donkey Games
    Website - Facebook - Twitter

  • zajinakajazzzajinakajazz Member Posts: 43

    @NipaDidIt uhh. the file you attached was the earlier file you sent me...

  • zajinakajazzzajinakajazz Member Posts: 43

    @NipaDidIt nvm my mistake, Thank you so MUCH!!!

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    @zajinakajazz said:
    NipaDidIt nvm my mistake, Thank you so MUCH!!!

    Happy to help!

    Mental Donkey Games
    Website - Facebook - Twitter

Sign In or Register to comment.