ID:161553
 
ok i want to have an icon change sides if another icon is being worn... this doesent work :(

why?? lol

obj
var
worn = 0
wg = 0
obj
elf_blade
name = "Elf Blade"
worn = 0
icon = 's.dmi'
verb
Wear()
if(src.worn == 1)
src:worn = 0
usr.overlays -= 'as.dmi'//-= means subtract (-) the (=) 'shirt.dmi'
usr << "You reove the [src.name]."
else
if(src.wg == 1)
src:worn = 1
usr.overlays += 'asa.dmi'
usr << "You wear the [src.name]."
if(src.wg == 0)
src:worn = 1
usr.overlays += 'as.dmi'
usr << "You wear the [src.name]."
Look()
usr<<"Yep, definitly a sword..."
Drop()
if(src:worn == 1)
usr << "Not while its being weilded."
if(src:worn == 0)
src.loc=locate(usr.x,usr.y,usr.z)
Get()
set src in oview(1)
src.loc = usr
usr<<"You picked up a [src]"


grand_elf_blade
name = "Grand Elf Blade"
icon = 'ges.dmi'
worn = 0
verb
Wear()
if(src.worn == 1)
src:worn = 0
src:wg = 0
usr.overlays -= 'ges.dmi'//-= means subtract (-) the (=) 'shirt.dmi'
usr << "You reove the [src.name]."
else
src:worn = 1
src:wg = 1
usr.overlays += 'ges.dmi'
usr << "You wear the [src.name]."
Look()
usr<<"Yep, definitly a sword..."
Drop()
if(src:worn == 1)
usr << "Not while its being weilded."
if(src:worn == 0)
src.loc=locate(usr.x,usr.y,usr.z)
Get()
set src in oview(1)
src.loc = usr
usr<<"You picked up a [src]"
no expert coder, but i read somewhere you shouldnt use the : operator in situations like that... or something.

i did just wake up but i see =='s, and if i remember correctly, isnt that booleans? (which i think dont apply here...)
In response to Eternal Desire
if you mean instead of :
if(src.wg==0) ;
if(src.wg:0)
dream maker gets mad @ u :P
In response to RanEsu
actually, i meant:
if(src:wg==0)

a . woulda done the job instead of : although, == is another error i think...
In response to Eternal Desire
Is the problem maybe that you never had the "wg" variable change for the first sword thing?