Need Help With Element Generated Sound
Quote from Tmast98 on October 15, 2013, 10:35 pmHey,
Does anyone know how to make the elements of a chamber, specifically funnels and light bridges, play custom or stock sounds like they do in co-op and single player? I know it has to do with the game_sounds_music_a1-4.txt. I don't know though how to edit them to fit what I want them to do.
Any help would be appreciated on this, as music is being designed for a chamber I'm making to be used specifically for the bridges and funnels to play as they do in game, and I don't want the songwriters efforts to go to waste, since I know it has to be possible somehow.
Thanks for the help,
Tmast98
Hey,
Does anyone know how to make the elements of a chamber, specifically funnels and light bridges, play custom or stock sounds like they do in co-op and single player? I know it has to do with the game_sounds_music_a1-4.txt. I don't know though how to edit them to fit what I want them to do.
Any help would be appreciated on this, as music is being designed for a chamber I'm making to be used specifically for the bridges and funnels to play as they do in game, and I don't want the songwriters efforts to go to waste, since I know it has to be possible somehow.
Thanks for the help,
Tmast98
Quote from srs bsnss on October 16, 2013, 7:24 amIt's certainly possible by editing the relevant soundscript and putting in your custom sounds and map name, but I personally wouldn't know how to do that. I've only ever worked with the default TBeam music by tricking the game into thinking it was an A4 map.
It's certainly possible by editing the relevant soundscript and putting in your custom sounds and map name, but I personally wouldn't know how to do that. I've only ever worked with the default TBeam music by tricking the game into thinking it was an A4 map.

