Problems with multitile overlays(2) in Developer Help
|
|
Code:
obj clothes feet var/obj/clothes/feet/right var/obj/clothes/feet/left Click() if(usr.feet=="off") if(usr.sex in src.sex) var/obj/l = new left var/obj/r = new right usr.overlays+=image(src.icon) usr.overlays+=image(l.icon) usr.overlays+=image(r.icon) usr.feet="on" src.suffix="Equipped" else return else if(usr.feet=="on"&&src.suffix=="Equipped") if(usr.sex in src.sex) usr.overlays-=image(src.icon) for(var/o in usr.overlays) if(o==src.left) usr.overlays-=image(src.left) if(o==src.right) usr.overlays-=image(src.right) usr.feet="off" src.suffix=null else return else usr<<"<font color=red>You can't equip two pieces of the same type of clothing." aile left=/obj/clothes/feet/aile/l right=/obj/clothes/feet/aile/r icon='Clothes/Feet/Female/aile/aile.dmi' icon_state="item" sex=list("Female") l icon='Clothes/Feet/Female/aile/left.dmi' pixel_x=-32 r icon='Clothes/Feet/Female/aile/right.dmi' pixel_x=32
|
Problem description:
There're no runtime errors, but it displays wrong or doesn't display at all. I've checked the icons and their states are right and everything. Don't mind the "unequip" I'm not really done with that yet. Anyways, is there any way where I can get these to display in their respective places?(left being pixel_x=-32 and right being pixel_x=32)
|
Also I suggest adding the items to the player when adding them, so that you can restore them without any problem, or check if they are equipped by checking the usrs vars.