ID:146770
 
Code:
        Tall(var/iconset as icon)
var/obj/O=new/obj/overlay
O.icon=iconset
O:layer=MOB_LAYER+2
O:pixel_y=32
usr.overlays+=O
Tall_state(state as text)
for(var/obj/O in usr:overlays)
if(O!=null)
O:icon_state=state
else
return


Problem description:

I like the new forums stuff. o.O Oh...huh...The tall icon will load but the state won't change.
Nnoooeess, you're using the colon (improperly)!
And, I think you have to remove an overlay then add it again for it to change icon_states.
In response to Hell Ramen
Make it a var.
mob/obj/overlay/head

Then do overlays-=head, then adjust head.icon & head.icon_state, then do overlays+=head.
In response to Hell Ramen
Hell Ramen wrote:
Nnoooeess, you're using the colon (improperly)!
And, I think you have to remove an overlay then add it again for it to change icon_states.

Indeed... In 99.9% of cases where you use a colon your doing something wrong.

Especially in this case, your using '.' and ':' interchangably. Use one or the other, not both. In this case you want to use '.'

If you have an undefined variable compile-time error that is fixed by using ':' in place of '.' sure it compiles, but your gonna end up with runtimes up the wazoo.
Overlays is not your normal list. When your character is saved the overlays are sort of mashed into 1 single overlay. You can still remove them by reference to the original icon or a variable equal to the overlay you wish to remove. You can also save overlays as a different variable and then add them again when the character is loaded.