Closed MAGNAT2645 closed 3 years ago
Check this out https://forums.alliedmods.net/showthread.php?p=2260519
I just remembered that this can be done with Stripper:Source or newer analogue - Level KeyValues: Stripper which requires Level KeyValues and More ADTs.
For example, map vsh_merry_city_v2 has few ambient_generics (they're not server-wide), you can disable Jingle Sound (which plays near some door i believe) like this: addons/stripper/maps/vsh_merry_city_v2.cfg
remove:
{
"targetname" "Door Jingle"
"classname" "ambient_generic"
"message" "xmas/store jingle.mp3"
}
modify:
{
match:
{
"targetname" "Door Trigger"
"classname" "trigger_multiple"
}
delete:
{
"OnStartTouchAll" "Door Jingle,PlaySound,,0,-1"
}
}
If map has soundscapes for music then you can replace soundscape's sound with null i believe or just remove soundscape (and its triggers) entirely.
So i made Stripper config for vsh_megaman. addons/stripper/maps/vsh_megaman6_rc1.cfg
modify:
{
match:
{
"OnStart" "sound_fix,Trigger,,0,-1"
}
delete:
{
"OnStart" "sound_fix,Trigger,,0,-1"
}
}
modify:
{
match:
{
"classname" "team_control_point_round"
}
delete:
{
"OnStart" "fla_bgm,PlaySound,,1,-1"
"OnStart" "kni_bgm,PlaySound,,1,-1"
"OnStart" "cen_bgm,PlaySound,,1,-1"
"OnStart" "tom_bgm,PlaySound,,1,-1"
"OnStart" "bli_bgm,PlaySound,,1,-1"
"OnStart" "win_bgm,PlaySound,,1,-1"
"OnStart" "pla_bgm,PlaySound,,1,-1"
"OnStart" "yam_bgm,PlaySound,,1,-1"
}
}
modify:
{
match:
{
"classname" "tf_gamerules"
}
delete:
{
"OnWonByTeam1" "sound_fix,Trigger,,0,-1"
"OnWonByTeam2" "sound_fix,Trigger,,0,-1"
}
}
remove:
{
"classname" "logic_relay"
"targetname" "sound_fix"
}
remove:
{
"classname" "ambient_generic"
"targetname" "/.{3}_bgm/"
}
Didn't test in game but this config actually removes any ambient_generic with bgm attached to them (checked via stripper_dump).
Description
Some cool maps (like vsh_megaman) have built-in music (via soundscape or ambient_generic, i believe). I think it's possible to somehow stop map music (or even disable it) for clients.
Applications
First of all, we don't want to disable whole map ambient so we can create something like configuration table so if map has targetname for sound entities we can put these names to our table and do something only with these entities. I think there's a way to do it using FindEntityByClassname and then just accept inputs like StopSound or even Kill.
Code Snippet
Other Information