ID:142355
 
Code:
mob
proc
Sai(mob/M in oview(1))
set category = "Jutsus"
set name = "Sabaku Kyuu"
if(usr.fired)
return
if(usr.move==0)
usr<<"Your frozen"
return
if(usr.PK==0)
usr<<"NON PK ZONE!"
return
if(usr.rest)
usr<<"Not while resting"
return
if(usr.Rei<=50)
usr<<"Not Enough Reiatsu"
return
usr.Rei -= 50
usr.fired = 1 // Sets the firing var to 1, so he cant fire another beam
view()<<"<font size=1><font face=verdana><b><font color=white>[usr]<font color=green> Says: Sabaku Kyuu!"
M.overlays+='Sai.dmi'
M.captured=0
sleep(100)
M.captured=1
M.overlays-='Sai.dmi'
usr.fired=0
mob/Hado/verb/Saii()
set name="Sai"//also a verb for Shoot
set category="Techniques"


if(usr.PK==0)
usr<<"You are in a Non Player Killing Zone."
return
if(usr.rest)
usr<<"not while resting"
return


runtime error: Cannot read null.overlays
proc name: Sabaku Kyuu (/mob/proc/Sai)
usr: Agrey (/mob/Game)
src: Agrey (/mob/Game)
call stack:
Agrey (/mob/Game): Sabaku Kyuu(null)
Agrey (/mob/Game): Sai()


Problem description:


i keep getting this run time every time i use the move, any help is appreciated
In response to Popisfizzy
i took it out replaced with src same error
In response to Agrey123
Well then, maybe you should click the provided link and read more into your problem.
In response to Popisfizzy
the link talks about switching src and usr is that the problem with the code?or is smething else
In response to Agrey123
Gah. I didn't read your proc correctly, though the use of usr could still present a problem. The problem here is that you're not passing an argument to the proc.
In response to Popisfizzy
what does that mean, lol? like which part is wrong
In response to Agrey123
The problem is that you're making an argument that looks for a nearby mob (Which you called M). If there isn't an M, then as soon as you try to do anything to M, it complains that you're trying to do something to nothing. The solution is to check to see if there is an M before you do the rest of the proc.
In response to Adam753
mob
proc
Sai(mob/M in oview(1))
if(src.fired)
return
if(src.move==0)
src<<"Your frozen"
return
if(src.PK==0)
src<<"NON PK ZONE!"
return
if(src.rest)
src<<"Not while resting"
return
if(src.Rei<=50)
src<<"Not Enough Reiatsu"
return
if(M)

src.Rei -= 50
src.fired = 1 // Sets the firing var to 1, so he cant fire another beam
view()<<"<font size=1><font face=verdana><b><font color=white>[src]<font color=green> Says: Sabaku Kyuu!"
M.overlays+='Sai.dmi'
M.move=0
sleep(10)
M.move=1
M.overlays-='Sai.dmi'
src.fired=0
else
src<<"no mob"
return


i tried this but it kept saying no mob, what am i doin wrong
In response to Agrey123
There is no mob in oview(1). I can't think why that should be, unless... This is a stupid question, but you are standing next to a mob when you use this proc, aren't you?
In response to Adam753
yes i stand next to the mob and then i use the proc and then it says no mob is there after i used that code
In response to Agrey123
How strange! If there's a mob immediately next to you, why wouldn't it work? That is odd...
I'm going to go to bed now, but one last idea.
Instead of this: mob/M in oview(1) try this: mob/M as mob in oview(1)

Maybe... It probably won't work, to be honest, but try it anyway. Let me know, see you tomorrow.
Procedure arguments don't work like verb arguments. If this were a verb, your argument mob/M in oview(1) would be converted into an input(). What you want to do is send and argument to the proc, or just grab one if it's close. You can use a hybrid of sorts by defaulting the argument to a mob in oview() with locate(), then you can overide it by sending a mob if you want.

Sai(mob/M=locate() in oview(1,src))  //  locate() defaults to the variable's declared type (/mob).