Skip to main content

Targeting Filter

A Targeting Filter narrows a list of Actors produced by a Relation State or Team Flags target (on Redirectors, State Based Effects, Effectors) or by a Custom Targeter / Custom Actor. The source of a filter is the Relate To Actor of that scope.

Write your own by deriving from TargetingFilter.

Create › Power › Misc › Targeting Filter

Chain​

Runs several filters in order; each one receives the result of the previous one.

FieldDescription
FiltersThe filters, in order.

Distance​

Keeps the Actors whose distance to the source passes a comparison. Ships for Vector2, Vector2Int, Vector3, Vector3Int.

FieldDescription
Position Stat KeyThe position Stat, read on the source and on each Actor.
ComparerThe float comparison on the distance (e.g. Lower Or Equal 5, or a range).

Closest In Sight​

Keeps one Actor: the closest one inside the source's view cone. Actors without the position Stat are skipped; if nobody qualifies the list is emptied. Ships for Vector2, Vector2Int, Vector3, Vector3Int.

FieldDescription
Position Stat KeyThe position Stat.
Direction Stat KeyThe source's facing direction.
Direction ThresholdThe minimum dot product between the facing and the direction to the Actor. 1 = straight ahead only, 0 = a 180° cone, −1 = all around.
Distance CapThe maximum distance.

Random Actor Except Source​

Keeps one random Actor that is not the source. Use it for bounce to another enemy, spread to a random ally.

Stat Based​

Keeps the Actors whose Stat passes a condition.

FieldDescription
Stat KeyThe Stat checked on each Actor.
ComparerA Single Stat Condition asset.

Examples​

GoalFilter
a random enemy within rangeTargetingFilter_RandomFoeInRange_R3D (Kodes) — Chain [TargetingFilter_InRange6_R3D (Distance ≤ 10), TargetingFilter_RandomActorExceptSource_R3D]
every living enemy within 8 mTargetingFilter_AliveInRange8 — Chain [TargetingFilter_Alive (Stat Based), TargetingFilter_InRange8 (Distance ≤ 8)]
the closest living enemy in frontTargetingFilter_Chain_3DC — Chain [TargetingFilter_IsAlive_3DC, TargetingFilter_ClosestInSight_3DC (Direction Threshold 0.15, Distance Cap 10)]
only foes that are not poisoned yetStat Based — Stat Poison, condition Equals 0

Order matters in a Chain: filter by alive first, then pick the closest, or Closest In Sight may pick a dead Actor and leave nothing for the next filter.