XCOM 2
34 ratings
Dedicated Pistol Slot 2.0 - A Configuration Guide
By Veehementia
A guide built to help users understand the configuration method used in Dedicated Pistol Slot 2.0
   
Award
Favorite
Favorited
Unfavorite
Introduction
Hello!

This guide aims to be a quick reference for users to understand the new and improved configuration method used in Dedicated Pistol Slot 2.0, as well as providing examples and warnings on both how to and how to not configure the mod.

You can download Dedicated Pistol Slot 2.0 here.
Info, General Syntax and Parameters
INFO

You can find Dedicated Pistol Slot 2.0's configuration file here:

(Your Steam Installation Folder)\steamapps\workshop\content\268500\1705464884\Config\XComPistolSlot.ini

For those who want to manually redirect abilities to use the correct slot, the exact slot used by Dedicated Pistol Slot 2.0 is:

eInvSlot_Pistol

GENERAL SYNTAX

Dedicated Pistol Slot 2.0 introduces different methods for both granting a slot and deciding what is allowed to be equipped in it.

The general syntax used in the configuration file is:

+ADD_SLOT=(SOLDIER_CLASS="", SOLDIER_ABILILTY="", WEAPON_CAT="", TEMPLATE_NAME="", ALLOW_EMPTY=)


PARAMETERS

The various parameter's definitions are:
  • SOLDIER_CLASS
    Determines which soldier class is going to receive the pistol slot. You can find all the classes' names in XComClassData.ini. Custom classes will have their own custom XComClassData.ini placed inside their mod folder, so go check that to get the class name. For example:
    SOLDIER_CLASS="Rookie"
    A special note for RPGO Users: RPGO does not use the conventional class methods used by the game. Instead, it forces all soldier to be one singular class - "UniversalSoldier".
    Keep in mind that granting a slot to the UniversalSoldier class will thus grant one to every single soldier in the barracks, regardless of his specializations.

  • SOLDIER_ABILITY
    Determines which ability is going to grant a soldier the pistol slot. This is similar to how 1.0 operated, but in reverse: the pistol slot will be granted to whatever soldier has the appropriate ability, regardless of class (unless previously specified). For example:
    SOLDIER_ABILITY="SwordSlice"

  • WEAPON_CAT
    Determines which weapon category is going to be allowed to be equipped by the slot. For example, to make it possible to equip Autopistols, you're going to have to use
    WEAPON_CAT="sidearm"
    since the Autopistol category in the game's files is "sidearm".

  • TEMPLATE_NAME
    Determines which specific template is going to be allowed to be equipped by the slot. This can also include non-weapon items, such as the Hacker Laptop from the Iridar's System Inflitration 2.1 mod. For example (template name taken from Iridar's System Inflitration 2.1 mod):
    TEMPLATE_NAME="IRI_HackerLaptop"

  • ALLOW_EMPTY
    Determines whether or not the slot can be empty. When set to false, the slot will not be able to be empty, and will always reattempt to equip the best infinite weapon available between those that share the category you specified in WEAPON_CAT. It is worth noting that this won't make Gatecrasher Rookies have a pistol, but it will auoequip one once you rank them up to Squaddie. Set it to true to allow the slot to be empty. For example:
    ALLOW_EMPTY=false

Reminder: TEMPLATE_NAME and WEAPON_CAT are mutually exclusive! This means you can't add both to the same line; if you do so, this won't work as expected!
Input Priority, Unique Slots and Dynamic Changes
INPUT PRIORITY

It's important to know that you cannot input multiple instances of the same parameter. For example:

+ADD_SLOT=(SOLDIER_CLASS="Specialist", SOLDIER_CLASS="Ranger", WEAPON_CAT="pistol", ALLOW_EMPTY=false)

This will give the slot only to Rangers, because that's the last class specified. To give it to both Rangers and Specialists, simply split the entry in two:

+ADD_SLOT=(SOLDIER_CLASS="Specialist", WEAPON_CAT="pistol", ALLOW_EMPTY=false) +ADD_SLOT=(SOLDIER_CLASS="Ranger", WEAPON_CAT="pistol", ALLOW_EMPTY=false)

