Basic Conditional Branch Script question

Hi

I am new to RpgMaker Scripts but I have some basic coding knowledge. I try to make an Event show a text when the player gets near it but nothing happen when the player gets within the prescribed distance (5 tiles). I use a conditional branch and add some script. I have set the Event to autonomous random movement and trigger is set to parallel. Here is the code:

error.png


What am I doing wrong?

Regards,
Gamb
this in that context isn't the event, its the interpreter. the interpreter has a property for the ID of the event that it's currently running. you need to use that property to fetch the position of the correct event.
Instead of this.x and this.y, try $gameMap.event(this._eventId).x and $gameMap.event(this._eventId).y
this in that context isn't the event, its the interpreter. the interpreter has a property for the ID of the event that it's currently running. you need to use that property to fetch the position of the correct event.
Instead of this.x and this.y, try $gameMap.event(this._eventId).x and $gameMap.event(this._eventId).y
Thanks a bunch, that solved it.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/basic-conditional-branch-script-question.178858/