Store region ID in variable

Hey!

I set up a common event (parallel process) that stores the players X, Y and Region ID in three variables. The first two are neccessary to get the Region ID. However, I'm afraid that might cause lag on the long run. (does it?)

Is there any way to get this done via a plugin faster?
X and Y:
$gamePlayer._x
$gamePlayer._y

Region ID:
$gameMap.regionId($gamePlayer._x, $gamePlayer._y)

edit: just call these 2 when you need them
$gamePlayer.regionId()

If you're doing it in a parallel process common event, add a Wait 5 Frames either before or after, because the player is not going to move 60 tiles in a second, so you don't need to do the check on every frame.

And you don't need a plugin. You just use Control Variables and put that in the Script section.

Original thread: https://forums.rpgmakerweb.com/threads/store-region-id-in-variable.91636/