XCOM 2
44 ratings
Customising WotC soldier classes with the ini files
By initium and 1 collaborators
A short guide that explains how to use the ini files to develop WotC custom classes by...
  • Adding random stats to give a simple not created equal feel
  • Adding random ability decks so you don't get clashes and redundant AWC perks (very powerful and simple to do)
  • Adding a third branch to the Ability Tree
  • Adding abilities to your soldier class from other mods
   
Award
Favorite
Favorited
Unfavorite
Introduction
WotC instructions (will probably work with vanilla too)

Look to the right to find the contents. Click to take you to that section if you wish.

Did you know you can use the ini files in a far more creative way than what you see in the default files? Do you know you can add extra rows of abilities to you soldiers class just using the ini files. Do you know the difference between an ini and an int file?

Well the ini file lives in the Config folder and is where XCom pulls numbers and items (for want of a better description) to create soldier in the game at the very start.
The int file lives in the Localization folder and is all the front end text that a player sees, such as names and descriptions.

When you use a custom class you will download ini files that normally include the XComClassData and XComGameData. These ini files will contain the promotion progression and soldier loadout respectively. Below is an explanation of what you can mod and how. I've used Richards Class Templates to achieve some good results for replacing the vanilla classes. He has excellent descriptions to help you develop your custom class.

Keep in mind that any changes that you make should match the weapons you use and the game you are modding. ie - A Better AI, Increase pod size by force level, Golden Path missions revamp, LEB's Late game enemies, Light stategy changes, etc. In other words don't make the game too easy, as it will just spoil the playability of the game, so balance it out with some of the great mods out there.

The below information is a combination of my own tinkering and reading other peoples advice.
1. Remove old soldier progression
You need to remove old soldier progression lines from the updated template. Use...

!SoldierRanks=()

Place this just above the first SoldierRanks= line for each class to remove the older perk tree instead of "-SoldierRanks=..." for each old line.

I discovered this thanks to @SentySent
DerBK uses it in his Alien Hunters mod

You need to do this in mod classes you have downloaded and are editing. If you don't do this the game will read the first set of info and use it, or look for the default files. Or just not work. XCom 2 only wants one set so tell it to ignore the default and use the edit you are now creating.
2. Alter soldier set up
An example of the soldier class template typical for the game and mods...

Where you see a ; before the line, this is referred to commenting out. The game will not read what is after the ; so it's really useful to write notes for yourself. In the SDK you will often see the devs have left notes.

Where you see a + this is to add the edit into the template. Without this the new information you are placing in the config will be ignored and the game will revert to the old info.

[TemplateClass_EXAMPLE X2SoldierClassTemplate]
;This disable MultiPlayer using the class
+bMultiplayerOnly=0
+ClassPoints=4
;This adds an icon for the class
+IconImage="img:///UILibrary_Common.class_PLACE IT HERE"
;This forces the game to use the class
+NumInForcedDeck=1
;This weights the class in comparison to other classes. ie. You'll get more/less
+NumInDeck=3
;This is the number of assists (wounding an enemy) that equals a kill
+KillAssistsPerKill=5
;This is needed to properly load your class with the relevant weapons - Loadouts are created in the GameData.ini
+SquaddieLoadout="SquaddieTemplateClass02"
;These lines allow weapons to be used - They do not give the weapon. See Loadout above
+AllowedWeapons=(SlotType=eInvSlot_PrimaryWeapon, WeaponType="sniper_rifle")
+AllowedWeapons=(SlotType=eInvSlot_PrimaryWeapon, WeaponType="rifle")
+AllowedWeapons=(SlotType=eInvSlot_SecondaryWeapon, WeaponType="pistol")
+AllowedWeapons=(SlotType=eInvSlot_SecondaryWeapon, WeaponType="sidearm")
;This line can be copied with other armors and works like the AllowedWeapons lines
+AllowedArmors="soldier"
;This line is referring to the TLE DLC. If you don't have this DLC you don't need this line.
+AllowedArmors="sharpshooter"
;This line makes receiving AWC perks true or Flase (0 for False) and adds the XCOM line of abilities to the bottom of the soldier promotion screen as seen in game play. See 4. Add Random Ability Deck below for more info
+bAllowAWCAbilities=0
;These lines stop the AWC perk listed from being applied to the soldier ability deck that is generated at the beginning of the game
;+ExcludedAbilities="" ; AWC Disabled
;+ExcludedAbilities="" ; AWC Disabled
;+ExcludedAbilities="" ; AWC Disabled
;+ExcludedAbilities="" ; AWC Disabled
;+ExcludedAbilities="" ; AWC Disabled
;+ExcludedAbilities="" ; AWC Disabled
;This allows the soldier class to have bonds
+bCanHaveBonds=true
;This sets the AP received at each promotion (Hero classes get 10AP)
+BaseAbilityPointsPerPromotion=4

