ID:142200
 
ok my code looks like this

        
mob/mugger
icon = 'mugger.dmi'
var
wander = 1





proc/Movement()
if(wander) step_rand(src)
..()



And it says wander is undefined -__-
Edit: Oops.
mob/mugger
icon = 'mugger.dmi'
var/wander = 1
proc/Movement()
if(wander) step_rand(src)
..()

Which works fine with no errors.
The code you just gave will compile. My guess is that you did something like this:

mob/verb/Rawr(mob/M in oview(5))
M.wander = !M.wander //notice how M was defined as just a mob.
//it would give errors because the wander
//var is not defined under /mob
if(!M.wander)
view() << "[M] is so scared by [usr] that they stopped!"
else
view() << "[M] panicks because of [usr]'s roar!"


You could fix that by replacing mob/M with mob/mugger/M or by saying:

if(istype(M,/mob/mugger)) //this checks if they are of the /mob/mugger type
//or anything that descends from that type
var/mob/mugger/MG = M //define a new var for the mugger


Or:

if(istype(M,/mob/mugger)) //same as before
M:wander //you would access the vars with the : operator instead of the . operator
//however, this can cause runtime errors if there is no wander var under M
//Consider yourself warned!