mob/var
UP=0
UPMod=1
obj/Unlock_Potential/verb/Unlock_Potential()
set category="Skills"
var/mob/M=input("Who?","") as null|mob in view(1)
if(M) switch(input(M,"[usr] wants to unlock your hidden powers. Do you want to do this?", "",text) in list("No","Yes"))
if("Yes")
if(!M.UP) <---Says there is an error here
usr<<"You use Unlock Potential on [M]."
var/boost=100000*M.BPMod*M.UPMod*M.StatRank
if(boost>M.RecordBP*5) boost=M.RecordBP*5
M.RecordBP+=boost
M.RecordBP+=500*M.UPMod
M.Pow+=(500*M.PowMod)
M.MaxKi+=200*M.KiMod
M.kimanip+=10
M.flightskill+=(20*M.flightmod)
M.haszanzo=1
M.zanzoskill+=(20*M.zanzomod)
M.MaxBPpcnt+=(50*M.KiRegen)
M.GravMastered+=50*M.GravMod
M.DeclineAge+=10
M.UP=1 <--- says there is an error here
else usr<<"[M]'s potential is already unlocked."
return
if("No") usr<<"[M] declined your offer."
It works fine when compiled but I am just trying to get to the object tree so I can experiment around with the code. I am thinking there is some confusion between usr and the definition of M here?
Regenerate.dm:37:error: M.16: undefined var
Regenerate.dm:52:error: M.16: undefined var
Best and easiest way to avoid these kinds of naming collisions is to follow a proper naming convention which includes not using ALL CAPS for anything except constants (or anything at all).