Anchor Mode
A companion's motion is relative to another entity's position, generally the player.
Anchors
consist of a list of AnchorTargetData
The order matters as companion will try for anchors in order, and stop once a target is found for a given anchor mode.
When no targets are found, fallback to Owner
.
Structure
Property | Type | Default | Notes |
---|---|---|---|
Mode |
AnchorTarget | Owner | Anchor target, described below. |
Range |
int | 640 | Search range in pixels, only switch anchor when the target is less than this far from owner. |
StopRange |
int | 0 | Makes the companion stop moving towards anchor at this range (in pixels). |
Filters |
List<string> | null | List of anchor mode specific filters, see the headings on each Mode for details. If not specified, then no filters have been implemented. |
RequiredAbilities |
List<string>? | mode dependent | List of ability classes to check for to determine if this anchor should be enabled. Some modes have default values, which can be cleared by setting this value to null . |
Monster
Anchor to nearest monster.
Filters: list of monsters to avoid targeting, based on their key in Data/Monsters.
RequiredAbilities: Default "Hitscan"
, "Projectile"
.
Forage
Anchor to nearest forageable item.
Filters: list of context tags to avoid harvesting, e.g. "category_flowers"
(exclude flower category) or "color_orange season_summer"
(exclude orange and summer). Each space separated sub list of tags act as AND while the overall list act as OR.
RequiredAbilities: Default "HarvestForage"
.
Stone
Anchor to nearest breakable stone.
RequiredAbilities: Default "HarvestStone"
.
Object
Anchor to nearest placed object. This is a superset of Stone and Forage, but also placed objects on the ground.
Crop
Anchor to nearest harvestable crop.
Filters: list of context tags to avoid harvesting, e.g. "category_flowers"
(exclude flower category) or "color_orange season_summer"
(exclude orange and summer). Each space separated sub list of tags act as AND while the overall list act as OR. For crops, only the main harvestable item is considered.
RequiredAbilities: Default "HarvestCrop"
.
Shakeable
Anchor to nearest shakeable bush/tree/fruit tree.
Filters: list of "Bush"
, "Tree"
, "FruitTree"
, indicating which of the 3 possible categories to avoid targeting.
RequiredAbilities: Default "HarvestShakeable"
.
TerrainFeature
Anchor to nearest terrain feature. This is a superset of Crop and Shakeable.
Owner
Anchor to the player who equipped the trinket. Range has no effect. This is the default anchor.