runtime error: Cannot read null.miningexp proc name: LevelUp (/mob/skill/levelup/mining/proc/LevelUp) source file: Skill Level Up.dm,7 usr: Tikey (/mob/players/Wizard) src: null call stack: LevelUp(Tikey (/mob/players/Wizard)) Mineral Rock (/mob/Skills/Rock): Mine()
As you see, it's reading null.miningexp. Here's the LevelUp() to it:
mob
skill
levelup
mining
proc
LevelUp()
if(src.miningexp >= src.miningmaxexp)
src << "<font color=green size=1 face=Arial>Your mining is now [mining+1]!"
src.mining++
src.miningmaxexp+=2
src.miningexp=0
I though that's all right. But what I suspect is that the problem is in the mine verb itself. Which I will show you now:
mob
Skills
icon = 'skills.dmi'
Rock
icon_state = "Rock"
name = "Mineral Rock"
density = 1
verb/Mine()
set src in oview(1)
var/obj/pickaxe = locate(/obj/pickaxe) in usr.contents
if(pickaxe)
if(mining == 1)
return
else
mining=1
usr << "<B><font color=white size=1 face=Arial>\[SKILL]: You begin to mine."
sleep(30)
if(prob(10+usr.mining))
usr << "<B><font color=white size=1 face=Arial>\[SKILL]: You find to what you see is a mineral!"
usr.contents+=new/obj/JEWELS/Granite
mining=0
usr.miningexp++
call(/mob/skill/levelup/mining/proc/LevelUp)(usr)
return
else
usr << "<b><font color=white size=1 face=Arial>You don't find anything."
mining=0
usr.miningexp++
call(/mob/skill/levelup/mining/proc/LevelUp)(usr)
return
/*--SNIP--*/
else
usr << "<font color=white size=1 face=Arial>You don't have a pick axe!"
mining=0
return
Now, what I think the problem is, is that I'm calling call() wrong. If this is the case, can someone tell me how to fix it? If not, give me some tips on how to fix it. Thank you and good night.
~Tikey
This way, usr is passed in from the verb, and referenced as M by the call() proc. Please note, however, that M's type will need to be a mob which supports miningexp, miningmaxexp, mining, etc., or you'll wind up with more runtime errors. So, if your player characters are all of type /mob/PC, then make the appropriate change to the argument for LevelUp(). Hopefully this helps.