XCOM 2
65 ratings
[WOTC] XpanD's Console Commands
2
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
1.325 MB
13 Dec, 2023 @ 8:38am
28 Aug @ 6:47am
9 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 judge)

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>

DropSoldier and SetUnitCombatStat are still experimental. Proceed with caution, and report any issues! (see the Change Notes page for the latest 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. If using arguments, save first! Potentially dangerous.

ToggleShowCorpses
Draws markers on the map to indicate actual corpse locations for looting, game is inaccurate. Updated every second, use again to disable. Best when 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 <amount of soldiers>

Strategy commands:
HealSoldier
Fully heals the selected soldier. (or SPARK/MEC/whatever)

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

BondSoldier <full name of second unit, no nickname>
Increases the bond between two soldiers by one level.

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

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

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

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

RandomizeSoldierNickname
Randomizes a soldier's nickname, picking from nicknames normally available to them.

SetSoldierNickname <nickname>
Sets a soldier's nickname. Allows illegal chars and >11-char nicknames. Seems to work fine?

SetSoldierFirstName/LastName <name>
Sets a 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)

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 unit outlines. (plus the Better Debug Camera, if available)

Debug: DumpHelpTextOnlyAbilities, DumpDataNameOnlyUnits, DebugSetFixedTimeMult [new multiplier] [log things trying to change time?]

FindX commands:
If a template name is provided, these show any available names/description, the parent class, and any other info. Otherwise, they'll show a list of things matching the provided arguments.

FindAbility: Abilities.
FindWeapon: Weapons. Also counts heavy-slot weapons.
FindEquipment: Non-weapon equipment. (as determined by the game)
FindMiscItem or FindResource: Other items, such as resources and certain in-mission rewards.
FindHackReward: Hack rewards, and intel unlocks for "special" missions.
FindTech: Research, Proving Ground and Shadow Chamber projects.
FindUnit: Units. (nice for DropUnitImproved).
FindCommand: Console commands. Best-effort, may miss stuff. Partial matches only.

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.
77 Comments
XpanD  [author] 22 hours ago 
Just downloaded it to check, and my game seems to open okay with both mods active.

I'd be kind of curious to see the log output here, but I don't think this CAN be an incompatibility; both mods are fully self-contained and don't do anything that could be incompatible with any other mods, other than maybe overlapping a command or two.

I feel like the "mod stays active despite being unticked" thing is important, here; it sounds like something in your setup is keeping files stuck in inconsistent states. Unticking should always work; this removes the mod from the engine config (XComModOptions.ini) the game uses to decide what to load.

If you haven't yet, try rebooting your PC. That might clear out ghosts in the system like this.
Mr_Snipz 23 hours ago 
I also posted this to the other person's mod page too if you wanted to see about reaching out to ∑3245 directly
Mr_Snipz 23 hours ago 
I think I may have found your first incompatibility?

I’ve used the mod “[WotC] UC - Character Pool Restoration” by ∑3245 (link below) for years with no issues, until after I downloaded your mod. After starting the game via AML, I get a "appDebugMessagef" notification with the message: "Error detected attempting load of package: WotC_Misc_CharPoolToJSONUtil", which is something from ∑3245’s mod. After that, the game gets stuck and won't start unless I uncheck ∑3245’s mod.

https://steamproxy.com/sharedfiles/filedetails/?id=2850536604

When I do uncheck ∑3245’s mod, the game runs like normal, except their console commands don't work. However, your mod’s console commands are now always available in my game whether I have your mod checked or not.

Do you know of a solution to this or what may be causing this?
crumb 17 Nov @ 11:06am 
This is an incredibly narrow request, but would it be possible to implement a force return to Avenger command, or do you know any way of doing this? I have an ironman save at the final mission that I want to go back to the Avenger screen from in order to get a screenshot of the soldier list in the barracks. I can't find any way of doing this. Some talented mod author is maybe my only hope!
Dragon32 31 Oct @ 2:07pm 
What he said. :spacehamster:
XpanD  [author] 31 Oct @ 1:57pm 
Console is enabled with the "-allowconsole" launch argument outside of the game itself, ironman won't affect it. Assuming you're using the Alternative Mod Launcher (which you probably want to be), just go to Options > Settings and add it at the end of the "Active arguments" box. (with a space between it and the previous entry)

Once this is done, hit ` or ~ to open the big console. May be different depending on keyboard layout, just try a few keys. Make sure you use the big console, not the small single-line one at the bottom of the screen.
SlowPokeDerp 31 Oct @ 1:16pm 
@Dragon32
Do you know of a way to enable the console in Ironman? I am hounding for it
Dragon32 31 Oct @ 1:12pm 
@SlowPokeDerp
Yes, add the mod and enable the console in launch options
SlowPokeDerp 31 Oct @ 1:00pm 
Is there a way to use this during an Ironman playthrough?