I get this error while running a battle, but it only occurs at the end of a battle and then only if I miss.....
runtime error: Cannot read null.HP
proc name: Execute (/mob/proc/Execute)
usr: Syier (/mob/PC/Peasant)
src: Syier (/mob/PC/Peasant)
call stack:
Syier (/mob/PC/Peasant): Execute(null)
Syier (/mob/PC/Peasant): Player1(null)
Syier (/mob/PC/Peasant): MParrycheck(null)
Syier (/mob/PC/Peasant): Execute(null)
Syier (/mob/PC/Peasant): Player1(null)
Syier (/mob/PC/Peasant): MParrycheck(null)
Syier (/mob/PC/Peasant): Execute(null)
Syier (/mob/PC/Peasant): Player1(null)
Syier (/mob/PC/Peasant): Battletest(null)
-----
if(ACC-rand(1,100)<=0)
view() << "[src] missed the [M]!"
M.MExecute(src)
-----
-----
Death()
if (src.type == /mob/PC/Peasant)
PCDeath()
else
if(src.HP <= 0)
range() << "[src] was slain by [usr]."
del(src)
-----
There's the 2 simple procs, please tell me what I'm doing wrong, and make me sound as stuipd as possible in the process if you have the time.
ID:147693
Jan 22 2004, 4:40 pm
|
|
Jan 22 2004, 4:52 pm
|
|
You need to show us the execute proc, as that is the one generating errors. Also, please enclose your code with <DM> tags.
|
In response to HavenMaster
|
|
------
|
In response to Syier
|
|
*blinks* I think I just realized how stupid I am......I let it continue the Execute proc after I missed -_-
|
In response to Syier
|
|
We really didn't need to see any procs. Your problem is that you were calling Battletest(), without putting in any arguments (things between the parenthesis). I'm assuming it's a mob. If that doesn't fix the problem, then it's in the next proc in the callstack that is "whatever(null)". The one at the bottom is called first, and it works its way up.
Also, your other problem is that view(), orange(), range(), citrus(), etc. all have usr as a default argument for the center, which is obviously not what you want. Also, I'd say that the proc doesn't belong to mobs, if the call stack didn't say otherwise. You shouldn't remove the indendation like that, it leads to confusion. |