Hey guys. Really sorry for the necropost,
however, I've made a few fixes and additions to this pathfinder to give it extra functionality (am I excused?).
This modified version should work with anything the previous version worked with.
Modifications:
I noticed some of you were complaining about your event not moving, I believe this was because your goal location was impassable. This issue is fixed: Goal location may now be impassable, pathfinder will still reach it.
I also noticed the pathfinder behaves strangely if the event's custom move route is set to repeat. It would repeat the steps of the originally determined path, which is pointless. This is improved: If the move route is set to repeat, the pathfinder will revalidate path each step. You can now specify the x and y to be variables or continuously changing values such as the player's x and y, and it will follow them. (Note, this is a bit more processor heavy, but for repeat only, the normal move route hasn't been modified)
Added parameter: Distance. So I wanted to use the pathfinder for an event to follow the player, but I wanted it to follow up to a certain distance from the player and then stop. By specifying the (optional) distance parameter, you can do just that. This is effectively an alternative to party following, except not limited to the party.
Jet, feel free to change the comments, though I made some additions to explain the modifications and also label the code I've modified.
Modified script:
http://pastebin.com/raw.php?i=ctt8RfdK
One final thing with the movement repeat behaviour that I'll mention: When applying your find_path script to your event's custom move route with a distance of say 3, that will continue running until it has reached a distance of 3 from its target (including moving targets), you can then add a random move step after it, and it will move randomly as long as it is within the specified distance from the target. You could use the change frequency moves to set the find_path frequency to highest, and random to normal (it hurries to the target, then wanders slowly).