yes i tried swapping position of the two plugins, i even found a previous thread ..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?
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.This little plugin has made life so much better!
I've made a couple of little tweaks I thought I would share in case they would come in handy for anyone.
https://github.com/caseylutz/KCL-MV/blob/master/KCL_SmartPath.js
First off the ability to reference events by name. I actually created a separate module for this. It adds a findEvent call to the gameInterpeter to allow you to query events by numerical ID or canonical name. You can either include the FindEventsByName script and SmartPath by event names or you can not include it and just use the numbers. This version of SmartPath will only use the additional script if it's present.
e.g.:
SmartPath Lab_001_Hero Lab_001_ExitSmartPath -1 Field_001_CenterSmartPath 3 7I also added a plugin call for waiting until the smart path is reached.
SmartPath <event_target> WAITI also added an auto-cancelling trigger to clear the auto-path target once it's reached. This is useful if you are controlling the player and want to stop targeting at the end of the path. If you don't clear his target then he will constantly try to re-acquire it every time you move.
SmartPath <event_target> AUTO_CANCELIf your target is actually impassible for whatever reason I've also added a cancellation near (so if you're within 1 tile...)
SmartPath <event_target> AUTO_CANCEL_NEARNow if you have an event where you want the hero to walk to a given location, wait on him, do a cutscene or whatever, and then resume play you can do that like so:
Plugin Command: SmartPath -1 Event_LocationPlugin Command: SmartPath -1 Auto_CancelPlugin Command: SmartPath -1 WaitYou can also have some actions take place before the Wait if, for instance, you'd like to have a conversation but make sure the event waits for the target to reach its destination.
// 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();
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?@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?
Plugin command for the event or player to find the nearest specified region id.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?
I just made the whole thing a pluginPlugin command for the event or player to find the nearest specified region id.
* 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 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
That's something you can do by putting a conditional where you're calling itThank 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)
Can you turn this into a single script command, to make it easier in the movement route text box?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
No, because I consider it a non-issue. I give you my permission to edit the plugin for your use case.Can you turn this into a single script command, to make it easier in the movement route text box?