You replace sound scripts with a MAPNAME_level_sounds.txt which you place in the maps folder. Open tf2_misc_dir.vpk and go to the scripts fodler. There are some text files with all the soundscripts of the game.
All announcer lines should be in game_sounds_vo.txt. There a shit tone of scripts so use the search function to get the right one. Here is an example from game_sounds_vo.txt
Code:
"Announcer.SD_OurTeamHasFlag"
{
"channel" "CHAN_VOICE2"
"volume" "1"
"pitch" "PITCH_NORM"
"soundlevel" "SNDLVL_NONE"
"rndwave"
{
"wave" "vo/announcer_sd_possession01.mp3"
"wave" "vo/announcer_sd_possession16.mp3"
"wave" "vo/announcer_sd_possession21.mp3"
"wave" "vo/announcer_sd_possession24.mp3"
}
}
Looks like it's the script for the special delivery mode, it randomly plays one out of four voice lines of the announcer when your team gets the flag. If you want to replace that because you are making some custom special delivery mode then you have to copy this script into your own MAPNAME_level_sounds.txt.
the part with "rndwave" is what you are going to edit. Create a custom sound file that is supposed to play instead and name it differently and it instert it in the script.
For example, I now created with a text-to-speach programm a voice saying "our team has the banana basket" or something like that and save the mp3 to tf/sounds/lampenpam/vo_banana_get.mp3 then I'd have to change the script to:
Code:
"Announcer.SD_OurTeamHasFlag"
{
"channel" "CHAN_VOICE2"
"volume" "1"
"pitch" "PITCH_NORM"
"soundlevel" "SNDLVL_NONE"
"wave" "lampenpam/vo_banana_get.mp3"
}
As you can see I used "wave" instead of "rndwave" because It doesn't need to select a file at random, but of course you can do it similar to the original script if you want to play a random file.
Now while playing the map with the name of your level_sounds.txt file, the voice lines for the team grabing the flag in SD is replaced with my custom file. It's important that you don't change the name of the scripts (in this case the "Announcer.SD_OurTeamHasFlag") so it replaces the right sound.
But you can add custom scripts (with a new custom name) to your level_sounds.txt too. You can play them with an ambient_generic by specifiying the name of the sound script but that's only usefull if you have a script with randomly selected sound files.