How do events work? In details?

Hello everyone 😀

Im trying to find the frame data of events for better processing, and I can't seem to know that od find the information.
1) How does events are processed?
2) How many frames before it executes commands?
3) If 2 parallel process events are running, and 1 of them activates a switch to prevent the other from running, will the other event stop or finish his process first?
4) Can commands be executed after the transfer command?
5) Can commands be executed after Erase Event?
6) Will animations stop when the event disappears

I'm trying to find similar info to know what does events do in-depth, but I need your help guys 😛

Thank you! 😀
A lot of what you're asking is user controlled, I think. . . if I'm understanding your question correctly.

As for #1, I'm not sure I understand what you want explained.

2. It's up to you. Commands will be executed immediately unless you input a wait function. Otherwise, processes move forward in the order in which they are input, in succession, without stopping, until the event comes to an end.

3.It depends on how you set up the switch, I would imagine?

4.Do you mean you want the player to transfer to a new map and continue using the same event? If so, then no, you would have to use a new parallel process on the new map in order to continue whatever is happening.

5. I honestly don't know this answer, but I would imagine not.

6. If an event disappears, everything associated with that event will also disappear.

I might be misunderstanding your questions, though. Sorry if I'm not helping.
1) Might need you to elaborate on this, since I don't quite understand what you're asking.

2) I want to say 1 frame for an event command to start, but don't quote me on that.

3) I'm not 100% sure on this one either, but I seem to recall that the other parallel event will end once it finishes its processing first. At least that's what happened for me when I was experimenting with some push event related c.

4) Yes, but only if you add commands after the transfer command. The event will end once all of the commands that were added after have processed.

5) From what I remember, Erase Event will immediately stop processing any other commands that come after.

6) Need to specify which animation you're talking about. Battle animations will stop once it plays through all of its frames, while a sprite animation stops if you use erase event or a switch to a new event page (though, if the new event page has a sprite, I think whichever frame the first sprite stops at will determine what animation frame the sprite in the next page event will be on). If you only change the sprite to a blank graphic, the animation will continue to loop until you tell it to stop.
3) random - it depends on where in the game loop each event is relatively to each other, and you have no way of knowing that.
Sometimes all other processes are executed before the second parallel process stops, and sometimes it stops immediatly.

4) not reliable - sometimes the commands after a transfer to a different map are executed, sometimes not - again, it depends on the status of what is left in the game loop but also on the kind of commands after the transfer - if any of those commands include a wait (not only explicit, but also implicit), then all commands after that will be lost.
However, that only counts for transfers to a different map, because that deletes the events on the current map and restarts common events. If the transfer is on the same map, the commands will proceed regularly.

5) no
1) Events are processed by an interpreter. The interpreter loads the list of commands from the event and keeps an index of which command it is currently executing, execute the next one and increase the index, until there are no more commands left.
Some commands may have to wait for a certain number of frames or wait until something happens (like a move route finishing). In this case, the interpreter is suspended and after every frame it checks if it can continue.
Parallel Process events have their own interpreter, everything else use the same interpreter. You can't have two non-parallel events running at the same time because of thise.

2) Depends on the command. There are basically three types of commands:
a) Something that happens immediatelly. For example: Changing a variable value
b) Something that is "reserved" to execute on the next frame. For example: Common Event Calls and Map transfers
c) Something that happens over time. For example: A move route.

If you have an event like this:
Code:
call common event 5
change variable 1 to 5

The variable will be changed before the event is executed. Both commands are executed immediatelly, but the common event call is not handled by the interpreter, instead it is reserved on a temp data and when the next frame starts the game will see that there is a common event reserved and will execute it.

4) Check my explanation for number 2. Transfering the player works the same way: The player is transfered after 1 frame, so every command that can be run immediatelly will be executed before the transfer. Once the interpreter is suspended and the next frame starts, the player will be transfered and the remaining commands of the current event will be lost.

I'm not sure about 3, 5 and 6.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-events-work-in-details.74745/