Pause the game momentarily via script call

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
210
Reaction score
18
First Language
Spanish
Primarily Uses
RMMV
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?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,813
Reaction score
7,885
First Language
German
Primarily Uses
RMMV
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...
 

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
210
Reaction score
18
First Language
Spanish
Primarily Uses
RMMV
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?
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,813
Reaction score
7,885
First Language
German
Primarily Uses
RMMV
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...
 

KotoYama

Veteran
Veteran
Joined
Apr 20, 2019
Messages
210
Reaction score
18
First Language
Spanish
Primarily Uses
RMMV
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?
 
Last edited:

Latest Threads

Latest Posts

Latest Profile Posts

FastFood in my country is neither fast nor cheap like it's expected to be, but people still buy a lot of it. I don't want to imagine how much of it people would eat if it was.
Started finishing up my bosses and characters...I don't know how long...but its going to take long...

I ended up needing to do a chapter one world map remake. It's still WIP but coming along nicely. =D
Stream will be live shortly! I will be beginning a play-through of Resident Evil 4! Feel free to drop by!

1st iteration on castle interior in Tiled.

Forum statistics

Threads
107,752
Messages
1,031,889
Members
139,894
Latest member
soicau888vip
Top