Maintain map event state when temporarily transferring player to another map

Hi there,

I'm trying to create a scene that can be triggered from an event on a map, much like a battle. So in the same way as when a battle is initiated, the map, when the battle ends, will be in the exact same state as it was before you started the battle (almost as if you paused the game, events will be in the same places they were along their move route, etc), I would like to have a scene take place that, when finished, will take the player back to exactly where they were on the map, with the map exactly as it was before the scene took place. However, this is not a battle, this is normal, overworld gameplay that would run like anything else - so probably on a separate map with its own events.

I have considered transferring the player to another map and using self-switches or variables, but I think this would end up being a lot of work in the long-term as I repeat this behaviour throughout the game, as I would probably have to do something like set a variable that stores the locations of every NPC on the map, where the player was, and so on.

Really, I want this to work exactly the same as a battle would. Just pause the map (and I'm sure behind the scenes you would have to store the state of it somewhere for later), move the player to the temporary map, player does everything they need to do there, event happens that returns them to the original map, gameplay resumes as normal.

Perhaps there is a plugin that would help with this? I'm not loath to this actually being a "battle" in the sense of what RPG Maker sees it as, as long as there's complete freedom to run events and move around as though it were any other map. Ideas would be appreciated (and sorry if I'm missing something obvious).

Thanks.
I think the easiest way to do this would actually be to create a large map separated into two sections. One section is the main area, then, further away than the player can see, you have the second section of the map that you use for your cut-away.

Then, when you transfer the player, you turn on a switch that pauses all the NPC events. That same switch could be used to "turn on" the NPC events in the second map area. You run your cut-away sequence in the second area, then transfer the player back and turn the switch off.

This would ensure that all of the events keep their values and the player wouldn't know the difference. And if you use the switch and different event pages, the events won't take much extra processing power.

Would that work for you?
There are Save Event Location plugins like Yanfly's or this one. The plugin file has English instructions
There are Save Event Location plugins like Yanfly's or this one. The plugin file has English instructions

Ah, clearly I didn't search well enough! I didn't know Yanfly had a plugin for that (I even had it downloaded locally 😀) - I think both of those will do exactly as I'm looking for. The only other thing is making sure the player is transferred back to the same location as they were in when they were transferred to the temporary map - but that will be fine as a variable I think.

I think the easiest way to do this would actually be to create a large map separated into two sections. One section is the main area, then, further away than the player can see, you have the second section of the map that you use for your cut-away.

Then, when you transfer the player, you turn on a switch that pauses all the NPC events. That same switch could be used to "turn on" the NPC events in the second map area. You run your cut-away sequence in the second area, then transfer the player back and turn the switch off.

This would ensure that all of the events keep their values and the player wouldn't know the difference. And if you use the switch and different event pages, the events won't take much extra processing power.

Would that work for you?

Btw, I was considering taking this approach. Only thing that sort of bothered me was that, I expect that I'll be repeating this same scene a lot, on different maps throughout the game. Would probably be a lot of repetition.

Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/maintain-map-event-state-when-temporarily-transferring-player-to-another-map.174269/