ID:156946
 
Ok, in my game, Bleach: A New Beginning, I am having some troubles with a robe.

Basically the player becomes a Shinigami, and during this process they receive an Asauchi and a Sihakushyo(Their black robe). Now in the game, there are 2 icons for the main base. One with a sword, and one without. I know this may not be the best way to go about it, but it was fairly easy to do, since there are 2 different ways of running. My main problem is making the Sihakushyo change its way of running to fit the base. I tried overriding it in the client/Move(), but it did not work.(I tried something along the lines of:
#define IS icon_state
client/Move()
for(var/obj/Sihakushyo/S in mob.overlays)
if(mob.swordequipped)
S.IS = "runsword"

)
That code had some parts left out as well.

What am I doing wrong? Is there even a way to achieve this?
Overlays is a special list that's contents cannot be modified once added to it or something like that.
In response to LordAndrew
Hmmm. Can anyone offer me any advice towards a better way of approaching different running states?
In response to Albro1
If you do not specify the icon_state of an overlay, it will always match the icon_state of the object it is overlayed upon.
In response to Garthor
I did specify it though. I used the
#define IS icon_state

and defined the overlay's icon_state with
S.IS = "runsword"
In response to Albro1
No, you didn't, because that would crash the procedure with a runtime error, as the overlays list is read-only.

Or, well, it would if you were looping through it properly. As-is, it just does nothing.

Regardless, this is entirely irrelevant, and I've already told you how to do what you want.