foobarhl / foo_quakesounds_hl2dm

[foo] bar's quakesounds_hl2dm branch
2 stars 1 forks source link

Fix headshots handling & Improve config parsing #7

Closed Adrianilloo closed 1 year ago

Adrianilloo commented 3 years ago

Hi,

Last weeks I decided to make certain changes I came with. I'm going to describe them in enough detail, also for any server admins to understand. These include:

Self-explanatory samples from my server's config:

Instead of assigning a sound directly as a value for the sound set (e.g. "standard" "file.mp3"), you need to organize the keys in the following way, listing each possible random sound as a subkey of the sound set:

"Grenade" // The event type
{
    "0" // The kill count
    {
        "standard" // The sound set
        {
            "1" "kdnnuevo/boombombazo.mp3"
            "2" "kolokonklan/xgrenadex.mp3"
        }
    }
}

Of course, the original one-liner format for a single assigned sound is still supported. Important: the randomized setups will only work when a kill count key ("0" in the example) surrounds the sound set key. Otherwise the event will be set incorrectly.

"Headshot"
{
    "standard"  "kdnnuevo/quake/boomheadshot.mp3"
    "kills"     "0,3,5"
}

In the context of the proposed changes in the PR, this setup means: play the specified HS sound when applicable at kill streaks 3 & 5 (with the unique "headshot 3" and "headshot 5" existing phrases each), and for every other kill streak with the unique "headshot" phrase (originally the "headshot 1" one).

Finally, the changes are already well tested from my server. If you want to see them in action, you can add me in Steam. I hope you like the changes!

Thank you.