[Solved]Freeze hero?

Started by Zefk, April 27, 2017, 05:38:00 AM

Previous topic - Next topic
April 27, 2017, 05:38:00 AM Last Edit: April 27, 2017, 09:15:41 PM by Zefk
Is there a way to freeze the hero, but still allow hero:set_animation("animation") and then unfreeze the hero?

I know something similar can be done by drawing a sprite at the hero coordinates and setting the hero visibility to false. Also, this can be done with a movement because it disables the hero control and that does not cancel the animation when trying to move the hero until the movement is completed.

I don't understand the question. You can call hero:set_animation() when the hero is frozen, there is no problem.

The question is unclear. Maybe he intends to keep an animation while the hero is not frozen. Is that so?
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."

QuoteI don't understand the question. You can call hero:set_animation() when the hero is frozen, there is no problem.

@Christopho
My mistake. I got it to work now. It seems hero:freeze() just does not work on map:on_started().
     

QuoteThe question is unclear. Maybe he intends to keep an animation while the hero is not frozen. Is that so?

@Diarandor
I actually would like to know that. For example, is it possible to have the hero walk around using a "stopped" animation instead of "walking"? My first thought would be to change the hero:set_tunic_sprite_id(sprite_id) and have the animation for "walking" be "stopped."

The easy way is to change the tunic sprite. Another way is to code a script for an animation fix (using the sprite events of the tunic sprite), but this may produce other problems and complicate things, so avoid doing this if possible.
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."