XCOM 2
[WOTC] ADVENT Reinforcements (Includes ABA Support)
This topic has been locked
Wilko  [developer] 29 Oct, 2017 @ 4:13am
Custom animations, depending on Template
You can change the function inside 'X2Ability_CommanderReinforcements.uc' to have multiple animations, based on template.

simulated function Reinforce_BuildVisualization(XComGameState VisualizeGameState) { local XComGameStateHistory History; local XComGameStateContext_Ability Context; local XComGameState_Ability Ability; local StateObjectReference InteractingUnitRef; local XComGameState_Unit UnitState; local X2CharacterTemplate SourceTemplate; local VisualizationActionMetadata EmptyTrack; local VisualizationActionMetadata BuildTrack; local X2Action_PlayAnimation PlayAnimation; local X2Action_PlaySoundAndFlyOver SoundAndFlyover; History = `XCOMHISTORY; Context = XComGameStateContext_Ability(VisualizeGameState.GetContext()); InteractingUnitRef = Context.InputContext.SourceObject; UnitState = XComGameState_Unit(History.GetGameStateForObjectID(InteractingUnitRef.ObjectID)); SourceTemplate = UnitState.GetMyTemplateManager( ).FindCharacterTemplate( UnitState.GetMyTemplateName( ) ); BuildTrack = EmptyTrack; BuildTrack.StateObject_OldState = History.GetGameStateForObjectID(InteractingUnitRef.ObjectID, eReturnType_Reference, VisualizeGameState.HistoryIndex - 1); BuildTrack.StateObject_NewState = VisualizeGameState.GetGameStateForObjectID(InteractingUnitRef.ObjectID); BuildTrack.VisualizeActor = History.GetVisualizer(InteractingUnitRef.ObjectID); Ability = XComGameState_Ability(History.GetGameStateForObjectID(context.InputContext.AbilityRef.ObjectID, 1, VisualizeGameState.HistoryIndex - 1)); SoundAndFlyOver = X2Action_PlaySoundAndFlyOver(class'X2Action_PlaySoundAndFlyOver'.static.AddToVisualizationTree(BuildTrack, Context, false, BuildTrack.LastActionAdded)); SoundAndFlyover.SetSoundAndFlyOverParameters(none, Ability.GetMyTemplate().LocFlyOverText, 'None', eColor_Alien); PlayAnimation = X2Action_PlayAnimation(class'X2Action_PlayAnimation'.static.AddToVisualizationTree(BuildTrack, Context, false, BuildTrack.LastActionAdded)); switch (SourceTemplate.DataName) { case 'AdvCaptainM1': case 'AdvCaptainM2': case 'AdvCaptainM3': PlayAnimation.Params.AnimName = 'NO_CallReinforcementsA'; break; default: PlayAnimation.Params.AnimName = 'HL_CallReinforcementsA'; break; } PlayAnimation.bFinishAnimationWait = true; }
< >
Showing 1-2 of 2 comments
Wilko  [developer] 29 Oct, 2017 @ 4:14am 
The key section here is the 'switch' at the end, that sets the animation to play, based on the template name, with the default being used if no case is met.
Wilko  [developer] 11 Dec, 2017 @ 12:54pm 
This is now included in the mod (V3).
< >
Showing 1-2 of 2 comments
Per page: 1530 50