A downloadable Rpg Maker MV/MZ Plugin

Buy Now$5.00 USD or more

List of Plugins I am Releasing:

KoTC Optimized Auto Scaling Minimap Basic [Free]
KoTC Optimized Auto Scaling Minimap Advanced [Premium]

KoTC Optimized Pathfinding System [Premium]
KoTC Basic Optimized Roguelike Line of Sight [Free]
KoTC Optimized Basic Onscreen Waypoint System [Free]
KoTC Optimized Advanced Onscreen Waypoint System [Premium]
KoTC Optimized Dynamic Music System [Free]
KoTC Roguelike Visual Loot Drop System [Premium]



Feature Demonstration Video

Conpatable with Yanfly Region Restrictions and Aerosys Random Maps During Playtime
Yanfly Region Restrictions confirmed to be working with MZ.


An adaptation of the AStar pathfinding library for maximal optimized usage within Rpg Maker MV and Rpg Maker MZ, also used in my game Knight of the Celestial.

I released this because after looking at all the other pathfinding scripts, I felt the community needed one that keeps the FPS high, and one that can find paths immediately and exactly to wherever one pleases, including random locations on the map, or near a target coordinates or target event.

Unlike other pathfinding scripts, while anything is pathfinding, including the player, it will ignore collisions with other events if they're in the way,, passing through them without using Through, and without triggering unwanted touch events. If a player does not want an event to have its collision ignored during pathing, they can type into its notes:

<KoTC Collision>

Events that are on the Below layer one does not need to do this with, they will be activated with player touch as they normally would be.

Features:
-Fastest path to destination, or random path to destination.
-Backtracking a set percentage of a taken path after arrival at destination.
-Event on arrival, such as setting a switch or selfswitch, setting a variable to a number or string, and calling a common event.
-Works on player as well, if anything ever throws it off course, it auto adjusts.
-Highly optimized pathfinding with minimal to no impact on cpu usage.
-Events stop pathing when in a menu, and continue when menu is closed.
-No range limit, can path across a huge complicated map with no impact on performance.
-Path to random walkable location on map.-
-Path to random location in a chosen radius of the x y location chosen on map.
-Path to target event or player.
-Path to random location in a chosen radius of the target event or player.
-Path to map edge.
-Path with a chance of delay each step.

Events do not collide with other events normally while pathfinding but you
can determine which ones you want to be collidable by putting in their notes:

<KoTC Collision>

Exactly like that, its case sensitive, and the events pathfinding will end
early when it collides with a target, applying "Event Touch", as it normally
would.

Events move routes normally only refresh while near the player in the default game. I've added a way to determine which ones can continue to refresh their move routes outside of the players screen/proximity. Put into the events notes:

<KoTC Update>

Exactly like that, and it will continue to update its move route where it normally would not. This is good for if you having distant events pathing to the player, or wandering a map at random, they'll continue to move.

-- Plugin Commands and Script Calls --

ARRIVAL EVENT and ARRIVALTARGET are optional, if you do use them read this.

Arrival Event list:
s = Switch
v = Variable
ss = Self Switch
c = Common Event

Example:
s1 = Switch 1
v177 = Variable 177
ssb = Self Switch B
c100 = Common Event 100

!Important for Self Switches!
If you use a self switch script call make sure to encase the switch text in quotation marks like so, for example : "ssa"

For plugin commands you do not need to do this.

 
Arrival Target List:
Variables : Number or string, works with sentences.
Switches :  Set to 1 for ON and 0 for OFF.
Self Switches : Set to 1 for ON and 0 for OFF.
"Only MV" Common Event : Leave blank, ID is referenced in Arrival Event.
"Only MZ Plugin Command" Common Event : Set to the ID of the common event.


!Important for Directional Passability Per Tile!
It is more cpu intensive but if you wish a map to determine directional
passability per tile you add to the map notes:

<KoTC Advanced Pathmap>
 
