Yanfly Engine Plugins is a plugin library made for RPG Maker MV, a wonderful piece of software to help you make that role playing game of your dreams. You can find out more about RPG Maker MV here.
You can grab the plugin here:
Events have a typically bland movement behavior. They either stand in one place, always chase you, always run from you, move randomly, or always just move in specified patterns. This plugin lets your events suddenly switch from their norm to chasing or fleeing from the player.
This plugin allows you to make events that will chase the player or flee from the player when the player enters within range of the event or when the event sees the player.
How to Use
Insert these lines into the script call window within the Movement Route event to give an event the chase or flee flag.
Note: This doesn’t work with players.
Script Call lines
this._chaseRange = x
Event will chase player if reaching x range.
this._fleeRange = x
Event will flea from player if reaching x range.
this._chaseSpeed = x
Event’s movement speed when chasing.
this._fleeSpeed = x
Event’s movement speed when fleeing.
this._sightLock = x
Event will flee/chase player for x frames.
this._seePlayer = true
Requires the event to be able to see player.
this._seePlayer = false
Doesn’t require event to be able to see player.
this._alertBalloon = x
This balloon will play when player is seen.
this._alertSound = x
This sound will play when player is seen.
this._alertCommonEvent = x
This event will play when player is seen.
It is best to play this inside of a custom move route for the event at a high frequency rate. Keep in mind these effects only occur after the setting is made and ran, which means upon loading a map, if the event with a low frequency hasn’t loaded up ‘this._chaseRange = x’ in its movement queue yet, the event will not chase the player just yet.
Happy RPG Making!