XCOM 2
186 vurderinger
Any Class Any Weapon
   
Pris
Føj til foretrukne
Gjort til foretrukken
Fjern som foretrukken
Filstørrelse:
Offentliggjort:
18.416 KB
6. feb. 2016 kl. 12:21
1 ændringsbemærkning ( vis )

Abonner for at downloade
Any Class Any Weapon

Beskrivelse
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 kommentarer
Jhonny G 29. juni kl. 3:06 
Great mod. Works very well with Tree Tier Weapons and SMG Pack.
SlimShady47 28. mar. 2022 kl. 16:18 
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 kl. 18:57 
"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
Hellbilly 13. juni 2021 kl. 11:11 
WOTC version?
☦Agent 48☦ 31. dec. 2020 kl. 7:51 
this SUU-(caugh) SUUOOLS
shardinhand 21. apr. 2020 kl. 21:22 
Any Class Any Weapon (WOTC) version?
_b1ack0ut 5. jan. 2020 kl. 10:50 
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 kl. 15:50 
Doesnt work with secondary weapons
Zacharius Sneed 23. nov. 2018 kl. 12:13 
Doesn't work for mod weapons
Zacharius Sneed 5. maj 2018 kl. 8:18 
Can you do this but for class specific weapons, like giving a grenadier a machete?