Pause the game momentarily via script call

I'm working on a new active battle system for my game and I wanted to add little freezes like when the player gets hit by an enemy etc. The game freezing effect is broadly used in tons of fighting games and hugely contributes to the overall game feel.
Can I somehow freeze all game processes just for a second or so via script call?
no - and for a lot of reasons, including the fact that a true freeze would mean that nothing happens anymore.

I'll explain how the wait command works, that should explain this to you - and you would have to do something similar.

there is a main game loop that contains and processes all elements in the game, including updating the graphic display and every move route and every event and more. Freezing everything would mean that the display no longer updates and the operating system would think that the game crashed.

Even the wait command doesn't freeze the event - it tells the main game loop to "skip processing this event for x frames/loops". That is why a wait command in a parallel process reduces lag.

You now have to do basically the same: tell the main loop to skip processing those events and actions that should appear "frozen".
But that "skip until" is a property of the objects, which means there is no one command that could freeze everything - you would have to tell every element that requires this to set the property for skipping for a number of frames.
And to do that, you'll need to know which objects need this, and tell every one of them that with another script command.

Identifying those objects is probably possible, but not easy...
Unfortunately, this method won't work for me cause my battle system is built on moving pictures and projectiles.
What I was looking for is something like when you calling the menu (pressing x\esc) isn't that possible?
if all of your battle happens in events only, then it should be possible to get a plugin that causes event processing to stop by filtering through the type of objects in the game loop.
as long as you don't utilise plugins for your battle as that would be more difficult to identify.

and screens are handled extremely different - if I remember correctly the map you see in the background of the menues is not the map itself but a screenshot of that mapscene. Because the scenes are handled differently...
Sounds difficult. I dought I'll be able to do it all by myself.
I get it about the screens, but couldn't I just do the same but only for a second?

Original thread: https://forums.rpgmakerweb.com/threads/pause-the-game-momentarily-via-script-call.130548/