Event "if" statement not running when moving event hits a target regionId

20230501154920_1.jpg

The correct region is on the map, and the correct events are being called in the movements.

Does it have something to do with the custom movement route? They move to the correct location then just stall.

20230501161934_1.jpg

20230501161810_1.jpg
Your branch will pass whenever event 148 is in a non-zero region, due to how JavaScript checks "truthy" conditions.

character.regionId() returns the ID of the region where character is located. It does not expect any arguments. You can do the comparison yourself, e.g.

$gameMap.event(148).regionId() === 1
However, you don't actually need any scripting for this. You can use the Get Location Info command to store the character's region ID in a game variable, then check that variable with a Conditional Branch. E.g.

◆Get Location Info:Check, Region ID, This Event ◆If:Check = 1 ◆Text:None, None, Window, Bottom : :I'm in region 1! :End
Thank you, this gives the expected function. (And has revealed a whole different problem for me to chew on for a bit.)
Great! I think. Happy RPG Making! 👋

Original thread: https://forums.rpgmakerweb.com/threads/event-if-statement-not-running-when-moving-event-hits-a-target-regionid.157132/