Plugin to change Region ID

Hi again.

SO I have a footstep plugin and it doesnt currently offer the ability to turn on or off during event. So my only option is to change the Region ID (I tried changing tile set but it didnt do anything, I am using transparent tiles for collision on a parallax) . There is this RED plugin I am looking at but it sems to only change an ID based on x and y instead of changing "id 1 to id 12" and that just isnt realistic because I would have to have like idk, hundreds of event commands to do that.

image_2025-07-13_140031508.png


Is there any alternative? I know I could change to a similar map, but then you run into lots of logistical problems involving eventing and I would really like a simple and straight forward solution if at all possible. I did talk to the developer of the plug in and he said he would update it later to be able to be switchable but he seems like a busy person and so I would like an alternative if that never happens.
Can't you just loop it with that plugin (don't know if it lags with massive map)? Like for example 5->10:

for (let y=0; y<$dataMap.height; y++) {
for (let x=0; x<$dataMap.width; x++) {
const regionId = $gameMap.regionId(x, y);
if (regionId === 5){
$gameMap.setTileId(x, y, 10);
}
}
}
Use that plugin with this script
Code:
var q = 4;
var r = 9;
for (var x = $gameMap.width(); x--;) for (var y = $gameMap.height(); y--;)
if ($gameMap.regionId(x, y) === q){$gameMap.setTileId(x,y,r);}
Replace 4 with the previous region id
9 with the new region id
Can't you just loop it with that plugin (don't know if it lags with massive map)? Like for example 5->10:

for (let y=0; y<$dataMap.height; y++) {
for (let x=0; x<$dataMap.width; x++) {
const regionId = $gameMap.regionId(x, y);
if (regionId === 5){
$gameMap.setTileId(x, y, 10);
}
}
}


I cant even get that plugin to work, even with FOSSIL but idk if its actually doing region id or tile ID because it says both and its confusing me. And I would much rather work with something else.
Ok, I tested it and it seemed to work for me (region id). But hope you find another solution then.
Map data is usually the same between engines so an MV map plugin should work in MZ
Use that plugin with this script
Code:
var q = 4;
var r = 9;
for (var x = $gameMap.width(); x--;) for (var y = $gameMap.height(); y--;)
if ($gameMap.regionId(x, y) === q){$gameMap.setTileId(x,y,r);}
Replace 4 with the previous region id
9 with the new region id


Imma be honest I dont understand what im being instructed to do.

The plug in as I understand it doesnt work by default, so do you mean have an event with the plug in (i assume comment command, it doesnt actually tell me where to put the code) set up and then have a script command under that with your instructions?

I also dont know what im looking at or what that would do.

What is var q and var 6? And where are they being called from?

Im extremely lost looking at that.

Is there no other option lol I kind of hate this plug in.
Ok, I tested it and it seemed to work for me (region id). But hope you find another solution then.


Its a me problem then, I just dont understand what im looking at and the plug in does nothing to explain it so my lack of experience is making it hard to read I think.

I do appreciate everyone's help though.

It could also be something finicky with the footsteps plug in itself. Who knows.
$gameMap.setTileSquareId(x, x2, y, y2, r) is to set the range already, so you don't
need to loop through anything if it is already an option to so.

so it can go down or up with number or -number to set the square you want.
You put that block of script (either mine or rpglord's) in a script field in an event. Then trigger that event and it will go through every tile on the map and if it's region id 4 (or whatever you change it to) it will change the region id to 9 (or whatever you changed that to)

$gameMap.setTileSquareId(x, x2, y, y2, r) is to set the range already, so you don't
need to loop through anything if it is already an option to so.

so it can go down or up with number or -number to set the square you want.
I was under the impression that script changed EVERY tile in a range to the new region id. The OP wants to change all tiles of one region id to another region id
Yeah, like AquaEcho said.

@ShadowDragon But that changes all the tiles? They only want to change tiles with certain regions, I think.
EDIT: Looks like she edited that in as a reply too. So like she said X 2.
x and x2 = like 4 and 9 will change tileIdx to tileId x2, nothing more, nothing less.
so it only do some, but you can do 0 and 999 for example for the entire map 🙂
Yeah from x to x2, but if affects all tiles in that range. You can't choose which ones to change inside the range.
You guys have big brains and I just want to my feet to bleed. Its kind of a cute bit of lore happening.
Did you get the script to work?
Did you get the script to work?
setTileSquareId does your code already:

JavaScript:
    Game_System.prototype.setREDRegionSquare = function(mapId, x, x2, y, y2, regId)
    {
        console.log('Setting region square: ');
        for (i = x; i <= x2; i++) {
            for (j = y; j <= y2; j++) {
                $gameSystem.setREDRegion(mapId, i, j, 5, regId);
            }
        }
    };

    Game_Map.prototype.setTileSquareId = function(x, x2, y, y2, regId) // <==
    {
        $gameSystem.setREDRegionSquare($gameMap._mapId, x, x2, y, y2, regId);
    };
so the square check that I give cover it all, so why double the trouble?
Did you get the script to work?

Im gonna come back to this post at some point when I have a less busy day, I currently made a separate map with dependencies relative to the former, but its a particular instance where I can get away with that because its the end of a scene and can be its own map. But I'll definitely be trying to get it to work out later, but it really sounds like its just me not having enough experience with the language to understand things at first glance, which is fixable.

I wonder how possible it is for someone to make a plug in that can just change region IDs on the fly through eventing say in a plug-in command. I imagine its probably not too easy since I dont see one anywhere, but damned if I wouldn't pay for it.
if you want plugin commands for both settings, it is similar than
a scriptcall, so it doesn't really matters.

best way to change on the fly is using the scriptcall and use event pages.
so you can set a few up, and probable switches.

so if switch 5 is ON (bound to region ID 5, than X change to 5,
but you have to keep track to turn off all others correctly.

doing so, can be done by a scriptcall too, or use a variable ID to set to
an number like 5, and repeat the scriptcall and change the value
of region ID to the value of the region ID, so its easier to swap too.

so you have something like:

$gameMap.setTileSquareId(x, x2, y, y2, $gameVariables.value(10))

so whatever the value holds in variable 10 = the region ID on that mapId.
so your region change is instantly 🙂

change the x and x2, y, y2 to the square/rect you want to cover on the mapId.
I just want to my feet to bleed.
If you have a lot of problems understanding code, then we can perhaps try a different approach.

you never linked or specified which floorstep plugin you're using.
If you link us to a website with its code, people can check if that plugin has a better solution than trying to change region ID to change what that plugin does.

OK, it might go to a dead end as well (especially if it's one of the obfuscated ones), but it is at least a chance to check it.
So the dev of the footstep plugin did actually update it to be triggerable which is really awesome of them, thats more than id expect from people especially when they have a busy life.

The plugin in question is https://sirogamesdev.itch.io/footstep-pro

With that being said, this conversation has still been really helpful. Even with all the unfamiliar language, it does help to make it a familiar language by discussing it.

Original thread: https://forums.rpgmakerweb.com/threads/plugin-to-change-region-id.178896/