XCOM 2
Not enough ratings
AutoPromotion
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
362.626 KB
26 Nov, 2022 @ 3:57am
21 Dec, 2023 @ 4:39pm
7 Change Notes ( view )
You need DLC to use this item.

Subscribe to download
AutoPromotion

Description
Auto Promotes troops when they are eligible for promotion. You can set progression you want your troops to follow in the config files.

Go to
~\steamapps\workshop\content\268500\2893561181

go to the Config folder, open the XComGameData.ini in whatever text editor of your choice, and follow the instructions at the top of the file.

if you would like to add a custom class you made or a custom class you use, you can open a PR on github.
Simply Click here[github.com] to go the repository, and go to the XComGameData.ini file and add your changes.


New Features and Fixes with update released on December 21st 2023

The following has been added:
  • BuyBarracksAbilities => To be used after LevelUpBarracks. Buys the abilities so you don't have to.
  • Fixed PromoteAllSoldiers and PromoteSoldier to work as intended



Console Commands:
  • GetSoldierAbilitiesForRank(string SoldierName, int rank) logs the ability name and position for the given rank in the log file.
  • ListSoldierAbility(string soliderName, int rank, int branch) => prints to the log file what ability is at the rank and branch on the ability tree. Useful for helping you change the presets.
  • BuyBarracksAbilities => To be used after LevelUpBarracks. Buys the abilities so you don't have to.
  • PromoteAllSoldiers(optional int rankUps = 1, optional name className = '') => allows you to promote all your troops. You do not need to run LevelUpBarracks before running this command. Furthermore, you can specify a className so you may promote all troops of a specific class should you need it.
  • PromoteSoldier(string soldierName, option int rankUps = 1) => Promotes a single soldier given the name. Do not include the nickname of the troop.
The promoting commands do not allow you to pick a specific class if the troop is a rookie. If you want the rookie to be a specifc class, use MakeSoldierAClass and then use the PromoteSoldier command.


The following has been implemented upon user request/user aid

Mod Config Menu Integration
Due to demand, the Mod Config Menu has been integrated to enable a more customized auto promoting experience.
  • Enable OnlySquaddies => Enable to make it so that it will only auto promote to rank squaddie. disabled by default. Having this and OnlyVets enabled renders the two options useless as now it will autopromote all troops regardless of rank.
  • Enable OnlyVets => Enable to make it so that it will only auto promote starting at rank squaddie. disabled by default. Having this and OnlySquaddies enabled renders the two options useless as now it will autopromote all troops regardless of rank.
  • Check Barracks => Enable to check the barracks after every mission for troops eligible for promotion and auto promote them.
  • Enable Logging => This is helpful for debugging but also figuring out what the class internal name is. If you want to add a custom class and don't know the internal name, enable to find out. Details below. disabled by default
  • Show Promotion Popup => When a soldier is eligible for promotion, a pop up occurs. You can disable/enable this. This is disabled by default.
  • Ignore Covert Action => Enable to not autopromte soldiers on covert actions. If you have Show Promotion Popup enabled, it will still execute.
  • Rank Up But Not Buy Ability => Rank the soldier up to the next available rank (ex: squaddie to corporal) but do not buy the ability. disabled by default.
  • Enable Buying Random Ability => Enable to have your troops select a random ability when they rank up. Enabling causes the mod to ignore presets for classes as well as the rank no buy option.
  • Use Soldier Full Name => Enable to allow using the soldier's name as well as the class name. So if John Doe is no found, it will default to the class the trooper is. Enabled by default. Credit to RustyDios.

Code Improvement, Logging Improvement, LWOTC Support, Using The Soldier's Name, as well as the new image can be attributed to Rusty Dios. Thanks Rusty.

Code Refactor done by me

If you want to say more than thank you, feel free to Buy me an apple[www.buymeacoffee.com]

How to find the Soldier's Internal Class Name or Full Name
Make sure that you have logging enabled, otherwise you will not see the logs!
Also make sure you have ranked up a soldier to squaddie with the class in question, otherwise you won't see it.
Also make sure that you don't have buying a random ability enabled.
  • Go to this file in your computer
    ..\Documents\my games\XCOM2 War of the Chosen\XComGame\Logs\Launch.log
  • Then, search for "Beat_AutoPromote" or "==========". This will take you to the start of the logs.
  • Scroll down and You should see a line that says "COMPLETED AUTO-PROMOTION", look 1 line above it.
  • The text in the brackets next to "soldierType" is what you are looking for.
  • If for some reason the full name isn't working for you, the line above the one from the previous step has the name you need to enter.
54 Comments
DDR Khat 23 Jul @ 4:08am 
That seemed to have fixed it for only one mission, then went back to not auto-promoting again? [Edit] It seems like the auto-promote failed for the vial mission. It went back to working for 2 missions at least afterwards.
DDR Khat 23 Jul @ 3:12am 
That seems to have fixed it! Thanks @Beat ! :)
Beat  [author] 13 Jul @ 3:30pm 
So this is technically a bug but its simply fixed be enabling the option again. Technically the code should not depend on that option being checked to promote anyway but it currently does.
Beat  [author] 13 Jul @ 3:25pm 
No, if you put a named soldier in your ini file, it will use that. If the soldier eligible for promotion does not exist in the ini file, it will default to the class promotion definition in the ini
DDR Khat 13 Jul @ 8:43am 
It should be the same setting I don't recall changing it. I'm not too interested in applying promotions to the soldiers names but instead their role itself. Is that not what this value is doing?
Beat  [author] 13 Jul @ 8:40am 
In the screenshot you sent previously, you had "enable soldier name in addition to soldier class" off. Was that still the case for this? That's responsible for this. scenario.
DDR Khat 12 Jul @ 9:55am 
Of course, no point not being patient. It's not like you've intentionally made it not work for me :D we'll get there eventually, I'm certain!

[1431.90] Beat_AutoPromote: what is bIsLogged True
[1431.90] Beat_AutoPromote: what is bUseClassIfNoMatchedName False
[1431.90] Beat_AutoPromote: what is bShowRankedUpPopups False
[1431.90] Beat_AutoPromote: what is bOnlySquaddies False
[1431.90] Beat_AutoPromote: No Named match for unit [ Aleel Adlisk ], AND Use Class auto-match turned off
[1431.90] Beat_AutoPromote: SKIPPED AUTO-PROMOTION

Seems this makes it quite apparent what's going on. But I don't see an option for setting the UseClassIfNotMatched
Beat  [author] 11 Jul @ 6:24pm 
When you start a new run go ahead and enable logging so we can see what's going on. It'll help me figure out what's going on. Thank you for your patience.
DDR Khat 11 Jul @ 4:42pm 
① Didn't turn on logging; settings was as they were in the screenshot. In hindsight, should've done that. Sorry. ② No custom classes at all, no. All standard XCOM2 WoTC ③ Hadn't tried that one yet. Finished another run today so I'm happy to start a new run and play for a bit to check that for you and report back when I've had some sleep
Beat  [author] 11 Jul @ 1:12pm 
So a few questions. Did you enable logging? In your screenshot it wasn't enabled so just want to double check. Are you using any non standard classes? Does it still promote rookies or is that not working either?