ID:2523804
 
(See the best response by Kaiochao.)
Code:
var
Fuzzies = 0

mob
Enemies
Spawner
New()
spawn(-1) Spawn()
return ..()

proc
Spawn()
while(src)
while(Fuzzies < 5)
new /mob/Enemies/Fuzzy(loc)
sleep(600)
Fuzzy
New()
Fuzzies += 1
return ..()


Problem description:
The Spawner is supposed to check every minute for how many of the Fuzzy mobs are in the game, and produce them until there are 5 before waiting another minute. Regardless, it only produces 1 mob at a time. It spawns a single mob, then does nothing more until I kill that mob, at which point it instantly produces another mob. How do I fix this?
Best response
Sounds like you have a loop not shown, called in an alternate or inherited New of Fuzzy, which isn't spawn()'d or have waitfor disabled, causing the Spawner to wait for the "new" line to finish, which only happens after the Fuzzy dies.
You got it. Forgot to spawn the Fuzzy's movement proc. Thank you for the help.

Login to reply.