How do I ask for Events RegionID?

In RMVXACE I did it this way:


$game_map.events["event ID"].region_id




Short, simple and effective.


This does not seem to work in RMMV:


$gameMap.event("evend ID").regionId




How can I translate the Ace Version of the script call into RMMV?


Edit:


Okay anyway, luckily I found the solution in this post. Thanks Shaz for the solution.


$gameMap.event(id).regionId()


So the new version needs the () brackets after ".regionId".
You only need to do that if you're writing a script.  If you're just using commands, you can use the Get Location Info command.  You may need to use Control Variables to get the event's location - I'm not sure if Get Location Info lets you select a player/event or just the coordinates.
I am using the event system with script calls whenever I can. Because I like a $global variable system with arrays much more than searching through multiple sites of variables, from the default system.


Yes I would need the X and Y values (if you mean the following command). Perhaps this would also work:


$gameMap.regionId($gameMap.event(id).x, $gameMap.event(id).y)


But the first command looks cleaner.
I was referring to using event commands rather than a script call.  I would not suggest the code you've just posted, when there's a far easier way, if you HAVE to use script calls to do it.
Yes I have to use script calls at some points. In this case it's rather the script section of a conditional branch. I will use the first, easier version.


For some things I find script calls easier as they don't require huge event blocks and can use arrays. This way I can use the same common event for all 4 players and their moving events.


But yes, I use event commands aswell. Especially for moving and conditional branches. I tried using script calls in VX ACE for the moving commands but for some reason it didn't worked.

Original thread: https://forums.rpgmakerweb.com/threads/how-do-i-ask-for-events-regionid.55679/