Quote from josepezdj on October 16, 2013, 7:48 amWhat you can try is to pakrat stuff into the BSP and expect the packed stuff to gain priority over the stock (outside) stuff
I'm particularly interested in achieving this as well since the moment I noticed the new music when you're funnelled from the DLC 2 on, but I just decided I'd deal with it whenever I have some free time (that is NEVER
)
So, first thing to do is to identify how this thing exactly works... After a quick research, this is what I found:
1. From the files you mention, the only one that could be interesting for this is the one named "game_sounds_music_a4.txt", although I don't really think it's the key, since it is relative to the first campaign, act 4 (a4)
This is the part of the code that is relative to the tractor beams (tbeams):
- Code: Select all
"music.sp_a4_tb_intro_b1"
{
"channel" "CHAN_STATIC"
"soundlevel" "SNDLVL_NONE"
"volume" "0.45""wave" "*music/sp_a4_tb_intro_b1.wav"
"soundentry_version" "2"
"operator_stacks"
{
"update_stack"
{
"import_stack" "update_music_stereo"
"volume_fade_out"
{
"input_max" "3.0"
"input_map_min" "0.05"
}// "volume_lfo_time_scale"
// {
// "input2" "0.3"
// }
// "volume_lfo_scale"
// {
// "input2" "0.95"
// }"import_stack" "p2_update_music_play_tbeam"
"play_entry"
{
"entry_name" "music.sp_a4_tb_intro_tbin"
}
"stop_entry"
{
"match_entry" "music.sp_a4_tb_intro_tbin"
}
}
}
}As you can see, there's a part that reads "import stack" and the operator stack "p2_update_music_play_tbeam"... but that's all, nothing else... Also, there is no such operator stack defined in the file sound_operator_stacks.txt that is inside portal2/scripts...
2. However, into the folder /portal2_dlc2/scripts there are 2 important files:
- game_sounds_music_dlc2.txt (declared into the game_sounds_manifest.txt that's inside portal2_dlc2/scripts folder as well)
- sound_operator_stacks.txtAnd inside this latter one, there indeed is a definition for that operator stack called "p2_update_music_play_tbeam":
- Code: Select all
"p2_update_music_play_tbeam"
{
"tb_mixer"
{
"operator" "get_soundmixer"
"mixgroup" "testTBin"
}
// "print_tb_mixer"
// {
// "operator" "util_print_float"
// "input" "@tb_mixer.output_volume"
// }
"tb_delta"
{
"operator" "math_delta"
"input" "@tb_mixer.output_volume"
}
"tb_mixer_zero"
{
"operator" "math_float"
"apply" "less_than_or_equal"
"input1" "@tb_mixer.output_volume"
"input2" "0.0"
}
"tb_start_trigger"
{
"operator" "math_float"
"apply" "less_than"
"input1" "@tb_delta.output"
"input2" "0.0"
}
"tb_start_trigger_test"
{
"operator" "math_float"
"apply" "min"
"input1" "@tb_start_trigger.output"
"input2" "@tb_mixer_zero.output"
}
// "print_tb_delta"
// {
// "operator" "util_print_float"
// "input" "@tb_delta.output"
// }// "print_start_trigger"
// {
// "input_execute" "@tb_start_trigger.output"
// "operator" "util_print_float"
// "input" "@tb_start_trigger_test.output"
// }
"tb_stop_trigger"
{
"operator" "math_float"
"apply" "greater_than"
"input1" "@tb_mixer.output_volume"
"input2" "0.0"
}
"play_entry"
{
"execute_once" "false"
"operator" "sys_start_entry"
"input_start" "1"
"input_execute" "@tb_start_trigger_test.output"
"entry_name" "Default.Null"
}
"stop_entry"
{
"input_execute" "@tb_stop_trigger.output"
"operator" "sys_stop_entries"
"input_max_entries" "0.000000"
"match_entity" "false"
"match_substring" "false"
"match_entry" "Default.Null"
}
}3. But the best part comes now... if we look into the file game_sounds_music_dlc2.txt, we find the following:
- Code: Select all
"music.ctc_tbeam_001" // in the tractor beam
{
"channel" "CHAN_STATIC"
"soundlevel" "SNDLVL_NONE"
"volume" "0.39""wave" "*music/ctc_tbeam.wav"
"soundentry_version" "2"
"operator_stacks"
{
"start_stack"
{
"import_stack" "start_sync_to_entry"
"elapsed_time"
{
"entry" "music.ctc_b1_001"
}
"duration_div"
{
"input2" "1"
}
"div_mult"
{
"input1" "1.0"
}"stop_entry"
{
"operator" "sys_stop_entries"
"input_max_entries" "0.000000" //A sound will not stop itself from playing.
"match_entity" "false"
"match_substring" "true"
"match_entry" "propgel"
}}
"update_stack"
{
"import_stack" "update_music_stereo"
"mixer"
{
"mixgroup" "unduckedMusic"
}"volume_fade_in"
{
"input_max" "3.0"
"input_map_min" "0.05"
}
"volume_fade_out"
{
"input_max" "0.75"
"input_map_min" "0.05"
}
"volume_lfo_time_scale"
{
"input2" "0.3"
}
"volume_lfo_scale"
{
"input2" "0.4"
}}
}
}From which we can deduce, the music that plays when we're funnelled is music/ctc_tbeam.wav
And of course when we look into the pak01_dir.VPK file inside the /portal2_dlc2 folder, we find this music .WAV file in
.
Now... I think one possible approach could be to edit the file game_sounds_music_dlc2.txt, and to make it point to a custom music file name located wherever, instead of the one it is pointing at now; then pack both, the .TXT file altogether with the custom music file, and now to make the game update the audio cache and expect this maneuver only by itself could make the game load what's inside the BSP instead of anything outside (or precached on game startup)...
I think this deserves a try at least...
Hmmmmm..... maybe using that recent HMW's find with the command "sv_soundemitter_flush"?
I hope this first research at least get you on one possible right track
What you can try is to pakrat stuff into the BSP and expect the packed stuff to gain priority over the stock (outside) stuff
I'm particularly interested in achieving this as well since the moment I noticed the new music when you're funnelled from the DLC 2 on, but I just decided I'd deal with it whenever I have some free time (that is NEVER )
So, first thing to do is to identify how this thing exactly works... After a quick research, this is what I found:
1. From the files you mention, the only one that could be interesting for this is the one named "game_sounds_music_a4.txt", although I don't really think it's the key, since it is relative to the first campaign, act 4 (a4) This is the part of the code that is relative to the tractor beams (tbeams):
- Code: Select all
"music.sp_a4_tb_intro_b1"
{
"channel" "CHAN_STATIC"
"soundlevel" "SNDLVL_NONE"
"volume" "0.45""wave" "*music/sp_a4_tb_intro_b1.wav"
"soundentry_version" "2"
"operator_stacks"
{
"update_stack"
{
"import_stack" "update_music_stereo"
"volume_fade_out"
{
"input_max" "3.0"
"input_map_min" "0.05"
}// "volume_lfo_time_scale"
// {
// "input2" "0.3"
// }
// "volume_lfo_scale"
// {
// "input2" "0.95"
// }"import_stack" "p2_update_music_play_tbeam"
"play_entry"
{
"entry_name" "music.sp_a4_tb_intro_tbin"
}
"stop_entry"
{
"match_entry" "music.sp_a4_tb_intro_tbin"
}
}
}
}
As you can see, there's a part that reads "import stack" and the operator stack "p2_update_music_play_tbeam"... but that's all, nothing else... Also, there is no such operator stack defined in the file sound_operator_stacks.txt that is inside portal2/scripts...
2. However, into the folder /portal2_dlc2/scripts there are 2 important files:
- game_sounds_music_dlc2.txt (declared into the game_sounds_manifest.txt that's inside portal2_dlc2/scripts folder as well)
- sound_operator_stacks.txt
And inside this latter one, there indeed is a definition for that operator stack called "p2_update_music_play_tbeam":
- Code: Select all
"p2_update_music_play_tbeam"
{
"tb_mixer"
{
"operator" "get_soundmixer"
"mixgroup" "testTBin"
}
// "print_tb_mixer"
// {
// "operator" "util_print_float"
// "input" "@tb_mixer.output_volume"
// }
"tb_delta"
{
"operator" "math_delta"
"input" "@tb_mixer.output_volume"
}
"tb_mixer_zero"
{
"operator" "math_float"
"apply" "less_than_or_equal"
"input1" "@tb_mixer.output_volume"
"input2" "0.0"
}
"tb_start_trigger"
{
"operator" "math_float"
"apply" "less_than"
"input1" "@tb_delta.output"
"input2" "0.0"
}
"tb_start_trigger_test"
{
"operator" "math_float"
"apply" "min"
"input1" "@tb_start_trigger.output"
"input2" "@tb_mixer_zero.output"
}
// "print_tb_delta"
// {
// "operator" "util_print_float"
// "input" "@tb_delta.output"
// }// "print_start_trigger"
// {
// "input_execute" "@tb_start_trigger.output"
// "operator" "util_print_float"
// "input" "@tb_start_trigger_test.output"
// }
"tb_stop_trigger"
{
"operator" "math_float"
"apply" "greater_than"
"input1" "@tb_mixer.output_volume"
"input2" "0.0"
}
"play_entry"
{
"execute_once" "false"
"operator" "sys_start_entry"
"input_start" "1"
"input_execute" "@tb_start_trigger_test.output"
"entry_name" "Default.Null"
}
"stop_entry"
{
"input_execute" "@tb_stop_trigger.output"
"operator" "sys_stop_entries"
"input_max_entries" "0.000000"
"match_entity" "false"
"match_substring" "false"
"match_entry" "Default.Null"
}
}
3. But the best part comes now... if we look into the file game_sounds_music_dlc2.txt, we find the following:
- Code: Select all
"music.ctc_tbeam_001" // in the tractor beam
{
"channel" "CHAN_STATIC"
"soundlevel" "SNDLVL_NONE"
"volume" "0.39""wave" "*music/ctc_tbeam.wav"
"soundentry_version" "2"
"operator_stacks"
{
"start_stack"
{
"import_stack" "start_sync_to_entry"
"elapsed_time"
{
"entry" "music.ctc_b1_001"
}
"duration_div"
{
"input2" "1"
}
"div_mult"
{
"input1" "1.0"
}"stop_entry"
{
"operator" "sys_stop_entries"
"input_max_entries" "0.000000" //A sound will not stop itself from playing.
"match_entity" "false"
"match_substring" "true"
"match_entry" "propgel"
}}
"update_stack"
{
"import_stack" "update_music_stereo"
"mixer"
{
"mixgroup" "unduckedMusic"
}"volume_fade_in"
{
"input_max" "3.0"
"input_map_min" "0.05"
}
"volume_fade_out"
{
"input_max" "0.75"
"input_map_min" "0.05"
}
"volume_lfo_time_scale"
{
"input2" "0.3"
}
"volume_lfo_scale"
{
"input2" "0.4"
}}
}
}
From which we can deduce, the music that plays when we're funnelled is music/ctc_tbeam.wav And of course when we look into the pak01_dir.VPK file inside the /portal2_dlc2 folder, we find this music .WAV file in
.
Now... I think one possible approach could be to edit the file game_sounds_music_dlc2.txt, and to make it point to a custom music file name located wherever, instead of the one it is pointing at now; then pack both, the .TXT file altogether with the custom music file, and now to make the game update the audio cache and expect this maneuver only by itself could make the game load what's inside the BSP instead of anything outside (or precached on game startup)...
I think this deserves a try at least...
Hmmmmm..... maybe using that recent HMW's find with the command "sv_soundemitter_flush"?
I hope this first research at least get you on one possible right track
Quote from FelixGriffin on October 16, 2013, 8:24 amIf you have sounds called (iirc) music.[mapname].tbin and music.mapname.tbout (those are soundscript entries, not filenames), they should play when you enter or exit a funnel. The DLC2 ones are played on the Workshop, where the map names are changed.
If you have sounds called (iirc) music.[mapname].tbin and music.mapname.tbout (those are soundscript entries, not filenames), they should play when you enter or exit a funnel. The DLC2 ones are played on the Workshop, where the map names are changed.