Change the rate of Spawning Enemies
jkornoff
Member Posts: 55
Hi, and thanks in advance for the help.
I have two enemies. The initial spawn rate is one every 2 and 5 seconds respectively. Easy.
But now I am trying to slowly increase that rate over time. The longer you survive, the more often the enemies spawn.
I guess I'm not clear on how to change a game integer attribute. I've got a game.Level attribute set at 1. My enemies spawn using a timer set at every game.Level+1 and game.Level+4. So initially every 2 and 5 seconds.
Even after reading the tutorials I haven't successfully been able to change the game.Level value it seems.
I have two enemies. The initial spawn rate is one every 2 and 5 seconds respectively. Easy.
But now I am trying to slowly increase that rate over time. The longer you survive, the more often the enemies spawn.
I guess I'm not clear on how to change a game integer attribute. I've got a game.Level attribute set at 1. My enemies spawn using a timer set at every game.Level+1 and game.Level+4. So initially every 2 and 5 seconds.
Even after reading the tutorials I haven't successfully been able to change the game.Level value it seems.
Comments
But that doesn't work for me.
create a new actor called timer (or whatever you want). Make it a 25 x 25 actor and just put it outside the field of view.
Create a timer in it
every 10 seconds
change attribute game.Level to game.Level+1
as long as game.Level is an integer, that will increase it by 1 every five seconds.
then in your spawner, create a few rules
if game.Level < 5
timer every 5 sec
spawn actor
if game.Level < 10
timer every 3 sec
spawn actor
if game.Level < 15
timer every 1 sec
spawn actor
etc.
something like that should work.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
Thank you!