Long War 2 Console Commands

Start with the fundamentals.

Moderator: deaconivory

Forum rules
Players can post in Long War 201 threads but not start new ones.
deaconivory
Long War 2 Crew
Posts: 167
Joined: Tue Dec 29, 2015 1:12 am

Long War 2 Console Commands

Post by deaconivory »

When used by players these are "cheat codes" plain and simple, using them will forever cast you into the hellish pit of cheaters, but may just help you learn the game a bit as well. Nothing is guaranteed and don't ask for help with these, whatever Faustian pact you've created for yourself means that you and Google can work it out on your own. Read each command closely as you type it into the console and it will provide enough information as to what data it is looking for.

I'm not helping you.

Long War 2 console commands (there are some missing for sure):


LWAddRebel true WorldRegion
LWAdvanceActivity XCOM Activity WorldRegion number
LWdebugpodjobs (this displays the status of enemy pods on the map)
LWDumpActivityLog
LWDumpAIJobNames
LWDumpAIJobs
LWdumpregioninfo
LWForceActivityDetection
LWForceActivityDetection Enemy Activity WorldRegion (see blelow)
LWForceAWCRerolls
LWForceMission (see below)
LWForceRecruitRoll
LWGiveAWCDefenseAbility Soldier Name
LWGiveAWCOffenseAbility Soldier Name
LWGiveAWCPistolAbility Soldier Name
LWLevelUpRebel Soldier Name
LWprinthistory
LWSetAlertLevel Number
LWSetAutoResolveEnabled
LWSetEvacCounter Number
LWForceEvac
LWSetForceLevel Number
LWSetVigilanceLevel Number
LWSpawnActivity Enemy Activity WorldRegion (see below)
LWToggleShowFaceless
LWValidatePendingDarkEvents