**Important: If you switch the AWC off you will be effectively creating a faction class and because faction classes do not receive AWC appointed perks they also do not receive the Ability Points from the AWC on promotion. You have to add below the +BaseAbilityPointsPerPromotion=4 this line...
+AbilityPointsIncrementPerPromotion=2

You can see this on the faction class templates in XcomClassData.ini. This line adds an additional 2AP per promotion and stacks the award so the amount of AP goes up in line with the promotions you gain added to the BaseAP you set in the line above.
If you don't remember to do this part then on promotion your custom class will stop gaining Ability Points so you wouldn't be able to award a perk.

I recommend using Richards Create your own Class Template mod to get started in modding.
If you are worried about creating or editing soldier class templates, or wish to play a game where you can choose abilities you want to experience, then use I'm the Commander Here by Dare
3. Add Random stat progression and additional stats to soldier
Below is an example of how to add random progression to individual stat types. Remember to keep things balanced. An alternative to small random amounts is one potentially large stat bonus at an early rank. This may help you decide what class to make that soldier for instance. Generally though I find the large bonus approach over powerful in the early game and if you miss out there is no way to recoup the loss without multiple covert action bonuses.

Adding a Random stat is done using an integer (whole number). You can make it a negative if you're insane or a large number if you're a baby.

Adding RandStatAmount=x does not mean the soldier will receive the amount, only that an amount may be added between the base stat amount and the maximum RandStatAmount you have entered. i.e - StatType=eStat_Will,StatAmount=4,RandStatAmount=6 gives 4 and upto 10 Will (4+6)

Dodge, Defence and Mobility stats have been added to the example below. Using Point Based Not Created Equal mod, or checking the default XComGameData_CharacterStats, will provide a list of other soldier stats built into the game. Warning - not every stat has a visual indicator to give the player info. I'd recommend using a mod that provides additional info if you add additional stats.

; squaddie
+SoldierRanks=(AbilitySlots=((AbilityType=(AbilityName="Example_perk1", ApplyToWeaponSlot=eInvSlot_PrimaryWeapon)), \\
(AbilityType=(AbilityName="Example_perk2", ApplyToWeaponSlot=eInvSlot_SecondaryWeapon))), \\
aStatProgression=((StatType=eStat_Offense,StatAmount=10), (StatType=eStat_HP,StatAmount=1), (StatType=eStat_Strength,StatAmount=0), (StatType=eStat_Hacking,StatAmount=0), (StatType=eStat_CombatSims,StatAmount=1), (StatType=eStat_Will,StatAmount=4,RandStatAmount=6), (StatType=eStat_Dodge,StatAmount=3,RandStatAmount=4), (StatType=eStat_Defence,StatAmount=2,RandStatAmount=1), (StatType=eStat_Mobility,StatAmount=0,RandStatAmount=1)))

**Note. At Squaddie rank you must have a Secondary Weapon ability. You need to have at least one ability for the secondary weapon so the class can function properly. Secondary weapons are how a class is given it's speciality. i.e - Sword>Ranger; Gremlin>Specialist; Launcher>Grenadier; Pistol>Sharpshooter
**Note. At Squaddie rank you must have (StatType=eStat_CombatSims,StatAmount=1), at each additional rank this can be omitted.
4. Adding random abilities to soldiers (two methods)
Use this method if you have disabled the AWC. (See section 2)

You can remove the need for the AWC perks and any potential clashes by creating one or more Random Ability Decks (RAD). These decks are use by the hero classes and you can copy the same ini structure to define one for your soldier class.

RADs can be placed on any branch of a soldier class. The base game uses them to fill XCom abilities awarded to hero classes.

They do not work at Rank 1 (Squaddie) as the game will pick the first ability listed to fill the promotion slot defined in the RAD.

By adding empty () you produce a chance that at this promotion rank nothing may be selected. The more blanks the lower the chances are of a soldier rank being populated with an ability.

RADs can be applied to any rank above Squaddie you want it to, but remember that if you haven't provided the rank with a RAD then it can not recieve an ability there.

You can have multiple RADs, to the point that each rank in the class can have a unique RAD for that rank and class.

You can share RADs across classes, for example making all sergeants in every class pick from the same RAD that is specialised for physical attributes.

Each RAD has to be named differently for the game to understand which RAD template to pick the ability from.

Here's an example of multiple RADs which can be placed above the first rank promotion line...

; Random Ability Decks to chose from each named differently
+RandomAbilityDecks=(DeckName="XComAbilitiesTemplateClass_EXAMPLCLASSa", \\
Abilities=((AbilityName="Lucu_Infantry_StaggeringShot", ApplyToWeaponSlot=eInvSlot_PrimaryWeapon), \\
(AbilityName="Deadeye", ApplyToWeaponSlot=eInvSlot_PrimaryWeapon), \\
(AbilityName="Lucu_Infantry_Harrier", ApplyToWeaponSlot=eInvSlot_Unknown), \\
(), \\
()))
+RandomAbilityDecks=(DeckName="XComAbilitiesTemplateClass_EXAMPLCLASSb", \\
Abilities=((AbilityName="Lucu_Sniper_CoverTarget", ApplyToWeaponSlot=eInvSlot_PrimaryWeapon), \\
(AbilityName="F_Recharge", ApplyToWeaponSlot=eInvSlot_PrimaryWeapon), \\
(AbilityName="F_Momentum", ApplyToWeaponSlot=eInvSlot_PrimaryWeapon), \\
(AbilityName="F_OpenFire"), \\
(AbilityName="F_Imposition"), \\
(), \\
(), \\
()))
+RandomAbilityDecks=(DeckName="XComAbilitiesTemplateClass_EXAMPLCLASSc", \\
Abilities=((AbilityName="F_Flatline", ApplyToWeaponSlot=eInvSlot_PrimaryWeapon), \\
(AbilityName="F_ThousandsToGo", ApplyToWeaponSlot=eInvSlot_PrimaryWeapon), \\
(), \\
(), \\
()))

;squaddie...(promotion lines continue here)

Understanding the inner workings
To determine how likely a soldier is to receive an ability from a RAD you need to understand that each RAD is an array. An array is built by the game taking each item listed in the RAD and placing it in order to select from. An array starts at 0 and continues to add the items listed in the RAD until it reaches the end.
Using XComAbilitiesTemplateClass_EXAMPLCLASSc there are 2 abilities named and another 3 blanks making a total of 5. the array would look like this...

0, 1, 2, 3, 4 - where...

0=(AbilityName="F_Flatline", ApplyToWeaponSlot=eInvSlot_PrimaryWeapon)
1=(AbilityName="F_ThousandsToGo", ApplyToWeaponSlot=eInvSlot_PrimaryWeapon)
2=()
3=()
4=()

Each time the game uses that array it checks the result and supplies the result to that soldier's template, then it removes the result from the next roll. In this example if the roll =1, then F_ThousandsToGo would be returned to that specific soldier's template, and on the next roll only 0, 2, 3, 4 would be available. So the first roll from the array =2 abilities form 5 available items, which =40%. The next roll =1 ability from 4 available items, which =25%

Alternatively if the first roll =3, then a blank would have been added to that soldier's template and there would be 2 abilities from 4 items, which =50%.
--- Thanks to Dare for explaining this ----

Here's an example of how to place the RAD into the soldier class...

; captain
+SoldierRanks=(AbilitySlots=((AbilityType=(AbilityName="KillZone", ApplyToWeaponSlot=eInvSlot_PrimaryWeapon)), \\
(AbilityType=(AbilityName="Quickdraw")), \\
(RandomDeckName="XComAbilitiesTemplateClass_EXAMPLCLASSb")), \\
aStat...

These examples use Divine Lucurations Infantry and Sniper mods and Favid's Extended Perk Pack, which in turn uses XModBase 2 by xylthixlm. A great example of RAD use for building a soldier completely from RAD is Alien Hunter by DerBK. Check it out.


Use this method if you have the AWC still enabled
You have the XCOM line in the promotion screen

(Using New Promotion Screen by Default to review this)
In the game soldier abilities are placed within their class template and an additional line of abilities is randomly assigned labelled XCom below the last line of the class abilities. The game selects randomly from a pool of abilities that consists of the vanilla abilities, any class mods with their abilities and any mod that adds abilities. The only time abilities are not added to the XCom pool is where the ability is specifically coded in the SDK to not be available. (AFAIK)

A work around was created in the WOTC DLC to add abilities. If you look at your XComDataClass.ini file you will see at the top the LighteningReflexes ability has been added from the Skirmisher Template.

As you scroll down the file you can see that in the Ranger and Sharpshooter templates, LighteningReflexes has been added to the Excluded Abilities list to avoid a conflict with abilities that should be used.
ExcludedAbilities=LightningReflexes" ; prevent conflict with Shadowstep

With the AWC still enabled that means all the abilities from classes you are subscribed to and activated will be added to the pool, so you will have to exclude certain abilities from the random skills pool available for certain or all class templates.

Example - Using Devine Lucubration's Sniper class, you wouldn't want 'Set-up' on say a Grenadier or Ranger. Yet this will happen as 'Set-up' is available as a cross class ability.
or...
Favids 'Watch Them Run' selected for Grenadiers, as this would potentially conflict with 'Salvo'. One allowing you to use a grenade for free as a first move (Salvo) and the other putting you into overwatch having used a grenade (Watch Them Run), making Salvo a wasted ability.
(Caveat - As the above stated, some abilities may not be available due to their coding)

Bottom line - Check and recheck that the abilities available are those you want and exclude all those that you don't. This could take some time depending on how many class mods you have.

Also remember that one ability may overwrite the functionality of other abilities.

To check which abilities are available use I'm the Commander Here by Dare. It's a great tool for real game checking.
5. Add a third branch to the Soldier ability tree
To add a third branch to a soldier class ability tree edit the SoldierRanks=(AbilitySlots= so there is a 3rd (AbilityType=(AbilityName...

example
; squaddie
+SoldierRanks=(AbilitySlots=((AbilityType=(AbilityName="Example_perk1", ApplyToWeaponSlot=eInvSlot_PrimaryWeapon)), \\
(AbilityType=(AbilityName="Example_perk2", ApplyToWeaponSlot=eInvSlot_PrimaryWeapon)), \\
(AbilityType=(AbilityName="Example_perk3", ApplyToWeaponSlot=eInvSlot_SecondaryWeapon))), \\
aStatProgression=((StatType=eStat_Offense,StatAmount=10), (StatType=eStat_HP,StatAmount=1), (StatType=eStat_Strength,StatAmount=0), (StatType=eStat_Hacking,StatAmount=0), (StatType=eStat_CombatSims,StatAmount=1), (StatType=eStat_Will,StatAmount=4,RandStatAmount=6), (StatType=eStat_Dodge,StatAmount=3,RandStatAmount=4), (StatType=eStat_Defence,StatAmount=2,RandStatAmount=1), (StatType=eStat_Mobility,StatAmount=0,RandStatAmount=1)))

Adding a blank (AbilityType=()) will result in a space at this rank on the tree. You may also find that if you do not place a blank () on the 3rd line of promotions that the game may fill it with a random ability. I've seen this happen in my own experimenting, but do not know why.

Remember that you can add a RAD to any line and at any rank. You can even have multiple RAD at the same rank. Using the same RAD will result in two abilities being pulled from that RAD.

example
+SoldierRanks=(AbilitySlots=((), (RandomDeckName="Grenadier2"), (RandomDeckName="Grenadier2")), aStatProgression=(...

If you are using a mod that has a "localization" file, like Richards Create your own class templates mod, then you'll find a XComGame.int file. Inside this will be all the player facing information for the class, it's special abilities, if any came packed, and the names of the Abiltiy Tree branches. In the base game there are 3 branches. Two have their perks defined and the third is randomised using the AWC. These lines will be named according to the class and the third line will have the name XCOM. Adding a third branch without changing the Loacalization file will result in the additional branch not displaying a name. To change this use...

+LeftAbilityTreeTitle="Ranger"
+RightAbilityTreeTitle="Assault"

+AbilityTreeTitles[0]="Ranger"

+AbilityTreeTitles[1]="YourVeryOwnSubClass"

+AbilityTreeTitles[2]="Assault"

You can also edit the class description using...

+ClassSummary="Close-Quarters-Combat and ambush specialists. Work from the shadows to scout, or run the line for maximum impact with sword and shotgun."

If you chose to add more ability lines to your soldier class I recommend using New Promotion Screen by Default mod by Tzarnal-Moonwolf. It's possible to add many lines to the game. I have no idea how many is the limit, but consider this. The UI is not designed to view more than 4 lines of abilities and you really don't need more than 4 lines to chose from. It would also take you ages to get all the ranks as they require Ability Points (AP) to buy them.
6. Finalising your class
In the above examples you will have noticed a "+" at the beginning of lines. This is required in class mods by the game to add the line into the base game at the start, when the game is preparing all the templates that are to be used. Similarly if you use "-" before a line it is removed from the game. In section 1 you can see an alternative to blocking out the soldier promotion lines.

If you do not add the "+" and "-" then the game will create the templates it needs to define the game from the original file info.

If you are tweaking the XComDataClass.ini file with the vanilla soldiers, then you don't need to place a "-" or "+" as this file is native to the game rather than being added to it. All the additional eStat and RandStat will be picked up along with the changes to abilities.

Also note that you can comment out lines using ";" at the start, but if you add ";" between matching () then you break the game reading the information within it. That includes when a line has been broken for easy editing using the "\\" which you will see with Notepad++. If you come across this in a mod delete the "; what ever info I've written here to help you out" and make certain that all the () are matched. This is one of the easiest things to overlook and will stop your hard work showing in the game.

**Note - If you ";" comment out the [Template...] in your XComClassData, hoping to avoid it loading into your game, then you're in for a shock. The game will concatenate the remaining template information into the first [Template...] it can find. That will be the Rookie template. You'll find a gremlin flying behind your character in the character pool if this happens. You'll have access to all weapons and the game will generally be junk. So don't do it!

Check; double check; debug; play the game; check again.

If you want to use a soldier ability from another mod, firstly subscribe to it, then activate it, then go to the XComClassData.ini and set the ForceDeck and NumInDeck to 0

+NumInForcedDeck=0
+NumInDeck=0

This will stop it from appearing in the game but keeps the abilities active for you to use. That also includes the GTS abilities, if any. You can also do this with the base game classes, though make sure you have something to replace them with otherwise you'll play the entire game with rookies. Now that would test your tactical mastery Commander.

If you still have issues with the custom soldiers appearing I recommend Devine Lucubrations 'Disable any class' mod.
I would also recommend using 'Point Based Not Created Equal' mod, which only affects the Rookies in the game, including the reward and black market soldiers (which will adopt your custom edits as they are auto promoted during the game).

Finally if you're feeling brave check out xylthixlm 'XModBase 2.0' to create your own abilities. A great example of what can be achieved with this mod is Favid's 'Extended Perk Pack', which many have used including yours truly.
Note - Favid forgot to add the weapon links to the ability names. If you decide to use them then check the discussion page I posted in the Extended Perk Pack to copy and paste the correct links for the ability to work with the weapon. Also remember to check that the ability works as you hope. To do this use the console command with [WOTC] Additional Soldier Console Commands by shiremct

That's it for this thrilling instalment - All spelling mistakes are intentionally placed to test your English ;)
Good luck modding Commander.
51 Comments
initium  [author] 1 Jul, 2021 @ 10:14am 
@videl.rosado

Hi. Explain a little more what you're trying to do and I'll help if I can.
Shovel-Knight-69 30 Jun, 2021 @ 10:57pm 
Hello!!!!!

I want to ass the random stat increases but as this is my first time doing so.... could I send you a picture of what I have done and you can let me know if it is correct?
initium  [author] 18 Apr, 2021 @ 9:19am 
I've sent you a friend request so we can discuss without clogging up this thread
Shadowo1f6 18 Apr, 2021 @ 4:20am 
i can train soldiers to be the class, the end up with the correct equipment/load-out, BUT they can only progress 3 ranks, can only first rank abilities, and all of the abilities are randomized. I'll admit, i have no idea whats going on anymore...
Shadowo1f6 18 Apr, 2021 @ 4:09am 
the xcomgamedata was identical, i swapped out deep cover for another ability, but that didnt work either... maybe since i have skirmisher abilities i should allow the class access to bullpups to see if that works
initium  [author] 17 Apr, 2021 @ 6:44pm 
Let me know if the conflict and the XComGameData fix the issue
initium  [author] 17 Apr, 2021 @ 6:42pm 
The XComGameData.ini should look something like this for your custom class

[XComGame.X2ItemTemplateManager]
+Loadouts=(LoadoutName="SquaddieTemplateClass01", Items[0]=(Item="Shotgun_CV"), Items[1]=(Item="Pistol_CV"))
initium  [author] 17 Apr, 2021 @ 6:37pm 
Have you defined your SquaddieLoadout in the XComGameData.ini
Without this in place your squaddie will not be armed as there is no weapons for the game to pull for your soldier build.
initium  [author] 17 Apr, 2021 @ 6:18pm 
DeepCover and EverVigilant conflict with each other. You'll see the devs add a note in the base game at "ExcludedAbilities". Makes sense as one is trying to kiss the dirt and the other is sticking its head up to return fire. The animation just wouldn't work. =)

I'll check what you have put here and get back later.
Shadowo1f6 17 Apr, 2021 @ 4:22pm 
they are base game as far as i know, the names are from a file in the guide to the same mod, i think the ambush is called waylay?

found them

-Waylay, Take as many overwatch shots as you have actions for (unless you run out of ammo)
AbilityName="SkirmisherAmbush", ApplyToWeaponSlot=eInvSlot_Unknown

-Interrupt, A powerful form of overwatch, instead of reaction fire perform any action isntead (there are restrictions)
AbilityName="SkirmisherInterrupt"

*pulled from the guide that came with the mod*