Exactly like that, and the pathfinding will be able to make use of tiles
that have limited directional passability. But I recommend for large maps
or active combat maps to not use this for optimal performance, test and see!


 --Targeted Commands--

 -Normal-

 == Fastest Path ==

 Plugin Command: KoTCPathfindToTarget EVENTID TARGETEVENTID ARRIVALEVENT ARRIVALTARGET

 Script Call: KoTCPathfindToTarget(EVENTID, TARGETEVENTID, ARRIVALEVENT, ARRIVALTARGET)

 Plugin Command Example : KoTCPathfindToTarget 1 7
 Script Call Example : KoTCPathfindToTarget(1, 7) 

 Makes event 1 pathfind to event 7.


 Plugin Command Example : KoTCPathfindToTarget 1 $gamePlayer
 Script Call Example : KoTCPathfindToTarget(1, $gamePlayer) 

 Makes event 1 pathfind to the player. 


 Plugin Command: KoTCPathfindToNearTarget EVENTID TARGETEVENTID RADIUS ARRIVALEVENT ARRIVALTARGET

 Script Call: KoTCPathfindToNearTarget(EVENTID, TARGETEVENTID, RADIUS, ARRIVALEVENT, ARRIVALTARGET)
 

 Plugin Command Example : KoTCPathfindToNearTarget 1 7 15
 Script Call Example : KoTCPathfindToNearTarget(1, 7, 15)
 

 Makes event 1 pathfind to a random position within 15 tiles of event 7.

 Plugin Command Example : KoTCPathfindToNearTarget $gamePlayer 9 10
 Script Call Example : KoTCPathfindToNearTarget($gamePlayer, 9, 10)
 

 Makes the player pathfind to a random position within 10 tiles of event 9



 == Random Path ==

 Plugin Command: KoTCRandomPathfindToTarget EVENTID TARGETEVENTID ARRIVALEVENT ARRIVALTARGET

 Script Call: KoTCRandomPathfindToTarget(EVENTID, TARGETEVENTID, ARRIVALEVENT, ARRIVALTARGET)

 Plugin Command: KoTCRandomPathfindToNearTarget EVENTID TARGETEVENTID RADIUS ARRIVALEVENT ARRIVALTARGET

 Script Call: KoTCRandomPathfindToNearTarget(EVENTID, TARGETEVENTID, RADIUS, ARRIVALEVENT, ARRIVALTARGET)
 

 -Stutter-

 == Fastest Path ==

 Plugin Command:
 KoTCStutterPathfindToTarget EVENTID TARGETEVENTID STUTTERCHANCE STUTTERMAXDELAY ARRIVALEVENT ARRIVALTARGET 

 Script Call:
 KoTCStutterPathfindToTarget(EVENTID, TARGETEVENTID, STUTTERCHANCE, STUTTERMAXDELAY, ARRIVALEVENT, ARRIVALTARGET) 

 Plugin Command Example : KoTCStutterPathfindToTarget 1 7 50 0.5
 Script Call Example : KoTCStutterPathfindToTarget(1, 7, 50, 0.5) 

 Makes event 1 pathfind to event 7 with a 50% chance of pausing movement for 0.5/half a second each step.

 

 Plugin Command Example : KoTCStutterPathfindToTarget 1 0 50 0.5
 Script Call Example : KoTCStutterPathfindToTarget(1, 0, 50, 0.5) 

 Makes event 1 pathfind to the player with a 50% chance of pausing movement for 0.5/half a second each step.    


 Plugin Command:
 KoTCStutterPathfindToNearTarget EVENTID TARGETEVENTID MAXRADIUS STUTTERCHANCE STUTTERMAXDELAY ARRIVALEVENT ARRIVALTARGET

  Script Call:
 KoTCStutterPathfindToNearTarget(EVENTID, TARGETEVENTID, MAXRADIUS, STUTTERCHANCE, STUTTERMAXDELAY, ARRIVALEVENT, ARRIVALTARGET)
 

 Plugin Command Example : KoTCStutterPathfindToNearTarget 1 7 10 25 1
 Script Call Example : KoTCStutterPathfindToNearTarget(1, 7, 10, 25, 1)

 

 Makes event 1 pathfind within 10 tiles of event 7 with a 25% chance of pausing movement for one second each step.


 Plugin Command Example : KoTCStutterPathfindToNearTarget 1 0 15 30 0.5
 Script Call Example : KoTCStutterPathfindToNearTarget(1, 0, 15, 30 0.5)

 Makes event 1 pathfind within 25 tiles of the player with a 30% chance of pausing movement for half a second each step.
 

 == Random Path ==

 KoTCStutterRandomPathfindToTarget EVENTID TARGETEVENTID STUTTERCHANCE STUTTERMAXDELAY ARRIVALEVENT ARRIVALTARGET

 KoTCStutterRandomPathfindToTarget(EVENTID, TARGETEVENTID, STUTTERCHANCE, STUTTERMAXDELAY, ARRIVALEVENT, ARRIVALTARGET);
 

 -Backtrack-
 == Fastest Path ==

 Plugin Command:
 KoTCBacktrackPathfindToTarget EVENTID TARGETEVENTID MINBACKTRACK% MAXBACKTRACK% ARRIVALEVENT ARRIVALTARGET 

 Script Call:
 KoTCBacktrackPathfindToTarget(EVENTID, TARGETEVENTID, MINBACKTRACK%, MAXBACKTRACK%, ARRIVALEVENT, ARRIVALTARGET)
 

 Plugin Command Example : KoTCBacktrackPathfindToTarget 1 7 50 100
 Script Call Example : KoTCBacktrackPathfindToTarget(1, 7, 50, 100)
 
 Makes event 1 pathfind to event 7, backtracking to a random point between 50% and 100% towards the path start  after arriving at its target.
 


 Plugin Command Example : KoTCBacktrackPathfindToTarget 1 0 100 100
 Script Call Example : KoTCBacktrackPathfindToTarget(1, 0, 100, 100) 

 Makes event 1 pathfind to the player, backtracking towards the path start after arriving at its target.
 

 == Random Path ==

 Plugin Command:
 KoTCBacktrackRandomPathfindToTarget EVENTID TARGETEVENTID MINBACKTRACK% MAXBACKTRACK% ARRIVALEVENT ARRIVALTARGET

 Script Call:
 KoTCBacktrackRandomPathfindToTarget(EVENTID, TARGETEVENTID, MINBACKTRACK%, MAXBACKTRACK%, ARRIVALEVENT, ARRIVALTARGET)

 -StutterBacktrack-

 Plugin Command:
 KoTCStutterBacktrackPathfindToTarget EVENTID TARGETEVENTID MINBACKTRACK% MAXBACKTRACK% STUTTERCHANCE STUTTERMAXDELAY ARRIVALEVENT ARRIVALTARGET 

 Script Call:
 KoTCStutterBacktrackPathfindToTarget(EVENTID, TARGETEVENTID, MINBACKTRACK%, MAXBACKTRACK%, STUTTERCHANCE, STUTTERMAXDELAY, ARRIVALEVENT, ARRIVALTAR
 

 Plugin Command Example : KoTCStutterBacktrackPathfindToTarget 1 7 50 100 25 0.5
 Script Call Example : KoTCStutterBacktrackPathfindToTarget(1, 7, 50, 100, 25, 0.5)

 
 Makes event 1 pathfind to event 7, backtracking to a random point between 50% and 100% towards the path start after arriving at its target, with a 25% chance each step of pausing for half a second.


 

 Plugin Command Example :
KoTCStutterBacktrackPathfindToTarget 1 0 100 100 50 1
 Script Call Example :
KoTCStutterBacktrackPathfindToTarget(1, 0, 100, 100, 50, 1)
 
 Makes event 1 pathfind to event 7, backtracking to the path start after arriving
 at its target, with a 50% chance each step of pausing for 1 second.


 -- Coordinates --
 == Fastest Path ==

 -Normal-
 Plugin Command:
KoTCPathfindToCoordinates EVENTID X Y ARRIVALEVENT ARRIVALTARGET

 Script Call:
KoTCPathfindToCoordinates(EVENTID, X, Y, ARRIVALEVENT, ARRIVALTARGET)
 

 Plugin Command Example : KoTCPathfindToCoordinates 1 10 10
 Script Call Example : KoTCPathfindToCoordinates(1, 10, 10)
 

 Makes event 1 pathfind to coordinates 10 10.
 

 Plugin Command Example : KoTCPathfindToCoordinates 0 10 10
 Script Call Example : KoTCPathfindToCoordinates(0, 10, 10)
 
 Makes the player pathfind to coordinates 10 10.



 Plugin Command:
KoTCPathfindToNearCoordinates EVENTID X Y RADIUS ARRIVALEVENT ARRIVALTARGET

 Script Call:
KoTCPathfindToNearCoordinates(EVENTID, X, Y, RADIUS, ARRIVALEVENT, ARRIVALTARGET) 

 Plugin Command Example : KoTCPathfindToNearCoordinates 1 10 10 15
 Script Call Example : KoTCPathfindToNearCoordinates(1, 10, 10, 15) 

 Makes event 1 pathfind to a random position within 15 tiles of the targeted coordinates. 

 Plugin Command Example : KoTCPathfindToNearCoordinates 0 10 10 15
 Script Call Example : KoTCPathfindToNearCoordinates(0, 10, 10, 15)

  Makes the player pathfind to a random position within 15 tiles of the
 targeted coordinates.

 == Random Path ==
  Plugin Command:
KoTCRandomPathfindToCoordinates EVENTID X Y ARRIVALEVENT ARRIVALTARGET

 Script Call:
KoTCRandomPathfindToCoordinates(EVENTID, X, Y, ARRIVALEVENT, ARRIVALTARGET)

 Plugin Command:
KoTCRandomPathfindToNearCoordinates EVENTID X Y RADIUS ARRIVALEVENT ARRIVALTARGET

 Script Call:
KoTCRandomPathfindToNearCoordinates(EVENTID, X, Y, RADIUS, ARRIVALEVENT, ARRIVALTARGET)

 -Stutter-

 == Fastest Path ==

 Plugin Command:
KoTCStutterPathfindToCoordinates EVENTID X Y STUTTERCHANCE STUTTERDELAY ARRIVALEVENT ARRIVALTARGET

 Script Call:
KoTCStutterPathfindToCoordinates(EVENTID, X, Y, STUTTERCHANCE, STUTTERDELAY, ARRIVALEVENT, ARRIVALTARGET)
 

 Plugin Command Example : KoTCStutterPathfindToCoordinates 1 10 10, 50, 0.2
 Script Call Example : KoTCStutterPathfindToCoordinates(1, 10, 10)
 

 Makes event 1 pathfind to coordinates 10 10 with a 50% chance each step of
 pausing movement for 1/5th of a second, 0.2 seconds.
 

 Plugin Command Example :
KoTCStutterPathfindToCoordinates 0 10 10 25 1
 Script Call Example :
KoTCStutterPathfindToCoordinates(0, 10, 10, 25, 1)
 
 Makes the player pathfind to coordinates 10 10 with a 25% chance each step of pausing movement for 1 second.



 Plugin Command:
KoTCStutterPathfindToNearCoordinates EVENTID X Y RADIUS STUTTERCHANCE STUTTERDELAY ARRIVALEVENT ARRIVALTARGET

 Script Call:
KoTCStutterPathfindToNearCoordinates(EVENTID X Y RADIUS STUTTERCHANCE STUTTERDELAY ARRIVALEVENT ARRIVALTARGET)
 
 Plugin Command Example :
KoTCStutterPathfindToNearCoordinates 1 10 10 15, 10, 1

 Script Call Example :
KoTCStutterPathfindToNearCoordinates(1, 10, 10, 15, 10, 1)

  Makes event 1 pathfind to a random position within 15 tiles of the
 targeted coordinates with a 10% chance each step of stopping for 1 second.
 

 Plugin Command Example :
KoTCStutterPathfindToNearCoordinates 0 10 10 15, 100, 0.2

 Script Call Example :
KoTCStutterPathfindToNearCoordinates(0, 10, 10, 15, 100, 0.2) 

 Makes the player pathfind to a random position within 15 tiles of the
 targeted coordinates with a 100% chance each step of stopping for 0.2 seconds.

 == Random Path ==
 Plugin Command:
 KoTCStutterRandomPathfindToCoordinates EVENTID X Y STUTTERCHANCE STUTTERDELAY ARRIVALEVENT ARRIVALTARGET

 Script Call:
 KoTCStutterRandomPathfindToCoordinates(EVENTID, X, Y, STUTTERCHANCE, STUTTERDELAY, ARRIVALEVENT, ARRIVALTARGET)

 Plugin Command:
 KoTCStutterRandomPathfindToNearCoordinates EVENTID X Y RADIUS STUTTERCHANCE STUTTERDELAY ARRIVALEVENT ARRIVALTARGET

 Script Call:
 KoTCStutterRandomPathfindToNearCoordinates(EVENTID X Y RADIUS STUTTERCHANCE STUTTERDELAY ARRIVALEVENT ARRIVALTARGET);

 

-Backtrack-
 Plugin Command:
 KoTCBacktrackPathfindToCoordinates EVENTID X Y MINBACKTRACK% MAXBACKTRACK% ARRIVALEVENT ARRIVALTARGET 

 Script Call:
 KoTCBacktrackPathfindToCoordinates(EVENTID, X, Y, MINBACKTRACK%, MAXBACKTRACK%, ARRIVALEVENT, ARRIVALTARGET)
 

 Plugin Command Example : KoTCBacktrackPathfindToCoordinates 1 5 5 50 100
 Script Call Example : KoTCBacktrackPathfindToCoordinates(1, 5, 5, 50, 100)
 

 Makes event 1 pathfind to coordinates 5x 5y, backtracking to a random point between  50% and 100% towards the path start after arriving at its target.

 

 Plugin Command Example :
KoTCBacktrackPathfindToCoordinates 1 10, 10, 100 100

 Script Call Example :
KoTCBacktrackPathfindToCoordinates(1, 10, 10, 100, 100) 

 Makes event 1 pathfind to coordinates 10x 10y, backtracking towards the path start
 after arriving at its target.

 

Plugin Command:
KoTCBacktrackPathfindToNearCoordinates EVENTID X Y RADIUS MINBACKTRACK% MAXBACKTRACK% ARRIVALEVENT ARRIVALTARGET

 Script Call:
KoTCBacktrackPathfindToNearCoordinates(EVENTID, X, Y, RADIUS, MINBACKTRACK%, MAXBACKTRACK, ARRIVALEVENT, ARRIVALTARGET)
 

 Plugin Command Example : KoTCBacktrackPathfindToNearCoordinates 1 10 10 15 50 100

 Script Call Example : KoTCBacktrackPathfindToNearCoordinates(1, 10, 10, 15, 50, 100)

 Makes event 1 pathfind to a random position within 15 tiles of 10x 10y
 backtracking to a random point between 50% and 100% towards the
 path start after arriving at its target.
 

 Plugin Command Example : KoTCBacktrackPathfindToNearCoordinates 0 10 10 15 100 100
 Script Call Example : KoTCBacktrackPathfindToNearCoordinates(0, 10, 10, 15, 100, 100) 

 Makes the player pathfind to a random position within 15 tiles of coordinates x10 y10  with a 100% chance each step of baccktracking to the the path start.


 -StutterBacktrack-
 Plugin Command:
 KoTCStutterBacktrackPathfindToCoordinates EVENTID X Y MINBACKTRACK% MAXBACKTRACK% STUTTERCHANCE STUTTERMAXDELAY ARRIVALEVENT ARRIVALTARGET 

 Script Call:
 KoTCStutterBacktrackPathfindToCoordinates(EVENTID, X, Y, MINBACKTRACK%, MAXBACKTRACK%, STUTTERCHANCE, STUTTERMAXDELAY, ARRIVALEVENT, ARRIVALTARGET)
 

 Plugin Command Example :
KoTCStutterBacktrackPathfindToCoordinates 1 10 10 50 100 25 0.5

 Script Call Example :
KoTCStutterBacktrackPathfindToCoordinates(1, 10, 10, 50, 100, 25, 0.5)
 
 Makes event 1 pathfind to 10 x 10 y, backtracking to a random point between 50% and 100% towards the path start after arriving at its target, with a 25% chance each step of stopping  for half a second.
 

 Plugin Command Example :
KoTCStutterBacktrackPathfindToCoordinates 1 15, 15 100 100 50 1

 Script Call Example :
KoTCStutterBacktrackPathfindToCoordinates(1, 15, 15, 100, 100, 50, 1)
 
 Makes event 1 pathfind to 15 x 15 y, backtracking to the path start after arriving at its target, with a 50% chance each step of stopping for one second.

 

-- Random Destination -- 
== Fastest Path ==

 -Normal-
 Plugin Command:
KoTCPathfindToRandom EVENTID ARRIVALEVENT ARRIVALTARGET

 Script Call:
KoTCPathfindToRandom(EVENTID, ARRIVALEVENT, ARRIVALTARGET)
 

 Plugin Command Example : KoTCPathfindToRandom 1
 Script Call Example : KoTCPathfindToRandom(1)
 
 Makes event 1 pathfind to a random pathable position on the map.
 


 Plugin Command Example : KoTCPathfindToRandom 0
 Script Call Example : KoTCPathfindToRandom(0) 

 Makes the player pathfind to a random pathable position on the map. 
 

 == Random Path ==

 Plugin Command:
KoTCRandomPathfindToRandom EVENTID ARRIVALEVENT ARRIVALTARGET

 Script Call:
KoTCRandomPathfindToRandom(EVENTID, ARRIVALEVENT, ARRIVALTARGET)
 

 Plugin Command Example : KoTCRandomPathfindToRandom 1
 Script Call Example : KoTCRandomPathfindToRandom(1)

 Makes event 1 pathfind to a random pathable position on the map.

 
 Plugin Command Example : KoTCRandomPathfindToRandom 0
 Script Call Example : KoTCRandomPathfindToRandom(0)
 

 Makes the player pathfind a random path to a random pathable position
 on the map.
  

 -Stutter-

 Plugin Command:
KoTCStutterPathfindToRandom EVENTID STUTTERCHANCE STUTTERDELAY ARRIVALEVENT ARRIVALTARGET

 Script Call:
KoTCStutterPathfindToRandom(EVENTID, STUTTERCHANCE, STUTTERDELAY, ARRIVALEVENT, ARRIVALTARGET) 

 Plugin Command Example : KoTCStutterPathfindToRandom 1 50 1
 Script Call Example : KoTCStutterPathfindToRandom(1, 50, 1) 

 Makes event 1 pathfind to a random pathable position on the map with a
 50% chance each step of stopping for 1 second.
 

 Plugin Command Example : KoTCStutterPathfindToRandom 0 25 0.5
 Script Call Example : KoTCStutterPathfindToRandom(0, 25, 0.5) 

 Makes the player pathfind to a random pathable position on the map with a
 25% chance each step of stopping for half a second.

 -Backtrack-

 -Map Edge-

 == Fastest Path ==

 KoTCPathfindToFarMapEdge EVENTID ARRIVALEVENT ARRIVALTARGET

 == Random Path ==
 -Normal-
 -Map Edge-

 Plugin Command:
KoTCRandomPathfindToFarMapEdge EVENTID ARRIVALEVENT ARRIVALTARGET

 Script Call:
KoTCRandomPathfindToFarMapEdge(EVENTID, ARRIVALEVENT, ARRIVALTARGET)

 -Stutter-

 Plugin Command:
KoTCStutterRandomPathfindToRandom EVENTID STUTTERCHANCE STUTTERDELAY ARRIVALEVENT ARRIVALTARGET

 Script Call:
KoTCStutterRandomPathfindToRandom(EVENTID, STUTTERCHANCE, STUTTERDELAY, ARRIVALEVENT, ARRIVALTARGET)

 

-Backtrack-

 Plugin Command:
KoTCBacktrackPathfindToRandom EVENTID MINBACKTRACK% MAXBACKTRACK% ARRIVALEVENT ARRIVALTARGET

 Script Call:
KoTCBacktrackPathfindToRandom(EVENTID, MINBACKTRACK%, MAXBACKTRACK%, ARRIVALEVENT, ARRIVALTARGET)

 Plugin Command:
KoTCBacktrackRandomPathfindToRandom EVENTID MINBACKTRACK% MAXBACKTRACK% ARRIVALEVENT ARRIVALTARGET

 Script Call:
KoTCBacktrackRandomPathfindToRandom(EVENTID, MINBACKTRACK%, MAXBACKTRACK%, ARRIVALEVENT, ARRIVALTARGET)

------- Extra Information -------

You can use a script call in an events custom move route to self reference it by doing this.

Example: KoTCPathfindToRandom(this._eventId);

Due to how my script is structured, even if your move route is set to repeat, it will trigger only once until the event has reached its destination, or until you assign a new route, then it will trigger again, allowing one to have civilians wandering around a town for example, or to simulate an npc searching for the player at their last known position.


-----------------------------------------------------------------------------------------

Terms of Usage: Paid to use for commercial and non commercial use as long as you credit me, and do not redistribute the script. If you were to make a game commercially with my script id appreciate it if you messaged me about it.

Changelog:
V1.41 Fixed the "Imported" error.
V1.4 Fixed the "X" error upon map transfer.
V1.3 Experimental massive update, many commands added for a variety of pathfinding, added option to detect directional passability of tiles on specific maps for performance purposes.
V1.2 Allow players to activate a switch, set a variable, set a self switch, or activate a common event upon arrival!
Fixed Minor Bugs.
V1.1 Allowed players to determine what can be collided with during pathfinding using the <KoTC Collision> note, and allowed players to update events moveroutes when they are normally too far with the <KoTC Update> note.
V1 Released

Please make suggestions if you have any, and report issues if you find any.

StatusReleased
CategoryAssets
Rating
Rated 4.0 out of 5 stars
(4 total ratings)
AuthorKnight of the Celestial
Tagsmv, mz, pathfind, pathfinder, pathfinding, rmmv, rmmz, RPG Maker MV, RPG Maker MZ, system

Purchase

Buy Now$5.00 USD or more

In order to download this Rpg Maker MV/MZ Plugin you must purchase it at or above the minimum price of $5 USD. You will get access to the following files:

KoTC Pathfinder V1.41.rar 18 kB

Development log

Comments

Log in with itch.io to leave a comment.

Been a few months since I last made a comment, and after trying to figure out how to use it on and off the whole time, I can say this: If you want to buy this, don't. Dev has seemingly abandoned the plugin with no answers in over a year. They may have abandoned the account all together, since there doesn't seem to be any new activity on their other projects either. Their YouTube and WordPress are just as quiet. 

The pathfinding also doesn't always work consistently, since I still sometimes get the x undefined error, and trying to use the plugin commands to make it work are also hit-and-miss. What bothers me most in attempting to use it is there's no wait function, and sometimes other commands in the event will run before the pathing, even if the pathing is the first command in the event. This happens regardless of using the scriptcall or plugin. 

TLDR eyebleeding font: Don't spend 5 bucks on this, not worth it.

(1 edit)

I have purchased the plugin, and in general it works well, in fact its pathfinding algorithm is infinitely superior to the one that comes by default in RPG Maker, but there are some bugs to resolve.

When an operation like KoTCPathfindToCoordinates is invoked by script or directly in a plugin itself using $gamePlayer as an argument, the operation fails (thisnpc2 fails to reference $gamePlayer). Others functions fails too.

The KoTCPathfindToNearCoordinates operation generates an infinite loop in certain cases when the tile you want to approach is not reachable, but other tiles within the specified radius are.

The plugin itself is good, it has served me well, and I can manage on my own to correct certain errors, but it would be nice if it were updated and the bugs were fixed.

Greetings.

(+1)(-1)

Has someone made a free alternative to this?

Hey are you still maintaining or responding to comments in regards to this plugin? I wanted to ask about the movement speed of NPCs.

(1 edit)

I purchased this plugin hoping it'd be the solution to my problems with getting an Event to have Smart Pathfinding but currently I'm having a hard time just trying to get the plugin to work correctly.

I can't seem to get any of the plugin or script calls to work and I'm uncertain if I'm just doing something wrong. Doesn't anyone know the setup for getting an event to start pathfinding/moving? My event is just not wanting to move at all. 

I keep trying to make an event chase after the player character, but it never works. I don't know if I'm just dumb or if there's something wrong with it? 

I'm trying to use KoTCPathfindToTarget(1, $gamePlayer) script call in the route option of autonomous movement, with the 1 replaced with the proper eventID #, but I get "Type Error cannot read property 'x' undefined". I can't really find anything on this page about it, or if I'm using it improperly. Any idea why I'm getting the error? o.o

Does this work for NPCs at all, outside of console? I've been banging my head against this for a little while and I cannot for the life of me work out how to get the NPCs to move. Calling

KoTCPathfindToTarget(58,50); in console works fine...

But calling this in a script... nothing. NPC does not move.

What's the stupid thing I'm likely to be doing wrong?

How are NPCs supposed to be setup for using this? I've tried in a script of my own, or in an inline script. A CE and in NPC page, in route and not.

NPC just... doesn't move.

Path finding does not work, I use a command KoTCRandomPathfindToFarMapEdge(this._eventId and the event travels to some random area and half the time it gets itself stuck and then looks for another random area to travel to, never the edge of the map as a destination.

(3 edits)

Do you know what is causing this error? I think this plugin could be modified to work with (Altimit) pixel movement as it sometimes does work, but after a few commands it will crash and show this error, using this command in an event

KoTCPathfindToCoordinates(1, Math.round($gamePlayer.x), Math.round($gamePlayer.y), "ssa", 1);

Edit: I was able to stop the crashes by changing every getNodeAt function to Math.round the coordinates at the node. The events only pathfind in four directions now but the game no longer crashes.

I've gotten my pathfinding working, but I'm trying to make a monster chase a player, and the monster just goes to where they were, stands around for a second or two, then pathfind again. How can I update the pathfinding more frequently, preferably while the monster is still in motion?

Is there any way to set the destination X and Y coords from 2 variables? I need to make a pathfinding script that will go to ($gameVariables.value(993), $gameVariables.value(994)) position T-T

The variables are static for the duration of the event and would not be changing until the event were to finish.

I have purchased this plugin, and it doesn't consume many resources. I had tried other plugins that, when moving events to a specific position, would cause lag and slow down the game if that position was far away or had multiple events. Another problem I had was that when the events were far away, their movement path wouldn't update. This plugin solves that. But I have a problem: if I use the script "KoTCPathfindToCoordinates" with the note "<KoTC Update>" when interacting with another event that displays a message, the event that is moving with the script stops. Another issue I have is that events using this script pass through the player or other events on the map. If I use the note "<KoTC Collision>", they don't pass through, but they stop without reaching their destination. They don't try to avoid the obstacle or stop and then continue. It would also be good if other event functions didn't execute until it reached its position. I have solved this by activating a local switch, for example, using the script "KoTCPathfindToCoordinates(2, 32, 22, "ssA", 1);" and on the event page with local switch A, adding the functions that should execute when the event is in position. But for now, it's impossible for me to use this plugin because the events stop if any text message is shown with another event, and I don't know how to make them not pass through the player and other events without stopping the movement completely. If you can help me with this, I would appreciate it.

Thank you.

I totally agree with you because I am experiencing the same problem. I hope this is fixed.

I've got the same problem and hope for a fix, but it seems there isn't happening anything, unfortunately :( I expected this plugin to be supported since this is a paid plugin.

(2 edits)

I purchased this plugin today (April 18) and it still has the cannot read property x of undefined error. Is the download file the latest version? The .rar says 1.41 but the plugin file says 1.4.

Also, if I use Yanfly Region Restrictions with it it says $KoTCPathMatrix1 is not defined.

This is on MV and it happens as soon as I load the game with the event on the map.

Sorry you are having trouble,  i had to fix this stuff up in a hurry at a library. 

But thank you for your report, ill get to the bottom of this and I'll let you know once its fixed or if i need extra information. 

(1 edit)

Edit: I found out it's because some of the functions don't take $gamePlayer as an argument in either the plugin command or script call although that's what your instructions say to do. It will work if you change $gamePlayer to 0.

Here is the console log for the error.

(+1)

Hi o7

At line 2,903 of KOTC Pathfinding plugin, the code tries to execute "return $KoTCPathMatrix1", I found that simply deleting this line of code stops the crash as well as continuing to work with Yanfly's Region Restrictions.

I don't know if this is advisable by Knight, but it's a working Band-Aid fix so far.

(2 edits) (+1)

I may try it later, but you may want to comment out the line by putting // in front of it instead of deleting the line. I didn't get much use out of this plugin since it doesn't work with pixel movement (decimal coordinates)

I actually tried to get it working with pixel movement by rounding the destination coordinates to whole numbers, and it would work a couple times before inevitably crashing when it tried to go to a node with a float coordinate along the path to the destination

Hi friend, I've been experimenting with this plugin hoping to see if I can make random generated/self automated traffic.

2 things I like to inquire about is 1) Is there a way I can have command spawned events movement self identify? (see Galv spawned events) and 2) Is it possible to have events locate and travel to the furthermost region?

So, i've got a problem. I keep getting an error that says "ReferenceError: imported is not defined"
 This happens when I have the plugin turned on and run the game to test it. I'm using MV.

Hey there, thank you for reporting the issue, I believe it is resolved in V1.41, do let me know if any other problems arise.

Wow...He actually updated the plugin

Works good with Mv3D (no running the CPU to 100% like the other path finders) but I get crashes most of the time when leaving a map that it's active on, always "Cannot read property 'x' of undefined" - sometimes x is 18 or another number... no clue whatta do please lemme know if there's somethin I can do to fix!

Are you planning on updating this sometime soon? It's a great plugin for the most part, but it has some notable issues like lack of smoothness when running from script calls in an events movement path, as well as crashing being an issue when moving between maps. I need this plugin for my game so I was hoping if you'd come back and make a new version for it, heck I'd even be willing to buy it again.

Hey, sorry I've been overwhelmed with RL stuff, I found a chance to update this, but had to work quickly. I've fixed the "x" error I believe, just thought I should let you know, the smoothness I'll have to get back to you on, with my mv3d experiments I suspect that its related to the size you set the mv3d world chunks to.

Giga chad

Does it work with pixel movement plugins?

(1 edit)

It doesn't. The plugin crashes if it's given nodes with decimals, and the pathfinding is only in four directions.

can't there be at least a free demo?

I paid to use your script. It does the best pathfinding of all plugins i tried but its breaks my game everytime i want to leave the map with: "Cannot read property 'g'" I tried an empty Project and got the same Problem but "Cannot read property 'x' ". And the plugin is not working without Yanflys Regio-Restrictions. Without it the game doesnt start and i get an Imported-Error. Its not a Problem beacuse i want to use RegioRestrictions anyway but i thought it was optional. WEhat can i do to fix it? I am using MV

I have a pathfind thing in a parallel process on a map, but if I try to change it to something else after a switch happens the event refuses to move anymore for some reason, how do I fix this?

(-1)

Bought and tried to use it, but I get

"ReferenceError

Imported is not defined"
Even in a clean project file.

(MZ)

Hey, I just bought the plugin and tried out a few things. I noticed that the pathfinding does not work at all as long as there's another route being processed on the map that uses the wait-until-finished function. At least it won't react to any plugin or script calls in this case. Everything was fine when I removed the other event that waited for its move route's completion. Is there a way to fix this?
Besides, I tried using <KoTC Collision> because it looked a bit weird when NPCs just walk through the hero. However, if there's a collision, the whole pathfinding route just stops. Is there a workaround here so that NPCs (passengers in a city) neither go just through the hero nor stop when colliding (instead, maybe walk around the hero)?
I would love to see those functions if it's something that's possible :)