A few "Vanilla" XCOM2 Commands that are also useful:
X2DebugMap
AiDebugAi
x2debugvisibility
AddItem AssaultRifle_CG (Adds a coil gun . . . you know, for science)
killallais (Kills all of the AI controlled units on the map, including VIPs and Rebels, so be careful with this one)
Skipai (this pauses the AI and the aliens will not take another turn, if you save and reload it resets this)
killclosestunittocursor (be careful this can kill XCOM and VIPs too)
Togglefow (won't reveal enemy units)
RestartLevel; This is basically Bronzeman as I understand it (which means it may be completely wrong)
TTC; "Toggle To Cursor" - selected unit
TATC; "Toggle All To Cursor" - all XCOM units
RemoveFortressDoom Number - removes this many Avatar timer pips
HealAllSoldiers
LevelUpBarracks
SetStrategyFacilitiesUnlockAll
SetStratagyFacilitiesInstantBuild
SetStratagyFacilitiesFree

You need to have at least 1 of these resources in your inventory for the command to work properly:
GiveResource alienalloys number
GiveResource EleriumCore number
GiveResource EleriumDust number
GiveResource Intel number
GiveResource Supplies number
GiveEngineer number
GiveScientist number

Regions:
WorldRegion_EastNA
WorldRegion_WestNA
WorldRegion_SouthNA
WorldRegion_NorthSA
WorldRegion_SouthSA
WorldRegion_WestEU
WorldRegion_EastEU
WorldRegion_NorthAF
WorldRegion_EastAF
WorldRegion_SouthAF
WorldRegion_EastAS
WorldRegion_WestAS
WorldRegion_NorthAS
WorldRegion_SouthAS
WorldRegion_NorthOC
WorldRegion_SouthOC

Some of the XCOM Activity:
RecoverItem_LW
RecoverItemADV_LW
RecoverItemTrain_LW
RecoverItemVehicle_LW
RecoverFlightDevice_LW
HackWorkstation_LW
HackWorkstationADV_LW
HackWorkstationTrain_LW
SupplyLineRaidATT_LW
SupplyLineRaidTrain_LW
SupplyLineRaidConvoy_LW
DestroyRelay_LW
ProtectDevice_LW
ExtractVIP_LW
RescueVIP_LW
RescueVIPVehicle_LW
NeutralizeTarget_LW
NeutralizeTargetVehicle_LW
SecureUFO_LW
SabotageAlienFacility_LW
SabotageAdventMonument_LW
Terror_LW
AvengerDefense_LW
AssaultAlienBase_LW
Jailbreak_LW
Defend_LW
Rendezvous_LW
IntelRaid_LW

Some of the Enemy Activity (Yes there are SPOILERS below):

If you don't want spoilers don't read below

Seriously, stop now . . .

ProtectRegion
Counterinsurgency
ReinforceActivity
COINResearch
COINOps
BuildResearchFacility
RegionalAvatarResearch
GlobalAvatarResearch
ScheduledOffworldReinforcements
EmergencyOffworldReinforcements
SuperEmergencyOffworldReinforcements
Repression
Invasion
AvengerHunt
Propaganda
ProtectResearch
ProtectData
TroopManeuvers
HighValuePrisoner
PoliticalPrisoners
Logistics
CloneDeployment
DebugMission
Rendezvous
IntelRaid
Defend
Goumindong
Posts: 193
Joined: Tue Jan 24, 2017 11:04 pm

Re: Long War 2 Console Commands

Post by Goumindong »

Worth noting that the "givescientist" and "giveengineer" commands only spawn one engineer or scientist. The "number" is the "quality" of the engineer from 1 to 10. Not sure what the baseline quality is but you will get one if you enter the text with no modifier. If you enter "10" your scientist/engineer will be much more effective at their tasks
kenyfpowers
Posts: 2
Joined: Tue Jan 31, 2017 8:49 pm

Re: Long War 2 Console Commands

Post by kenyfpowers »

Thanks for this. Is there a way to "Force" the Nest Mission? I'm midway through August and still haven't gotten the mission yet (and I have the hunter weapons already). Or is there a way to check the current forcelevel?
themefund
Posts: 4
Joined: Sun Feb 05, 2017 6:58 pm

Re: Long War 2 Console Commands

Post by themefund »

does the LWLevelUpRebel Soldier Name work on any soldier? I've had a few times where my soldiers have been promoted to a vanilla class because I have the "UseMyClass" Mod installed and didn't properly reset all the classes in my CharPool to the new LW classes. I didn't catch the error until after I'd ranked them to LCPL and noticed the third tree was missing.

In vanilla there is no way to give a soldier an extra rank (AFAIK) even through console commands. You can change their classes, but they are set back to squaddie, which is a bummer.
RXTXK
Posts: 50
Joined: Sun Jul 31, 2016 2:55 pm

Re: Long War 2 Console Commands

Post by RXTXK »

I'm considering jumping into the pit.
Can anyone help me with how the force level is calibrated.

I understand it drives (but not exclusively) enemy types and am thinking about setting it back to 'just about to see archon levels'.
Should this be 5,50,500? what is the typical numeric range and does it increase approximately linearly over time or geometrically?

Also do I risk putting the game into an inconsistent state by winding it backwards?
Biasface
Posts: 8
Joined: Sun Jan 15, 2017 1:45 pm

Re: Long War 2 Console Commands

Post by Biasface »

(sorry for stupid question)
How does one go about enabling the dev console in the first place?
nmkaplan
Posts: 207
Joined: Thu Jan 26, 2017 5:14 pm

Re: Long War 2 Console Commands

Post by nmkaplan »

Biasface wrote:(sorry for stupid question)
How does one go about enabling the dev console in the first place?
Go to steam Library. Right click XCom2, click "properties". Click "set launch properties".

Type "-allowconsole" (no quotes, but include the dash) in the box and click "ok"

While running the game, press the tilde key (~). It's usually at the upper left of the keyboard above the tab key and/or to the left of the 1 key. This brings up the console. Press the tilde key again to clear it.
cerebrawl
Posts: 137
Joined: Mon Jan 30, 2017 10:41 am

Re: Long War 2 Console Commands

Post by cerebrawl »

themefund wrote:does the LWLevelUpRebel Soldier Name work on any soldier? I've had a few times where my soldiers have been promoted to a vanilla class because I have the "UseMyClass" Mod installed and didn't properly reset all the classes in my CharPool to the new LW classes. I didn't catch the error until after I'd ranked them to LCPL and noticed the third tree was missing.

In vanilla there is no way to give a soldier an extra rank (AFAIK) even through console commands. You can change their classes, but they are set back to squaddie, which is a bummer.
I think it's for the haven rabble rebels, not soldiers. A targetable rank up command would be nice.


I have another command request: a targetable AWC reroll. This has a number of applications for fixing soldiers after changes to AWC tables changes and/or class perk changes, as well as things like Commander's choice(indeed, it would let the mod use it to auto-fix AWC rolls).
HighlanderBR
Posts: 5
Joined: Mon Jan 30, 2017 7:14 pm

Re: Long War 2 Console Commands

Post by HighlanderBR »

Any of these commands can change the advent strength in a region?
EDIT: Just tested, LWSetAlertLevel Number does (need to use the region code)
themefund
Posts: 4
Joined: Sun Feb 05, 2017 6:58 pm

Re: Long War 2 Console Commands

Post by themefund »

cerebrawl wrote:I think it's for the haven rabble rebels, not soldiers. A targetable rank up command would be nice.

I have another command request: a targetable AWC reroll. This has a number of applications for fixing soldiers after changes to AWC tables changes and/or class perk changes, as well as things like Commander's choice(indeed, it would let the mod use it to auto-fix AWC rolls).
Just found this from Grimy: https://steamcommunity.com/sharedfiles/ ... =693790751

He has a levelupsoldier command, and I've commented for a rerollAWC for individuals as well. Perhas that's the best solution we've got for now?
Sevireth
Posts: 6
Joined: Tue Jan 17, 2017 8:15 pm

Re: Long War 2 Console Commands

Post by Sevireth »

Is there a way to change the console's position from covering the top two thirds of the screen, to single line on the bottom I have seen on other players' screens? Taking screenshots and TTCing stuck units is quite tricky without that
TheCiroth
Posts: 79
Joined: Fri Jan 27, 2017 6:53 pm

Re: Long War 2 Console Commands

Post by TheCiroth »

Hit the \ key to have it be one line.
cerebrawl
Posts: 137
Joined: Mon Jan 30, 2017 10:41 am

Re: Long War 2 Console Commands

Post by cerebrawl »

themefund wrote:
cerebrawl wrote:I think it's for the haven rabble rebels, not soldiers. A targetable rank up command would be nice.

I have another command request: a targetable AWC reroll. This has a number of applications for fixing soldiers after changes to AWC tables changes and/or class perk changes, as well as things like Commander's choice(indeed, it would let the mod use it to auto-fix AWC rolls).
Just found this from Grimy: https://steamcommunity.com/sharedfiles/ ... =693790751

He has a levelupsoldier command, and I've commented for a rerollAWC for individuals as well. Perhas that's the best solution we've got for now?
He made an individual AWC reroll command too.

http://steamcommunity.com/sharedfiles/f ... earchtext=
Mongor123
Posts: 2
Joined: Sat Feb 18, 2017 4:56 am

Re: Long War 2 Console Commands

Post by Mongor123 »

Does anyone know the console command for adding suppressors into your inventory :)
Suppressors replace the repeaters in LW2, so they use the same template names as repeaters: "FreeKillUpgrade_Bsc", "FreeKillUpgrade_Adv", "FreeKillUpgrade_Sup". So "AddItem <name> <amount>" should work.
vrork
Posts: 1
Joined: Sun Feb 19, 2017 5:18 pm

