MZ Event Chasing Player Plugin Help

I want the npc to spot the player within a range (5 tiles) and start to chase them, and when the player is far enough (10), they'll stop.
I'm using this plugin right now.. and it works to making the npc chase, but how to make them stop?
(I'm using the detect part as paraell: close -> self switch a, and when self switch a is on they chase and kill the player (event touch).)
Aaaaa they won't stop chasing, how to make them stop when I'm faraway enough? 😢
https://reflector88.itch.io/proximity-sensor <- props to the creator
Example:
1716666678479.png
1716666686696.png
2 solutions off the top of my head:

1 if you only want the event to chase the player for a certain amount of steps change its move route to custom and do however many "move toward player" steps/tiles you want the to make and then turn the self switch off.


2 you're going to need a separate parallel event that tracks the player's position and the position of the event using variables, do some math to determine the distance between them (I believe there is a script call to check distance between 2 things) and have a conditional branch turn the self switch off when the distance becomes greater than 'X'.

The plugin creator said in a comment on their itch page that once the distance is met and the plugin does its thing, it stops checking.
Greetings,

I have no experience with the plugin itself, so perhaps someone can offer more pointed advice.

That being said, I believe a potential solution to your issue could be by creating a B event page on the snowman, and then having regions on the map that, when touched by the player, switch the snowman's page to B and turns self switch A off.

In this way you would have a "leash radius" where the snowman would reset. You could even have the snowman shuffle on over to his original starting location once the leash started.

Edit 1: Or, even better, just have the regions turn Self Switch A on the snowman off, so that once he resets, he can attack again!

Just an idea to help out!

Happy game making,

-Niniann
Have you seen if yanfly's chase plugin for MV works with fossil in mz? Because it does exactly what you want to do out of the box.
Thanks everyone for the comment! but english isnt my first language, so it's difficult to understand...
and for the plugin, it only applies to the current event. which im confused. 😢
but english isnt my first language, so it's difficult to understand..
OK, then I'll describe it in a way that is hopefully better understandable.

You need a second event for checking the distance between the player and the enemy, because the plugin does not help with anything after it triggered the proximity.

that second event needs to be parallel, starting with a wait(3) or so and then using four control variable commands and four variables to get player and event X Y.

The next step would be to use mathematics (Pythagoras) to calculate the distance between the event and the player.
and if the distance is greater than 10, reset the event to page 1.
OK, then I'll describe it in a way that is hopefully better understandable.

You need a second event for checking the distance between the player and the enemy, because the plugin does not help with anything after it triggered the proximity.

that second event needs to be parallel, starting with a wait(3) or so and then using four control variable commands and four variables to get player and event X Y.

The next step would be to use mathematics (Pythagoras) to calculate the distance between the event and the player.
and if the distance is greater than 10, reset the event to page 1.
That's more understandable haha, thank you! I will update once I finish :>>

Original thread: https://forums.rpgmakerweb.com/threads/event-chasing-player-plugin-help.168992/