forked from bonzaiferroni/Traveler
-
Notifications
You must be signed in to change notification settings - Fork 6
Home
crazydubc edited this page Dec 25, 2020
·
6 revisions
argument | type | description |
---|---|---|
target |
Object | Where you want to go |
distance |
Number | The minimum distance to move to. 3 is good for building/repairing while 1 is good for things like harvesting, transferring, and withdrawing. Default is 1. |
priority |
Number | The priority of this creeps task. High priority will swap lower priority creeps out of the way when pushing isn't an option. Default is 1. |
options |
Object | Optional object with one or more of properties described below |
*Also works for PowerCreeps |
argument | type | description |
---|---|---|
target |
Object | Your target. |
distance |
Number | Minimum distance to target. See Move() |
priority |
Number | The priority of this creeps task. See Move() |
*Also works for PowerCreeps |
argument | type | description |
---|---|---|
shard |
String | Destination shard |
room |
String | Target room on destination shard. Traveler will use this to find the closest portal room to this room when arriving at the new shard. |
priority |
Number | The priority of this creeps task. See Move() |
*Also works for PowerCreeps |
argument | type | description |
---|---|---|
destination |
room name | Destination room. |
argument | type | description |
---|---|---|
destination |
Object | Destination object |
options |
Object | Optional object with one or more of properties described below |
property | type | description |
---|---|---|
ignoreRoads |
boolean | Creeps won't prefer roads above plains (will still prefer them to swamps). Default is false unless a creep will not gain fatigue from moving on plains, then it is always true . |
ignoreCreeps |
boolean | Will not path around other creeps. Default is true . |
offRoad |
boolean | Creeps won't prefer plains or roads over swamps, all costs will be 1. Default is false unless a creep will not gain fatigue from moving on swamps, then it is always true . |
stuckValue |
boolean | Number of ticks of non-movement before a creep considers itself stuck. Default is 2. |
ignoreStructures |
boolean | Will not path around structures. Default is false . |
preferHighway |
boolean | Creep prefer to travel along highway (empty rooms in between sectors). |
allowHostile |
boolean | Hostile rooms will be included in path. Default is false . |
allowSK |
boolean | SourceKeeper rooms will be included in path. (if false , SK rooms will still be taken if they are they only viable path). Default is false . |
obstacles |
Object[] | Array of objects with property {pos: RoomPosition} that represent positions to avoid. |
roomCallback |
function | Callback function that accepts two arguments, roomName (string) and matrix (CostMatrix) and returns a CostMatrix or boolean. Used for overriding the default PathFinder callback. If it returns false , that room will be excluded. If it returns a matrix, it will be used in place of the default matrix. If it returns undefined the default matrix will be used instead. |
routeCallback |
function | Callback function that accepts one argument, roomName (string) and returns a number representing the foundRoute value that roomName. Used for overriding the findRoute callback. If it returns a number that value will be used to influence the route. If it returns undefined it will use the default value. |
returnData |
Object | If an empty object literal is provided, the RoomPosition being moved to will be assigned to returnData.nextPos . |
restrictDistance |
number | Limits the range the findRoute will search. Default is 32. |
useFindRoute |
boolean | Can be used to force or prohibit the use of findRoute. If undefined it will use findRoute only for paths that span a larger number of rooms (linear distance >2). |
maxOps |
number | Limits the ops (CPU) that PathFinder will use. Default is 20000. (~20 CPU) |
movingTarget |
boolean | Allows you to avoid making a new pathfinding call when your destination is only 1 position away from what it was previously. The new direction is just added to the path. Default is false . |
repath |
number | Float value between 0 and 1 representing the probability that creep will randomly invalidate its current path. Setting it to 1 would cause the creep to repath every tick. Default is undefined . |
travelData |
Object | Passing in an empty object will allow traveler to populate it with details about the current situation, including pathfinder return results, next position, and its travel state. Default is undefined . |
ensurePath |
boolean | This can improve the chance of finding a path in certain edge cases where might otherwise fail. Default is false . |
freshMatrix |
boolean | Will guarantee that a new structure matrix is generated. This might be necessary if structures are likely to change often. Default is false . |
maxRooms |
number | Limit how many rooms can be searched by PathFinder. Default is undefined . |
route |
Object | Supply the route to be used by PathFinder. Default is undefined . |