Sounds

Updated for version 3.38.

Module Definition

The module is inherited from ModuleBase. So base parameters can be found there.

This module requires SuperBLT to be installed or else the sounds will not load http://superblt.znix.xyz/

Module name

The name of the module you use as the meta of the module definition is 'Sounds' or 'SoundsModule' if _force_search is set to true in the module definition.

XML Structure

<Sounds directory prefix load_on_play unload auto_pause relative dont_store_float ...>
    <prefixes>
        <value_node value="prefix"/>
    </prefixes>
    <sound id stop_id prefix load_on_play unload auto_pause relative dont_store_float full_path ...>
    <sounds directory ...>
    </sounds>
</Sounds>

Only sound node

Only Sounds node

Both Sound and Sounds node

those values are mostly optional if defined from the sounds node, all sounds inside it will inherit the value

Example

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

<Sounds direcotry="sounds">
    <sounds directory="m4" prefix="regular">
        <sound id="m4_fire_single" path="fire.ogg"/>
        <sound id="m4_tighten" path="enter_sight.ogg"/>
        <sound id="m4_fire_single" path="fire.ogg" prefix="suppressed_a"/>
    </sounds>
</Sounds>

This replaces the m4 sounds. Due to how SuperBLT loops the sounds, you should either define use_fix in the sounds section of your custom weapon or use the autofire sound fix mod: https://modworkshop.net/mydownloads.php?action=view_down&did=20403

Extra nodes

<scan> node

Scans a directory to quickly add sounds. Useful when you have a lot of sound ids. The parameters are pretty much the same as <Sounds>.

Example:

<Sounds prefix="prefixx">
    <scan prefix="some_prefix" directory="sounds"/>
</Sounds>

These nodes below use mostly the id and prefix parameter. But, some can use more parameters such as stop_id. These nodes cannot load files so don't define paths or directories.

<queue> node

A queue of sound ids. Example:

<Sounds directory="sounds">
    <sound id="one"/>
    <sound id="two"/>
    <queue id="one_and_two">
        <sound id="one"/>
        <sound id="two"/>
    </queue>
</Sounds>

<random> node

Like <queue> but randomizes which sound to play every time. The sounds inside of it are just ids. Example:

<Sounds directory="sounds">
    <sound id="one"/>
    <sound id="two"/>
    <random id="one_or_two">
        <sound id="one"/>
        <sound id="two"/>
    </random>
</Sounds>

<stop> node

Makes a stop ID. This can be used to stop a few sounds. The sounds inside of it are just ids. Example:

<Sounds directory="sounds">
    <sound id="one"/>
    <sound id="two"/>
    <stop id="stop_my_stuff">
        <sound id="one"/>
        <sound id="two"/>
    </stop>
</Sounds>

<redirect> node

Redirects a sound id to a different sound id. You can even redirect it to a randomized or queued sound. Example:

<Sounds directory="sounds">
    <sound id="one"/>
    <redirect id="whistling_attention" to="one"/>
</Sounds>

Functions

Last updated