Weapon Mod
Updated for version 3.38.
This page is missing some information.
Module Definition
The module is inherited from ItemModuleBase. So base parameters can be found there.
This modules let's you add weapon aprts.
Module name
The name of the module you use as the meta of the module definition is 'WeaponMod' or 'WeaponModModule' if _force_search
is set to true in the module definition.
XML Structure
<WeaponMod ...>
<WeaponMod ...>
Parameter | Type | Description |
---|---|---|
id | String | The ID of the part |
based_on | String | An ID of an existing weapon part you want to base your part on. Full list here https://modworkshop.net/wiki.php?action=view&id=3 |
type | String | The type of the part. Can be: |
sub_type | String | The sub type of the part. Like a silencer is a barrel extension (barrel_ext) and a supressor. The types: |
ver | Number | The version of the module. Version 2 should be used now. It does the following: Defaults pcs to an empty table (use hidden=true to hide parts!) and makes guess_unit default to true |
guess_unit | Boolean | Guesses the unit for you. The resulted unit will be "units/mods/weapons/ |
wpn_pts | String | Like |
global_value | String | For packs of mods, a global id assigned to all. A nice way to label your mods. You'll still have to create the global value through GlobalValueModule |
override | Table | Overrides data of other attachments when this attachments in added to weapon |
adds | Table | List of additional attachments added with this attachment |
forbids | Table | List of attachments that can't be used with this attachments. Note. If attachment on list is currently on weapon it will be removed after adding this attachment |
weapons | Table | A table of weapon ids (factory ids) that the weapon part can be added to |
weapons_override | Table | A table of weapons and the override they should have for the part |
parts_override | Table | A table of weapon mods and the override they should have for the part |
parts_forbids | Table | A table of weapon mods ids that can't work with the part |
unit | String | Optional path to the first person unit. Defaults to units/mods/weapons/ |
third_unit | String | Optional path to the third person unit. You usually don't need a third person unit for weapon parts |
stance_mod | Table | A table of weapon ids -> translation and rotation. Usually used by sights to set a custom stance for the weapon mod (Lets you align the weapon with the sight to the center of the screen) |
name_id | String | Localization ID for the title (Defaults to bm_wp_ + |
texture_bundle_folder | String | Folder to contain the icon. The path will be guis/dlcs/ |
is_a_unlockable | Boolean | Makes the item unlockable. Defaults to true |
droppable | Boolean | Makes the item droppable through the end screen cards. Defaults to true |
stats | Table | Stats added by attachment. Note, adding stats group wont remove other stats that are copied from based_on. If you want remove copied stats from such attachments use value 0 (Example damage="0").Available stats parameters and values: |
perks | String/Table | A string or a table of perks that the part adds |
a_obj | String | Name of the bone used by the attachment |
dlc | String | An optional DLC for the part. Defaults to "mods". Unless you know what you're doing, don't change this |
sound_switch | String | Changes firing sound prefix |
And any other tweakdata value. There are more that are not listed here yet.
The icon
The icon will be stored in guis/dlcs/mods/textures/pd2/blackmarket/icons/mods and will be named id
.texture then add it using AddFiles.
Example
This example is what you would put inside your main node within your mod config
This will add another saw blade to the saw. Based on an existing saw blade. You will still need to localize the title of the part. In this case bm_wp_wpn_part_YOUR_PART_NAME
will need to be localized using LocalizationModule. And add unit, object, material_config, textures and icon through AddFiles Thankfully shortcuts make it easier:
Template
Download template (sight) here
Last updated