Strategic Display of Soldiers - XCOM:EU 2012

From Nexus Mods Wiki
Jump to: navigation, search


Overview

This information is derived primarily from the Nexus 'XCOM Mod Talk' Forum thread R&D to increase squad size

Apparently all the display of Soldiers, MECs, and SHIVs (collectively called "pawns") in the Strategy layer (HQ and Dropship) is handled by the SeqEvents function. Understanding how this works is necessary to make adjustments to things involving the display of these pawns, such as when increasing the size of the squad and the number placed/carried on the Dropship.

Programs and Tools

Details

The process begins as follows:

  • From XGStrategySoldier.AddToHQLocation, XGStrategySoldier.AddToLocation is called
  • AddToLocation first maps Location to state (which is what allows off-duty soldiers to be dressed in casual clothing in the barracks), then creates the pawn, then invokes class'SeqEvent_HQUnits'.static.AddUnitToRoomSequence.
This can include the various cinematics (e.g. eSoldierLoc_PsiLabsCinematic) in which case the pawn is immediately destroyed.
The RoomName string argument for the squad select (location 1 = eSoldierLoc_Dropship) is "Dropship". The complete mapping from location value to RoomSequence RoomName is in section #Separate Content below.
  • AddUnitToRoomSequence gets the first free open slot if none is specified (useful for the barracks view where you don't care about particular ordering), then invokes GetSpecializedRoomName (which is misnamed as it actually returns the RoomClass, possibly specialized, and then invokes AddUnit to the Room returned in the previous step.
  • GetSpecializedRoomName appends MEC or SHIV suffixes (as needed) to the RoomName and then calls FindHQRoomSequence.
  • FindHQRoomSequence is where the trail gets difficult to follow, but is the key next step:

class'Engine'.static.GetCurrentWorldInfo().GetGameSequence().FindSeqObjectsByClass(class'SeqEvent_HQUnits',
 true, HQUnitEvents);
Idx = 0;
J0x69:
if(Idx < HQUnitEvents.Length)
{
  UnitMap = SeqEvent_HQUnits(HQUnitEvents[Idx]);
  if((UnitMap != none) && UnitMap.ObjComment == RoomName)
  {
     return UnitMap;
  }
  ++ Idx;
  // [Loop Continue]
  goto J0x69;
}
return none; 

It first retrieves all SeqObjects that are of type class'SeqEvent_HQUnits', then loops through them until the supplied RoomName matches the .ObjComment element, and returns that SeqObject.

(See also UE3:SequenceObject (UDK).)

The most direct (least hacked) way would be to alter the class'SeqEvent_HQUnits' SeqObject with comment "Dropship" and add the additional slot index locations. After a little digging, and a little luck, it appears that this info is defined in the Anim_Hangar.UPK file in \CookedPCConsole. (Yet another UPK to possibly mod).

After decompressing the file, file offset 0x4881E9 is where the "DropShip" RoomSequence appears to be defined. It's unclear what format this is in. It's not Unreal bytecode but it's also not any form of flash/actionscript, as best I can tell. Following "Dropship" are the "Dropship_Shiv", "Dropship_Mec", and "Dropship_MecTrooper" RoomSequences, as can be created by the GetSpecializedRoomName function.

The good news is that there appears to be 12 units in each of these sequences. (See #DropShip Units.)

The bad news is that these are lightweight objects that don't appear to actually contain coordinates, and probably refer to some earlier objects: "Soldier01" through "Soldier06", "Mec1" through "Mec6", "MecTrooper1" through "MecTrooper6", and "Shiv1" through "Shiv6", which again invokes the restriction of only 6 displayed pawns.

For the complete set of RoomNames for all HQ Locations: see #HQ RoomNames.

MEC in Civvies, MECs in MEC armor, and SHIVs have specialized variants of these names set up with "_MecTrooper", "_Mec", and "_Shiv" appended to the base RoomName.

Separate Content

DropShip Units

HQ RoomNames

m_arrSoldierLocation[0]="Barracks"
m_arrSoldierLocation[1]="Dropship"
m_arrSoldierLocation[2]="Infirmary"
m_arrSoldierLocation[3]="Morgue"
m_arrSoldierLocation[4]="PsiLabs"
m_arrSoldierLocation[5]="PsiLabsCinematic"
m_arrSoldierLocation[6]="Armory"
m_arrSoldierLocation[7]="Gollup"
m_arrSoldierLocation[8]="CyberneticsLab"
m_arrSoldierLocation[9]="GeneLab"
m_arrSoldierLocation[10]="Armory"
m_arrSoldierLocation[11]="Outro"
m_arrSoldierLocation[12]="1stMEC"
m_arrSoldierLocation[13]="1stGeneMod"
m_arrSoldierLocation[14]="GeneLab_Anim"
m_arrSoldierLocation[15]="Armory"


References

Referred to by this article:



That refer to this article:

  • None as yet