ID:1347668
 
(See the best response by SuperSaiyanGokuX.)
I need help creating an equipped item icon system. Basically, I need a way to create a new icon_state. So I have the item's normal inview icon_state, but I also need a way to make a new icon_state where the item is in hand. So for example

 obj/item/weapon/example
name = "example"
icon_state = "example"
icon_stateeq = "example equipped"


So that when I equip it, it adds an overlay of the icon_stateeq.
Best response
There are a few ways to do this. A simple method would just be to change the object's icon_state when it becomes equipped, then add the object to the mob's overlays. For this method, you don't even need that extra variable, you can just use a system of object.icon_state="[object.icon_state] equipped", then, when they unequip the item, you remove it from their overlays, and change its icon_state back to the original, "object.icon_state=initial(object.icon_state)"

Another method is to create a new /icon object and set it to a copy of the weapon's icon, but with the equipped state (var/icon/I=icon(object.icon,"[object.icon_state] equipped")", then add that to the player's overlays (this is likely a better method if you still want the original object to display its unequipped icon_state elsewhere, like inventory screens and whatnot)