Range
Tip
Range is a rather classic and multi-meaning flag. It first appeared in Red Alert on weapons to control range, later in Red Alert 2 in sound(md).ini to control the propagation range of sound effects, and then later in Yuri's Revenge on super weapons to control the size of the range indicator ring. Since it has so many different usages, readers need to find the information they need in the following text based on their actual editing context.
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.
See Also
On SuperWeaponTypes
| Flag: | Range |
| File(s): | rules(md).ini |
| Values: | Floating point values: Any decimal number (clearer range should be added in Template:Values). |
| Default: | 0 |
| Applicable to: | SuperWeaponTypes |
Define the radius (in cells) of the indicator ring for this super weapon.
Generally, this is set to be consistent with the effective range of the super weapon. For those with a fixed 3x3 cell range, an indicator ring with Range=3 is used for approximation.
Notes
The indicator ring is centered on the target cell rather than the cursor, so the indicator ring only follows when the cursor moves to another cell.
This is just a visual effect, and doesn't actually influence the Super Weapon's area of effect.
Bugs/Side-Effects/Unexpected Limitations
At larger ranges, the indicator line is drawn with incorrect graphics. However, Range=11 is sufficient for most super weapons in vanilla, because their effective range generally does not exceed this value at maximum.
See Also
- LineMultiplier - controls the line density of this visual effect.
- HasRadialIndicator - similar functions on buildings that use the same drawing mode.
- SW.Range - a new flag introduced by Ares for controlling the actual effective range of various super weapons.
On Sounds
| Flag: | Range |
| File(s): | sound(md).ini |
| Values: | Signed integers: All whole numbers from -2147483648 to 2147483647; in rare cases, only from -32768 to 32767. |
| Default: | [Defaults]→Range= |
| Applicable to: | VocTypes |
Some sounds should be heard by players regardless of their current screen position ("Kirov reporting", for example), while other sounds should only be heard within a certain radius from their point of origin (Machinegun impact sound, for example). In the second case, the Range= in the sound's section defines that radius.
Notes
If you don't specify a Range= when a game is expecting it, it will default to the Range= value of the sound(md).ini's [Defaults] section.
