Funnels cause custom music to stop
Quote from MetallicHero on October 21, 2014, 9:08 pmSo I've got custom music playing in my map, but when I enter then exit a funnel, the music isn't playing anymore. Does anyone know how to fix this?
So I've got custom music playing in my map, but when I enter then exit a funnel, the music isn't playing anymore. Does anyone know how to fix this?
Quote from josepezdj on October 22, 2014, 4:04 amFunnels are hard-coded to search for special instructions into soundscript entries, therefore the only way you have to make your funnels to play music is:
1. To use certain already existing soundscripts that includes those mentioned instructions. Take for instance one of the following (these are all inside your portal2/sccripts/game_sounds_music_a4.txt file):
- music.sp_a4_tb_intro_b1
- music.sp_a4_tb_catch_b0
- music.sp_a4_tb_catch_b1
....You should search for this piece of code inside your game's sound scripts (the following code is taken from that last example "music.sp_a4_tb_catch_b1"):
- Code: Select all
"import_stack" "p2_update_music_play_tbeam"
"play_entry"
{
"entry_name" "music.sp_a4_tb_catch_tbin"
}
"stop_entry"
{
"match_entry" "music.sp_a4_tb_catch_tbin"
}NOTE: you must play those soundscripts by triggering an ambient_generic entity, no other entity understands the code inside soundscripts!
2. You can make a custom soundscript file for your map where you add a similar piece of code for the tbeams (tractor beams) but pointing to your custom sounds and soundscripts. However, so far, packing custom soundscripts files inside your BSP won't work once your map is published on the workshop, the game keeps searching in precached sound files or local folders, and not inside the BSP...
Funnels are hard-coded to search for special instructions into soundscript entries, therefore the only way you have to make your funnels to play music is:
1. To use certain already existing soundscripts that includes those mentioned instructions. Take for instance one of the following (these are all inside your portal2/sccripts/game_sounds_music_a4.txt file):
- music.sp_a4_tb_intro_b1
- music.sp_a4_tb_catch_b0
- music.sp_a4_tb_catch_b1
....
You should search for this piece of code inside your game's sound scripts (the following code is taken from that last example "music.sp_a4_tb_catch_b1"):
- Code: Select all
"import_stack" "p2_update_music_play_tbeam"
"play_entry"
{
"entry_name" "music.sp_a4_tb_catch_tbin"
}
"stop_entry"
{
"match_entry" "music.sp_a4_tb_catch_tbin"
}
NOTE: you must play those soundscripts by triggering an ambient_generic entity, no other entity understands the code inside soundscripts!
2. You can make a custom soundscript file for your map where you add a similar piece of code for the tbeams (tractor beams) but pointing to your custom sounds and soundscripts. However, so far, packing custom soundscripts files inside your BSP won't work once your map is published on the workshop, the game keeps searching in precached sound files or local folders, and not inside the BSP...
Quote from greykarel on October 22, 2014, 12:05 pmOh, Jose, I think you misunderstood the problem. As far as I got the point of OP, the author means that his custom music stops playing when player is in funnel and doesn't resume when he gets out. I met the same while working on "Banzai".
1. To force your music to resume just check the flag "Is NOT Looped" in ambient_generic's properties, even if it is actualy looped.
2. To keep your custom music playing while player is in funnel place your music file in folder ...portal2/sound/vo/cavejohnson.
Oh, Jose, I think you misunderstood the problem. As far as I got the point of OP, the author means that his custom music stops playing when player is in funnel and doesn't resume when he gets out. I met the same while working on "Banzai".
1. To force your music to resume just check the flag "Is NOT Looped" in ambient_generic's properties, even if it is actualy looped.
2. To keep your custom music playing while player is in funnel place your music file in folder ...portal2/sound/vo/cavejohnson.
Quote from josepezdj on October 23, 2014, 9:19 amHehe... yeah I understood the problem the OP posted and answered accordingly but I simply forgot that nice trick of yours!
Hehe... yeah I understood the problem the OP posted and answered accordingly but I simply forgot that nice trick of yours!
Quote from MetallicHero on November 5, 2014, 9:21 pmQuote:1. To force your music to resume just check the flag "Is NOT Looped" in ambient_generic's properties, even if it is actualy looped.I've tried that but it didn't work, I also tried to move it to /sound/music/ but that didn't work either.
I've tried that but it didn't work, I also tried to move it to /sound/music/ but that didn't work either.
Quote from greykarel on November 9, 2014, 6:43 pmSorry, that was my fault. It's been a loong time since I did that and point 1 in my post above is not actualy correct.
I've refreshed my memory and found out that flag "Is NOT Looped" should be unchecked but it actualy doesn't affect music in case of funnel issue. But it let you stop your sound by input and resume it after loading a save.Another reason why your music doesn't resume is sound file format. All my custom music is looped .wav files and they work fine. If your file is .mp3 then it sould be in portal2/sound/vo or portal2/sound/vo/cavejohnson folder. In the first - music keeps silent while player is in funnel and resumes after. In the second - keeps on playing. I've tested it and it works.
Sorry, that was my fault. It's been a loong time since I did that and point 1 in my post above is not actualy correct.
I've refreshed my memory and found out that flag "Is NOT Looped" should be unchecked but it actualy doesn't affect music in case of funnel issue. But it let you stop your sound by input and resume it after loading a save.
Another reason why your music doesn't resume is sound file format. All my custom music is looped .wav files and they work fine. If your file is .mp3 then it sould be in portal2/sound/vo or portal2/sound/vo/cavejohnson folder. In the first - music keeps silent while player is in funnel and resumes after. In the second - keeps on playing. I've tested it and it works.