ID:261759
 
I've set up a few layers(overlay layers) for different articles of clothing so if you were to have on a jacket but not a shirt and you put the shirt on, the jacket would stay over the shirt. So I did this...

var/const
SHIRT_LAYER = FLOAT_LAYER-3
SHIRTT_LAYER = FLOAT_LAYER-5
SHOE_LAYER = FLOAT_LAYER-5
JACKET_LAYER = FLOAT_LAYER-2
PANTS_LAYER = FLOAT_LAYER-4
GLOVE_LAYER = FLOAT_LAYER-1
HAIR_LAYER = FLOAT_LAYER-1
GLASSES_LAYER = FLOAT_LAYER-6
obj
shirt
icon = 'shirt.dmi'
layer = SHIRT_LAYER
verb
Wear()
set src in usr
usr.overlays += src
Tuck()
set src in usr
src.layer = SHIRTT_LAYER
pants
icon = 'pants.dmi'
layer = PANTS_LAYER
verb
Wear()
set src in usr
usr.overlays += src


Now while I don't get any errors, the layers I defined aren't working. At first I had usr.overlays += The file here. Which I soon realized wouldn't use the layers I defined because I was only adding the icon. So i changed it to src and it still doesn't work, although it does show the icon overtop the character. Where'd I go wrong?

Resonating Light
It isn't really possible to do a layer up or down from FLOAT_LAYER. They're all considered to be the same as FLOAT_LAYER.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
It isn't really possible to do a layer up or down from FLOAT_LAYER. They're all considered to be the same as FLOAT_LAYER.

Lummox JR

So what I read in the help files is false? Well, if that's the case then how would I go about getting this effect to work?

Resonating Light
In response to Resonating_Light
Resonating_Light wrote:
So what I read in the help files is false? Well, if that's the case then how would I go about getting this effect to work?

Okay, I stand corrected on this one: The overlays should all appear on the same layer as the base object (but they may be over or under it), but in a particular order relative to each other.

Lummox JR
In response to Lummox JR
Lummox JR wrote:
Okay, I stand corrected on this one: The overlays should all appear on the same layer as the base object (but they may be over or under it), but in a particular order relative to each other.

Lummox JR

call me stupid if you want, but I didn't understand that. Would you mind explaining it in a different way? Perhaps a longer response. Meanwhile I'll keep reading it and hope that it hits me.

Resonating Light
In response to Resonating_Light
I got bored so I fiddled around with this, it seemed to work.

var/const
ARMOR_LAYER = FLOAT_LAYER-1
CLOTHES_LAYER = FLOAT_LAYER-2

obj
overlays
lght_bl_shrt
icon = 'shirts.dmi'
icon_state = "lght bl"
layer = CLOTHES_LAYER

stl_brst
icon = 'armor.dmi'
icon_state = "stl brst"
layer = ARMOR_LAYER

obj

/////////////////
breast_plates
/////////////////

Steel_Breastplate
icon = 'armor.dmi'
icon_state = "stl brst"
verb/Get()
set src in oview(0)
usr.contents += new/obj/breast_plates/Steel_Breastplate
del(src)
verb/Drop()
src.loc = usr.loc
usr.overlays -= /obj/overlays/stl_brst
usr << "<font color=blue>You drop the [src]."
usr.upper = ""
verb/Wear()
if(usr.cloak == "")
if(usr.upper == "")
usr.upper = "Steel Breastplate"
usr.overlays += /obj/overlays/stl_brst
usr << "
<font color=blue>You wear the [usr.upper]."
return
if(usr.cloak != "")
usr << "<font color=red>You cannot wear this over your [usr.cloak]."
return
if(usr.upper == "Steel Breastplate")
usr << "
<font color=red>You're already wearing a [usr.upper]!"
verb/Remove()
if(usr.upper == "Steel Breastplate")
usr.overlays -= /obj/overlays/stl_brst
usr << "<font color=blue>You remove the [usr.upper]."
usr.upper = ""

sorry it's so long like that... just copy/paste it into a spare code file to see it right. That works for me, and for the shirt just substitute the 'usr.overlays += /obj/overlays/stl_brst' with 'usr.overlays += /obj/overlays/lght_bl_shrt' Is that a little more clear?