Event check if player if following them, stop and wait if too far away.
BMM_Archive · July 15, 2026
Original Source
- Original title: Event check if player if following them, stop and wait if too far away.
- Original author: jchedges
- Original date: April 6, 2016
- Source thread: https://forums.rpgmakerweb.com/threads/event-check-if-player-if-following-them-stop-and-wait-if-too-far-away.60061/
- Source forum path: Game Development Engines > Legacy Engine Support > RPG Maker MV Support
Summary
Hi everyone. I'm currently trying to script the following behavior to an event. Basically I want this NPC to go to it's smartpath destination, but when the player is too far away it stops, tells the player to keep up, and waits for them to be close enough. Then it keeps walking. So something like this:
Archived First Post
I'm currently trying to script the following behavior to an event.
Basically I want this NPC to go to it's smartpath destination, but when the player is too far away it stops, tells the player to keep up, and waits for them to be close enough. Then it keeps walking.
So something like this:
Track player X and Y position
Track this event's X and Y position
if (eventX - playerX >= 10 || eventY - player Y >= 10)
 cancel event smart path to destination
 Gab window text "Hey, keep up!"
 wait until player is close enough, then re establish smart path
else
 smart path to destination
This is what I've put together so far, which is not working. It's just going through the script over and over, as shown by my console log literally 2 seconds after the game starts. For whatever reason it's not actually stopping and waiting for the player.
Am I going about this the wrong way? I'm pretty new to this so there might be a way easier way to do this.
Thanks in advance!
Downloads / Referenced Files
RPG Maker Web attachments are mirrored locally when available. Other external links remain hosted by their original creator or third-party service.
- Local mirror: 21216-b5bdd5464d2593ce00231ed462a7625f.png
SHA-256:65a891b234ddc7d92c93cacf834499ff7a2ff431d818856d308b82a0b68f4ac7
Original attachment URL: https://forums.rpgmakerweb.com/attachments/screen-shot-2016-04-06-at-6-56-51-am-png.35862/ - Local mirror: 21217-5e6784841a727b35cb52fa6f5576bea0.png
SHA-256:bccecd9b2949c67271bae69f714150e91cc287db865ad5243e756eb326a703f9
Original attachment URL: https://forums.rpgmakerweb.com/attachments/screen-shot-2016-04-06-at-6-57-03-am-png.35863/ - Local mirror: 21218-fece3b9ee2f779142fe691006904759b.png
SHA-256:5bf8f449fa40380d0a2206f43efc7dbf251090b5c7a37ad17a840aca4f877b59
Original attachment URL: https://forums.rpgmakerweb.com/attachments/screen-shot-2016-04-06-at-6-58-04-am-png.35864/
Referenced Images / Attachments
Creator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
Topic Summary
Loading summary...