ID:273680
 
Instead of your basic Spawn system with a loop how could I do this instead?

- I'm creating a zombie game kind of based off of Nazi Zombies. How could I create a spawn system where it spawns zombies from one area on the map. Lets say for every round it multiplies it by *0.2 and where zombies only spawn when the round is started?

Any suggestions?
Use a for() loop?
var/number_of_zombies_to_spawn = 100
var/round = 1
proc/spawn_zombies()
var/x = 100*(0.2*round)
for(x,x>0,x--)
new /mob/zombie(/*whatever location*/)
In response to Spunky_Girl
Thank you very much.
In response to Spunky_Girl
Don't forget to toss a delay in there somewhere, that loop is liable to overload if given the right conditions.
In response to Nadrew
Lol, figured that out the first time I ran it not paying attention. But then after that I fixed it.
In response to Nadrew
Wait for some reason it's not working I thought it was earlier but it's not and here's my setup.

area
ZombieSpawn




proc/spawn_zombies()
var/x = 100*(0.2*usr.Round)
for(x,x>0,x--)
new /mob/zombie(/area/ZombieSpawn)
mob
verb
Ready()
set hidden=1
if(usr.InRound==1)
usr<<"<font color=red><B>:CLIENT INFO:</B> You must first kill all zombies in this round!"
else
usr<<"<B>The Round Will Begin Soon!"
usr.Round+=1
usr.InRound=1
usr.Round()
In response to XxBloody NightmarexX
XxBloody NightmarexX wrote:
Wait for some reason it's not working I thought it was earlier but it's not and here's my setup.

>
> area
> ZombieSpawn
>
>
>
>
> proc/spawn_zombies()
> var/x = 100*(0.2*usr.Round)
> for(x,x>0,x--)
> new /mob/zombie(/area/ZombieSpawn)
> mob
> verb
> Ready()
> set hidden=1
> if(usr.InRound==1)
> usr<<"<font color=red><B>:CLIENT INFO:</B> You must first kill all zombies in this round!"
> else
> usr<<"<B>The Round Will Begin Soon!"
> usr.Round+=1
> usr.InRound=1
> usr.Round()
>
>


I still need help.
In response to XxBloody NightmarexX
Exactly, what isn't working?
In response to Emasym
No enemies are spawning.
In response to XxBloody NightmarexX
You need to be more specific. That is like:

Student - "I can't do the math problem"
Teacher - "Well, what are you having trouble with?"
Student - "My answer is wrong"
In response to OrangeWeapons
I stated the problem as clear as I could, no enemies are spawning!
In response to Emasym
In that code I don't see the spawn_zombies() proc called anywhere.. Also NEVER use usr in procs, ALWAYS use src.
In response to XxBloody NightmarexX
You have a GLOBAL proc, in which you're using "usr" to calculate a number.

"usr" is nobody. "Usr" also shouldn't be used in procs, ax Xyphon has mentioned, except for actions where you're 100% sure the player has called them (ex: Mouse actions such as Click, DblClick, MouseExited, MouseEntered) and client/Topic(), mainly.

Hence, your number is most likely nothing, thus not making zombies spawn.