ID:176437
 
....after getting shot. i have the shooting verb all set up, i just need to know how to get the mob to disappear when the "bullet" comes in contact with him. this should go for player controlled character as well as NPCs. thanks.
obj/Bullet/Bump(mob/M)
if(ismob(M))
M.die()
In response to Garthor
i'm getting an "undefined proc" error for M.die()
In response to EnjoiStaticX
try changing M.Die() with M.del
Its simple and effective, and it doesnt seem you want much complication with procs.
In response to Maz
still getting the same kind of errors.. =( maybe i can run a test game so you can see what i'm trying to do?
In response to EnjoiStaticX
M.die() is the proc belonging to all mobs that dictates how they die. You need to write one yourself.
In response to Garthor
ok..i've tried and tried and i can't seem to get anyway to get the die() proc to work. =(
In response to EnjoiStaticX
<font size=6>YOU... HAVE... TO... MAKE... ONE.</font>
In response to EnjoiStaticX
mob/proc/die()the proc
if(src.hp <= 0)//change hp to your var thats their hp (lol do i under stand my self)
src.loc=locate(2,2,1)//change this to the location where he spawns
src.hp = src.maxhp//change hp and maxhp to what you call your var hp and maxhp is (like health or whatever)


I hope that should help...
In response to Garthor
yeah....i tried making the die() proc, but it won't work. i'm sorry i just don't know how to do it. i looked at the reference and guide and stuff and still nothing. oh, and making your text really big to make me look stupid isn't really cool...
In response to EnjoiStaticX
Garthor doesn't need to make you look stupid. You're doing a fine job of that already.

I already gave you one example of a die() proc in [link]
In response to Crispy
ok sorry...it still won't work though. here's what i have:

obj
bullet
Bump(mob/M)
if(ismob(M))
die()
icon = 'projectile.dmi'
icon_state = "bullet"
New(mob/owner)
..()
walk(src,owner.dir)
sleep(10)
del src

mob/proc/die(mob/killer)
if (killer==src)
world << "[src] committed suicide"
else
world << "[killer] kills [src]"
del src
In response to EnjoiStaticX
btw, i'm getting "unbalanced" and "proc definition not allowed inside another proc" errors.
In response to EnjoiStaticX
EnjoiStaticX wrote:
ok sorry...it still won't work though. here's what i have:

obj
bullet
Bump(mob/M)
if(ismob(M))
die()

That's supposed to be M.die(), and as I showed you yesterday that should really be M.die(owner). Why are you using (a form of) my die() proc, but not any of the other changes you needed to make?

New(mob/owner)
..()
walk(src,owner.dir)
sleep(10)
del src

This is indented too far, which is why you're getting those errors. And it's still wrong. I showed you yesterday how to do the New() proc correctly.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
That's supposed to be M.die(), and as I showed you yesterday that should really be M.die(owner). Why are you using (a form of) my die() proc, but not any of the other changes you needed to make?

That's mine, actually. :-) I _did_ tell him to supply the killer argument though. Copy 'n' paste syndrome, methinks.
In response to Crispy
Crispy wrote:
That's mine, actually. :-) I _did_ tell him to supply the killer argument though. Copy 'n' paste syndrome, methinks.

Ah. I noticed the interior wasn't quite mine but the killer arg was one I put in. I could tell that what he's been doing (including the removal of M from M.die() at one point) has been making partial changes based on what people tell them, whether the advice is good or not, and then not trying to tie it all together or even undo the bigger blunders.

Lummox JR