Hey there - how do I set it up that I get the coordinates from game variables? $gameVariables.value(ID) doesn't seem to work neither in a Plugin nor in a Script call

(2 edits)

Good plugin! Seems to be the only pathfinding plugin for that actually works with MZ3D. However my events seem a lot more slow and 'clumsy' then yours in the video. Any idea of what could be causing it?

 I have npc's being spawned in and I tried setting the script command in their move route to:


  KoTCPathfindToTarget(this._eventId, 13)


 It works but the NPC's seem to get stuck in these back and forth movements before deciding on a path. Sometimes they slowly stop working all together. Unfortuntely my game requires the events to make it to their destination in a set time frame. At this point they're taking way too long for even a demo release. One thing I'm wondering is if you added an option in the drop down commands to have the target be not just 0 for player and 1 and above for events but also an option for this._event() ?

 If you need any more documentation let me know. I would really love to see this plugin running smoothly in my game. And I will definitely tip for the help! 

(+1)

Good afternoon Oktober! :
I am sorry that MZ3D is having issues with this, but I  still got a few days of MZ trial left to work with, we will get to the bottom of the issue until its gone!

I believe that MZ3D is changing the mathmatics of movement speed, i will look into it and get back to you asap.

Thank you for reporting the issue ^^

(1 edit)

