Improved Friendly Reinforcement Mechanics

If you liked this item, please rate it up on Steam Workshop page.

Author: Tedster

Last revision: 16 May, 2023 at 14:23 UTC (1)

File size: 79.87 KB

On Steam Workshop

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://steamcommunity.com/sharedfiles/filedetails/?id=1223925683

Download
Revisions:

Old revisions of this mod are available below. Click the link to download.