The "Wait" command is still confusing to me

I've been using RPG Maker for about a year, and only today discovered something that was giving me a lot of troubles in planning my events and I couldn't figure out a way around it.

It seems that if a parallel process event has 2 pages, page 1 is running a wait command (ex. 100 frames), then page 2 is activated while the wait command is running (ex. on frame #50), and then page 1 is activated once again - page 1 will just continue exceuting the wait from the point where it stopped (ex. frame #51) and not from the beginning...
Edit: that was not the issue

How do you have one event "reset" another parallel process event and make it go back to its first command?
Could you post what these 2 pages look like, as there could be more than one reason for this behaviour.
Use Alt+PrtSc for the screen shots so that it only takes the active window (we don't need to see your whole desktop) and do not crop any part of it. The commands down the left side are as important as the commands you put in on the main part.
what's the trigger for page 2? also parallel?
because "wait" usually means "yield to higher process" not "halt on this process"

there could be a plugin overriding that as well.
I tested it on 2 empty events that don't have anything besides wait and incrementing a variable to keep track of it. when the page changes from 1 to 2 and then again from 2 to 1, the command execution continues from where it stopped and doesn't reset to the beginning
Edit: this was not the issue
That behaviour is strange and this is the first case I heard about it.
However it might be because you set the second page to parallel - you should NEVER set an page without content to parallel, because that creates nothing but lag.

That said, what the wait command really does is something different to what is perceived by most people.
The game interpreter runs all events in a big loop, the game loop, that is processed once per frame.
The wait command now tells the interpreter "store this position in the event for later and skip processing the event for x loops/frames".

In the case of an triggered event, that looks to the outside as a wait for this event.
In the case of a parallel or autorun, this reduces the number of times the event is processed - only once every n loops/frames instead of every frame. That is the reason why waits in parallels reduce lag.

And my guess is that since the event was never removed from parallel the adress is kept, and no one else ever encountered this problem because the others had already internalized to never cause lag by an empty parallel.
you need 3 tab (called page?)
1: is empty
2: same as your tab(1) but in the last give on switch 14 and off 19
3: same as your tab(2) but in trigger normal (since nothing will touch it)
1: is empty
no need for the empty page, if no switch is active then the event will simply not exist if it has no empty page.
You would only need the empty page if you want the sprite to be there if no switch is set.
And my guess is that since the event was never removed from parallel the adress is kept, and no one else ever encountered this problem because the others had already internalized to never cause lag by an empty parallel.

Just to clarify, I only made this event for testing. However your answer definitely makes sense of it now as all pages that are affected by this issue are parallel processes. I don't think there's a way it works with another trigger because:
- I need it to start without any player input, action or touch
- I need it to not freeze the player either, so autorun is no good

So back to my main question, if a parallel process event page stops being active amidst a wait, how can I force it to "abandon" the commands it reserved for later and "reset" back to its first command once that page is active again? (assuming that is possible at all, of course)
.....
So back to my main question, if a parallel process event page stops being active amidst a wait, how can I force it to "abandon" the commands it reserved for later and "reset" back to its first command once that page is active again? (assuming that is possible at all, of course)
I see your condition on this topic where
Code:
if( switch A is active)
    run(something)
else
//nothing run here..
endif

I suggested only 1 page and dont give any switch on condition (i said earlier empty) but put this event on paralel
just add condition on "content"
Code:
if switch 19 on
... your code on 1st page here
since you not making something related to else condition.. the if command not added with 'else'.

and you don't have to add more tab/page on those event. the drawback of this method is the 'event' so there are 2 instead of 1 like you made earier.

if the code are to much (long).. put on common event and run the common event inside if condition.

other suggestion is use js.. but that's OOT
After some more testing...
it seems like the issue is that the page can't switch from 1 to 2 and then immediately back to 1, there has to be at least one frame between the switches, otherwise page 1 never stops being active.

That's a big problem for my game because I really need a way to "reset" parallel process events back to the beginning of their page somehow. is there no script call or plugin that could pull this off?
Have you tried 'jump to label' with the label at the very beginning of the page?
or use exit event processing while on that specific parallel.
it would be a bit tricky because exit event processing only restarts the parallel it is invoked in, not a different parallel.

alternatively you might consider doing the time entirely differently, because that is an extremely strange way to handle time.
Most people use common events instead of a map event, and then use low waits with a counting variable instead of a long wait sequence, especially because that allows for better reset handling on map changes
Have you tried 'jump to label' with the label at the very beginning of the page?

This would work if event #1 can tell event #2 to jump to a certain label within event #2
If it only works within the same event it is invoked in, it's not what I need
In that case it might be easier to completely rework your event logic.

can you give a full description of what it is supposed to do from the player viewpoint?
then we might be able to point you to a better solution.
I'm looking into possible workarounds at the moment as the game is way too complex at this point to rework the entire system.
It's not that it's supposed to do something specific... page switching in general is one way that my events are interacting with each other and changing each other's behaviors. But sometimes I need one event to "reset" another's command list, and I was hoping an instant page switch would do the trick. Since it does not, sometimes an event page keeps running which throws the system out of balance for a bit. It doesn't break the game, just looks like a "glitch" to the player.
As Andar said, it's a little hard to give more specific help when the purpose of this event is not clear.

If you just want it to count to ten seconds but reset when you turn a switch on, here:
Code:
◆Wait:60 frames
◆If:Time not passing is ON
  ◆Control Variables:#0001 Seconds = 0
  ◆Control Switches:#0001 Time not passing = OFF
  ◆
:Else
  ◆Control Variables:#0001 Seconds += 1
  ◆
:End
◆If:Seconds = 10
  ◆Text:None, Window, Bottom
  :Text:Ten seconds
  ◆
:End
And if you want an event somewhere else on the map to do something on a particular page then you can do that with a simple script call.

$gameSelfSwitches.setValue([mapID, eventID, "switch"], true/false)

So if you are on map 61 and you want event #27 to do something on its second page, it would look like this (assuming that page is conditioned by self switch A):

$gameSelfSwitches.setValue([61, 27, 'A'], true

Then when it's done whatever it is you want to happen, you turn its self switch OFF
$gameSelfSwitches.setValue([61, 27, 'A'], false

Those changes are instant.
After some more testing...
it seems like the issue is that the page can't switch from 1 to 2 and then immediately back to 1, there has to be at least one frame between the switches, otherwise page 1 never stops being active.

That's a big problem for my game because I really need a way to "reset" parallel process events back to the beginning of their page somehow. is there no script call or plugin that could pull this off?
thats why I'm suggesting not use page with condition inside.
it seem, the page not jump into correct condition.

Original thread: https://forums.rpgmakerweb.com/threads/the-wait-command-is-still-confusing-to-me.156844/