ID:144556
 
Code:
mob
proc
deathcheckbot(mob/M)
if(M.hp <= 0)
src.exp += M.level
src.money += M.money/2
M.dead = 1
del(M)
var/obj/blood/B = new(M.x,M.y,M.z)
spawn(100)
del(B)


Problem description:I want the bot to drop blood when it dies.

You're deleting M then your trying to place it where M is. Since M is already deleted, it's not there and M.x, y, and z are null. Move var/obj/blood/B = new(M.x,M.y,M.z) up 2 lines.
In response to Pyro_dragons
mob/proc
deathcheckbot(mob/M)
if(M.hp <= 0)
src.exp += M.level
src.money += M.money/2
M.dead = 1
var/obj/B=new/obj/blood(M.loc)
spawn(10)del(M)//delete the bot in 1 sec
spawn(100)del(B)//delete the blood in 10 sec
Your death check is backwards. In a death check proc, src must always be the victim. (The proc mostly concerns the victim, and has much less to do with the killer.) M, therefore, should be the killer.

Lummox JR
In response to Dark Emrald
Thanks. And I realized I did that when I looked at it on the forums again. Stupid mistakes :(
In response to Lummox JR
Considering that's not what his problem was, and the fact that it doesn't always need to be it since its the same as carrying the killer as M.. the point of that post was? >.>
In response to VcentG
VcentG wrote:
Considering that's not what his problem was, and the fact that it doesn't always need to be it since its the same as carrying the killer as M.. the point of that post was? >.>

Yes, src always needs to be the victim. Never write a proc for the wrong src. It's bad design, and bad design leads to worse bugs.

Lummox JR
In response to Lummox JR
oOoO Yes master *bows*
In response to VcentG
lol just ignore lummox, he never knows what hes talking about, he just likes to use the words src and usr in his posts as much as possible
In response to Falacy
Falacy wrote:
lol just ignore lummox, he never knows what hes talking about, he just likes to use the words src and usr in his posts as much as possible

This from the person that says if(a) is equivalent to if(a == 1)?

Lummox is one of the staff that works on the source code of the compiler. Coupled with the fact that he has a masters degree in computer science, if I remember correctly, I'm infinitely certain he knows more about what he's talking about than you do.
In response to Popisfizzy
Popisfizzy wrote:

This from the person that says if(a) is equivalent to if(a == 1)?

close enuf!

Lummox is one of the staff that works on the source code of the compiler. Coupled with the fact that he has a masters degree in computer science, if I remember correctly, I'm infinitely certain he knows more about what he's talking about than you do.

byond is going downhill, i blame that on lumox's crapy work, so, bad point to make =P also im in college right now to get a degree in programming, and planning on going to full sail after im finished here to get one in game design, so, lummox nooblar knows nothing compared to me!
In response to Falacy
Close enough? Hardly.
proc/FalacyIsWrong()
var/a = "this is a text string"
if(a == 1) world << "Holy crap, Falacy is right"
else if(a) world << "Haha, he doesn't know what in god's name he's talking about."

Please, run that code and tell me what it evaluates to.
In response to Popisfizzy
running that code would do nothing considering its a proc and it doesnt get called anywhere... so! you lose =P
In response to Falacy
Ah, touche. Then add the following to what I previously stated:
mob/Login() FalacyIsWrong()
In response to Popisfizzy
lol, seeing as i just outsmarted you does that make you a retarded puppy? and yes i know im not right about that! but, if a=1 and you say if(a) or if(a==1) they yield the same result, which was the case when i made the comments =P
In response to Falacy
Hell, if we're going with that, then I geuss pi is equal to exactly three because of this.
In response to Popisfizzy
mmmmm, pie...
also, if that equation made any sense at all the answer to everything would be 0... you cant do that to an equation lol
In response to Falacy
if both of you continue this line of off-topic spam, then i will personally ban both of you from the forums for a lengthy period of time. this roughage serves *no* purpose.

don't even bother continuing to post in this thread unless you are helping out the original poster. (and smart-ass comments mixed with helpful content is not appropriate either). please do something more constructive with your free time.
In response to digitalmouse
*pokes mouse in the eye*
now as i was saying, if you multiply both sides by 0 you get 0pi=0 not 0=0 o.O

*still doesnt undertsand y byond has forums if youre not even alowed to post on them, how stupid can u get*

you dont see me closing topics on my forums because they got too many posts, thatd just be dumb! now granted this topic has gone rather off topic... but eh! *waits to be bant... again*
In response to Falacy
Falacy wrote:
<font color="blue">> *pokes mouse in the eye*
now as i was saying, if you multiply both sides by 0 you get 0pi=0 not 0=0 o.O

*still doesnt undertsand y byond has forums if youre not even alowed to post on them, how stupid can u get* </font>

BYOND has forums for helping people as well as sharing creations and ideas. you recent posts in this thread and elsewhere contain none of that- only flames and smart-ass commentary.

<font color="blue">> you dont see me closing topics on my forums because they got too many posts, thatd just be dumb! now granted this topic has gone rather off topic... but eh! *waits to be bant... again*</font>

take 30 days off. hopefully you'll return a more productive member of the community. i know you can- you just need to stop with the crap posts in-between. it makes you look like a troll. we don't need trolls here.

for the rest of you, either help this guy out, or move on.
Page: 1 2