You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specify whether to use this new experimental pathfinder in game objects methods. This method should be invoked every tick. It affects the following methods behavior: <ahref="#Room.findPath"><code>Room.findPath</code></a>, <ahref="#RoomPosition.findPathTo"><code>RoomPosition.findPathTo</code></a>, <ahref="#RoomPosition.findClosestByPath"><code>RoomPosition.findClosestByPath</code></a>, <ahref="#Creep.moveTo"><code>Creep.moveTo</code></a>.
151
+
`PathFinder` is enabled by default. This method can be used to disable `PathFinder` and use an older, slower algorithm (although doing so is not recommended). This method should be invoked every tick when used. It affects the following methods behavior: <ahref="#Room.findPath"><code>Room.findPath</code></a>, <ahref="#RoomPosition.findPathTo"><code>RoomPosition.findPathTo</code></a>, <ahref="#RoomPosition.findClosestByPath"><code>RoomPosition.findClosestByPath</code></a>, <ahref="#Creep.moveTo"><code>Creep.moveTo</code></a>.
152
152
153
153
{% api_method_params %}
154
154
isEnabled : boolean
155
-
Whether to activate the new pathfinder or deactivate. The default is `true`.
155
+
Whether to activate or deactivate the pathfinder. The default is `true`.
@@ -366,22 +365,22 @@ An object containing additonal pathfinding flags:
366
365
<li>
367
366
<div class="api-arg-title">ignoreRoads</div>
368
367
<div class="api-arg-type">boolean</div>
369
-
<div class="api-arg-desc">Ignore road structures. Enabling this option can speed up the search. The default value is false. This is only used when the new <a href="#PathFinder"><code>PathFinder</code></a> is enabled.</div>
368
+
<div class="api-arg-desc">Ignore road structures. Enabling this option can speed up the search. The default value is false. This option is ignored if <a href="#PathFinder"><code>PathFinder</code></a> has been disabled.</div>
<div class="api-arg-desc">You can use this callback to modify a <a href="#PathFinder-CostMatrix"><code>CostMatrix</code></a> for any room during the search. The callback accepts two arguments, <code>roomName</code> and <code>costMatrix</code>. Use the <code>costMatrix</code> instance to make changes to the positions costs. If you return a new matrix from this callback, it will be used instead of the built-in cached one. This option is only used when the new <a href="#PathFinder"><code>PathFinder</code></a> is enabled.</div>
373
+
<div class="api-arg-desc">You can use this callback to modify a <a href="#PathFinder-CostMatrix"><code>CostMatrix</code></a> for any room during the search. The callback accepts two arguments, <code>roomName</code> and <code>costMatrix</code>. Use the <code>costMatrix</code> instance to make changes to the positions costs. If you return a new matrix from this callback, it will be used instead of the built-in cached one. This option is ignored if <a href="#PathFinder"><code>PathFinder</code></a> has been disabled.</div>
375
374
</li>
376
375
<li>
377
376
<div class="api-arg-title">ignore</div>
378
377
<div class="api-arg-type">array</div>
379
-
<div class="api-arg-desc">An array of the room's objects or <a href="#RoomPosition">RoomPosition</a> objects which should be treated as walkable tiles during the search. This option cannot be used when the new <a href="#PathFinder"><code>PathFinder</code></a> is enabled (use <code>costCallback</code> option instead).</div>
378
+
<div class="api-arg-desc">An array of the room's objects or <a href="#RoomPosition">RoomPosition</a> objects which should be treated as walkable tiles during the search. This option is ignored when <a href="#PathFinder"><code>PathFinder</code></a> is enabled (use <code>costCallback</code> option instead).</div>
380
379
</li>
381
380
<li>
382
381
<div class="api-arg-title">avoid</div>
383
382
<div class="api-arg-type">array</div>
384
-
<div class="api-arg-desc">An array of the room's objects or <a href="#RoomPosition">RoomPosition</a> objects which should be treated as obstacles during the search. This option cannot be used when the new <a href="#PathFinder"><code>PathFinder</code></a> is enabled (use <code>costCallback</code> option instead).</div>
383
+
<div class="api-arg-desc">An array of the room's objects or <a href="#RoomPosition">RoomPosition</a> objects which should be treated as obstacles during the search. This option is ignored when <a href="#PathFinder"><code>PathFinder</code></a> is enabled (use <code>costCallback</code> option instead).</div>
385
384
</li>
386
385
<li>
387
386
<div class="api-arg-title">maxOps</div>
@@ -401,7 +400,7 @@ An object containing additonal pathfinding flags:
401
400
<li>
402
401
<div class="api-arg-title">maxRooms</div>
403
402
<div class="api-arg-type">number</div>
404
-
<div class="api-arg-desc">The maximum allowed rooms to search. The default (and maximum) is 16. This is only used when the new <a href="#PathFinder"><code>PathFinder</code></a> is enabled.</div>
403
+
<div class="api-arg-desc">The maximum allowed rooms to search. The default (and maximum) is 16. This option is ignored if <a href="#PathFinder"><code>PathFinder</code></a> has been disabled.</div>
0 commit comments