XCOM 2
[WOTC] ADVENT Reinforcements (Includes ABA Support)
Wilko  [developer] 12 Oct, 2024 @ 4:11pm
Guidance on ability duplication
Basically you're duplicating several functions, files and configs - renaming any reference to AdventCommander_CallReinforcements to your own value (but only in your duplicated code/files!). In these examples, I'm using XComSoldier_CallReinforcements.

X2Ability_CommanderReinforcements.uc
Copy the X2AbilityTemplate function, and rename to your unique name:

static function X2AbilityTemplate CreateTemplate_XComSoldier_CallReinforcements() { local X2AbilityTemplate Template; local X2AbilityCost_ActionPoints ActionPointCost; local X2AbilityCooldown_LocalAndGlobal Cooldown; local X2AbilityCharges Charges; local X2AbilityCost_Charges ChargeCost; local X2Effect_CommanderReinforcements ReinforceEffect; `CREATE_X2ABILITY_TEMPLATE(Template, 'XComSoldier_CallReinforcements'); Template.IconImage = "img:///UILibrary_PerkIcons.UIPerk_evac"; Template.Hostility = eHostility_Defensive; Template.AbilitySourceName = 'eAbilitySource_Standard'; Template.eAbilityIconBehaviorHUD = EAbilityIconBehavior_AlwaysShow; ActionPointCost = new class'X2AbilityCost_ActionPoints'; ActionPointCost.iNumPoints = 1; ActionPointCost.bConsumeAllPoints = false; Template.AbilityCosts.AddItem(ActionPointCost); Cooldown = new class'X2AbilityCooldown_LocalAndGlobal'; Cooldown.iNumTurns = default.ReinforcementsLocalCooldown; Cooldown.NumGlobalTurns = default.ReinforcementsGlobalCooldown; Template.AbilityCooldown = Cooldown; Charges = new class 'X2AbilityCharges'; Charges.InitialCharges = default.ReinforcementsAbilityUses; Template.AbilityCharges = Charges; ChargeCost = new class'X2AbilityCost_Charges'; ChargeCost.NumCharges = 1; Template.AbilityCosts.AddItem(ChargeCost); Template.AbilityTriggers.AddItem(default.PlayerInputTrigger); Template.AbilityToHitCalc = default.DeadEye; Template.AbilityTargetStyle = default.SelfTarget; Template.BuildNewGameStateFn = TypicalAbility_BuildGameState; Template.BuildVisualizationFn = Reinforce_BuildVisualization; Template.bShowActivation = true; Template.bSkipFireAction = true; ReinforceEffect = new class 'X2Effect_CommanderReinforcements'; // This Effect Will Need Duplicating !!! Template.AddShooterEffect(ReinforceEffect); return Template; }

Then, add the new X2AbilityTemplate to the CreateTemplates() function at the top of the file:

static function array<X2DataTemplate> CreateTemplates() { local array<X2DataTemplate> Templates; Templates.AddItem(CreateTemplate_AdventCommander_CallReinforcements()); Templates.AddItem(CreateTemplate_XComSoldier_CallReinforcements()); return Templates; }

In theory, you now have a duplicate of the ability. It's going to summon the same group of people, and probably needs custom config for limits/uses/recharges, but it's a starting point.

As for other steps, you've got:

X2Effect_CommanderReinforcements.uc
Duplicate this file, giving it a unique name. Then go back to your X2AbilityTemplate function and rename references to X2Effect_CommanderReinforcements to the new name. In the config file, duplicate and update as needed:
[WOTCAdventReinforcements.X2Effect_CommanderReinforcements] ; --- For standard reinforcements, use "ADVx3_Standard" ReinforcementsID="CRx4_AdventTroops" ; --- Set an 'ideal' distance away from the XCOM squad for call-ins - setting any number below 5 will generally be on top of them ReinforcementsSummonTileOffset=20 [WOTCAdventReinforcements.X2Effect_XComReinforcements] ; --- New name here! ReinforcementsID="XCOM_SQUAD" ; --- Enter your encounter list ReinforcementsSummonTileOffset=10

XComGame.int (or language you'll use)
Duplicate the existing lines in the file and rename to your new ability:
[AdventCommander_CallReinforcements X2AbilityTemplate] LocFriendlyName="Request Reinforcements" LocLongDescription="Advent officers can call for reinforcements to be dropped near the XCOM squad's position." LocHelpText="Request reinforcements to the battle." LocFlyOverText="Reinforcements en route" [XComSoldier_CallReinforcements X2AbilityTemplate] LocFriendlyName="Request Ally Reinforcements" LocLongDescription="XCOM soldiers can call for reinforcements to be dropped near the squad's position." LocHelpText="Request reinforcements to the battle." LocFlyOverText="Reinforcements en route"
Last edited by Wilko; 12 Oct, 2024 @ 4:25pm