Pause an entity movement ?

Started by MetalZelda, January 15, 2016, 08:02:12 PM

Previous topic - Next topic
Hi.

Is there any way to pause every entities on the map that have movement ?

For example, if I interact with a custom entity, all entities in the map still moves while I want them to be suspended.
It could be useful if there is a entity:set_paused() function, or is there any way to do it ?

Not directly. You would have to start a dialog or to pause the game. Maybe you can change your pause menu so that it does not always open when the game gets paused.
We should probably open a feature request for a game:set_suspended() function.

Hmmm, my question wasn't really precise, my question was about freezing all entities movement without pausing the whole map / game (example : hero can still move)

I think that requesting a new function with the syntax enemy:freeze/unfreeze(), or enemy:set_frozen(boolean) would be the best, if Christopho agrees. This is perfect to paralize enemies with electricity or ice. (Stopping all timers and changing animations with some custom function and later calling enemy:restart() might be necessary for that event, but this is off-topic.)
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."