MZ Event Chase Player

Hey so I'm not asking someone to make me a custom plugin for this, I feel like there MUST be an existing plugin that works for this, and I just want someone to point me in the right direction. I think this is still the right forum and if it's not, please at least know I'm not posting this in the wrong forum *on purpose*.

I found and tried one plugin here on the official 4ums with this functionality, which is https://ct-bolt.itch.io/rmmz-chase-player-plugin

Now, possibly owing to it being an acknowledged very early demo, it doesn't work great. by which I mean it more or less does what it's supposed to, but a little clunkily, and then when I feed in an event move route to an event using the plugin (for instance, with an event that's an on-touch encounter, the event move route to make it disappear once that enemy chases the party down initiating a fight and the party kills that enemy) it locks. Events with the plugin's note tag don't seem to like receiving movement routes from event commands.

I've looked on MakerDevs and a few other places with no luck. This Huddell plugin, Cyclone Movement, or this Casper Gaming plugin, CGMZ Event Movement MIGHT include the basic functionality I'm looking for, but then again they might not, and I'm reticent to hand over money for something that might not even do the one fairly simple thing I want. Likewise, I don't really have a budget for MZ Plugins (I'm using MZ for the Touch The Stars jam) so I'm not inclined to shell out $ I don't have to Visustella for this. If anyone has ported Yanfly's Event Chase Player for MV over to MZ, I haven't found it. I feel like there's gotta be something free and working around here for a function this basic, even though RMMZ hasn't been out all that long.
What about this
Close! I'm looking for a "sensor" that lets an event "know" or "see" when the player is within a certain range, say, five tiles. CTBolt's plugin does this but as I mentioned it has some issues.
If I recall correctly, @SigmaSuccour posted a video about switching event pages using a sensor. So you could try to combine both to create what you wanted. Check their profile posts.
@TheGentlemanWinner
AutoSelfSwitch.js for MZ by Triacontane.

This turns on a self switch for an event when player is nearby.
(Use Google Translate since it's in Japanese.)
Hey so I'm not asking someone to make me a custom plugin for this, I feel like there MUST be an existing plugin that works for this, and I just want someone to point me in the right direction. I think this is still the right forum and if it's not, please at least know I'm not posting this in the wrong forum *on purpose*.

I found and tried one plugin here on the official 4ums with this functionality, which is https://ct-bolt.itch.io/rmmz-chase-player-plugin

Now, possibly owing to it being an acknowledged very early demo, it doesn't work great. by which I mean it more or less does what it's supposed to, but a little clunkily, and then when I feed in an event move route to an event using the plugin (for instance, with an event that's an on-touch encounter, the event move route to make it disappear once that enemy chases the party down initiating a fight and the party kills that enemy) it locks. Events with the plugin's note tag don't seem to like receiving movement routes from event commands.

I've looked on MakerDevs and a few other places with no luck. This Huddell plugin, Cyclone Movement, or this Casper Gaming plugin, CGMZ Event Movement MIGHT include the basic functionality I'm looking for, but then again they might not, and I'm reticent to hand over money for something that might not even do the one fairly simple thing I want. Likewise, I don't really have a budget for MZ Plugins (I'm using MZ for the Touch The Stars jam) so I'm not inclined to shell out $ I don't have to Visustella for this. If anyone has ported Yanfly's Event Chase Player for MV over to MZ, I haven't found it. I feel like there's gotta be something free and working around here for a function this basic, even though RMMZ hasn't been out all that long.

hello. Hey moghunter has a sensor plugin for MZ. I currently use this in my game. It’s able to sense a player within the number of squares you designate. So you can set up an event chase player.

You can simply have the event running a parallel process...
JavaScript:
if ($gameMap.distance($gamePlayer.x, $gamePlayer.y, $gameMap.event(this.eventId).x, $gameMap.event(this.eventId).y) < num){

    //do something

} else {

    //do something else

}
...where "num" is the number of tiles away you want to check for. Then if the player gets close enough it will do the action, such as moving towards the player, and when the player manages to get outside of range it will stop.

Personally I use...
JavaScript:
if (Math.abs(Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2))) < num){
    //do something
} else {
    //do something else
}
...because it is much less resource intensive, though it doesn't however check for looping maps if that matters. x1,y1 representing one target's location, and x2,y2 representing another. You of course don't need to use the player in either example, you can use two event locations.

Original thread: https://forums.rpgmakerweb.com/threads/event-chase-player.138089/