Smart Pathfinding
2015.10.21
by Shaz
Introduction
This plugin allows you to set up smart pathfinding for events.
How to use
Add to your plugins folder (file name does not really matter, but I call mine SmartPath.js). There are no parameters to set.
Use the plugin command
SmartPath eventID1 eventID2 to make event 1 find a path to event 2
Use the plugin command
SmartPath eventID x y to make the event find a path to x, y on the map
Use the plugin command
SmartPath eventID cancel to cancel pathfinding for the event
eventID, eventID1 and eventID2 can be a number for a specific event (no leading zeros), 0 for the event issuing the plugin call, -1 for the player, or $gameVariables.value(id) to get the event number from the specified variable (replace id with the variable id, no leading zeros).
x and y can be map coordinates or $gameVariables.value(id) to get the x or y value from the specified variable (replace id with the variable id, no leading zeros).
The event will continue to follow its target until told to stop. So if the target is another event or the player, if the target moves, the event will adjust its course or follow, depending on how close it is to the target.
Plugin
Download from pastebin
Credit
- Shaz
Terms
- free for use in commercial games
Note
- the plugin says it works for events OR the player, but I'm not sure that it does work for the player. I need to re-test that.
本贴来自国际rpgmaker官方论坛作者:Shaz处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:
https://forums.rpgmakerweb.com/threads/smart-pathfinding.46761/