Problem with parallel event trigger

I have problems with parallel event trigger on MZ. If you transfer player to another map, event stops playing, so if after transferring you need to remove event (turn self switch A on, for example, or turn off the switch that executes the common event off) it will never happen because player will be just transferred to another map again, if he returns to the map where event got activated.
What I mean, for example I want to check if player at the region 1 and if it so text shows and then player transferred to a new map, then sound is played, then this event is removed for good.
20240517_120316.jpg


It's just transfers player to another map, no sound is played and if you return to this map and step on region 1 you'll get transferred again. The same when you use a common event. How can I create an event that does what I want? Or at least removes region check event after player is transferred. Also is this bug or feature? On MV this works as expected, you are moved to another map, then sound played and self switch is activated.
I'm not sure.. You mean when you come back to the old map? So the game will force you to teleport again, right?

If so.. you should try using reg -= 1 (if I remember correctly) After Tranfer Player
And then use if reg = 0 / Control Self Switch


- This will reset your reg values.

I may have typed some mistakes. If anyone knows more than me, please help.
I'm not sure.. You mean when you come back to the old map? So the game will force you to teleport again, right?

If so.. you should try using reg -= 1 (if I remember correctly) After Tranfer Player
And then use if reg = 0 / Control Self Switch
I may have typed some mistakes. If anyone knows more than me, please help.


This will reset your reg values.
The problem is after transferring player parallel event just stops. So it's trasfers you, but everything that it suppose to do after that isn't working. So if you step on region 1 again you are teleported again.

Update.
I've found the solution. I only use parallel event trigger to check the region and if it equals 1 it turns on the self switch A, new event page that is activated with self switch A is set to Autorun, which works the same way as on MV and doesn't stop after player is teleported to another map.
20240517_130212.jpg

20240517_130222.jpg

Now it works!
It looks like for optimisation's sake parallel events now only run when the player is on the same map as the event and stop immediately if player is transferred. And if it's a common event, it starts from the beginning after you are teleported to another map.
It looks like for optimisation's sake parallel events now only run when the player is on the same map as the event and stop immediately if player is transferred.
That has always been the case, and is still the same in MZ And no, your assumption on that the autoruns continue to run is also wrong.

In each and every case, the map events are deleted on leaving the map.
An event with a transfer command can only continue after the transfer as long as it remains in memory - and that depends on the interaction between the commands and the game loop.

This time is longer for an autorun than for a parallel because autorun is exclusive and parallel not, but depending on the commands used in the autorun it still can be cancelled before all commands are processed.

The correct solution that will always work would be to make a new event on the new map for shutting the transfer down - although that means you'll have to use a regular switch instead of self-switch.
To just provide another option to what @Andar said about using a normal switch instead of a self-switch, you could still use the self-switch if you used the script to turn on the self-switch from another event.

With the script, you can turn self-switches on or off on any map and in any event.

The script is $gameSelfSwitches.setValue([1, 5, ‘A’], true);

Where 1 = the mapId, 5 = eventId, A = the self-switchId, and true = on and false = off

But be careful because in the example above, the single quotes around the A won’t work if you copy and paste that.
In each and every case, the map events are deleted on leaving the map.
This is misleading: the state of the source event only affects the execution of its commands when the event's trigger is set to Parallel. This is because Parallel events run through an interpreter on the event itself, which resets on page change.

By contrast, when a non-Parallel event starts its commands are all placed into the main interpreter: a single interpreter instance that persists throughout a playthrough. So these events will run to completion, regardless of what happens to the source event (e.g. unloaded due to map change).

Pretty sure this has been true since RM2k3, if not earlier.

the single quotes around the A won’t work if you copy and paste that
Here you go~
JavaScript:
$gameSelfSwitches.setValue([1, 5, 'A'], true);
That has always been the case, and is still the same in MZ And no, your assumption on that the autoruns continue to run is also wrong.

In each and every case, the map events are deleted on leaving the map.
An event with a transfer command can only continue after the transfer as long as it remains in memory - and that depends on the interaction between the commands and the game loop.

This time is longer for an autorun than for a parallel because autorun is exclusive and parallel not, but depending on the commands used in the autorun it still can be cancelled before all commands are processed.

The correct solution that will always work would be to make a new event on the new map for shutting the transfer down - although that means you'll have to use a regular switch instead of self-switch.
Oh, I see. I stopped using RPGM couple of years ago so I don't remember for sure how it works anymore, but I could swear it worked in MV somehow.... I guess I'll just drop it then.
@Yulia By the way, I just noticed your Face Sets and Portraits link and checked them out. They are very nice!

I hope the responses above were helpful.
@Yulia By the way, I just noticed your Face Sets and Portraits link and checked them out. They are very nice!

I hope the responses above were helpful
Yes, thank you very much!
Edit: though it turned out I can do what I need without regions at all, just by placing event below the player and setting it to player touch, so I just dropped this parallel event, but information is very helpful anyway.

Original thread: https://forums.rpgmakerweb.com/threads/problem-with-parallel-event-trigger.168761/