Hello again Oktober! 
I may be getting close to a solution, the version i uploaded last could have possibly solved it for you, but if not, you could send me your project, or send me the map that is having the issues, in a project with mz3d setup with your configuration so i can watch the events and make certain that i've tracked down the problem for you.

Discord: Castiger#0538
Castiger on the rpg maker forums
or wherever works for you.

Perfect! I'll try this updated version tonight and let you know ASAP! TYSM!

(1 edit)

I just wanted to report another bug/problem: If a tile didn't have all four directions passage set in tileset (like ladders/stairs for example), then events have a problem with setting a path. My event didn't wanted to go through these tiles. I set them to four/all directions and they can now. 

I think this may be useful for dev and others. Thanks. 

Thank you for bringing this to my sttention, ill restructure the path map to take into consideration directional passagein the coming update :) 

As always, thank you for your hard work :))

(1 edit)

Happy to do it! I want everyone to have things just the way they like, will do my best to make that  happen.

Yep Region Restrictions comparable 

V1.3 released, experimental so tell me if anythings being wackY!

I've successfully gotten directional passability into the system, but due to extra cpu usage based on map size, i've made it optional, you add to the map notes you wish to use ladders or anything else with limited directional passability:

<KoTC Advanced Pathmap>

And that map should allow you to do complicated pathfinding if all is in working order :)

