XCOM 2
50 ratings
[WOTC] XpanD's Console Commands
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
746.219 KB
13 Dec, 2023 @ 8:38am
15 Sep, 2024 @ 12:20pm
7 Change Notes ( view )
You need DLC to use this item.

Subscribe to download
[WOTC] XpanD's Console Commands

Description
Adds several new console commands to the game. Part utility, part developer stuff, part blatant cheating. (I won't tell if you don't!)

Usage:
Angle bracket arguments ("<" and ">") are required, square bracket ones ("[" and "]") are optional. Arguments with a question mark are boolean -- they accept either "true" or "false". Debug commands are rough drafts for testing purposes.

Brackets are only used to show whether an argument is required or not. Do not include them!

This will work: SetUnitCombatStat Offense 50
This does not: SetUnitCombatStat <Offense> <50>

Note that DropSoldier, SetUnitCombatStat and the tactical FixSoldier are still experimental. Proceed with caution, and report any issues! (see the Change Notes page for more details)

Tactical commands:
EndBattleForceWin
Attempts to force-complete all objectives, and then ends the mission. See special thanks.

HealSoldier [target non-allies instead?]
Fully heals the closest unit, wakes them up if unconscious and removes bleed-outs.

FixSoldier [target non-allies instead?]
Refreshes the closest unit's will, restores AP and removes negative statuses.

RepairSoldierArmor [target non-allies instead?]
Repairs shredded armor on the closest unit, and refreshes ablative shielding.

SetUnitCombatStat <stat type to adjust> <new value>
Changes the selected stat on the closest unit to the given max value. Reverts on battle end.

KillClosestEnemy [target neutral units?] [target allies instead of enemies?]
Kills the closest enemy to the cursor. Handles stuff like mind control and regeneration properly.

KillAllEnemies [target neutral units?] [target allies instead of enemies?]
Kills all enemies on the field. Save first, potentially very dangerous! (if using arguments)

ToggleShowCorpses
Draws markers on the map to indicate actual corpse locations for looting, can't trust the game. Updated every second, use again to disable. Made to be paired with Extract Corpses.

DropSoldier <full name of unit, no nickname>
Drops undeployed units into combat at the cursor, using whatever gear they had equipped last. Note that the game randomly unequips soldiers sometimes, check beforehand if possible!

Debug: DropRandomSoldiers <number of soldiers>
Attempts to drop in the specified amount of units. Requires names to follow the "Random #" format from GiveRandomRookies, and always starts at 1.

Strategy commands:
HealSoldier
Fully heals the selected soldier or SPARK.

FixSoldier
Restores the selected soldier's will, and removes status effects like Tired/Shaken.

BondSoldier <full name of second unit, no nickname>
Increases the bond between the selected soldier and the targeted one by one level.

UnbondSoldier
Breaks all of the selected soldier's current bonds. (yes, they can have multiple!)

SetSoldierAP <amount>
Sets the selected soldier's number of personal (non-XCOM) ability points.

ForceShakeSoldier
Forces the selected soldier into a shaken state, and sets their will to zero.

ForceSoldierWeapon <weapon template name> [replace unique weapons?]
Force-spawns a weapon onto the selected soldier, even if they can't equip it otherwise.

RandomizeSoldierNickname
Randomizes the selected soldier's nickname, picked from nicknames normally available to them.

SetSoldierNickname <nickname>
Sets the selected soldier's nickname, even if they're not eligible for one yet. Allows illegal characters and >11-character nicknames, apply at your own risk! (very stable in tests, but yeah)

SetSoldierFirstName/LastName <name>
Sets the selected soldier's first or last name. Also allows illegal characters and long names.

Debug: HideUIFlags
Hides pending notification flags, usually seen at the bottom left. Might help if they're stuck.

Debug: GiveRandomRookies <number of rookies>
Spawns in X rookies with a "Random #" name format. Requires MEME Give Soldier Command.

Universal commands:
RollDie <highest number> [number of numbers to roll]
Rolls one or more random numbers between 1 and the given highest number. (inclusive)

FindAbility <ability template name, or part of a friendly name>
Displays an ability's name(s), parent class file and other useful data. Can also be used to search for abilities when provided with part of a friendly name. (the one that shows in-game)

