XCOM 2
75 ratings
[WOTC] Additional Soldier Console Commands
 
Rate  
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
0.126 MB
Apr 25 @ 11:10pm
Sep 15 @ 2:33pm
3 Change Notes ( view )
You need DLC to use this item.

Subscribe to download
[WOTC] Additional Soldier Console Commands

Subscribed
Unsubscribe
Description
[WOTC] Additional Soldier Console Commands

Currently adds three new console commands that can be used from the armory and one command used in tactical missions. Though the commands may be used to do cheaty things, the primary purpose of these commands are to help modders test and players integrate/update mod changes in their on-going campaigns:


LevelUpSelectedSoldier
LevelUpSelectedSoldier Ranks[INT]
Levels up just the currently selected soldier in the armory screen. The optional Ranks parameter lets you specify how many ranks to increase (defaults to 1 if unspecified).

Example - Level up the selected unit by 2 ranks:
LevelUpSelectedSoldier 2


RebuildSelectedSoldiersClass
RebuildSelectedSoldiersClass OPTIONAL_ChangeClassTo[FName] OPTIONAL_SetRankTo[INT]
Refreshes the ability tree and rerolls the XCOM abilities for the currently selected soldier in the armory screen. Used to update a class ability tree on an existing soldier that has been changed due to new mods or mod updates. Can use the optional parameters to change the soldier's class and set their rank (up or down). Refreshing a Soldier's Class will also reroll randomized stats from Point-Based NCE, Hidden Potential, etc. - unfortunately, this can't really be avoided without causing issues with all sources of stat-gains (Covert Ops, RPGO stat purchases, etc.).

Use this instead of the vanillia MakeSoldierAClass command to change classes. The vanillia command does not properly support things like Beta Strike, NCE, XCOM/AWC Abilities, etc. Also supports classes that use the Highlander's ClassesExcludedFromAWCRoll functionality.

Example - Change the currently selected unit to a rank 1 (squaddie) Ranger:
RebuildSelectedSoldiersClass Ranger 1


SetSelectedSoldiersComInt
SetSelectedSoldiersComInt eComInt_CombatIntelligence[BYTE]
Sets the currently selected soldier's Combat Intelligence level - use a value between 0 (standard) and 4 (savant). This will try to adjust the soldier's AP accordingly and WILL adjust it into the negative if you drop Combat Intelligence and have already spent the AP (meaning the next ability you purchase with AP on that unit will take extra XCOM AP to cover the difference). Be careful of the resistance cards that boost AP gain - it will calculate expected AP values based on the current value.

Modified from code initially provided by PEZ.

Example - Change the currently selected soldier's Combat Intelligence to Gifted [2]:
SetSelectedSoldiersComInt 2


ReloadWeapon
ReloadWeapon
In a tactical mission, reloads the currently selected unit's primary weapon.


Thanks and Credits
  • PEZ for providing the initial code for the command to set Combat Intelligence.

Version History
(See Change Notes for full history)
    1.1.1:
    • Added a ReloadWeapon command that will reload the selected unit's primary weapon in tactical.
    1.1.0:
    • Added the SetSelectedSoldiersComInt command (thanks to PEZ).
    • Added Console feedback messages indicating errors and successful command completions.
    • Updated the RebuildSelectedSoldiersClass command to reapply stat modifiers (like Beta Strike HP, NCE stats, etc.) to the unit. Note that randomized stats (NCE, Hidden Potential, etc.) will be rerolled.
    • Updated the RebuildSelectedSoldiersClass command to enforce a class' required character templates (ex: you cant make a skirmisher character into a templar class).
    1.0.0:
    • Initial Release!.

If you think there is a need for additional commands, leave a suggestion.
< >
72 Comments
Niteshade Sep 17 @ 12:03pm 
This is a wonderful and incredibly useful mod! alongside all of Musashi's mods and a mod to turn off avatar project ticks i have almost my perfect never ending Xcom sandbox war in place. I always just have a few select soldiers I liked getting certain perks on and reloading saves was getting tedious lol. Man your mod is a lifesaver!
Ty for this one.
shiremct  [author] Sep 17 @ 6:10am 
@Niteshade, glad you got it working!

@Professor / SentrySent, I think those requests should be doable, I'll work on them for the next update.
Professor Spank It Sep 16 @ 11:40pm 
Can you make a command to manually add an ability? Something like "Give EverVigilant PrimaryWeapon" to the selected soldier?
Niteshade Sep 16 @ 10:34am 
I did, it somehow didn't get toggled on when i went to select it on the launcher lol
/facepalm
Thanks for this! it compliments my RPGO game perfectly.
Niteshade Sep 16 @ 9:53am 
I was trying to use this in an existing save that also has RPG Overhaul to try rerolling a soldier to shuffle the perks to news ones but either I messed something up or its not working in my save at least.
when entering RebuildSelectedSoldiersClass , I'm just given a command not recognized message. I made sure I had the soldier selected/loaded in the Armory screen.
I"m sure I probably missed something obvious tho :/
SentySent Sep 16 @ 9:02am 
Hey I got a suggestion to add: can you make a version of setSoldierStat console command that works on SPARKs or soldiers without first name, surname or only have a nickname?
Deviathan Whale Sep 15 @ 9:22pm 
Thanks @shiremct !
shiremct  [author] Sep 15 @ 2:37pm 
Okay, there is now a reload weapon command.

Note, the ammo HUD display wont update immediately, but abilities requiring ammo will be available. The HUD will update after reselecting the unit or using an ability.
shiremct  [author] Sep 14 @ 8:25am 
I'll see what I can do this weekend to add something for it...
Astral Descend Sep 14 @ 2:10am 
Oh... never had that bug