Data\Validator


Validators are conditions that evaluate to true or false. Validators can be plugged into other data types and can be used to remove/disable behaviors, add additional checks to determine if a weapon or ability can fire, or create if/then/elseif style statements within effects (among other uses).
See our notion guide on Using Validators

Unit Within Range

Returns true if the specified number of units are found within a search radius.

Range

The radius of the circle to search.

Unit Count Range

MessageType: RangeInt

Returns true if the number of units found is between this min and max.

Distance Check Mode

EnumType: DistanceCheckModes

Determines whether to consider unit radius or center point when finding targets.

Distance Extend Mode

EnumType: DistanceExtendModes

Determines whether to extend the search radius by the source unit's radius.

Search Filter

MessageType: SearchFilter


Similar to other search filters.
See: Data/Effect/Area Search

Target Validators

Target units must pass these validators to be considered valid targets.

Nearby Unit Health

Returns true if a number of units are found within a search radius with a specific health value.


Shares many fields with Unit Within Range.

Range

The radius of the circle to search.

Unit Count Range

MessageType: RangeInt

Returns true if the number of units found is between this min and max.

Value Type

EnumType: Validator.ValidatorValueType

Whether the validator will check units' health as an Absolute or Percentage (between 0 and 1).

Health Value Range

MessageType: RangeDouble

Returns true if enough units are found with health within this min and max.

Check Health Unit Range

MessageType: RangeInt

Determines how many units must be found with the health value specified in Health Value Range.


Note that the total number of units found must also satisfy the Unit Count Range.

Distance Check Mode

EnumType: DistanceCheckModes

Determines whether to consider unit radius or center point when finding targets.

Distance Extend Mode

EnumType: DistanceExtendModes

Determines whether to extend the search radius by the source unit's radius.

Search Filter

MessageType: SearchFilter


Similar to other search filters.
See: Data/Effect/Area Search

Health Value

Returns true if a unit has health within a specific range.

Which Unit

Which unit will be considered by the validator. Using NONE defaults to TARGET_UNIT.

Health Value Range

MessageType: RangeDouble

Returns true if the checked unit's health is within this min and max.

Value Type

EnumType: Validator.ValidatorValueType

Whether the validator will check health as an Absolute or Percentage (between 0 and 1).

Troop Amount [Wild Sky]

Returns true of the unit has a specified number of child troop units.

Amount Range

MessageType: RangeInt

Returns true of the unit has a specified number of child troop units.

Unit Type Name

Returns true if enough units are found with health within this min and max.

Is Child [Wild Sky]

Returns true if the child_unit is a child troop of parent_unit.

Child Unit

Parent Unit

Unit Filter


Returns true if a unit matches a specific unit type (unit, missile, or structure).

Validate Unit Filter

EnumType: UnitComponent.UnitType

Returns true if the specified unit is of this type.

Which Unit

Which unit will be considered by the validator.

Combine

Allows you to combine other validators using logical operators.


Combine validators can be nested. Can be combined with negate for even more logic.

Operation

  • AND: Returns true if all of the listed validators are true.
  • OR: Returns true if any of the listed validators are true.

Validator List

The list of validators to combine.

Unit Engaged [Wild Sky]

Returns true if the specified unit is engaged.

Which Unit

Using NONE defaults to TARGET_UNIT.

Unit Type

Returns true if a unit is of a specific type.

Unit Type Name

Returns true if the unit is of this type.

Which Unit

Which unit will be considered by the validator.

Location Is Lane

Returns true if a point is in a lane (as defined in Terrain/WayPoints/Routes).

Target

Which point to check.

Ignore Rally Disabled Lanes

If enabled, routes using the "Disable Rally" flag won't be considered.

Unit Ai Behavior


Returns true if a unit has the specified AI Behavior type.

Behavior Type

EnumType: BehaviorComponent.BehaviorType

Returns true if the unit has this AI behavior type.

Which Unit

Which unit will be considered by the validator.

Wave Started [Wild Sky]

Returns true if the first wave has started.

Unit Stats

Returns true if a unit matches the specified unit filter.


Currently only supports checking if the unit is an air unit.

Which Unit

Which unit will be considered by the validator.

Air

EnumType: SearchFilter.Flag

Returns true if the unit matches this filter.

Point On Navmesh

Returns true if a point is on the nav mesh.

Target

Which point to check.

Effect Critical Hit

Returns true if the effect tree is a critical hit.


Note that this is only relevant for effect trees created by abilities or weapons.

Unit Is Moving

Returns true if a unit is currently moving.

Which Unit

Which unit to check. Using NONE defaults to TARGET_UNIT.

Point On Cliff

Returns true if a point is on the cliff.

Location

Which point to check.

Expression


Returns the result of the evaluated expression. Non-zero numbers are treated as true, 0 is treated as false.

Negate

Flips the result of the validator, similar to the not in Lua (true becomes false, false becomes true).