MugenDraco
Villager
- Xy$
- 0.21
I want to keep a randomly moving NPC inside a certain area. I've marked this area with a Region ID of 1. I have a Parallel event running to check if the NPC's random movements take her outside of Region 1. I'm using a conditional statement, and the If clause is the following script: $gameMap.events(this.eventId).regionId !== 1
I've set it up so that if the statement evaluates to true, to move her to the right, back inside the area, since the only exit is on the left side of the area. But it always evaluates to true for some reason, as if the Region ID isn't 1, which it obviously is. So she's just moving to the right indefinitely.
I Googled the syntax of events and region IDs for over an hour to stop all the "can't find property/function" errors I was getting, so I'm fairly certain the code in the script is correct. I have no idea why it's saying the region ID of the NPC isn't 1 when it is. Does anyone have any ideas what could be causing this?
I've set it up so that if the statement evaluates to true, to move her to the right, back inside the area, since the only exit is on the left side of the area. But it always evaluates to true for some reason, as if the Region ID isn't 1, which it obviously is. So she's just moving to the right indefinitely.
I Googled the syntax of events and region IDs for over an hour to stop all the "can't find property/function" errors I was getting, so I'm fairly certain the code in the script is correct. I have no idea why it's saying the region ID of the NPC isn't 1 when it is. Does anyone have any ideas what could be causing this?