XCOM 2
52 ratings
[WOTC] XpanD's Console Commands
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
850.096 KB
13 Dec, 2023 @ 8:38am
12 Aug @ 1:17am
8 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 and SetUnitCombatStat are still experimental, and debug commands are minimally-tested. 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.

ToggleShowPCPs [draw boxes at real size?]
Draws boxes and text on the map to show the boundaries of all plot cover parcels. By default, extends boxes by 50UU vertically for visibility. Best used with ToggleFreeView.

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>

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, GiveRandomRookies <number of rookies>

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 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 name.

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

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

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

FindTech <tech template name, or part of a 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.

PrintLevelInfo
Shows level/world info such as the current map name and any parcels.

ToggleFreeView
Toggles Fog of War, UI visibility and the debug camera. (camera requires Better Debug Camera)

Debug: DumpHelpTextOnlyAbilities, DumpDataNameOnlyUnits, DebugSetFixedTimeMult [time multiplier] [log attempted resets?]

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.
62 Comments
XpanD  [author] 12 Aug @ 1:29am 
Huge update today! Check the Change Notes page for all the goods.

(@General Anakin Skywalker: this also has the captured soldiers fix in ListSoldiers)
Chubby 3 Aug @ 9:08pm 
Yeah, no crates but mission success still so that's good enough for me. Thanks for the mod!
XpanD  [author] 3 Aug @ 2:23am 
Nope, WOTC only, sorry. It's unfortunately not feasible to keep up two separate builds for two (very) different versions of the game.

(also, worth noting -- confusingly enough, ForceCompleteObjective is only for strategy objectives and does nothing in tactical, despite what some sites say)
VanDusen 3 Aug @ 1:52am 
Can I get this mod to work wth xcom2/LW2? Stuck on alien activity beginning of AvengerDefense and the vanilla ForceCompleteObjective doesnt work. I can force end mission but lose ... Ironman of course. Restart Level etc. nothing works, last straw here ...
Smooth 2 Aug @ 3:30am 
I'll keep an eye out for an update, then! No rush, it's not a big deal. Seems like once a bond lv1 is formed they get raised to 7.5 minimum anyways, which is pretty much good enough as far as I'm concerned
XpanD  [author] 2 Aug @ 12:47am 
I'm not sure how many crates it'll count, but it should count the mission as a success at least. Let me know!
Chubby 1 Aug @ 8:06pm 
Does EndBattleForceWin also complete optional objectives like getting those supply crates in those supply raid missions? Had a mission where the map broke, so I'm wondering if it'll give me those.
XpanD  [author] 1 Aug @ 5:30am 
Not currently, but it's on the list of things to look at. Would be nice with all the new bond overhaul mods on the Workshop.
Smooth 1 Aug @ 5:25am 
Is there a command that can increase Compatibility between soldiers (not bond level)?
jahsinha 11 May @ 11:55pm 
Hmm. Thanks, Rusty. I'll have to check this out if I run into this again.