This is valid for all parameters, meaning you can't specify more than one SOLDIER_CLASS, one SOLDIER_ABILITY, one WEAPON_CAT per entry. This also means that, should you want to add multiple WEAPON_CATs to the same class, you will have to split the entry in whatever number of categories you wish to add. The same is valid with SOLDIER_ABILITIES.

It's also important to notice that the order with which you give the slots will matter in terms of their interaction with each other. In case there are multiple entries regarding the same class/ability, and all of them have ALLOW_EMPTY=false, the last item specified will be used by the default autoequip functionality. For example:

+ADD_SLOT=(SOLDIER_CLASS="Ranger", WEAPON_CAT="pistol", ALLOW_EMPTY=false) +ADD_SLOT=(SOLDIER_CLASS="Ranger", WEAPON_CAT="sidearm", ALLOW_EMPTY=false)

The Ranger will be able to equip both a Pistol and an Autopistol, but should you try to remove an item from the slot, the game will always automatically try to re-equip an Autopistol.


UNIQUE SLOTS

Differently from 1.0, the slots added by Dedicated Pistol Slot are now configurable on per-slot basis, rather than with global values. This means that every entry in the configuration file (and therefore every slot added) has its own unique list of allowed items and/or weapons.

For example:

+ADD_SLOT=(SOLDIER_CLASS="Specialist", WEAPON_CAT="pistol", ALLOW_EMPTY=false)

This entry allows every Specialist class to have a Dedicated Pistol Slot and to be able to equip a Pistol in it. Let's say I also want every Ranger class to have a slot and equip pistols in it. The entry would then become:

+ADD_SLOT=(SOLDIER_CLASS="Specialist", WEAPON_CAT="pistol", ALLOW_EMPTY=false) +ADD_SLOT=(SOLDIER_CLASS="Ranger", WEAPON_CAT="pistol", ALLOW_EMPTY=false)

Now, let's say that I want the Ranger class in particular to be able to choose between equipping Pistols or Autopistols in its slot, while keeping the Specialist restricted to only equipping pistols. The entries would now become:

+ADD_SLOT=(SOLDIER_CLASS="Specialist", WEAPON_CAT="pistol", ALLOW_EMPTY=false) +ADD_SLOT=(SOLDIER_CLASS="Ranger", WEAPON_CAT="pistol", ALLOW_EMPTY=false) +ADD_SLOT=(SOLDIER_CLASS="Ranger", WEAPON_CAT="sidearm", ALLOW_EMPTY=false)

By adding a third ADD_SLOT entry, I tell the mod to allow the weapon category "sidearm" to be equipped in the Ranger's specific slot. And since we specified to that slot to also allows Pistols in it, this means our Rangers will be able to choose between the two weapon categories in the Armory.

Inputting a SOLDIER_ABILITY parameter after a SOLDIER_CLASS parameter will give the slot only to soldiers who satisfy both requirements. For example:

+ADD_SLOT=(SOLDIER_CLASS="Specialist", SOLDIER_ABILITY="Combat_Protocol", WEAPON_CAT="pistol", ALLOW_EMPTY=false)

Will grant the slot ONLY to soldier who satisfy both requirements, which means that they are Specialists with the Combat Protocol ability. Of course, you can still tie the slot to a singular ability if you so desire:

+ADD_SLOT=(SOLDIER_CLASS="Specialist", SOLDIER_ABILITY="Combat_Protocol", WEAPON_CAT="pistol", ALLOW_EMPTY=false) +ADD_SLOT=(SOLDIER_ABILITY="Combat_Protocol", WEAPON_CAT="sidearm", ALLOW_EMPTY=false)

This entries will make it so:
  • All Specialists with the Combat Protocol ability will receive the slot and be able to equip pistols in it.
  • Any soldier with the Combat Protocol ability will receive the slot and be able to equip Autopistols in it. This will include Specialists.
  • All Specialists without the Combat Protocol ability will not receive the slot at all.


DYNAMIC CHANGES

Using this principles, we can use the config entries to dynamically update the slot's equippable content depending on soldier's ability and class. For example, if I want my Specialist to have a pistol slot, and equip pistols in it, the line would simply be:

+ADD_SLOT=(SOLDIER_CLASS="Specialist", WEAPON_CAT="pistol", ALLOW_EMPTY=false)

