ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

IFV Weapon System

From ModEnc
Revision as of 14:16, 22 July 2011 by NCoder (talk | contribs) ({{Tt|YTurretWeapon}} and {{Tt|YTurretIndex}})
Jump to: navigation, search

The following page should give an overview over the workings of the IFV system. First, note that the game is hardcoded to display IFV behaviour as expected ONLY with 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 units with this system (save for using .EXE modifications such as NPatch, RockPatch and Ares).

Flags involved

IFVMode

This is the only flag involved which is not set on the IFV proper. Instead, it is applied to infantry types (it can be applied to vehicle types as well, apparently, however there are various issues with this - see Bugs and Limitations) 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: 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.

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 14 'swapping factors' present (see below). Yuri's Revenge adds four more swapping factors, making the full use of the TurretCount possible.

YTurretWeapon and YTurretIndex

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 factor'. 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.

In Red Alert 2, the Swapping Factors, 14 in number, are:

  • 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

Yuri's Revenge adds the following additional swapping factors, bringing the count to 18:

  • InitiateTurretIndex
    InitiateTurretWeapon
  • VirusTurretIndex
    VirusTurretWeapon
  • YuriPrimeTurretIndex
    YuriPrimeTurretWeapon
  • GuardianTurretIndex
    GuardianTurretWeapon

For example:
[FV]
...
MachineGunTurretIndex=1
MachineGunTurretWeapon=7
[E1]
...
IFVMode=8

Now, when our little GI (E1) enters the IFV, the IFV will spring into 'Mode 8'. Now, you may be wondering why MachineGunTurretWeapon=7 springs in effect when the IFV is in 'Mode 8'. 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.

See also