Jump to content

MissileROTVar: Difference between revisions

From ModEnc²
Not obsolete, just barely noticable with expected values
No edit summary
 
Line 9: Line 9:
}}
}}


Specifies the rate of turn fluctuation percentage of guided missiles ([[projectiles]] with [[ROT]] greater than 1). Increasing this value increases the maximum amplitude of the randomly fluctuating sine wave that the missiles follow, causing them to wobble as they travel.
Specifies the rate of turn (ROT) fluctuation percentage of guided missiles ([[projectiles]] with {{f|ROT|link}} greater than 0). As the missile travels, its ROT is recalculated every [[frame]] based on this variable: the larger the value, the higher the variation in the missile's ROT.


Although this flag is valid, the effect is very minuscule – even with large values like {{tt|2000}}, the flight trajectory fluctuation is barely noticable.
Note that on regular missiles the effect is barely noticable, even with extreme {{f|MissileROTVar}} values, as the ROT never falls below what's stated on the projectile's rules. The lower the projectile's default ROT, the more noticable the effect is. For example, projectiles with {{f|ROT|1|link}} and a high enough variance (e.g. 2.0) causes the projectiles to randomly scatter around the target instead of hitting it perfectly.
 
== Pseudocode ==
 
Simplified [[pseudocode]]:
 
currentROT = (sin(((frame % 15) / 3) * 2 * π) * {{f|MissileROTVar}} + {{f|MissileROTVar}} + 1) * {{f|ROT|link}}


== See Also ==
== See Also ==
[[MissileSpeedVar]]
[[MissileSpeedVar]]

Latest revision as of 15:45, 5 June 2025

Tiberian Dawn Red Alert Tiberian Sun Firestorm Red Alert 2 Yuri's Revenge
Flag: MissileROTVar
File(s): rules(md).ini
Values: Percentages: Either a direct percentage (e.g. "50%"), or a floating point value (e.g. "0.5").
Applicable to: General


Specifies the rate of turn (ROT) fluctuation percentage of guided missiles (projectiles with ROT greater than 0). As the missile travels, its ROT is recalculated every frame based on this variable: the larger the value, the higher the variation in the missile's ROT.

Note that on regular missiles the effect is barely noticable, even with extreme MissileROTVar values, as the ROT never falls below what's stated on the projectile's rules. The lower the projectile's default ROT, the more noticable the effect is. For example, projectiles with ROT=1 and a high enough variance (e.g. 2.0) causes the projectiles to randomly scatter around the target instead of hitting it perfectly.

Pseudocode

Simplified pseudocode:

currentROT = (sin(((frame % 15) / 3) * 2 * π) * MissileROTVar + MissileROTVar + 1) * ROT

See Also

MissileSpeedVar