ID:171776
 
I'm using offset overlays for a multi-tile mob effect. Now, I was wondering, How would I flick() icon_states of the overlay? Like for a jump procedure, How would I flick all of the overlays of the individual mob with a "jump" state(the mob is 64x64 or 4 tiles)?
Changing the icon_state of the mob will change the icon_states of all the overlays.
In response to Garthor
Yes, but the iconstate is different for the overlays, then is it for the mob itself.. Say I want to change the iconstates for the jump proc, for the mob I want to flick the icon_state "J0,0" for the overlay pixel_y+32 the icon_state = "J0,1", etc. so how would I change the overlays icon_states individually.
In response to Troglodyte
Troglodyte wrote:
so how would I change the overlays icon_states individually.

You can't.

What you need to do is set a variable to the overlay, remove it from the list while adding another with the appropriate icon, then after X amount of time remove the new one and put the old one back in.
mob
icon='mob.dmi'
icon_state="0,0"
New()
var/obj/head/head=new
overlays+=head
verb/jump()
var/icon/I=icon(icon)
var/image
image;new_image
var/list
jump1=list();jump2=list()
icon_state="J[icon_state]"
for(var/index = 1 to overlays.len)
image=overlays[index]
if("J[image.icon_state]" in I.IconStates())
jump1+=image
overlays-=image
new_image=new
new_image.icon=image.icon
new_image.icon_state="J[image.icon_state]"
overlays+=new_image
sleep(10)
icon_state=copytext(icon_state,2,0)
for(image in jump2)
overlays-=image
for(image in jump1)
overlays+=image
obj/head
icon='mob.dmi'
icon_state="0,1"
pixel_y=32

You could do something like that to get all of the extra object parts to change icon states along with the main object part. It would look nicer if you used the idea there to make an overlay_flick function of your own, and you should be able to do so if you understand the concept behind this.
In response to Garthor
That only works if the overlay's icon and icon_state are the same as their location object.