View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-12-2013 , 03:17   Re: Help! Placing custom sounds to my server
Reply With Quote #5

The problem is that clients already think they have those sounds.

I haven't tested it, but I suspect it uses the teamplay_broadcast_audio event. You can intercept this event, read its "sound" value, and broadcast a new sound manually (using SourceMod's EmitSoundToAll). Note that these sounds should have different names than the sounds they're replacing. Or be in a different directory.

The "sound" values for MvM things you've mentioned are:

"music.mvm_end_last_wave"
"music.mvm_end_mid_wave"
"music.mvm_end_tank_wave"
"music.mvm_end_wave"
"music.mvm_lost_wave"
"music.mvm_start_last_wave"
"music.mvm_start_mid_wave"
"music.mvm_start_tank_wave"
"music.mvm_start_wave"
"MVM.BombWarning"
"MVM.PlayerDied"
"MVM.TankStart"

These names are keys from the various game_sound files inside tf2_misc_dir.vpk. Specifically, from scripts/game_sounds_music.txt and scripts/game_sounds_mvm.txt. Valve uses these to store which channel, volume, pitch, soundlevel, and wave file to play in a single location. Only sounds broadcast to all players on a team are sent via teamplay_broadcast_audio... examples include the non-MvM lose and win sounds.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 06-12-2013 at 03:23.
Powerlord is offline