Skip to content

GuardRange

Changed in 0.2.0

The distance in cells an object scans for targets while guarding, overriding its weapon range.

Specification
Applies to
AircraftTypeBuildingTypeInfantryTypeUnitType
File
rules.ini
Section
[<ObjectType ID>]
Value
distance (cells)
When omitted
0The object scans at the reach of its weapons.
rules.ini
[MYTANK] ; example UnitType
GuardRange=7.5

GuardRange sets how far an object of this type looks for targets on its own. The value is in cells, and fractions are accepted. It sets three scan radii, and target selection lists which mission uses which:

  • the guard radius is the value itself, except that a healer, such as a medic, scans 2 cells while in Guard;
  • the area radius, used by Guard Area, is twice the value, at most 16 cells;
  • the patrol radius, used by Patrol, is twice the value, kept between 7 and 16 cells.

At 0, the area and patrol radii become twice the longer of its two weapon ranges, with the same limits. A scan at the guard radius then accepts a target only when the weapon the object would choose against that target can reach it.

An engineer always takes that weapon-range guard radius, whatever its GuardRange. An engineer with no weapon then accepts a target within GuardRange of it. Its area and patrol radii still use the value.

The area and patrol radii also limit how far an object strays:

  • A Guard Area object that is neither firing nor already moving somewhere drops its target and heads home once it is more than three quarters of the area radius from its home position.
  • A patrolling object takes on a target it cannot already shoot only when the walk to it is shorter than the patrol radius, in cells, plus six.

GuardRange=-1 counts as leaving the key out.

See also — target-selection

History

  1. Changed0.2.0In development

    Read the overridden type values from the rules