Controlling Spawning actors
zajinakajazz
Member Posts: 43
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
When A < 30
--Timer Every 2.5 seconds
----Change A to A+1
----Spawn Actor
@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?"
So, once all 30 actors have been destroyed - wait for a certain amount of time - and then spawn another actor (just one single actor) ?
@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" ?
@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.
@Socks, another wave preferably. 5 actors.
Sorry, I don't understand anything of what you are saying (I'm easily confused ! lol ) hopefully someone else can jump in and suggest some ideas. Good luck !
@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.
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
@NipaDidIt I made an integer which I called wave2, but I'd like to see how you do it...
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
@NipaDidIt Thanks mate! hehe
You're welcome!
Mental Donkey Games
Website - Facebook - Twitter
@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?
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
@NipaDidIt uhh. the file you attached was the earlier file you sent me...
@NipaDidIt nvm my mistake, Thank you so MUCH!!!
Happy to help!
Mental Donkey Games
Website - Facebook - Twitter