ID:156391
 
Is there anyway to interrupt a flick() animation that is already in progress?
I tried overwriting it by doing another flick() using a blank icon file, but it didn't work.
flick() is just very brief, afaik, maybe instead, if it is possible, just change the state instead of flick, then if it needs to be interupted, just change it back or whatever.
In response to Wolfnova
The flick()'d animation will last however long the icon or icon_state's animation lasts. As far as interrupting the flick()'d animation, I have never done so before, nor had the need to.
You need to flick() an icon state that actually exists. Easiest solution: just flick(icon_state,src).
In response to Garthor
ahh thanks so much
In response to Gunbuddy13
I.e.
flick("charging",src)

mob/verb/Attack(mob/M)
if(usr.iscgarging)
usr.icon_state="punch"
if(M.ischarging)
M.icon_state="punched"
else
M.icon_state="punched"
usr.icon_state="punch"


This is just an example. The attack code does no damagr but it does change their icon. Btw im on my ipod so there might be some flaws. But atleast i tried :)
In response to Kingmasherr
That is completely unrelated to the question at hand.

Additionally, it contains a number of errors such as as typos and broken, nonsensical if-else constructs.

Furthermore, the question has already been answered.