ID:155930
 
Sorry if this has already been asked, didn't know how to search it properly. Anyways I have a basic icon for a mob, and I'm trying to figure out how to change its state then after the state has played once return back to its original. Sort of like an emote. I thought it would be easy but all I'm getting out of it is it plays it then doesn't return to the original but replays it every time I move. Any help is appreciated.
Nonborn wrote:
Sorry if this has already been asked, didn't know how to search it properly. Anyways I have a basic icon for a mob, and I'm trying to figure out how to change its state then after the state has played once return back to its original. Sort of like an emote. I thought it would be easy but all I'm getting out of it is it plays it then doesn't return to the original but replays it every time I move. Any help is appreciated.


flick()
In response to Hashir
Thank you so much. I was messing with icon_state. If anyone doesn't mind, could someone explain why that doesn't work. Just wanting to really understand the problem.
In response to Nonborn
Icon State is used for setting the usr icon to a permanant other state, but flick is used, just to change usr icon to a state temporary.

Example is like this, say you wish to make a transform verb.


mob/verb/Transform()
usr << "[usr] is Transforming."
flick("transforming",usr)
usr << "[usr] Transforms to his last form."
usr.icon_state = "Last Form"



Remember this is only an example, not a code snippet. I might have done something wrong, but I'm kinda in a real hurry.
In response to Hashir
You're doing it right, from what I can see.
Just a quick 'by the way', if the icon state is in another icon file (I think you can only use one icon state then, it that icon file.), you can do it like this:
flick('transforming.dmi',usr)
In response to Raimo
He was actually correct, he was using it to flick the transforming icon_state. You're flicking an icon.
In response to Darker Legends
I know that, it was just a tip for the original poster if he wanted to know how to do it as that.