GuardRange
| Flag: | GuardRange |
| File(s): | rules(md).ini |
| Values: | Signed integers: All whole numbers from -2147483648 to 2147483647; in rare cases, only from -32768 to 32767. |
| Default: | Range of the unit's current primary weapon |
| Applicable to: | TechnoTypes:
AircraftTypes, BuildingTypes, InfantryTypes and VehicleTypes |
Specifies the range, in cells, that this unit will scan for targets to attack.
As a special case, GuardRange is also used to determine the 'auto-fill' wall placement distance; the number of cells between which a new wall can be connected to an existing wall (assuming there are no obstructions).
Notes
If the GuardRange is greater than the weapon's Range, the unit will attempt to target enemies outside its firing range. However, due to insufficient range, it cannot fire and remains in a perpetual targeting state. In this scenario, you need to add DefaultToGuardArea=yes to make it approach the target.
If the default rules are used instead of manually specifying this flag, the unit's target acquisition will consider whether the weapon can actually fire at the target.
- For example, if the current primary weapon has [Projectiles]→SubjectToWalls=yes,
- Under default conditions the target acquisition mechanism will ignore targets blocked by OverlayTypes with Wall=yes.
- However, if the GuardRange is set to the same range as the [Weapons]→Range=, the unit will consider targets behind walls and choose to move around the cover obstruction to initiate attacks.