//Mist Proc
Mist()
var/area/Outside/O
if(O.ismist == 0)
O.ismist = 1
for(O in oview(src,45))
O.icon = 'Spells.dmi'
O.icon_state = "mist"
sleep(1800)
O.ismist = 0
O.icon = null
O.icon_state = null
break
else
return
//area
area
Outside
var
ismist = 0
israin = 0
issnow = 0
//verb
mob
verb
Mister()
usr.Mist()
Problem description:
Everytime I use the Mister verb, I get this error
runtime error: Cannot read null.ismist
proc name: Mist (/mob/proc/Mist)
usr: Dead_Demon (/mob/Player)
src: Dead_Demon (/mob/Player)
call stack:
Dead_Demon (/mob/Player): Mist()
Dead_Demon (/mob/Player): Mister()
You define O, but you don't set it to anything. By default, when you define a variable, it is set to null. That is why you're getting a "null.ismist" error.
To fix this, you have to use locate() to get the actual instance of the /area/Outside object.
However, I also notice that you're trying to make mist in a certain area. /area objects are a special type, and there is only one instance of the object in the world, even if you put them in different z levels. If you're trying to make mist in a certain area, looking at area objects wouldn't be such a good idea. Otherwise, if you want to make it misty everywhere outside, then it will work fine.
~~> Unknown Person