Let's say I'm playing using Iridar's System Inflitration 2.1 mod, which adds an equippable hacking laptop that increases the Hack stat, and I want my soldiers that have Haywire Protocol to also be able to equip it in the pistol slot. The configuration would then become:

+ADD_SLOT=(SOLDIER_CLASS="Specialist", WEAPON_CAT="pistol", ALLOW_EMPTY=false) +ADD_SLOT=(SOLDIER_ABILITY="Haywire_Protocol", TEMPLATE_NAME="IRI_HackingLaptop", ALLOW_EMPTY=false)

This config entries achieve three things:
  • Every Specialist will receive the slot and be able to equip a Pistol in it;
  • Every non-Specialist soldier that has the Haywire Protocol ability will receive the slot and be able to equip a Hacking Laptop in it;
  • Every Specialist with the Haywire Protocol ability will receive the slot and able to equip both a Pistol and a Hacking Laptop.

If we instead wanted only the Specialists able to use Haywire Protocol to be able to equip the Hacking Laptop (and not just any soldier with the Haywire Protocol ability), the configuration would then become:
+ADD_SLOT=(SOLDIER_CLASS="Specialist", WEAPON_CAT="pistol", ALLOW_EMPTY=false) +ADD_SLOT=(SOLDIER_CLASS="Specialist", SOLDIER_ABILITY="Haywire_Protocol", TEMPLATE_NAME="IRI_HackerLaptop", ALLOW_EMPTY=false)

This config entries achieve two things:
  • Every Specialist will receive the slot and be able to equip a Pistol in it;
  • Every Specialist with the Haywire Protocol ability will receive the slot and able to equip both a Pistol and a Hacking Laptop.
This means that every non-Specialist soldiers with the Haywire Protocol ability will not be able to equip the Hacking Laptop.
Exclusion List
If you have an item that would normally fit your DPS configuration criteria but that you don't want appearing in your slot, you can use the "ITEM_TEMPLATE_EXCLUDED" entry in the configuration file. Using that, you can specify the template name(s) of any single item you don't want to be able to equip inside the DPS. For example, if I wanted to allow all pistols in the slot but the Beam Pistol, I would simply have to add the entry

+ITEM_TEMPLATES_EXCLUDED="Pistol_BM"

to the configuration file to ban all Beam Pistols from being equipped in the slot, globally. To ban multiple items, simply repeat the line for each item you intend to exclude.

This functionality was asked (and the relevant code provided) by FearTheBunnies. All credits go to them for the idea and the implementation.
Conclusion
And that's a wrap! This is all you'll need to know in order to properly configure and use the Dedicated Pistol Slot.
If you still need help or have a question, leave it in the comments below, and I'll do my best to answer!

Also, I'd like to use this space to give a special thank to Iridar, who not only taught me everything I know about modding XCOM 2, but has also helped me countless times and has given me valuable input and instructions for nearly every mod I made. Thank you, truly.

And of course, the modding community in general, especially the Team CX group! You guys are awesome, don't stop making the coolest-looking mods the Workshop has ever seen!

Good luck, Commanders.
103 Comments
Veehementia  [author] 26 Sep @ 5:58am 
@Povuh is "travellight" an infinite item? The mod searches only for infinite items, as it is written in the guide.
Povuh 25 Sep @ 11:25am 
Hi, I thought I understood that part correctly, but maybe I'm missing something.

Travellight was already at the bottom of the list so it would take priority.

I've tried setting the allow_empty to false for all the other categories for that class as well, but that doesn't seem to make a difference.

I disabled all other mods and removing all the config from the proficiency pistol slot plugin so this is the only thing left, but it's still defaulting to claymore in the sidearm slot for the class:

[WOTC_PistolSlot.X2StrategyElement_WOTC_PistolSlot]

