ID:261322
 
Instead of having the whole world repop, I just made a turf that makes monsters after a certain period of time;

turf
grave
var/makingspeed = 100
New()
makingspeed()
..()
proc
makingspeed()
var/Zombie = locate(x,y,z)
sleep(50)
new /mob/Zombie(Zombie)
makingspeed()
icon = 'Grave.dmi'

The only problem is that if somone doesnt hunt down and kill these zombies, the map will be over run by them. So my question is how would I make the grave not spawn another zombie until the previous one has been slain? Thank you.
Philipe The Bard wrote:
Instead of having the whole world repop, I just made a turf that makes monsters after a certain period of time;

turf
grave
var/makingspeed = 100
New()
makingspeed()
..()
proc
makingspeed()
var/Zombie = locate(x,y,z)
sleep(50)
new /mob/Zombie(Zombie)
makingspeed()
icon = 'Grave.dmi'

The only problem is that if somone doesnt hunt down and kill these zombies, the map will be over run by them. So my question is how would I make the grave not spawn another zombie until the previous one has been slain? Thank you.

Just add a variable to the turf that contains the last zombie it made. If that variable is true (i.e. it has something in it) then don't make a new zombie.

By the way, your makingspeed variable isn't used at all... what you have right now is infinite recursion. Eventually this proc will crash.


turf
grave
var/makingspeed = 100
var/mob/last_zombie

New()
spawn(makingspeed) MakeZombies()
..()
proc
MakeZombies()
var/Zombie = locate(x,y,z)
if(!last_zombie) //if the last zombie was destroyed,
last_zombie = new /mob/Zombie(Zombie) //make a new one and set last_zombie to it
spawn(makingspeed) MakeZombies()
icon = 'Grave.dmi'
In response to Spuzzum
I got it in with out any errors or warnings, but wafter a monster is spawned from the grave, and I kill it, no other monsters come out.