Jump to content

MissileROTVar: Difference between revisions

From ModEnc²
en>Crimsonum
No edit summary
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Flag
{{Flag
|values={{Values|float}}
|values={{Values|percentage}}
|files={{ini|rules}}
|files={{ini|rules}}
|types={{Categ|General}}
|types={{Categ|General}}
Line 7: Line 7:
|ra2=yes
|ra2=yes
|yr=yes
|yr=yes
|tsobsolete=yes
}}
}}


According to the {{ini|rules}} comment, this flag would've defined the rate of turn fluctuation percentage of guided missiles ([[projectiles]] with [[ROT]] greater than 1). It's read but not used.
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.
 
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 ==
[[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