IFV Weapon System
|
|
|
|
|
|
IFV Overview
First thing to note is that the Red Alert 2 is hardcoded to IFV behaviour for the unit that has the ID [FV]. This means that while it is possible to alter the existing IFV a great deal, it is not possible to create other IFV units with this system, without using an engine extension such as Ares.
IFVMode
This tag applied to infantry and determines into which weapon/turret 'mode' the IFV will spring when the concerned infantry (or vehicle) enters it. Note that the mode of the IFV is determined by the passenger in the 'Gunner' slot of the IFV. If an IFV is set to have more than one passenger, the Gunner slot will be represented by a "pip" on the Passenger PipScale that will be seperated from the rest of the scale and is usually filled with the first passenger to enter the vehicle when it's empty.
- Note: IFVMode, like YTurretWeapon and YTurretIndex (see below) is floored at 0. That means that IFV mode 0 (the default mode of an IFV when empty) will use Weapon1, mode 1 will use weapon 2, etc. IFVMode=0 is also the default of this flag when it is omitted, meaning such infantry will not cause any change to the IFV mode when entering it.
- Note: If the IFV has more than one passenger, the Gunner position also has to be vacated seperately - if other passengers are inside the vehicle, normally unloading the vehicle will unload the other passenger slots first, while the Gunner will remain inside the vehicle and can only be unloaded by unloading the vehicle AGAIN after all other passenger slots have been cleared.
Gunner
This is set on the IFV itself and all this does is simply toggle the 'IFV' behaviour on and off. This may also be the flag responsible for causing additional logic related to the DeathWeapon set on an IFV, ensuring the weapon is only triggered if the current (Elite)WeaponX has Suicide set - ensuring it will only take effect (in unmodded Red Alert 2) if the vehicle is piloted by a Crazy Ivan or possibly Terrorist infantry unit. Note that the method of how the IFV's additional DeathWeapon logic is toggled and how it exactly works is poorly understood at the moment.
TurretCount
TurretCount determines how many turrets the engine will load for the unit. In order for proper IFV behaviour, this setting must be present and set to >0. According to Nighthawk, there is a maximum of 15 turrets that can be loaded for any unit without causing issues[1]. In Red Alert 2, it is not possible to actually use all 15 turrets because there are only 13 'swapping indexes' present (see below). Yuri's Revenge adds four more, making the full use of the TurretCount possible.
TurretWeapon and TurretIndex
The YTurretWeapon and YTurretIndex settings control which turret is used in which weapon mode. According to the flag description in the rules(md).ini, the Y is substituted for a 'swapping index'. The IFV's turret will change to the turret with the number specified in YTurretIndex when X-1 of the the IFV is equal to the YTurretWeapon with the same value of Y as the YTurretIndex. X in this case denotes the current weapon X used by the IFV.
The available IFV turrets in Red Alert 2:
- NormalTurretIndex
NormalTurretWeapon - RepairTurretIndex
RepairTurretWeapon - MachineGunTurretIndex
MachineGunTurretWeapon - RocketTurretIndex
RocketTurretWeapon - SniperTurretIndex
SniperTurretWeapon - ExplodeTurretIndex
ExplodeTurretWeapon - TerroristExplodeTurretIndex
TerroristExplodeTurretWeapon - ChronoTurretIndex
ChronoTurretWeapon - PistolTurretIndex
PistolTurretWeapon - BrainBlastTurretIndex
BrainBlastTurretWeapon - FlakTurretIndex
FlakTurretWeapon - ShockTurretIndex
ShockTurretWeapon - RadCannonTurretIndex
RadCannonTurretWeapon - CowTurretIndex
CowTurretWeapon
The additional IFV turrets in Yuri's Revenge:
- InitiateTurretIndex
InitiateTurretWeapon - VirusTurretIndex
VirusTurretWeapon - YuriPrimeTurretIndex
YuriPrimeTurretWeapon - GuardianTurretIndex
GuardianTurretWeapon
Summary
[FV]
...
MachineGunTurretIndex=1
MachineGunTurretWeapon=8
[E1]
...
IFVMode=8
Now, when our little GI (E1) enters the IFV, the IFV will spring into 'Mode 8', and will use Weapon9. The game then subtracts -1 from the number of the currently-used weapon (9), and checks which YTurretIndex is equal to the result of the calculation (8). MachineGunTurretWeapon qualifies, as it is set to 8. The 'swapping factor', the Y of the YTurretWeapon, here is MachineGun, so the game looks for the corresponding YTurretIndex with an equal value of Y, and finds it in MachineGunTurretIndex. It then checks the number specified in that index - which is 1 - and changes the turret to the turret with that number - FVTUR1. Now, you may be wondering why MachineGunTurretWeapon=7 springs in effect when the IFV is using Weapon9. This is because (as detailed above), the YTurretWeapon and YTurretIndex settings are floored at 0, whereas the modes and WeaponX are floored at 1, so that the WeaponX the IFV gets when entered by the GI is Weapon8, however in YTurretWeapon, it is counted as 'Weapon 7'. Weapon1 would be counted as 0, Weapon2 as 1, Weapon3 as 2, etc. Always one less than the acctual WeaponX.
- In other words:
The YTurretWeapon that will correspond to an IFV mode is always set to the number of the mode. The WeaponX invoked by that mode however is always the number of the mode +1.
Notes
It appears RocketTurretWeapon and RocketTurretIndex, while present in the unmodded YR, do not represent valid swapping indexes, bringing the useable count to 17. Somehow even without a valid swapping index attached to a weapon, the IFV will change into that weapon mode flawlessly, though no turret will be displayed for it.
Bugs/Side-Effects/Unexpected Limitations
- Eratic behaviour may result from setting multiple YTurretIndex to the same number.
- While VehicleTypes can have an IFVMode set and enter the IFV, Size and SizeLimit permitting, and can even change its weapon and turret, the tooltip will always display "Rocket IFV" when hovering over it. UseOwnName might be a workaround for this.
- If the IFV has a TurretCount value higher than the available turrets, and is entered by infantry with an IFVMode using one of those high values, it may cause the IFV and/or its turret to be completely invisible in-game.
See Also
IFV Turret Tutorial by Nighthawk





