PSA: Oh no! Valve made some voicelines mp3s! - Soundscripts and you

Discussion in 'Tutorials & Resources' started by YM, Jul 12, 2015.

  1. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,742
    If you're like me, you like using voicelines where they shouldn't be, sending PlayVO inputs to your tf_gamerules.

    Well that's all well and good, unless you were just using
    Because that's now broken. A whole bunch of voicelines (possibly all??) are now mp3s and don't play if you used this format.

    So! to counteract this, and to ensure it never breaks again we're going to look at soundscripts.
    The soundscript file you want is in the tf2_misk_dir vpk, grab your favourite vpk viewer and find scripts/game_sounds_vo.txt

    in there you'll find hundreds of entries like this:
    See how it's now an mp3? yeah, balls. But not to worry, now we've found the entry (ctrl+f the sound you want to use) just copy the name of the entry, without quotes and paste that into your output, like so:

    Now, the sound will play no matter what valve do to the filename/type. As long as they keep their soundscript updated (and they will) it'll work.


    "But YM, what if there isn't an entry I want, or what if I want to mute a default voiceline because it doesn't apply to my crazy new gamemode?" I hear you ask. Well, turns out maps can have map-specific soundscripts too. Yay!

    These follow this naming convention: <full map name>_level_sounds.txt and live in tf/maps, the same directory as your bsp. eg: tf/maps/sd_sabotage_a8_level_sounds.txt
    You can put whatever you like in there and then you can use it in your map (don't forget to pack it). If you want to mute a pesky voice line, then you can use this format:
    Here I've just copied the official Announcer.SD_RoundStart entry and snipped out the filepath line and changed the soundlevel to SNDLVL_NONE. It'll override what's in the standard one when your map is loaded, and unload it when your map is done.
    You could probably leave it blank, or just trim it down to just the soundlevel line, but I haven't tested that and cba to. This works and it's only a few bytes.


    Further reading:
    https://developer.valvesoftware.com/wiki/Soundscripts
     
    • Thanks Thanks x 11
  2. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,742
    I don't know when exactly this happened, but I was using .wav for sabotage back in February, and it's now .mp3s

    I'm guessing this is a gun mettle change

    EDIT:
    New info suggests they did it in a few batches around feb/march time. (2015 for people reading this in the future, hi, how are the hoverboards? Are the robot/alien/insect overlords good to you?)
     
    • Thanks Thanks x 1
    Last edited: Jul 12, 2015