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

YM

LVL100 YM
aa
Dec 5, 2007
7,135
6,056
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
<output> | tf_gamerules | PlayVO | vo/announcer_begins_1sec.wav |
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:
"Announcer.RoundBegins1Seconds"
{
"channel" "CHAN_VOICE2"
"volume" "VOL_NORM"
"pitch" "PITCH_NORM"

"soundlevel" "SNDLVL_NONE"

"wave" "vo/announcer_begins_1sec.mp3"
}
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:

<output> | tf_gamerules | PlayVO | Announcer.RoundBegins1Seconds |
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:
"Announcer.SD_RoundStart"
{
"channel" "CHAN_VOICE2"
"volume" "1"
"pitch" "PITCH_NORM"
"soundlevel" "SNDLVL_NONE"
}
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
 

YM

LVL100 YM
aa
Dec 5, 2007
7,135
6,056
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?)
 
Last edited: