XCOM 2
[WOTC] ADVENT Reinforcements (Includes ABA Support)
Wilko  [developer] 15 Jan, 2019 @ 10:36am
Adding AI routines to other enemies
Adding enemies to the config CharacterTemplates[0] array will give them the ability, but you'll need to tell the AI how and when to use it. This can be done by adding the existing 'TryCallReinforcements' behavior routine to their own. For example, adding the routine to the standard advent trooper would require you removing their existing behavior and replacing it with your own:

XComAI.ini
; -------- Remove AdventTroopers's default behaviour selectors -------- -Behaviors=(BehaviorName=AdventRedFirstActionSelector, NodeType=Selector, \\ Child[0]=DoIfFlankedMove, \\ Child[1]=SelectMove_JobOrAggressive, \\ Child[2]=TryMoveThenGrenade, \\ Child[3]=TryShootOrReloadOrOverwatch, \\ Child[4]=HuntEnemyWithCover) -Behaviors=(BehaviorName=AdventRedLastActionSelector, NodeType=Selector, \\ Child[0]=TryGrenade, \\ Child[1]=TryShootOrReloadOrOverwatch, \\ Child[2]=HuntEnemyWithCover, \\ Child[3]=SelectMove_JobOrAggressive) ; -------- Add "TryCallReinforcements" to the new behaviour selectors -------- +Behaviors=(BehaviorName=AdventRedFirstActionSelector, NodeType=Selector, \\ Child[0]=DoIfFlankedMove, \\ Child[1]=TryCallReinforcements, \\ Child[2]=SelectMove_JobOrAggressive, \\ Child[3]=TryMoveThenGrenade, \\ Child[4]=TryShootOrReloadOrOverwatch, \\ Child[5]=HuntEnemyWithCover) +Behaviors=(BehaviorName=AdventRedLastActionSelector, NodeType=Selector, \\ Child[0]=TryCallReinforcements, \\ Child[1]=TryGrenade, \\ Child[2]=TryShootOrReloadOrOverwatch, \\ Child[3]=HuntEnemyWithCover, \\ Child[4]=SelectMove_JobOrAggressive)

If you're using another mod that changes the trooper's AI behaviors already, this probably won't work.

If you want to add the behavior to lots of enemies, another option would be to replace a core behaviour to include the 'TryCallReinforcements' behavior.

One such behavior is 'TryJob', which is used by pretty much every enemy before moving on to more specific tasks:

; -------- Remove core behaviour selectors -------- -Behaviors=(BehaviorName=TryJob, NodeType=Selector, Child[0]=TryUnengagedJob, Child[1]=TryJobObserver) ; -------- Add "TryCallReinforcements" to the new behaviour selectors -------- +Behaviors=(BehaviorName=TryJob, NodeType=Selector, Child[0]=TryCallReinforcements, Child[1]=TryUnengagedJob, Child[2]=TryJobObserver)

This would apply to all enemies (but only be actually usable by the ones with the ability), without needing to replace every enemy's behaviors. Not sure how compatible this option would be with other AI mods!
Last edited by Wilko; 15 Jan, 2019 @ 10:49am