Funnels cause custom music to stop

Avatar
MetallicHero
17 Posts
Posted Oct 21, 2014
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?
Advertisement
Registered users don't see ads! Register now!
Avatar
josepezdj
2,386 Posts
Posted Oct 22, 2014
Replied 6 hours later

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):

  2. music.sp_a4_tb_intro_b1

  3. music.sp_a4_tb_catch_b0
  4. 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"):

         "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!

  1. 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...
Avatar
greykarel
225 Posts
Posted Oct 22, 2014
Replied 8 hours later

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.
Avatar
josepezdj
2,386 Posts
Posted Oct 23, 2014
Replied 21 hours later
Hehe... yeah I understood the problem the OP posted and answered accordingly but I simply forgot that nice trick of yours!
Avatar
MetallicHero
17 Posts
Posted Nov 05, 2014
Replied 13 days later

Quote:
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.

Advertisement
Registered users don't see ads! Register now!
Avatar
greykarel
225 Posts
Posted Nov 09, 2014
Replied 3 days later
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.