When using a Meta Maze, the Plugin will handle Self-Switches automatically for you, and you can skip this tutorial. However, you want to check out how to reset Self-Switches.
The feature described in this article will memorize Self Switches, with the ability to manually set these Switches to false, e.g., when the Player successfully finishes the dungeon, goes to the Worldmap, and then eventually decides to revisit this place again.
This tutorial is optional – when you don’t want to memorize Self Switches you can safely skip it.
Resetting Self Switches
Do a Plugin Command „Reset Self Switches“ to set all Self Switches of Events in a Dungeon to „false“. Pass the Space Map’s Id as argument. The equal JS Code is:
regardless of using Dungeon Generator or NoiseMap Generator, and „2“ is the Space Map’s Id.
If you wish to switch off only Self-Switches A (or B, C, D), use this command:
Do this tutorial when you build a randomized dungeon with a seedable RNG but not using a Meta Maze (which I don’t recommend doing, but maybe this procedure fits better what you need).
Let’s say, the Player must reach the exit of a dungeon area 5 times, or in other words, we make 5 floors until the Player escapes from the dungeon, then we refer to each area as „floor„. We will assign each floor with an individual id, that is unique within its Space Map, or in other words, we just tell the Generator on which floor the Player is right now. Create a variable and call it „Floor Id“. Every time the player goes one floor up or down, you need to update this variable accordingly.
MZ only: Plugin Command
Do the Plugin Call „set Floor by Variable“ or „set Floor“ right before the Generator is called to generate the Dungeon and fill in its arguments.
Do a Script Call right before the Generator is called to generate the Dungeon, or open/edit the Script Call that we put before to feed the RNG. Write this, and don’t forget to change the 5 to the variable that you are using to store the progression:
const floorId = $gameVariables.value(5); // <-- change the value '5' $dungeonGenerator.setFloorId(floorId);