obj/Almighty
icon = 'warp.dmi'
New()
Almightypick()
var/obj/Almighty/A = new /obj/Almighty()
A.loc = locate(7,20,1)
del(usr)
obj/proc
Almightypick()
sleep(600)
var/list/pickfrom = list()
var/mob/M
for(M in world)
if(M.key)
pickfrom += M
var/mob/choice = pick(pickfrom)
world << "The Gods have chosen [choice] to gain a level!"
choice.exp += choice.exp_req
choice.levelup()
Okay. I think there is a problem with an object calling a proc on a mob... This all works until it gets to "choice.levelup()" and then it stops.
runtime error: Cannot read null.exp
proc name: levelup (/mob/proc/levelup)
usr: null
src: Cowdude (/mob/sage)
call stack:
Cowdude (/mob/sage): levelup()
But the levelup() proc works just fine whenever else I call it.
to this:
With the original, even though you're creating M as a var/mob, when you just do an (M in world), it will grab everything, and I'm guessing not everything has an exp var. :) Hopefully this helps!