Random dungeon generator?

Yes, I know how to make a dungeon lead randomly somewhere.


What I need is a way for the game to remember it.


For example:


I go west of map 1. It could land me in the east part of map 2, 3, 4, 5, 6, or 17. I end up in 6. If I were to go east of map 6, afterwards, I would end up back in map 1. If I go west again, back to map 6.


However, if going west of map 1 got me in map 17, then going east of map 17 will land me in map 1. If this happens, going west of map 1 will lead me to map 17.


And I need a way to reset this when they leave the dungeon.


I was thinking of saving the variable numbers when it gets randomly generated, but I have no way of making it two-way.


Can you help me?
At the same time that you have the engine generate the map id the player is going to, have the map id the player is coming from stored in a map specific variable.
Yes, however I suggest common events that memorizes your location. This way you will be able to just call the common event instead of copy and pasting the script 10,000 times for every map.
If you want to take that a step further, you could write a plug-in.
Double-post notice: SatansAngel

If you want to add something, simply edit your earlier post.

Original thread: https://forums.rpgmakerweb.com/threads/random-dungeon-generator.73085/