Re: Long War 2 Console Commands

Post by vrork »

Can i get some help please? I am trying to make a character a Psionic and its not working. The character doesnt change class.
Jacke
Posts: 623
Joined: Sat Jan 28, 2017 1:10 am

Re: Long War 2 Console Commands

Post by Jacke »

Any idea how to input Unicode characters into the console?

I'm trying to adjust soldier "Zuzanna Kozłowska" and finding no way to enter a "Latin Small Letter L With Stroke", the 4th character of her last name.
seananigans
Posts: 88
Joined: Tue Feb 07, 2017 3:03 pm

Re: Long War 2 Console Commands

Post by seananigans »

Jacke wrote:Any idea how to input Unicode characters into the console?

I'm trying to adjust soldier "Zuzanna Kozłowska" and finding no way to enter a "Latin Small Letter L With Stroke", the 4th character of her last name.
Rename her first via vanilla customization options?
Jacke
Posts: 623
Joined: Sat Jan 28, 2017 1:10 am

Re: Long War 2 Console Commands

Post by Jacke »

seananigans wrote:
Jacke wrote:Any idea how to input Unicode characters into the console?

I'm trying to adjust soldier "Zuzanna Kozłowska" and finding no way to enter a "Latin Small Letter L With Stroke", the 4th character of her last name.
Rename her first via vanilla customization options?
Wow, that worked! Thanks!