FindWeapon <weapon template name, or part of a friendly name>
Same as above, but for weapons. (also counts heavy weapons and the like)

FindEquipment <equipment template name, or part of a friendly name>
Same as above, but for non-weapon equipment. (as determined by the game)

FindUnit <unit template name, or part of a friendly name> [difficulty level]
Same as above, but for units. Nice for something like DropUnitImproved.

FindTech <tech template name, or part of a friendly name>
Same as above, but for research/proving ground/shadow projects.

SearchAbilityDescriptions <part of description>
Searches for abilities by their descriptions.

ListSoldiers [show unavailable units?]
Lists all available/deployed units. Passing "true" also lets it show infiltrating units.

PrintDifficultyInfo
Shows a bunch of info on the current campaign, including difficulty and when it was started.

Debug: DumpHelpTextOnlyAbilities
Prints all abilities with valid help text but no description. (generally tactical-only stuff)

Debug: DumpDataNameOnlyUnits
Prints all units that only have an internal data name. Catches some things FindUnit can't.

Compatibility:
No overrides and no hard requirements, should be compatible with just about anything!

(may end up requiring Highlander in the future, but that should be about it)

Other console mods:
Additional Soldier Console Commands: The de-facto mod for changing soldier classes/stats.
Xylth Debugging Tools: Allows granting abilities/kills. Check description for overrides! (dev mod)
Bstars Scope: Dumps LOTS of info to the log for the selected unit. Nice for dev/troubleshooting.
Improved Friendly Reinforcement Mechanics: Adds a nicer DropUnit, fixes AICallReinforcements.
MEME Give Soldier Command: Lets you add new rookies, either random or by name.
Amalgamation Console Helper: Adds lots of new commands for the Amalgamation overhaul.

Special thanks:
  • shiremct for Additional Soldier Console Commands. Big inspiration and a solid reference.
  • Iridar, RustyDios, Zelfana, Tedster, SwfDelicious and others for their extensive help.
  • BlackDog for contributing the EndBattleForceWin command. Finally a thing now!
  • The helpful people of the XCOM 2 Modding Discord in general.
53 Comments
jahsinha 11 May @ 11:55pm 
Hmm. Thanks, Rusty. I'll have to check this out if I run into this again.
RustyDios 10 May @ 6:50pm 
CI already has it's own command for that, on the Geoscape with the mission open (ready to launch) use "ForceAbortSelectedInfil" and it should auto-complete the mission for you.
jahsinha 10 May @ 3:03pm 
endinfiltrationforcewin. is this a possible command you can build? Endbattleforcewin has been a life saver in bugged tactical missions and lets me go one with my life w/o cheating - I won but due to some endless spawn or some other nonsense, I can't progress. Recent bug is is trying to launch a CI infiltration after 250% and the map won't load - ctd in the opening cinematic. yes, I can binary search and all that but I'd rather cancel the infil or win it and move on. Possible?
General Anakin Skywalker 13 Apr @ 10:52am 
Yeah no problem !
I'll try to find another way to see the state of my captured soldiers, to see if they died or not
XpanD  [author] 13 Apr @ 10:22am 
Huh, that's definitely not intended. Taking a break for a bit, but I'll see if I can reproduce that whenever I start a new playthrough. Thanks for letting me know.
General Anakin Skywalker 13 Apr @ 7:52am 
Only the soldiers we have in our ship.
And if we add "true", we see scientist and all the others stuff but not them
XpanD  [author] 13 Apr @ 2:21am 
I don't fully remember how I set that up, but what does ListSoldiers show?
General Anakin Skywalker 12 Apr @ 7:28pm 
Can we see our soldier captured?
XpanD  [author] 18 Mar @ 2:00pm 
"SetSelectedSoldiersStat eStat_Hacking VALUEHERE" should work there, it's part of the Additional Soldier Console Commands mod. (might be eStat_Hack instead)
Leokosta 18 Mar @ 10:35am 
Is there a command I can use to increase a soldier Hack Status ? I am trying Vipers Hacker class, but hes Hacking skill is to low for my taste. LWOTC + TedJam .Thank you