PostAliensSpawned
Tracking Issue: #457
This event triggers right after the alien pods are added into the tactical mission's Start State, before their visualizers are spawned/visualized.
Overall it can be treated as an earlier alternative to 'OnTacticalBeginPlay'
event.
It can be used to make arbitrary changes to units that were just added to the Start State,
including Soldier VIPs that are spawned for Gather Survivors missions.
For example, this is how to set up an Event Listener to modify these Soldier VIPs:
// This EventFn requires an ELD_Immediate deferral.
static protected function EventListenerReturn PostAliensSpawned_Listener(Object EventData, Object EventSource, XComGameState StartState, Name EventID, Object CallbackData)
{
local XComTacticalMissionManager MissionManager;
local XComGameState_Unit UnitState;
local XComGameState_AIGroup GroupState;
MissionManager = `TACTICALMISSIONMGR;
if (MissionManager.ActiveMission.sType == "GatherSurvivors")
{
// Cycle through Group States, which are basically Game States for pods.
foreach GameState.IterateByClassType(class'XComGameState_AIGroup', GroupState)
{
// Check the pod for correct markings.
if (GroupState.EncounterID == 'ResistanceTeamMember_VIP' && GroupState.PrePlacedEncounterTag == 'ResistanceTeamMember_01')
{
// Assume the pod contains only one unit and grab the Unit State for it.
UnitState = XComGameState_Unit(GameState.GetGameStateForObjectID(GroupState.m_arrMembers[0].ObjectID));
if (UnitState != none)
{
// Make arbitrary changes to the Unit here.
}
}
// Do the same for GroupState.PrePlacedEncounterTag == 'ResistanceTeamMember_02' here.
}
}
return ELR_NoInterrupt;
}
EventID: PostAliensSpawned
NewGameState: StartState