V1.3 Experimental massive update, many commands added for a variety of pathfinding, added option to detect directional passability of tiles on specific maps for performance purposes.

Thank you, will update and use it for sure! :) My maps are rather small, so it should be fine. 

Hello! I'd like to buy this script but I was having a few questions about the versatility of the script. Is this only a script to have a player/event find the target in the fewest amount of tiles and time as possible? Or is there a way to add individuality to the route taking?

My intentions are to use Path finding on 4 boss-tier events that chase the player around the maze at the same time and wanted to give them unique behaviors to the movement!

(8 edits)

Right now you can find a path to a random destination in the targets radius!

But in the next update ill be adding what you are speaking of tonight/ tomorrow, finding a random path to the destination no matter how long that path is! ^.^

Finding a random path to the destination? That's sick! Is there any plans on your road map to have random pauses in movement and/or backtracking randomly?

(2 edits)

Ive figured out the random path command, and i have added new commands for a delay chance in their movement each step, as well as determining the delay. 

Im about to work on the backtracking before i release the next version, you sure have e some good ideas  

I'm making commands where it will backtrack a random or specific percentage of your choosing after it arrives at its destination.

As well as one to have a chance of backtracking each step after pathing a certain percentage of the path.

Tell me if you had anything else in mind :)

(1 edit)