+ADD_SLOT=(SOLDIER_CLASS="WOTC_APA_Medic", WEAPON_CAT="pistol", ALLOW_EMPTY=false)
+ADD_SLOT=(SOLDIER_CLASS="WOTC_APA_Medic", WEAPON_CAT="psiamp", ALLOW_EMPTY=false)
+ADD_SLOT=(SOLDIER_CLASS="WOTC_APA_Medic", WEAPON_CAT="combatknife", ALLOW_EMPTY=false)
+ADD_SLOT=(SOLDIER_CLASS="WOTC_APA_Medic", WEAPON_CAT="claymore", ALLOW_EMPTY=false)
+ADD_SLOT=(SOLDIER_CLASS="WOTC_APA_Medic", WEAPON_CAT="travellight", ALLOW_EMPTY=false)
Veehementia  [author] 25 Sep @ 9:57am 
@Povuh Read the guide, it's under "Input Priority"
Povuh 25 Sep @ 9:07am 
Hi, I've been trying to make the allow_empty=False logic work, so that removing the equipped item makes it equip a specific item by default.

For some reason I can't get it to work. Once I set allow_empty to false on travellight (profiency pistol mod), it equips the claymore by default instead. If I remove the claymore line it equips the pistol.

Any idea if I'm doing something wrong? How I can make travellight (or any other item) work as the default? My settings look like this for the proficiency medic:

+ADD_SLOT=(SOLDIER_CLASS="WOTC_APA_Medic", WEAPON_CAT="pistol", ALLOW_EMPTY=true)
+ADD_SLOT=(SOLDIER_CLASS="WOTC_APA_Medic", WEAPON_CAT="psiamp", ALLOW_EMPTY=true)
+ADD_SLOT=(SOLDIER_CLASS="WOTC_APA_Medic", WEAPON_CAT="combatknife", ALLOW_EMPTY=true)
+ADD_SLOT=(SOLDIER_CLASS="WOTC_APA_Medic", WEAPON_CAT="claymore", ALLOW_EMPTY=true)
+ADD_SLOT=(SOLDIER_CLASS="WOTC_APA_Medic", WEAPON_CAT="travellight", ALLOW_EMPTY=false)
Epic Dovahkiin 2 Sep @ 8:42pm 
how do you find weapon categories in the game files?
Veehementia  [author] 28 Aug, 2023 @ 6:55pm 
@fallenscion If you want a vest slot, use the vest slot mod.
fallenscion 28 Aug, 2023 @ 7:18am 
If I want to implement a vest slot, would the syntax be Template_name="defense"?
Veehementia  [author] 12 Jun, 2023 @ 11:16pm 
@Zigg Price For your first question, theoretically it should work, though I can't guarantee anything since I never tried it.
As per your second question, AFAIK Katanas and Axes are simply sword templates, and as such are included when you give access to the Sword archetype.
Zigg Price 12 Jun, 2023 @ 7:50pm 
Also, not necessarily something to do with the mod, but more general knowledge...since I put "Sword", will that also catch "Katana" and "Axe" from their respective mods? Not sure if they create whole new templates, or if they are just swords with a different name and stats.
Zigg Price 12 Jun, 2023 @ 7:50pm 
+ADD_SLOT=(SOLDIER_ABILITY="CarryUnit", TEMPLATE_NAME="pistol", ALLOW_EMPTY=True)
+ADD_SLOT=(SOLDIER_ABILITY="CarryUnit", TEMPLATE_NAME="sidearm", ALLOW_EMPTY=True)
+ADD_SLOT=(SOLDIER_ABILITY="CarryUnit", TEMPLATE_NAME="ArcThrower", ALLOW_EMPTY=True)
+ADD_SLOT=(SOLDIER_ABILITY="CarryUnit", TEMPLATE_NAME="CombatKnife", ALLOW_EMPTY=True)
+ADD_SLOT=(SOLDIER_ABILITY="CarryUnit", TEMPLATE_NAME="Holotargeter", ALLOW_EMPTY=True)
+ADD_SLOT=(SOLDIER_ABILITY="CarryUnit", TEMPLATE_NAME="SawedOffShotgun", ALLOW_EMPTY=True)
+ADD_SLOT=(SOLDIER_ABILITY="CarryUnit", TEMPLATE_NAME="Sword", ALLOW_EMPTY=True)
+ADD_SLOT=(SOLDIER_ABILITY="CarryUnit", TEMPLATE_NAME="HackerLaptop", ALLOW_EMPTY=True)
+ADD_SLOT=(SOLDIER_ABILITY="CarryUnit", TEMPLATE_NAME="psiamp", ALLOW_EMPTY=True)