Range/On Weapons
| Flag: | Range |
| File(s): | rules(md).ini |
| Values: | Floating point values: Any decimal number (clearer range should be added in Template:Values). |
| Special Values: | -2 in Red Alert 2 and Yuri's Revenge |
| Default: | 0 |
| Applicable to: | Weapons |
Define the maximum range of a weapon (in cells).
Notes
When the distance between the target and the unit is within this range, the normal Attack[1] cursor is used; otherwise, the AttackOutOfRange[2] cursor is used.
If the weapon uses a projectile with SubjectToElevation=yes, it can gain a range bonus when attacking from high ground to low ground, with calculation parameters set in [ElevationModel].
In Red Alert, if Range is negative, it will not participate in any distance checks, thus having no range limitation. In Tiberian Sun, it is handled in a different way. If Range is negative, it will acts just the same as 0.
Starting from Red Alert 2, it is allowed to set Range=-2 for a weapon as a special handling that allows infinite range.
Generally, this determines whether to use two-dimensional plane distance or three-dimensional space distance for calculation based on whether the shooter is in the air or on the ground.
Bugs/Side-Effects/Unexpected Limitations
Since the GuardRange is inherited from the Range by default, setting an excessively large Range value will cause game lag.
- If you set Range=-2, you must manually configure the GuardRange to enable units to actively seek out enemies.
Building objects always use the primary weapon's Range to determine the range.
When a weapon is used as a sub weapon created by another weapon's projectile ShrapnelWeapon, its range should not exceed 11; otherwise, it will aim regardless of distance and may trigger the EIP#0046A496.
Weapons that use Arcing=yes projectiles directly judge the distance to the target's center when aiming at buildings, ignoring Foundation. This results in the weapon always being judged as OutOfRange and unable to attack if it faces a building so large that the vertical distance from the center to the long side is farther than the range.
Range=-2 will cause weapons with DiskLaser=yes to never start charging, thus unable to fire.
Range=-2 will cause aircraft to be unable to perform attack actions.
Range=-2 will ignore the minimum range set by MinimumRange.
Footnotes
References
Starting from Phobos Build#49, any weapon can be customized to use planar distance calculation or default rules (not equivalent to forced three-dimensional distance). Refer to Phobos documentation.