And to boot, the UI to change the first name, last name, and nickname does take Unicode characters via this method.

https://en.wikipedia.org/wiki/Unicode_i ... ft_Windows

So I can change the name to remove the 'ł', adjust the soldier, then change her name back.

Of course, this would have been simpler if the console command UI just took Unicode characters.
User avatar
gassrex
Posts: 3
Joined: Sat Feb 13, 2016 11:54 pm

Re: Long War 2 Console Commands

Post by gassrex »

GiveResource codex brain?
any command for codex brain?
deaconivory
Long War 2 Crew
Posts: 167
Joined: Tue Dec 29, 2015 1:12 am

Re: Long War 2 Console Commands

Post by deaconivory »

gassrex wrote:GiveResource codex brain?
any command for codex brain?
Not 100% sure if this will work but I see:

GiveTech BlacksiteData
GiveTech CodexBrainPt1
GiveTech CodexBrainPt2

I am not at my computer so I can't tell if GiveItem CodexBrain works or not.
Rave42063
Posts: 1
Joined: Sat Mar 11, 2017 2:37 am

Re: Long War 2 Console Commands

Post by Rave42063 »

Hello,

How can I get soldier ID's?

The "displaysoldierclass - 1" command dumps everything in the console but it truncated after a few hundred lines and I can't see all my soldiers.

Is there a better way, or maybe a way to dump the output I tk a text file? Or even change the max lines of output in the console?
DanNHG
Posts: 1
Joined: Sun Mar 12, 2017 9:06 am

Re: Long War 2 Console Commands

Post by DanNHG »

Hello

I try to Force a Mission to Sabotage one Alien Facility and for that i try command : LW_ForceActivity SabotageAlienFacility WorldRegion West_AS,because the Avatarproject gain a point from a facility right there....but nothing happend...any tips? :?
pacotaco
Posts: 6
Joined: Wed Mar 22, 2017 4:49 pm

Re: Long War 2 Console Commands

Post by pacotaco »

Is there a command to spawn an extraction point? I am on ironman in a bugged Nest mission (already killed the VK) and I can't escape.
LordYanaek
Posts: 940
Joined: Mon Jan 23, 2017 1:34 pm

Re: Long War 2 Console Commands

Post by LordYanaek »

did you try LWForceEvac
From the name it looks like it should force evacuation out of the mission, but i would still make a backup of my saves in your situation :geek:
pacotaco
Posts: 6
Joined: Wed Mar 22, 2017 4:49 pm

Re: Long War 2 Console Commands

Post by pacotaco »

I found a command endmission xcomwins[ubool]

or something like that. I didn't read I just typed i in as is and I guess the default state is false because it called the mission a loss. Doesn't matter, I had already killed the VK earlier I guess it will just make the spokesman a little peeved. Before that I tried placing a VK to see if killing it again would work but it kept dropping inert sprites. So then I played around a bit and spawned a couple mutons and yadda yadda yadda I'm back baby.
Post Reply