XCOM 2
185 ratings
Any Class Any Weapon
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
18.416 KB
6 Feb, 2016 @ 12:21pm
1 Change Note ( view )

Subscribe to download
Any Class Any Weapon

Description
Allows any class, including rookies, to equip any primary weapon.


Modded classes are not supported. Here's a long reason why:

This cannot include custom classes. This isn't a script change, it's an .ini change, as it's way more compatible that way. The way this mod works is that it simply adds the relevant primary weapons to the vanilla class' equip lists.

Put simply, there no way to add conditionals that edit depending on whether or not certain content is present

You can't do something like*:

if (InfantryModActivated = 1) {
InfantryMod.CanEquipShotgunsbool = true
} else if (AssassinModActivated = 1)
Assassin.CanEquipCannonsbool = true
} else if ModCActivated = 1) {
...
...
...
} else if ModZActivated = 1) {
ModZ.CanEquipXbool = true
}

*I know weapon use isn't managed through booleans, it's just pseudocode and you get the point.

This is besides the fact that mods can't see or affect one another. This isn't skyrim, where plugins can have masters and override code unique to other plugins. Xcom 2 mods can't see one another, and if they can't see one another they certainly can't edit one another.

Now there is a way to approximate editing a mod with another mod, but only if the mod being edited changes vanilla .ini content (as this mod does) or overwrites (or extends but changes only vanilla code) an unreaclass script.

Most mods fall into this category, but class mods do not.

To use an unrealistic example, say "Mod A" changes AR damage to 6-8 and frag grenade damage to 8-10 and sword damage to 10-12. You want the AR damage but your own sword damage, and for whatever reason making a new mod of your own is the only way to do that (it's not). You change the sword damage to 14-16 and ensure "Mod B" takes priority over their mod, and boom, you have the AR damage changes plus the sword damage changes.

tl;dr two mods can edit the same vanilla content. Whichever mod has priority wins and edits dynamically. Mod B takes precedence and changes sword damage to 14-16, but the parts of Mod A that don't edit the same things as Mod B still apply, so assault rifle and frag grenade damage still exist.

Class mods obviously add new content rather than editing vanilla content, so this whole thing is rather irrelevant, but worthwhile to include for completion's sake.



So to sum everything up:

Class mods don't edit vanilla content, which causes this whole mess. If they did, I could simply edit DefaultClassData.ini and be done with it.

Because they don't edit vanilla content, I'd need to edit the class mod directly, becaues mods don't see each other. Even if I could somehow edit the class mod directly, I can't use conditionals, because again mods can't see each other. Even if I could somehow use conditionals, I can't use conditionals to change an .ini (where the vast majority of class mods externalize what weapons can be equipped). I can use conditionals to edit unrealclass scripts, but I'm not entirely sure whether or not it's possible to use conditonals to edit a separate unrealclass script that may or may not even be present. Even if it were possible, it'd require examining every single class mod's scripting individually, and frankly, ♥♥♥♥ that. Even if I did that and edited every class mods' scripting, my code still wouldn't do anything, because mods can't see each other.

Because I can't use conditionals, I'd have to brute force compatibility by adding the relevant code for every single class mod. Since mods can't see each other, there's no way to automatically detect which mod is active (read: I can't use conditionals), meaning you'd have to activate every single class mod on the nexus. But since mods can't see each other, my code would be a mess of undefined variables and wouldn't compile, unless I literally combined every class mod on the workshop and nexus into one gigantic ridiculous mod, which I can't do since that's not my creative content. Even if by an act of god my code did compile despite the many undefined variables (technically they'd be undefined sections of a larger class or ini, but I digress), because mods can't see or edit each other, that code would just sit there doing nothing.


tl;dr It's impossible to add support for class mods because mods can't see each other.


fortunately it's really really easy to manually edit what weapons a modded class can equip! In fact it's way easier to do this manually for the few class mods you, the end user, want, rather than try to include every single one.

Navigate to the class mod's mod folder (in your workshop folder if you download it off the workshop).
Do a search for AllowedWeapons. Open the relevant .ini (or ucs I suppose) and you'll see something like:

AllowedWeapons=(SlotType=eInvSlot_PrimaryWeapon, WeaponType=”rifle”)

below that line, add:
AllowedWeapons=(SlotType=eInvSlot_PrimaryWeapon, WeaponType=”shotgun”)

do the same for cannons or sniper rifles or whatever else you want, and you're set.
69 Comments
Jhonny G 29 Jun @ 3:06am 
Great mod. Works very well with Tree Tier Weapons and SMG Pack.
SlimShady47 28 Mar, 2022 @ 4:18pm 
For anyone who uses MacOS and wants to edit weapons for Skirmisher, Reaper, and Templar.

Open Terminal app. Then types this command:
cd ~/Library/Application Support/Steam/steamapps/workshop/content/268500/617733366/Config
(Note that 268500 and 617733366 might be different on your local folder. You can search for "AnyClassAnyWeapon.XComMod" file via the search bar on top-right.)

Then this command:
open .

Then Finder should show the folder. You need to edit this file "XComClassData.ini".

For example, adding this allow Reaper to use normal snipers and Vector snipers.

[Reaper X2SoldierClassTemplate]
+AllowedWeapons=(SlotType=eInvSlot_PrimaryWeapon, WeaponType="sniper_rifle")
+AllowedWeapons=(SlotType=eInvSlot_PrimaryWeapon, WeaponType="vektor_rifle")


The list of possible weapon codes are in here.
/Library/Application Support/Steam/steamapps/common/XCOM 2/XCOM2Data/xcom2-warofthechosen/xcomgame/config/defaultgamedata.ini
Comrade Pawington 13 Dec, 2021 @ 6:57pm 
"Xcom 2 mods can't see one another, and if they can't see one another they certainly can't edit one another."

i have a mod called ballistic shields that is actually changed tons by another mod, and i think their by different ppl
B33RBaron931 13 Jun, 2021 @ 11:11am 
WOTC version?
☦Agent 48☦ 31 Dec, 2020 @ 7:51am 
this SUU-(caugh) SUUOOLS
shardinhand 21 Apr, 2020 @ 9:22pm 
Any Class Any Weapon (WOTC) version?
_b1ack0ut 5 Jan, 2020 @ 10:50am 
this isn't working at all for any weapons, or any classes. I don't have mods that add weapons, or classes, and this isn't working for me
Stupei 21 Aug, 2019 @ 3:50pm 
Doesnt work with secondary weapons
Zacharius Sneed 23 Nov, 2018 @ 12:13pm 
Doesn't work for mod weapons
Zacharius Sneed 5 May, 2018 @ 8:18am 
Can you do this but for class specific weapons, like giving a grenadier a machete?