ID:267702
 
alrighty im trying to get it so you can pick up and wear clothes (in this case armor)... so i have this code.. from zeta... and heres the error...

Caits.dm:622:error:worn:undefined var
Caits.dm:626:error:src.worn:undefined var
Caits.dm:627:error:src.worn:undefined var
Caits.dm:631:error:src.worn:undefined var
Caits.dm:636:error:src.worn:undefined var
Caits.dm:638:error:src.worn:undefined var
Caits.dmb - 6 errors, 0 warnings (double-click on an error to jump to it)

So how exactly so i DEFINE the vars?



obj
Armor
name = "Armor"
icon = 'Armor.dmi'
worn = 0
verb
Wear()
set category = "Inventory"
if(src.worn == 1)
src.worn = 0
usr.overlays -= 'Armor.dmi'
usr << "You remove the [src.name]."
else
src.worn = 1
usr.overlays += 'Armor.dmi'
usr << "You wear the [src.name]."
Drop()
set category = "Inventory"
if(src.worn == 1)
usr << "Not while its being worn."
if(src.worn == 0)
src.loc=locate(usr.x,usr.y+1,usr.z)
Get()
set category = "Inventory"
set src in oview(1)
Move(usr)
worn = 0

that should be var/worn=0
In response to Wanabe
That would define a var that exists throughout that piece of coding only, at least that's how I understand it.

To define a var you do this:
[type of ojbect the var is]
var
[name of var] = [value, if any]

If there is no value don't put the "="

In your case it should look like this:
mob
var
worn=0