I wanted to experiment with some very specific attachment ideas that wouldn't fit in any other category, other than maybe boosts. I don't want to spoil it, but it would be very cool.
I don't want it to use the "Extra" category, as then it could prevent certain weapon attachments that I would like available in tandem with the WIP attachments.
I need to know how to make a new attachment category for weapons, and new attachments to go into them. Model work NOT required. Thanks!
The gadget attachment position is (literally) a copypasta from Pawcio. But the same principle applies for any new category of attachments.
You can name the category whatever you want, you just need to make sure you define its category in a localization file so it shows up.
For example, take this weapon mod with the category "magazine_holder". This is a cosmetic attachment that allows you to attach a space cosmetic magazine to the gun.
(There is more data to this attachment but I stripped it down to just the ID and the type for the sake of giving an example).
Spoiler!
<WeaponMod id="wpn_fps_ass_sleepo_beepo_magazine_holder" type="magazine_holder" ver="2">
</WeaponMod>
This would be its corresponding category I need to define in the localization. The left side is the category name that needs to match with type="whatever", the right is the name that will appear in the menu.
Spoiler!
"bm_menu_magazine_holder" : "Magazine Holster",
"bm_menu_magazine_holder_plural" : "Magazine Holsters",
Set the unit to payday 2's existing dummy unit that's just blank/invisible. You can either do this in the weapon mod itself or by forcibly overriding a weapon mod's unit to use the dummy part.
Spoiler!
<WeaponMod id="wpn_fps_pis_mk23_socom_irons" based_on="wpn_fps_pis_p226_o_standard" parent="barrel" a_obj="a_rds" type="sight" unit="units/payday2/weapons/wpn_upg_dummy/wpn_upg_dummy" hidden="true" ver="2">
</WeaponMod>
Spoiler!
<WeaponMod id="wpn_fps_smg_peacekeepermk1_receiver_lower" based_on="wpn_fps_m4_lower_reciever" type="lower_reciever" unit="units/mods/weapons/wpn_fps_smg_peacekeepermk1_pts/wpn_fps_smg_peacekeepermk1_receiver_lower" hidden="true" ver="2">
<override>
<wpn_fps_m4_uupg_fg_rail_ext unit="units/payday2/weapons/wpn_upg_dummy/wpn_upg_dummy" />
<wpn_fps_addon_ris unit="units/payday2/weapons/wpn_upg_dummy/wpn_upg_dummy" />
</override>
</WeaponMod>
Make sure the "based_on=whatever" is a real vanilla weapon mod or you'll crash upon equipping the gun.
pretty sure you can just use a type that isn't present in vanilla. ive seen it done a few times (like how RJC9000 has a couple of guns with a gadget placement attachment something that im pretty certain isn't around in vanilla) but i don't know enough lua to circumvent the error message on the name
obligatory beardlib weapon mod module link here