MZ Changing region IDs in event

Hi all,
I was wondering if it's possible to change region IDs in an event. I'm trying to make a designated gardening patch in my game by setting the tiles to region ID 1, then through events I want to change the region ID to 2, 3, etc, depending on what actions the player executed. I'm fine with either plugins or scripting to do this.

I came across Shaz's TileChanges plugin (for MV: Link), but it doesn't seem to work for MZ, as no plugin commands are showing up.

Thanks in advance for any help.
Selectable plugin commands are an MZ thing. For MV, you have to write
them out as a script. Since it has no interface elements, there are good
odds that it will work. You'll want to check the plugin's docs on how to
make the plugin calls.
Selectable plugin commands are an MZ thing. For MV, you have to write
them out as a script. Since it has no interface elements, there are good
odds that it will work. You'll want to check the plugin's docs on how to
make the plugin calls.
Thank you, I thought so. I managed to get Shaz's plugin working with the FOSSIL plugin for now.
@space_lion you can try this one: [RED_SetRegionId] in MZ with FOSSIL
as you can change the region of the tile from event and change it on the fly
without setting a region on your own.

so you need some event to change the region on the map to flip a switch or
use a global switch in order to change pages or variables.

as it is for MV smoothly, I dont know if it works in MZ.
@space_lion you can try this one: [RED_SetRegionId] in MZ with FOSSIL
as you can change the region of the tile from event and change it on the fly
without setting a region on your own.

so you need some event to change the region on the map to flip a switch or
use a global switch in order to change pages or variables.

as it is for MV smoothly, I dont know if it works in MZ.
Thank you for the suggestion. Can you tell me if RED_SetRegionID works for changing tiles with a specific region ID to another region ID? So for example: change all tiles with Region ID 10 to Region ID 20 after a certain switch is flipped.
set region make a tile on X,Y to 10 (in this case), than if a flip a switch
or variable it changed, you can use the same X,Y to 20 (just change number).

I dont know if it works in MZ, so its best to check that, as I dont know if there
is any plugin like that in MZ avaiable, unless its ported over.

I use it on my own for my HUD, and remove it when its not needed anymore
with a selfSwitch.

you could do also something like this:
if: SelfSwitch B = ON
// scriptcall to set region on X,Y to 10 (or range).
else
//scriptcall to set region on X,U to 20 (or range).
end

what will happen on that region can be set below or new parallel event

if: region == 10
do stuff
else
if region == 20
do other stuff
end
end
If you want to change the region id of all tiles when a flip is switched, can't you just do something like this:
Code:
If region id == 10
  If switch is ON
    //do stuff that you would have done with region id 20
  Else
    //do your regular region 10 stuff
  End if
End if
If you want to change the region id of all tiles when a flip is switched, can't you just do something like this:
Code:
If region id == 10
  If switch is ON
    //do stuff that you would have done with region id 20
  Else
    //do your regular region 10 stuff
  End if
End if
Well the problem is that there doesn't seem to be a scriptcall that allows you to change tile with region ID 10 to region ID 20. The locating of which tiles currently have region ID 10 is the problem. Currently I have to give in specific coordinates, but what I'd like to do is replace all tiles, regardless of coordinates, with region ID x to become region ID y

My current solution is writing a loop that checks a designated area on my map (I give in the min and max coordinates for both X and Y) and then loop through those tiles and change the region ID. Don't have it working yet, but that's what I'm going right now. It'd be a lot easier to just tell the engine to replace all tiles with region ID x to region ID y obviously.
Sorry for being confusing 😅
The point I was getting at is that obviously changing some tile's region id is not your end goal as that by itself doesn't do anything. I presumed that you are going to check the region id in a common event or something and do different stuff if the region id is 10 or 20. That's why I suggested to simply not worry about changing the region id (because that is not an intended feature and therefore causes headaches) but rather check where you wanted to check for region id 10 or 20 and instead check for region id 10 and if your switch is on or off.
Of course, if you need the region id for a plugin instead of your own eventing, then my suggested approach doesn't work.
Sorry for being confusing 😅
The point I was getting at is that obviously changing some tile's region id is not your end goal as that by itself doesn't do anything. I presumed that you are going to check the region id in a common event or something and do different stuff if the region id is 10 or 20. That's why I suggested to simply not worry about changing the region id (because that is not an intended feature and therefore causes headaches) but rather check where you wanted to check for region id 10 or 20 and instead check for region id 10 and if your switch is on or off.
Of course, if you need the region id for a plugin instead of your own eventing, then my suggested approach doesn't work.
Ah alright, yes that doesn’t work for me, because I wanted to prevent creating switches or variables for every tile. I’m creating a farming game and this is for plot of soil changing states depending on what seeds were planted and if they’re watered or not.
Then at midnight I wanted to reset the watered tiles back to being dry, which I’m using the regions for. I actually figured everything out earlier today, so it works. Instead of region ID I’m now checking the tile ID on a certain layer, which works. It’s basically the same idea, so I’m probably misusing this in some way, but it works so far. :LZSsmile:
Just curious, are the Region changes permanent? I mean do they persist Map changes?
Are they safed in the Safefile? If yes, this would be an absolutly awesome Plugin.
another way (if possible) can be far easier though that come to mind,
as there is a plugin for MZ (can give later).

if the maps are the same, and the region on the tiles are the same,
than you can use 2 duplicates of the map, 1 with region 10, other region 20.

you can switch map by flipping a switch (instantly) and not really transfering.
the plugin can do the same, but I think exit points can have the same exit (depending
on the switch) to what map to transfer.

if the X and Y become differently, than it might be possible too with the same approach,
chests and other stuff can be harder, but if you can port RED_setRegionId, than you
are mostly good to go.

Original thread: https://forums.rpgmakerweb.com/threads/changing-region-ids-in-event.151435/