<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.skycorp.global/index.php?action=history&amp;feed=atom&amp;title=Modding%3ANPCPathfindingLogic</id>
	<title>Modding:NPCPathfindingLogic - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.skycorp.global/index.php?action=history&amp;feed=atom&amp;title=Modding%3ANPCPathfindingLogic"/>
	<link rel="alternate" type="text/html" href="http://wiki.skycorp.global/index.php?title=Modding:NPCPathfindingLogic&amp;action=history"/>
	<updated>2026-04-05T12:22:40Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.7</generator>
	<entry>
		<id>http://wiki.skycorp.global/index.php?title=Modding:NPCPathfindingLogic&amp;diff=1239&amp;oldid=prev</id>
		<title>SkyCorp: Pathfinding exposed</title>
		<link rel="alternate" type="text/html" href="http://wiki.skycorp.global/index.php?title=Modding:NPCPathfindingLogic&amp;diff=1239&amp;oldid=prev"/>
		<updated>2026-01-28T02:42:45Z</updated>

		<summary type="html">&lt;p&gt;Pathfinding exposed&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
[[Category:LUA Class Reference]]&lt;br /&gt;
This class can perform pathfinding logic and store the result.  This variant is specifically designed for NPCs and other entities and can be used for them to path to other objects, locations, or the player.&lt;br /&gt;
&lt;br /&gt;
Example code:  Pathfinding Sample&lt;br /&gt;
&lt;br /&gt;
== Static Public Methods ==&lt;br /&gt;
&lt;br /&gt;
=== NPCPathfindingLogic generate([[Modding:Entity|Entity]] entity) ===&lt;br /&gt;
Creates new pathfinding.&lt;br /&gt;
&lt;br /&gt;
entity - the entity which is using this to pathfind somewhere.  (This will be used to determine the start of the path, and will be automatically updated as the entity moves around the map(s))&lt;br /&gt;
&lt;br /&gt;
== Public Methods ==&lt;br /&gt;
&lt;br /&gt;
=== void setDestination([[Modding:Location|Location]] destination) ===&lt;br /&gt;
Sets the place to navigate to.  It is recommended to call this again anytime before getting the next direction (before moving).  It will not incur a performance penalty to call it if the destination hasn&amp;#039;t changed.&lt;br /&gt;
&lt;br /&gt;
Okay to be nil if no destination.&lt;br /&gt;
&lt;br /&gt;
=== [[Modding:CardinalDirection|CardinalDirection]] getNextDirection() ===&lt;br /&gt;
Calculate the route and determine the next direction this NPC would need to take to get there.  An existing path is preferred as long as it is still valid.&lt;br /&gt;
&lt;br /&gt;
It is capable of routing between multiple maps, if there is a path to do so.&lt;br /&gt;
&lt;br /&gt;
=== int getRemainingDistance() ===&lt;br /&gt;
How many rooms distant is the destination from the NPC?  Note, this does not update remaining distance, it only gets it as of the last move.&lt;/div&gt;</summary>
		<author><name>SkyCorp</name></author>
	</entry>
</feed>