How to add custom soundscripts to your map?

  • If you're asking a question make sure to set the thread type to be a question!

PoisonHeadcrab

L1: Registered
Jun 27, 2010
14
0
So, I've now been desperately trying to implement a sound in my map that would play from a location with a desired attenuation. Since just pointing at my soundfile with an "ambient_generic" only resulted in the sound being played too loud right next to the source but already inaudible two meters away, I knew I had to make a soundscript.

Problem is, I have no clue where to put the piece of code, so that it can be played through the ambient_generic. I tried putting it into a file that is "maps/<mapname>_level_sounds.txt", like advised in the Valve Developer Wiki, but that doesn't work for me at all. And I'm just not sure about whether it wouldn't cause problems when putting an edited "game_sounds", or "game_sounds_manifest" into my final bsp file.

Does anyone has an idea how to solve this?
 

Seba

DR. BIG FUCKER, PHD
aa
Jun 9, 2009
2,364
2,728
You could try changing the Volume and Max Audible Distance keyvalues for the ambient_generic, that should fix your problems.
 

Ravidge

Grand Vizier
aa
May 14, 2008
1,544
2,818
[thread]7000[/thread] soundscapes
[thread]9300[/thread] making your own soundscape
 

PoisonHeadcrab

L1: Registered
Jun 27, 2010
14
0
You could try changing the Volume and Max Audible Distance keyvalues for the ambient_generic, that should fix your problems.

Thanks alot, that pretty much let me adjust the sound to what I need it to be :D
Was probably just a bit shy to put in insane distances, because it really looks like if you'd type 5000, the max distance would actually look more like 500 ingame.

Also, I've already looked into soundscapes, but they don't really seem like an option for this particular case, as I have other uses for those, that would have to overlap the sounds I'm trying to create.
 

PoisonHeadcrab

L1: Registered
Jun 27, 2010
14
0
Alright, I just figured I'd need to make the sound much louder, however the only option would be to edit the .wav to make it louder (volume settings in hammer all maxed out already).
When I do that however, there's a huge loss of quality, because of the high-amplitude waves being cut off. It looks I'll still need a script to achieve this (soundscapes also not an option, since I already have a use for that, the sound should play on top of that). :(

So, question again, how do I make a proper soundscript for my custom map, or is that even possible?
 

PoisonHeadcrab

L1: Registered
Jun 27, 2010
14
0

I already read that site, and the concept of a code entry representing a sound that can be accessed in hammer is very understandable to me. But have no idea in what file to put this piece of code whatsoever, so that it is and will be loaded when that script file is packed into the final .bsp.

I thought that creating a "maps/<mapname>_level_sounds.txt" for your custom map and putting the code in there would do the thing, but I later figured that doesn't work for me.

What files exactly do I have to edit and how, and how should I later pack them into the final .bsp?
 

ardysqrrl

L4: Comfortable Member
Oct 26, 2009
173
159
I'm not sure did you try making a game_sounds_manifest.txt
 

Aliensoldier

L1: Registered
Jul 17, 2011
25
1
Sorry for "excavating" a old thread, but I think I know the solution for this.
creating a file "maps/<mapname>_level_sounds.txt" should work, but you can't choose it with the Hammer Sound Browser 'cuz it's not listed in the manifest file.
Now you just simply need to open your soundscript, copy the name of the defined sound you want and paste it into the ambient_generic.
It works on the same princip for l4d.
 
Last edited: