Melee
Updated for version 3.38.
Module Definition
The module is inherited from ItemModuleBase. So base parameters can be found there.
This modules let's you add melee weapons.
Module name
The name of the module you use as the meta of the module definition is 'Melee' or 'MeleeModule' if _force_search
is set to true in the module definition.
XML Structure
<Melee ...>
<Melee ...>
Parameter | Type | Description |
---|---|---|
id | String | The ID of the melee weapon |
based_on | String | An ID of an existing melee you want to base your melee on. Defaults to |
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 |
unit | String | Optional path to the first person unit Defaults to units/mods/weapons/wpn_mel_ |
third_unit | String | Optional path to the third person unit. Mostly not needed with 3.38 and above |
name_id | String | Localization ID for the title (Defaults to bm_melee_ + |
unlock_level | Integer | Have a level in which the melee will become available (1 to 100) |
type | String | Optional type of the melee. Defaults to based on melee's one |
stats | Table | Optional table that holds stats of the melee weapon. |
sounds | Table | Optional table of sounds. There are 5 keys and each has a value for the sound. |
align_objects | Table | Optional table that is used to align the melee in specific hands or in both. Most melee weapons place it on "a_weapon_right". To place it on both you need both sides. "a_weapon_left" and "a_weapon_right". This is mostly not important if you based on already does that for you. |
anim_global_param | String | Optional animation group for the melee |
melee_repeat_expire_t | Number | Number of seconds to retract the melee back when swinging/hitting with it |
expire_t | Number | Time it takes until the melee weapon is put away after using it |
repeat_expire_t | Number | Time it takes to attack again (without putting away the melee weapon) |
melee_damage_delay | Number | Time it takes until the melee deals damage after using it |
<vr locked><offsets>...</offsets></vr>
<vr locked><offsets>...</offsets></vr>
Optional settings for VR
Parameter | Type | Description |
---|---|---|
locked | Boolean | Lock the melee from being used in VR. This may be because it doesn't support it well |
offsets | Table | A table of offsets for the melee in VR. Should look like this: |
offsets_npc | Table | Same thing as |
And any other tweakdata value. There are more that are not listed here yet.
The icon
The icon will be stored in guis/textures/pd2/blackmarket/icons/melee_weapons (unless you use texture_bundle_folder) and will be named id
.texture then add it using AddFiles.
Yep, pretty long path. Thanks Overkill.
Example
This example is what you would put inside your main node within your mod config
This will add the melee captains_shield
, which is based on the briefcase. You will still need to localize the title and description of the material. In this case bm_melee_captains_shield
and bm_msk_troll_dallas_desc
will need to be localized using LocalizationModule. And add unit, object, material_config, textures and icon through AddFiles
Template
Download template here
Last updated