ID:268970
 
mob/proc
DeathCheck()
if(istype(src,/mob/Characters))
if(src.HitPoints <= 0)
src.HitPoints = src.HitPoints
src.Dead = 1
usr.Zenni += src.Zenni
src.Zenni = 0
if(src == usr)
world << "<B><font size = 1><font color = red>Info:<i><font color = white>[src] Killed himself."
oview(3) << "<B><font size = 1><font color = red>Info:<i><font color = white>[src] dies right infront of you.."
else
world << "<<B><font size = 1><font color = red>Info:<i><font color = white>[src] was killed by [usr]."
oview(3) << "<B><font size = 1><font color = red>Info:<i><font color = white>[src] dies right infront of you.."
src.loc=locate(27,2,3)
src.Level()
src.Checker()
src.Update(src)
src.overlays+='halo.dmi'


Is theres usr in proc how else can i do it?
Yea, usr is there. The proc oview()'s default is usr. You would have to do oview(src,"blah") for it to be correct. This is also for alert(), view(), and input(). You also have usr.zenni and if(src == usr). Why don't you just pass an arguement so you don't have to use usr.
In response to N1ghtW1ng
wtf is an argument
In response to Dranzer_Solo
Dranzer_Solo wrote:
wtf is an argument

mob/proc/argument_demo(mob/ARGUMENTHERE,text/T)
world << "Argument Demo: [ARGUMENTHERE]: [T]"
Then when you call it..
argument_demo(src,"Hello")


Src would be ARGUMENTHERE in the proc.


Understandable right?
In response to Dranzer_Solo
Dranzer_Solo wrote:
wtf is an argument

http://www.byond.com/docs/ref/
http://www.byond.com/docs/guide/

~>Jiskuha
In response to Dranzer_Solo
No need for using "Wtf"
mob
verb
Tell(mob/player/M in world,T as text) // THis would be an arguement
alert(M,"[src] sent you a message)
M << "<---[src]: [T]"
src << "--->[src]: [T]"
Actually, in this form, it will work, and should be consider acceptable, unfortunately it's messy and hard to read, so people jump all over it.

So long as you call this death check from the person who killed this person, you should be fine.
Dranzer_Solo wrote:
Is theres usr in proc how else can i do it?

Put in an argument of mob/killer:

mob/proc
DeathCheck(mob/killer)
if(istype(src,/mob/Characters))
if(src.HitPoints <= 0)
src.HitPoints = src.HitPoints
src.Dead = 1
killer.Zenni += src.Zenni
src.Zenni = 0
if(src == killer)
world << "<B><font size = 1><font color = red>Info:<i><font color = white>[src] Killed himself."
oview(3) << "<B><font size = 1><font color = red>Info:<i><font color = white>[src] dies right infront of you."
else
world << "<<B><font size = 1><font color = red>Info:<i><font color = white>[src] was killed by [killer]."
oview(3) << "<B><font size = 1><font color = red>Info:<i><font color = white>[src] dies right infront of you."
src.loc=locate(27,2,3)
src.Level()
src.Checker()
src.Update(src)
src.overlays+='halo.dmi'
In response to Ter13
OK! btw thanks nightwig i udnerstoof that....i think ill have to read the Dm again refresh my mind..
In response to Wizkidd0123
You forgot, oview()'s default is usr I think.
In response to N1ghtW1ng
N1ghtW1ng wrote:
You forgot, oview()'s default is usr I think.

Thanks! I wasn't even paying attention; just replacing every instance of usr with killer. Fixed:

mob/proc
DeathCheck(mob/killer)
if(istype(src,/mob/Characters))
if(src.HitPoints <= 0)
src.HitPoints = src.HitPoints
src.Dead = 1
killer.Zenni += src.Zenni
src.Zenni = 0
if(src == killer)
world << "<B><font size = 1><font color = red>Info:<i><font color = white>[src] Killed himself."
oview(3,src) << "<B><font size = 1><font color = red>Info:<i><font color = white>[src] dies right infront of you."
else
world << "<<B><font size = 1><font color = red>Info:<i><font color = white>[src] was killed by [killer]."
oview(3,src) << "<B><font size = 1><font color = red>Info:<i><font color = white>[src] dies right infront of you."
src.loc=locate(27,2,3)
src.Level()
src.Checker()
src.Update(src)
src.overlays+='halo.dmi'
In response to Wizkidd0123
Urm...isn't is oview(src,3)? I thought the src came before the number. I might be wrong though, I tend not to use view and oview much. I know though in input and alert though it comes before the stuff inside the proc.
In response to N1ghtW1ng
nope
In response to Ter13
I really like the orange() proc...

I first saw it in the reference and thought:
"What? What's a fruit doing in DM?"
In response to Elation
Haha, same.
In response to Elation
Actually, oview() would be better for a Death Check. For example, it sends the messege stating the killer kills the victim to the oview(), the mobs that can see it happening, if you are blind, it shouldn't send it to you. I think that's the different between oview() and orange().

for(var/mob/M in orange(src))
M << "you can see me if you are blind or not."


for(var/mob/M in oview(src))
M << "you can see me only if you are not BLIND"
In response to Vizuke
Vizuke wrote:
Actually, oview() would be better for a Death Check. For example, it sends the messege stating the killer kills the victim to the oview(), the mobs that can see it happening, if you are blind, it shouldn't send it to you. I think that's the different between oview() and orange().

> for(var/mob/M in orange(src))
> M << "you can see me if you are blind or not."
>

> for(var/mob/M in oview(src))
> M << "you can see me only if you are not BLIND"
>


But orange has a cooler name!
In response to Elation
When I first notice the orange() proc, I was actually looking for built-in HTML colors like </font color=red>, but orange (the color) didn't have it and I looked at the orange() proc lol.
In response to Vizuke
Vizuke wrote:
When I first notice the orange() proc, I was actually looking for built-in HTML colors like </font color=red>, but orange (the color) didn't have it and I looked at the orange() proc lol.


I only realised it was a form of the (at the time unknown to me) range() proc after I had used it in a new part of my game.

"What a nice fruity addition to my - hey, wait a min-"
In response to N1ghtW1ng
N1ghtW1ng wrote:
Urm...isn't is oview(src,3)? I thought the src came before the number. I might be wrong though, I tend not to use view and oview much. I know though in input and alert though it comes before the stuff inside the proc.

In the case of view(), range(), and other procs of this sort, it actually doesn't matter. DM automatically puts those in the right order because it knows what it can expect as values in the proc.

Lummox JR
Page: 1 2