region ID

is it possible to change region ID's with a script call or is there a plugin that allows this?

i'm trying to for example flip a switch and region 1 changes to region 2 on the map
You can change a tile's region ID with following script:
JavaScript:
const x = 13;
const y = 25;
const newId = 42;
$dataMap.data[(5 * $dataMap.height + y) * $dataMap.width + x] = newId;
This will change the region ID of the tile at coordinates (13, 25) to 42.
By the way, the 5 represents the region ID layer. If you change it to something else, you'll be modifying a different layer. While I haven't tested it, I doubt that you can use this method to change a tile's sprite, since the spritesheet is most likely cached for performance reasons, as it needs to be accessed on every frame.

That said, keep in mind that this isn't permanent. As soon as the map data is reloaded, the region ID will be reset. This happens whenever the Scene_Map is created such as:
  • When starting a new game.
  • When loading a save game.
  • When transferring the player (even if it's to the same map).
  • When returning from any scene to the Scene_Map, such as:
    • Leaving the pause menu (Scene_Menu).
    • After combat (Scene_Battle).
    • Using an item that triggers a common event (Scene_Item).
    • Leaving a shop (Scene_Shop).
    • After a name input event command (Scene_Name).
    • After returning from the Debug screen (Scene_Debug).
    • Depending on the plugin you use, there may be any number of scenes you could return from.
You will either need a parallel event to ensure the region ID is always properly set, or a plugin that was made for this purpose.
According to its thread, Shaz's Tile Changer works via FOSSIL.
i'm using https://forums.rpgmakerweb.com/inde...ake-dungeon-even-more-dangerous-mz-mv.141453/ and i was tryin to make a map reveal event that would change the region once a switch is triggered.

Original thread: https://forums.rpgmakerweb.com/threads/region-id.152680/