ID:271645
 
is it possible to change an overlays icon_state

for example, i have a running icon state for a base, so i want to change the icon_state for clothes and hairs for the running state.
All you have to do is define the icon_state in the overlays icon file.
In response to Hellsing4
i tried, but when i try to define it, it says M.icon_state is like not available or something
In response to Max Omega
I think you misunderstood me. All you have to do is make the icon_state in the icon file for the overlay. Then code the state change for the mob's icon. Is that what you need help with? Coding the state change for the mob?

Edit**
Here's an example:
mob
verb
run()
src.icon_state="run" //thats the only state change you need
src.speed+=20 //you'll probably want them to move faster but you'll have to set the delays and what not yourself


Basically you don't have to code the state change for the overlay. It'll change on it's own when whatever it is on is changed.
In response to Hellsing4
I want to change clothes overlays icon state not the mobs
When ever i try to change it it says overlays not defined
you use flick("run",usr)

usr can be replaced with another variable, like M if it's (mob/M in world), etc.