custom soundscape won't work when embedded

darktemplar

L1: Registered
Dec 11, 2014
17
0
The map title is "koth_viaduct_voidventure".
I created a custom soundscape file to give the map more life in new areas where default tf2 soundscapes just wouldn't quite fit the bill.
I titled the soundscape .txt file "soundscapes_koth_viaduct_voidventure".

The custom soundscape works perfectly fine when I have it in my scripts folder and play the map normally, however when I use pakrat to embed the map with custom files it needs, I include the .txt soundscape file as necessary. I then remove the soundscape .txt file from my directory scripts folder to test and see how custom content will behave for other players, and the soundscapes suddenly do not work, and will not update beyond the default tf2 one heard first in the map.

Am I doing something wrong here?
I have pakrat-095, the most recent version to my understanding of it.
Why does my soundscape behave perfectly when in my scripts folder where it should be, but not recognized when embedded from my scripts fodler into the .bsp itself?

If the soundscape works when the file is where it should be on my side, but won't work when embedded (yes, I saved the .bsp after adding the file, it's not a stupid mistake like that (I hope)), then that must mean it's something with either pakrat or how tf2 handles specific packed files from a recent update...

I do not think it is pakrat, because with this custom soundscape file, I have also embedded some custom model, model material, and sound files to boot. When I remove these on my side and load up the map to test packed file behavior, they all appear/play just fine in the map, but for some reason the soundscape doesn't.

Any ideas? Or perhaps does someone know something I don't about a recent tf2 update that has borked embedded .txt soundscape files in other custom maps perhaps?
 

Freyja

aa
Jul 31, 2009
2,994
5,813
Make sure the embedded soundscape .txt file is placed in the /scripts directory. By default, pakrat will put the entire filepath on your pc instead, which will cause the game to not load it properly. You need to edit the path to simply /scripts/
 

darktemplar

L1: Registered
Dec 11, 2014
17
0
Make sure the embedded soundscape .txt file is placed in the /scripts directory. By default, pakrat will put the entire filepath on your pc instead, which will cause the game to not load it properly. You need to edit the path to simply /scripts/

Edit: Nevermind, apparently when I tried to change the path in pakrat, I had the soundscape file removed from my scripts folder from a previous test. It is now working. Thank you for your help <3

Edit 2: But now it seems my wonky custom sound behavior is back because of the packed content now... I may need to make an entirely new post about that as it is its own separate issue, and apparently VALVe has still not fixed it.

Edit 3: Scratch the above, my custom sounds are now playing without their strange extra glitchy effects but only after a complete re-embed. It seems that embedding and saving the .bsp with pakrat, but then going back and changing even one file and re-saving can make pakrat derp up. In fact other times when I was positive I had only saved the .bsp over with pakrat once it still borked my sound behavior in REALLY strange ways. Some sounds would play a tiny fraction of their ending right at the beginning, then cut early. Others would have the wrong pitch for no reason. I swear to God, pakrat has very wonky and inconsistent behind-the-scenes behavior. Anyone with a similar issue, I advise you to try packing your content with something other than pakrat and see if that resolves broken packed custom sound file behavior.
 
Last edited:

worMatty

Repacking Evangelist
aa
Jul 22, 2014
1,257
999
It is known that if you resave an already-packed BSP using Pakrat, it can corrupt the BSP. You should only ever use Pakrat once on a BSP. VIDE seems to be more reliable when resaving, so you should check it out.

Your wonky sounds could be down to corruption but it sounds to me like your game's sound cache is out of date. I converted some sounds from .wav in to MP3 format and changed the extensions in my script files, but when I ran the map they played like you are describing. Perhaps the game has cached wonky versions of your sounds from a previous attempt. If after you give VIDE a go, you can try the following:

Closie TF2 and delete all the sound.cache files that have lodged themselves in all your sound directories. Just do a Windows search for the files in tf/ and you can delete them all at once. Be mindful that if you have previously given your map to people, they may experience the same thing when you send them a new version. I think the sound cache stores entries by their game sound names defined in your scripts, so if you don't want to have to include instructions along with your map for the above, you can just change the names of your entries.

Let us know how it goes.
 

darktemplar

L1: Registered
Dec 11, 2014
17
0
It is known that if you resave an already-packed BSP using Pakrat, it can corrupt the BSP. You should only ever use Pakrat once on a BSP. VIDE seems to be more reliable when resaving, so you should check it out.

Your wonky sounds could be down to corruption but it sounds to me like your game's sound cache is out of date. I converted some sounds from .wav in to MP3 format and changed the extensions in my script files, but when I ran the map they played like you are describing. Perhaps the game has cached wonky versions of your sounds from a previous attempt. If after you give VIDE a go, you can try the following:

Closie TF2 and delete all the sound.cache files that have lodged themselves in all your sound directories. Just do a Windows search for the files in tf/ and you can delete them all at once. Be mindful that if you have previously given your map to people, they may experience the same thing when you send them a new version. I think the sound cache stores entries by their game sound names defined in your scripts, so if you don't want to have to include instructions along with your map for the above, you can just change the names of your entries.

Let us know how it goes.

That could quite possibly be what my issue was, but fortunately it doesn't happen every time. I ended up opening the .bsp in pakrat after already using pakrat to embed some files into it, then added the .nav file and resaved the .bsp with pakrat for a second time. Though testing all the content one last time before release just to be sure, everything seemed to check out. Removed all the content I embedded temporarily, then play-tested the map and all my sounds seemed to play perfectly fine. I do recall removing my sound.cache file in my sounds folder entirely and then verifying integrity of game cache when I was trying to fix this problem before with this map before I gave up and put it on hiatus, hoping VALVe would fix it as I assumed it was their fault since the map was in stable form prior to Scream Fortress 6, then broke without me even touching it. However that did not fix the issue. I am almost positive it is something to do with pakrat, but I am pretty sure I tried everything. Recompile the map, packed it all up only once, still creepy strange inconsistent custom sound file behavior in-game.

So long as it's working now is all I care about though. I just hope I don't run into it again but if I do, I will be sure to steer clear of pakrat.