Range
How far the weapon may be fired, in cells, or how far from the view a sound is still heard.
Firing distance
- Applies to
- WeaponType
- File
rules.ini- Section
[<ObjectType ID>]- Value
- distance (cells)
- When omitted
0
The weapon reaches a third of a cell less than the distance written. A target exactly at the written distance is therefore out of range. The value is in cells, and a fraction is accepted.
[MyCannon] ; example WeaponTypeRange=10.5MinimumRange=2The distance runs from the firer’s center to the target’s center and includes the height difference, with two exceptions:
- An aircraft measures the horizontal distance only, however far below it the target lies.
- Any other object in the air is measured as though it were at the target’s height, so for it too only the horizontal distance counts.
Against a structure, the reach gains an allowance of a quarter of a cell for each cell of the structure’s width plus its depth. A structure 2 cells wide and 2 deep adds one cell, so it can be hit from farther away than a vehicle.
The same test refuses a target in three more cases:
- The target is higher than the firer by at least the horizontal distance between them, and the projectile has neither
Arcing=yesnorAA=yes. - The firer stands beneath a bridge, the target is at or above the height of that bridge’s deck, and the projectile does not have
Arcing=yes. - The firer is higher than the target by at least the horizontal distance between them, and the firer is on the ground. A firer standing on a bridge counts as on the ground.
Range= is also used outside the firing test:
- An object whose
GuardRangeis zero takes its scan radius from its weapons’ range, and the threat score measures distance against the range; target selection covers both. - When a house rates its base defenses against armor and infantry, the range counts for at most four cells.
- An EM pulse cannon can be aimed only at cells within its weapon’s range, rounded down to whole cells.
- A weapon named as a projectile’s
AirburstWeapon=gives its range to each bomblet as fuel. It is not a firing distance there.
-1 counts as not set, so it keeps whatever an earlier rules file set.
Range=0 leaves the reach below zero. A weapon without an arcing projectile can then fire only at structures, and only within the structure allowance above.
A structure whose first-slot weapon has Range=0 counts as unable to shoot back. A human player’s objects outside a team, other than engineers, therefore do not pick it as a target on their own; target selection lists the rule and its exceptions.
Hearing distance
- Applies to
- Sounds
- File
SOUND.INI / SOUND01.INI- Section
[<Sound ID>]- Value
- integer
- When omitted
28
How far outside the view a sound played at a place in the world can still be heard, in cells of 48 pixels. A sound played without a place, such as a button click, ignores it.
Inside the view, the sound plays at full loudness. Beyond the edge of the view, its loudness falls in a straight line to silence at Range= cells. The distance used is the larger of the horizontal distance and twice the vertical distance. A sound that has faded below five percent is not started, and a playing one that fades below it stops, so the sound falls silent a little short of Range=.
With LOCAL in the sound’s Type=, the distance is measured from the center of the view instead of its edge. With GLOBAL, the fade stops at MinVolume=.
A value of 0 or less acts as 1, and a value above 1000 is read as 1000.
[GUN5]Range=20The default of 28 cells is 1344 pixels, within about one percent of the 1360 pixels over which the original game faded sounds. To the sides of the view, shipped sounds therefore fade out where they did. Above and below the view they fade out in half the distance, because the original game did not count vertical distance twice.
Type, MinVolume, Volume, MinimumRange, ProjectileRange, Speed, GuardRange, target-selectionHistory
- Added0.2.0In development
Define sounds with the Yuri's Revenge SOUND.INI keys —
sounds