Weapon
Updated for version 3.38. Thanks Pawcio for pretty much all of this info. This info here is mostly based of his template.
This page is missing some information.
You should read this to understand some things about the XML files in BeardLib.
Module Definition
The module is inherited from ItemModuleBase. So base parameters can be found there.
This modules let's you add weapons.
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
Many values are optional if their based on weapon already defines them and you don't wish to change them.
<weapon id ...>
<weapon id ...>
Parameter | Type | Description |
---|---|---|
id | String | Unique ID of weapon |
name_id | String | Optional localization ID for the name of the gun. Defaults to bm_w_ |
desc_id | String | Optional localization ID for the description of the gun. Defaults to bm_w_ |
unlock_level | Number | Required reputation level to unlock |
based_on | String | ID of weapon base that the custom weapon will be based on |
weapon_hold | String | Optional parameter that is only needed if custom weapon is using incorrect hold animation - In most cases ID is same as used in based_on |
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 |
texture_bundle_folder | String | Folder to contain the icon. The path will be guis/dlcs/ |
animations | Table | A table of animation group used by custom weapon: |
CLIP_AMMO_MAX | Number | Rounds in magazine/etc |
NR_CLIPS_MAX | Number | How many magazines/etc that weapon can have. Note: Both CLIP_AMMO_MAX and NR_CLIPS_MAX are used to calculate total ammo of weapon in this case: 30 * 5 = 150 total ammo |
ammo_pickup | Number | Optional index used for ammo pickup that defines how min and max values for ammo pickup are calculated. The indices:As we said, this is optional and you can pretty much use the based on's AMMO_PICKUP. |
AMMO_PICKUP | Table | Optional value if you want to set the AMMO_PICKUP manually without using premade indices. The table needs to have 2 values in the 1st index the low number and in 2nd the high |
muzzleflash | String | Optional in-game path to muzzle flash effect |
muzzleflash_silenced | String | Optional in-game path to muzzle flash effect when suppressor is attached |
shell_ejection | String | Optional in-game path to effect used for ejecting cases |
categories | Table | Optional ategories that weapons will be present this also has effect on player weapon skills. This can be |
stats | Table | Unique stats of custom weapon. Available stats parameters and values:
|
use_data | Table | Has a value named |
fire_mode_data | Table | Has a value named |
stats_modifiers | Table | Has a value named |
sounds | Table |
|
animations | Table | Has a value named |
And any other value from WeaponTweakData. There are more that are not listed here yet
<factory id ...>
<factory id ...>
Holds more data for the weapon.
Parameter | Type | Description |
---|---|---|
id | String | Unique factory ID of weapon. Defaults to wpn_fps_ |
unit | String | Optional path to weapon base unit. Leave empty to use the based on's unit |
stock_adapter | String | Optional parameter only needed if weapon will be using AR-15 Stocks. ID = Attachment that use "stock_adapter" type and will be added to connect weapon model with AR-15 stock models. |
animations | Table | Some weapons bases use own animations table if custom weapon is missing animations check if chosen base has animations table in the weaponfactorytweakdata script. |
optional_types | Table | Types used by weapon (Currently it's not used by the game but must be defined). Each value is a string in a value_node. Types are found here |
adds | Table | Adds additional attachments to specific attachment - like rails for sights or gadgets. Contains tables that have their meta as weapon mod ids and inside of these tables are the parts you want to add when using that part |
override | Table | Allows to override data of attachments used by weapon. Contains tables that have their meta as weapon mod ids and the values of the table contains any data of a weapon mod you wish to change like |
default_blueprint | Table | List of attachments IDs (all in a value_node) the weapon has by default. Any changes to this list require to sell old gun and repurchase it |
uses_parts | Table | IDs of the parts that the gun uses. You must also include the default_blueprint parts! |
skip_thq_parts | Boolean | Used only for NPC bows |
*These are all of the values for factory
<stance/>
<stance/>
Data for the "stance" of the weapon or basically where the guns is on the screen or how much rotated it is. There's one for standing (standard), aiming (steelsight), crouching(crouched), and bipod. The module will inherit the stance of the based on weapon regardless. Example of modifying the stance:
You can get the values for position (vector3) and rotation (Rotation) using a mod called PVM Using that mod you can pretty much change the stance to your liking.
The icon
The icon will be stored in guis/dlcs/mods/textures/pd2/blackmarket/icons/weapons and will be named id
.texture then add it using AddFiles.
Template
Since this template is more complex and requires other modules (other than the usual AddFiles, Localization) You pretty much should depend on the template. Download template here
Last updated