-
Notifications
You must be signed in to change notification settings - Fork 41
Traveler API
bonzaiferroni edited this page Jan 15, 2017
·
26 revisions
This code is still being tested. If you are using it, let me know if you run into any problems.
Traveler is a general-purpose tool for moving your creeps around.
####Features:
- Efficient path-caching and CPU-use (you can see how it compares with
creep.moveTo()
here) - Ignores creeps in pathing by default which allows for fewer PathFinder calls and single-lane creep movement
- Detects hostile rooms and will path around them once discovered
- Effective long-range pathing
- Lots of options (read below)
Move creep to goal
.
-
creep: Creep
The creep you want to move. -
goal: Object
Object with a property{ pos: RoomPosition }
. options: Object
-
ignoreRoads: boolean
Creeps won't prefer roads above plains (will still prefer them to swamps). Default isfalse
. -
ignoreCreeps: boolean
Will not path around other creeps. Default istrue
. -
ignoreStuck: boolean
Will not path around other creeps even if stuck. Default isfalse
. -
ignoreStructures: boolean
Will not path around structures. Default isfalse
. -
preferHighway: boolean
Creep prefer to travel along highway (empty rooms in between sectors). Default isfalse
-
allowHostile: boolean
Hostile rooms will be included in path. Default isfalse
. -
allowSK: boolean
SourceKeeper rooms will be included in path. (iffalse
, SK rooms will still be taken if they are they only viable path). Default isfalse
. -
range: number
Range togoal
before it is considered reached. The default is 1.