Ok here is the that makes everything happen. With what I have here so far it deletes the corpse along with the src.mob. I've also had it to where it will call the Dead() proc and sleep(500) with the original src overlaying the corpse. Can someone find a way to make it so the src is deleted right away but getloc is preserved to where it will create a corpse in it's place and then delete itself after a sleep(500)???
Dead(mob/mon/D) // Monster Dead
D.dead = 1
var/getloc = D.loc
switch(D.deathpic)
if("blob_green")
del(D)
new/dead/blobs/green(getloc)
spawn()
..()
-------------------------
// Dead Bodies
dead
parent_type = /obj
icon = 'monster.dmi'
New()
DeathSleep()
return
blobs
name = "Dead Blob"
green
icon_state = "blob_green_death"
proc
DeathSleep()
set background = 1
sleep(500)
del src
return
ID:148273
![]() Apr 27 2003, 3:05 pm
|
|
Dead(mob/mon/D) // Monster Dead
D.dead = 1 var/getloc = D.loc switch(D.deathpic) if("blob_green") var/P = new/dead/blobs/green(getloc) spawn(500) del(P) del(D) ---------------------------------- It seems when this runs.. it works for placing a corpse, but the del(P) never works. Any ideas??? It just stays there... LJR |
I believe any running procs that originate from an object are canceled when that object is deleted. That means the spawn is canceled as well. What you should do is modify the New() proc for the corpse to contian the spawn-delete code.
By the way, Volte has a better idea for how to determine which corpse is needed. Instead of storing a massive switch statement containing all the possible corpse types, just use a single variable that holds the object type you want to be created. <code>mob/goblin var/corpse = /obj/corpse/goblin proc/Die() new corpse(src.loc) del(src) obj/corpse New() spawn(500) del(src)</code> |
By the way -- I'm back from Mississippi. :)
~>Volte