Oh shit that's sick! That's great to hear you working on. 

The only other thing  I can immediately think of is region-specific path-finding; so for example if the player goes from region A to region B, the pathfinding changes.

EDIT: Oh! And occasionally deliberately taking a slower path.

Hey man! In preparation for your updates, I went ahead and paid 2x the suggested price as a thank you for your efforts to implement the stuff we talked about. It really means a lot to me and I want to thank you for it and help support the RPGM community! (/・ω・)/

Just in case you didn't get notified of my latest message; just wanted to let you know I paid 2x for your plugin. I said more stuff in the other message, but the important thing is to make sure that I'm grateful for your time!

Hello. Thank you for your plugin. Is there a way to check if the player/event has reacher the spot, and then do something different? For example switch GOING to OFF?

Hey there! You are welcome :) 
Only when you use a player touch event on a below or same level as player event that is the destination at the moment. But you have given me a good idea, I will implement being able to set a switch or variable to a particular value upon arrival if one wishes in the next patch!

Thank you so much for this, and for a quick reply! Can't wait then :)

Happy to help, I have added the feature you spoke of in the V1.2 update, all seems to be in working order ^^

Thank you! I'm trying to implement the new feature, but it seems not to work... I mean, the event does not even start pathfinding. Is this okay? "KoTCPathfindToCoordinates(1, 20, 7, ssa, 1)" I want event 1 to go to X:20, Y:7 and then, turn self switch A to on.

(2 edits)

You are welcome, I am sorry you are having errors.
I have hunted down the specific problem you were having, and tested the plugin command and its functioning fine now in V1.21!

You follow instructions really well, the script call would have worked if I wrote my instructions properly, I forgot to include that when you write :
ssa
in the script call, it should be surrounded by quotes so its a string, like "ssa", but the plugin command can be just ssa
Thanks for reporting the issue, let me know if you have any more. :)

Tried to use plugin instead of script, but there is an error and the game crashes. Cannot read property of "undefined" this time. 

"hile anything is pathfinding, including the player, it will ignore collisions with other events if they're in the way"
Can this feature be refined a bit? I don't want it to ignore all other events but only few of them, for example, ones that in a list like this [1,3,4,6]

(1 edit)

A fine suggestion, Ive looked into it and ill be adding it in the next update soon :)

Thanks for the idea!

That's awesome. I'm looking forward to see it

Hey! In the last update I should have addressed what you were refering to, using <KoTC Collision> in an events notes will allow it to collide with you or other events during pathfinding :)