MV Region ID = Variable

Here there game makers! I was trying make a geomancer skill like in final fantasy and I managed to use lunatic mode to make one skill use other skills when a variable.
Like when variable is 7 use the skill sandstorm and when the region is 9 use the skill snowstorm.

The problem I'm having is making the variable the same as the region ID.

What I'm looking for is for the variable to always be the same as the region Id.

Like when the party is on a regain Id of 252 the variable must be 252 or if the region is 56 the variable must be 56.
You can do this with a script call:

$gameVariables.setValue(variableid, $gamePlayer.regionId())

or simply put $gamePlayer.regionId() in the "script" operand of the change variables event command.
You can do this with a script call:

$gameVariables.setValue(variableid, $gamePlayer.regionId())

or simply put $gamePlayer.regionId() in the "script" operand of the change variables event command.
Should I put it in a parallel event or in as part of the skills code?
Should I put it in a parallel event or in as part of the skills code?
You have a few choices of where to put it. If you're doing the Geomancy effect in a notetag on the skill, then put this line above wherever you need to use the variable value.
You have a few choices of where to put it. If you're doing the Geomancy effect in a notetag on the skill, then put this line above wherever you need to use the variable value.
Thank you very much I'll give this a try.
You can also do this via event commands. On tab 3 is Get Location Info, which allows you to store the Region ID into a variable.

You'd run a Turn 0 troop event with that command, and then just stick that into each troop you have (there are plugins to automate that part for you, so you don't actually have to copy and paste it into every troop if you don't want to).

What Trihan said works perfectly, I'm just putting out the built-in method so you know about it 🙂

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