ID:148520
 
obj/Bullet/Bump(mob/M)
if(ismob(M))
M.die()

i get an error that says undefined proc. any ideas?
EnjoiStaticX wrote:
obj/Bullet/Bump(mob/M)
if(ismob(M))
M.die()

i get an error that says undefined proc. any ideas?

Then there is no /mob/proc/die... we'd have to see more code, that's all I can tell you. Do you have:
mob/
proc/
die()
// Commands

Note that if it is /mob/player/proc/die, it wont work.
In response to Nova2000
obj
bullet
Bump(mob/M)
if(ismob(M))
M.die()
icon = 'projectile.dmi'
icon_state = "bullet"
New(mob/owner)
..()
walk(src,owner.dir)
sleep(10)
del src

ok, there's the full code....what do you think now?
In response to EnjoiStaticX
try doing just die(), without the M.
In response to Mystic Water Mouse
Please Mystic, don't give advice about things you don't know a thing about.
In response to EnjoiStaticX
I think that it's not the full code. Do you, or do you not have a <code>mob/proc/die()</code> proc? If you don't, there's your problem. If you do, let's see it.
In response to Crispy
now that you mention it...i don't have the die() proc. i tired making one but i seriously can't get it to work... =(
In response to EnjoiStaticX
EnjoiStaticX wrote:
now that you mention it...i don't have the die() proc.

Well no wonder you're getting an "undefined proc" error! :-D

i tired making one but i seriously can't get it to work... =(

It's really not all that hard:

<code>mob/proc/die(mob/killer) if (killer==src) world << "[src] committed suicide" else world << "[killer] kills [src]" del src</code>

That's a very basic example; all it does is tell everyone about the death, and who caused the death. Just remember to pass the mob who killed src to die() when you call it, and you're set!

You can add anything else you want in there - you could respawn players instead of deleting them, place blood/bodies, give the killer an experience bonus, etc.
In response to Crispy
Don't forget you need
if(!killer)
world << "[src] spontaniously combusted."

if the killer no longer exists when the die() proc is called.
In response to EnjoiStaticX
EnjoiStaticX wrote:
obj
bullet
Bump(mob/M)
if(ismob(M))
M.die()
icon = 'projectile.dmi'
icon_state = "bullet"
New(mob/owner)
..()
walk(src,owner.dir)
sleep(10)
del src

ok, there's the full code....what do you think now?

I think you set up New() wrong; the owner of the bullet should be the second argument. The first argument is the location of the bullet. Also, you're calling sleep() instead of spawn() here, which doesn't seem like a good idea.
obj/bullet
icon = 'projectile.dmi'
icon_state = "bullet"
var/mob/owner

Bump(atom/A)
if(ismob(A))
var/mob/M=A
M.die(owner)
del(src)

New(newloc,mob/M)
owner=M
walk(src,owner.dir)
spawn(10)
del(src)

mob
proc/die(mob/killer)
if(killer)
world << "[killer] kills [src]!"
del(src)

Lummox JR