BeardLib
  • Home
  • Things to Know
    • Adding Files
    • ScriptData
  • Modules
    • Achievements
    • Add Files
    • Adding your own modules
    • AssetUpdates (Mod Updates)
    • Classes
    • Contact (contractors)
    • Crime Spree Mission
    • DLC
    • Dependencies
    • Elements
    • Global Value (Tagging weapons/etc)
    • Heist Music
      • Stealth Music
    • Hooks
    • Interactions
    • Keybind
    • Level
    • Localization
    • Mask Material
    • Mask Pattern
    • Mask
    • Melee
    • Menu Music
    • Menu
    • ModuleBase
    • Narrative
    • Options
    • Package
    • Script Mods (Replace script data)
    • Sounds
    • Tweak Modify
    • Weapon Mod
    • Weapon Skin
    • Weapon
    • XML
  • API
    • BeardLib Class
    • Constants
    • File Manager
    • Frameworks
    • Hooks
    • ModCore
    • Package Manager
    • Special Hook IDs
  • Utilities
    • FileIO
    • Input
    • Main
    • Math
    • Menu Helper Plus
    • Path
    • String
    • Sync
    • Table
    • Tweak Data Helper
    • XML
    • YAML
  • MenuUI
    • ComboBox
    • ImageButton
    • Item
    • Items
    • Keybind
    • Menus
    • Slider
    • TextBox
    • Toggle
Powered by GitBook
On this page
  • Module Definition
  • Module name
  • XML Structure
  • Example

Was this helpful?

Edit on GitHub
  1. Modules

Melee

PreviousMaskNextMenu Music

Last updated 3 years ago

Was this helpful?

Updated for version 3.38.

Module Definition

The module is inherited from . 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 id global_value unit third_unit .../>

<Melee ...>

Parameter
Type
Description

id

String

The ID of the melee weapon

based_on

String

global_value

String

unit

String

Optional path to the first person unit Defaults to units/mods/weapons/wpn_mel_id/wpn_mel_id

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_ + id)

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.min_damage Minimum damage of the melee. The in-game damage is the value * 10. So 30 damage is 3. This damage logic applies to many damage values in the gamemax_damageMaximum damage of the meleemin_damage_effectA number that gets multiplied by min_damage and the result of it is the minimum knockdown value.max_damage_effectA number that gets multiplied by max_damage and the result of it is the maximum knockdown value.charge_time Seconds to charge the melee fully.range Range of the melee weaponconcealment Concealment of the melee.

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>

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 position="0 0 0" rotation="Rotation(0,0,0)"/> or <offsets><left position="0 0 0" rotation="Rotation(0,0,0)"/> <right position="0 0 0" rotation="Rotation(0,0,0)"/></offsets> To have specific offsets for hands

offsets_npc

Table

Same thing as offsets just for npc variants of the melee

And any other tweakdata value. There are more that are not listed here yet.

The icon

Example

<Melee id="captains_shield" based_on="briefcase" global_value="captains_shield"/>

Template

An ID of an existing melee you want to base your melee on. Defaults to kebar. Full list here

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

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 . Yep, pretty long path. Thanks Overkill.

This example is what you would put inside your main node within your

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 . And add unit, object, material_config, textures and icon through

Download template

ItemModuleBase
AddFiles
mod config
LocalizationModule
AddFiles
here
https://modworkshop.net/wiki.php?action=view&id=7#Melee
GlobalValueModule