XCOM 2
40 ratings
Improved Friendly Reinforcement Mechanics
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
81.870 KB
14 May, 2023 @ 3:09pm
16 May, 2023 @ 7:23am
7 Change Notes ( view )

Subscribe to download
Improved Friendly Reinforcement Mechanics

Description
This mod is intended for streamers and/or other players who use use the DropUnit or AICallReinforcements commands to spawn units onto the XCOM team, and for players who use mods that use the reinforcement system to spawn units into team XCOM (NOTE: this is different from the Resistance team), such as M.E.M.E.B.O.T.S. If you are not doing either of these things, this mod won't affect you.

Problem: Units spawned into Tactical on eTeam_XCom using the base game reinforcement system have two issues:
  • When they spawn, they have no actions unless you manually give them AP after spawning.
  • On subsequent turns, the spawned units can't be used until the main XCOM squad uses its actions.

In order to fix this, you have to do two things:
  • Give the newly spawned units their 2 AP.
  • Move the units to the AIGroup that contains the other XCOM units. (Yes, the player controls an "AIGroup" despite not being AI. This is the system that defines the order the AI uses the pods. The player normally only has one "pod" to control.)

The first one you can workaround with GiveActionPoints, but the second issue you can't easily adjust this, thus I created this mod, which does two things:
  • A new DropUnitImproved command that functions identically to the base game DropUnit, except that when units are spawned onto team XCOM, it gives them 2 AP and moves them to the right group.
  • An event listener that detects reinforcement drops, and adjusts them when the units spawn. This adjusts the AICallReinforcements command as well as any other modded functionality that utilizes the reinforcements system to spawn friendly units. No change needed by the player to use the functionality.

Compatibility: Built and tested against LWoTC, also functions with normal WoTC, no clue if this works with the base game without WoTC. No requirements for the mod itself, but it will only do something if what you do fits what I mention at the top. Can be added mid-tactical.

Credits: Thanks for the folks on the main XCOM 2 Modding discord and the MEME discord for helping me understand how the AI works and the AIGroups structure so I could make this.

If you want more info on spawning units mid-tactical, check out this awesome post: https://steamproxy.net/sharedfiles/filedetails/?id=1223925683
24 Comments
CyberNeo 30 Apr @ 1:39pm 
One Question:
I have Reconceal After Battle Mod installed, but after I get reconcealed after a Battle and in the next turn the Reinforcement is coming the enemies doesn't moves automatically.Does this fix that too?
AlexSansNig 6 Feb @ 9:22am 
I'm sorry for being stupid but I do not understand how this works. Can you explain what command I need to type to get a ai in my team or preferably the resistance team. Like a example line? Thanks in advance
Tedster  [author] 5 Feb @ 8:57pm 
Dropping them onto your own team using DropUnitImproved gives you them as controllable units on your team.

Dropping them into the reinforcement team, you need to use AICallReinforcements or else the AI player won't initialize properly and they'll still do nothing.
AlexSansNig 5 Feb @ 3:07pm 
Hello, I'm trying to figure out how to get this to work. I spawned a soldier in the xcom team and in the resistance team but they both go afk I don't understand why the arent doing anything. Any tips?
Tedster  [author] 17 May, 2023 @ 9:06am 
Nope. If you spawn stuff into the resistance team, they'll be put as part of the resistance team and turn order as normal. This mod only affects units spawned onto eTeam_XCom (internal name). The other team options are eTeam_Alien, eTeam_Lost, eTeam_Resistance, eTeam_One, and eTeam_Two. The last two are used by 3rd party factions.
Shaggoth (Ищезаяц) 17 May, 2023 @ 12:22am 
i read it wrong then, i was thinking i spawn them and they quickly swap teams to get ap
Tedster  [author] 16 May, 2023 @ 2:34pm 
Yes, I should clarify, this makes no changes if they aren't spawned explicitly onto the XCOM team,the resistance team is not affected, and probably depends on if these units have AI trees set up.
Shaggoth (Ищезаяц) 16 May, 2023 @ 3:02am 
i just tested it with central and commanders avatar, but they still stand still, on resistance move. but at least now i'm sure mod is loaded
Shaggoth (Ищезаяц) 16 May, 2023 @ 1:10am 
hey, it finaly started to work :) your last update did it :steamhappy:
Tedster  [author] 15 May, 2023 @ 6:31pm 
Yeah, not sure why. I confirmed MrCloista was also encountering the issue with the release version (but not a private version), and they are now using the release version properly.