Please or Register to create posts and topics.

Custom Sounds and Scenes

PreviousPage 2 of 3Next

I don't know if it's necessary to rebuild the sound cache when the sounds are embedded in a BSP; I'll give it a shot soon and find out.

Kasc wrote:
In COLOURS there is a .cache file the soundcache folder, are these necessary, and if so - how do you make them?

Where is this soundcache folder? Is it inside the Colours BSP? I haven't tried anything relating to Pakrat or embedding resources in BSPs yet, so I don't know how to open these "special" BSPs (assuming it's possible to do so).

Regarding making individual soundcaches, I didn't think it was possible to do this in Portal 2 since it doesn't include the snd_buildsoundcachefordirectory console command (it only has snd_rebuildaudiocache, which rebuilds one sound cache for all the audio files, original and custom). Perhaps Pakrat is able to extract the part of the sound cache that's relevant for a given map.

Also, I've discovered that VCDs in VPKs only work if they're registered in the scenes.image file already, which basically rules out using VCDs in content you eventually want to distribute (since distributing a new copy of scenes.image isn't a realistic option). I suppose I'll focus on including sounds without the user needing to rebuild their sound cache to hear them; since the Colours maps do it, it must be possible.

I used map analyst and exported the custom data, which creates a zip:

sound -> all his custom sounds used.
materials -> all his custom materials used.
maps -> soundcache -> mp_coop_coulours.cache

Hmm, that's odd; I took a look at one of the Colours BSP files in Pakrat and, although the sound and materials folders were present, I didn't see a soundcache folder.

At any rate, I did a quick test and embedded a WAV in a BSP using Pakrat, and it works fine (at least for me) without building/rebuilding any sound caches. If anyone wants to give it a quick test to check that it works for them, I'd appreciate it (I've attached it below).

It's unfortunate that VCDs only seem to work with a scenes.image file that's modified to include them, but I suppose I'll just have to work around that.

it works :)

Thanks for testing it, Kasc. Evidently when sounds are embedded in a BSP no sound cache files are required, which certainly beats using VPKs and requiring the user to rebuild their sound cache.

Well if everything is loaded within the .bsp, maybe the sounds are too?

I was very glad when I discovered this command.

Code: Select all
snd_updateaudiocache

You can update the cache instead of having to rebuild it entirely.
I've only tested it with raw files though.
If only it was easier to add new soundscripts to your addons and maps.

It appears that, when sounds are embedded in a BSP, any issues relating to the sound cache are handled automatically.

That snd_updateaudiocache command does sound like quite a time-saver when testing sounds in VPKs. I still find it strange, however, that there doesn't appear to be a way to generate a sound cache for only a subset of sounds in Portal 2 while such functionality (according to the VDC wiki) does exist in L4D2. Without this functionality, including sounds in a VPK requires the user to run either snd_rebuildaudiocache or (as AniCator points out) snd_updateaudiocache in order for the sounds to play, which is decidedly inferior to simply embedding them in the BSP, which requires no additional effort on the part of the user.

For now, I'm just going to go with embedding the sounds in the BSP and using triggers, but I hope that the use of soundscripts and VCDs is possible in the future (using VCDs would certainly beat using a trigger possessing a bunch of outputs with different delays that play various sounds).

Why can't you use vscripts to trigger sounds within a map?

Hmm, I didn't think of that (I've only briefly read about vscripts and haven't used them yet). Is there a good reference for writing vscripts? Information about them and their capabilities on the VDC wiki seems rather sparse. Are they capable of playing sounds and firing triggers ala VCDs?

PreviousPage 2 of 3Next