@Shaz, thanks for the quick reply - it works! Thank you once again.
Smart Pathfinding
JS Plugin Releases (RMMV)Can I use this plugin in MZ?
If not, please tell me, will you port it to MZ and when?
This plugin is very necessary in MZ !

If not, please tell me, will you port it to MZ and when?
This plugin is very necessary in MZ !

This plugin will not work in MZ because it has plugin commands.
Will I port it? Initially I planned to port any plugin that people found useful. Now ... I don't know. The attitude people showed towards VisuStella and Yanfly was a major turnoff for me, and I don't know if I want anything to do with the engines or this community anymore.
Will I port it? Initially I planned to port any plugin that people found useful. Now ... I don't know. The attitude people showed towards VisuStella and Yanfly was a major turnoff for me, and I don't know if I want anything to do with the engines or this community anymore.
@Shaz
The attitude some people had towards VisuStella was disappointing to say the least, but not everyone in the community is like that. I'm still hopeful that the majority is grateful for all the assets that are created.
It is a shame that it doesn't get reflected more in the comments/posts.
I do hope you remain in the community, because I can't imagine someone more helpful and inventive than you. Ultimately it is your own decision, if you want to port something or not. It is a hobby and you should have fun doing it.
I can imagine a port is a lot of tedious work, but I loved your smart pathfinding, because it could make whole villages that much more engaging and real. I bet this plugin breathed live into so much npcs in a bunch of MV games. Even if you don't port it, you can be proud of that and I'm thankful this plugin exists for MV.
The attitude some people had towards VisuStella was disappointing to say the least, but not everyone in the community is like that. I'm still hopeful that the majority is grateful for all the assets that are created.
It is a shame that it doesn't get reflected more in the comments/posts.
I do hope you remain in the community, because I can't imagine someone more helpful and inventive than you. Ultimately it is your own decision, if you want to port something or not. It is a hobby and you should have fun doing it.
I can imagine a port is a lot of tedious work, but I loved your smart pathfinding, because it could make whole villages that much more engaging and real. I bet this plugin breathed live into so much npcs in a bunch of MV games. Even if you don't port it, you can be proud of that and I'm thankful this plugin exists for MV.
I'm sorry if this has been answered before, but is there a way to limit the number of steps the event takes? I want event 1 to move to event 2 but only X steps. How do I do that?
No, it will not do that. You would have to tell it to find the path, then wait a certain number of seconds, then cancel the pathfinding. But you may not always end up the correct distance away from the event that you want to.
Are your events moving? If not, then you don't need to use a plugin at all - you can just do a Move Route to make event 1 move in a fixed direction.
Are your events moving? If not, then you don't need to use a plugin at all - you can just do a Move Route to make event 1 move in a fixed direction.
I got here because I was having a problem with the script call for pathfing as it is found in the wonderful script call list assembled by @Archeia and incremented by many others.
I came here, found the solution and the answers to all subsequent problems I had.
Thank you @Shaz for taking the time to code it and share.
I am still amazed by how a piece of code made back in 2015 can still be useful to this day.
I came here, found the solution and the answers to all subsequent problems I had.
Thank you @Shaz for taking the time to code it and share.
I am still amazed by how a piece of code made back in 2015 can still be useful to this day.
is this possible to make compatible with Galv_Diagonal Movement? I want events to move diagonally when using the pathfinding.. thanks
I don't think I'd have time to do this, but you're welcome to post a new thread asking someone to make a patch.
However, have you tried swapping the order of plugins around?
However, have you tried swapping the order of plugins around?
yes i tried swapping position of the two plugins, i even found a previous thread ..
Oh that thread is VE_Diagonal Movement.. ill check
So I am having a bit of trouble with the Auto_Cancel command. I have a target event set to wander, but whenever it wanders away from the target coordinates in the SmartPath command, it immediately turns around to go back to those coordinates.
Still one of my favorite scripts that I may or may not be using in MZ.
Script Calls for those who need it.
Script Calls for those who need it.
JavaScript:
// Make Player go to X/Y
$gamePlayer.setTarget(null, X, Y);
//Make Player go to target event
const target = $gameMap.event(ID)
$gamePlayer.setTarget(target);
//Make event go to target event
const event = $gameMap.event(ID);
const target = $gameMap.event(ID)
event.setTarget(target);
//Make event go to player
const event = $gameMap.event(ID);
event.setTarget($gamePlayer);
//Cancel Pathfinding script calls. Use whichever you want.
$gamePlayer.clearTarget();
$gamePlayer.setTargetAutoCancel('on');
$gamePlayer.setTargetAutoCancel('near');
//Cancel Pathfinding script calls. Use whichever you want.
const event = $gameMap.event(ID);
event.clearTarget();
@Shaz,
Would it be possible to somehow make a script call to find a region id?
To avoid adding different events to points on the map?
Would it be possible to somehow make a script call to find a region id?
To avoid adding different events to points on the map?
You could write a script to randomly pick a tile in a region, then use Shaz's plugin to have an event go to those coordinates. Do you want to go to the closest tile of region ID x or a random tile?
Plugin command for the event or player to find the nearest specified region id.
I just made the whole thing a plugin
Code:
* This adds two extra script calls for Shaz Smart Path
* this.moveToRegionRandom(regionId) - move the player or
* event to a random tile of a specified region ID
* Ex: $gameMap.event(8).moveToRegionRandom(2);
* Moves event ID 8 to a random tile of region ID 2
*
* this.moveToRegionClosest(regionId) - move the player or
* event to the closest tile of a specified region ID
* Ex: $gamePlayer.moveToRegionClosest(4);
* Moves the player to the closest tile of region ID 4
Thank you very much my friend, the plugin works perfectly.
I just wanted to make a suggestion.
It would be possible for there to be a condition that the event or player only moves if they are in another specific region, for example:
The event/player is in no region (0) and has to move to region (4).
The script call could be something like: this.moveToRegionClosest(0, 4)
That's something you can do by putting a conditional where you're calling it
if(this.regionId()==1)
{this.moveToRegionClosest(regionId);}
if($gameMap.event(8).regionId()==1)
{$gameMap.event(8).moveToRegionClosest(4);}
If event 8 is in region 1, move event 8 to the closest tile of region 4
Can you turn this into a single script command, to make it easier in the movement route text box?
No, because I consider it a non-issue. I give you my permission to edit the plugin for your use case.
Original thread: https://forums.rpgmakerweb.com/threads/smart-pathfinding.46761/