When an enemies dies how do you make it so the spawn in it's original place?
ID:149584
![]() Mar 31 2002, 1:07 pm (Edited on Mar 31 2002, 1:24 pm)
|
|
Buzzyboy wrote:
He never asked that. I even searched He never asked that, you're right. He answered that, and it's probably the best code for it I've ever seen. ;-) [edit] Since I don't know where it is either, however, I'll just repost it from my snippets list: //Credit to: Shadowdarke (slightly modified by Spuzzum) There you go. Enjoy. =) |
world/New()
status+="Beta" spawn while(1) sleep(40) for(var/obj in world) for(var/mob/M in world) sleep(100) Repop() this will respawn objects, and mobs as in monsters every 1 minuet, rather easy :) - RaeKwon |
Buzzyboy wrote:
that won't work it's not going anywhere. is it because of the death check doesn't delete them? Yep, that'd be why. |
I have problems with each code.
for ShadowDarke's code it still won't respawn. for Raekwon's it says " Warning! could not find matching colour entry for white |
Weird, try this.
world/New() spawn while(1) sleep(300) for(var/obj in world) for(var/mob/M in world) sleep(600) Repop() if it still does, its a BYOND bug, cause it doesnt for me. - RaeKwon |
I tried making it a GM verb
and this it what it said runtime error: Infinite loop suspected. To avoid this safety check, set world.loop_checks=0 proc name: Repop (/proc/Repop) usr: \[Master GM] Buzzyboy (/mob/newbie) src: null call stack: |
Try this,it works fine for me.
world/New() If it doesn't something is REALLY wrong. -Kappa the Imp |
Okay, please re-read his post. He said that he doesn't delete mobs when they die.
If he wants either of these systems to work, he has to delete the mobs when they die. Of course, since he's not deleting mobs when they're killed, I don't see why he can't just add a variable like this: mob/var/respawn = 300 //30 seconds mob/var/turf/spawn_loc mob/New(loc) ..(loc) spawn_loc = loc mob/Death() //or whatever proc //do whatever spawn(respawn) //after 'respawn' ticks, src.loc = spawn_loc //return me to my spawn location //and do whatever else you need to do to make me new again |
Search back several hundred days using the Search tool for a post by Shadowdarke on the same subject, that's how.