Please or Register to create posts and topics.

ambient_generic - can't change volume

I want to add a sound effect to steam in my map. I created the entity ambient_generic with the following sound name: VFX.NeuroToxinLp. At default the sound plays way too loud for my liking, so naturally I went to turn down the volume a notch, but it doesn't seem to work no matter what value I put in. The volume remains the same.

Is this a bug and if so, is it possible to go around it to decrease the volume? Thanks in advance!

That's not exactly a bug. You are playing a soundscript (not a sound directly) that plays a looped sound (notice the "lp" part), and usually they are controlled by code instead of via the ambient_generic parameters... However, I think the output Volume still works. Try to fire this output (from a trigger_once for example located at the entry to your map):

OnStartTouch > [ambient_generic_name] > Volume > 5

Other option is, if you check inside your portal 2/portal2/scripts folder, you'll find the script called "game_sounds_vfx.txt", and inside it there's the soundscript you're playing:

Code: Select all
"VFX.NeuroToxinLp"
{
   "channel"      "CHAN_AUTO"
   "soundlevel"      "SNDLVL_80db"
   "volume"      "1.00"
   "wave"      ")vfx/vfx_ntoxin_lp.wav"
}

You can try playing directly the looped sound "vfx/vfx_ntoxin_lp.wav" and maybe this way you can control the volume with the ambient_generic parameters...

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]
josepezdj wrote:
That's not exactly a bug. You are playing a soundscript (not a sound directly) that plays a looped sound (notice the "lp" part), and usually they are controlled by code instead of via the ambient_generic parameters... However, I think the output Volume still works. Try to fire this output (from a trigger_once for example located at the entry to your map):

OnStartTouch > [ambient_generic_name] > Volume > 5

Other option is, if you check inside your portal 2/portal2/scripts folder, you'll find the script called "game_sounds_vfx.txt", and inside it there's the soundscript you're playing:

Code: Select all
"VFX.NeuroToxinLp"
{
   "channel"      "CHAN_AUTO"
   "soundlevel"      "SNDLVL_80db"
   "volume"      "1.00"
   "wave"      ")vfx/vfx_ntoxin_lp.wav"
}

You can try playing directly the looped sound "vfx/vfx_ntoxin_lp.wav" and maybe this way you can control the volume with the ambient_generic parameters...

I did try to switch the volume by a trigger, first with a logic_auto but just in case I even tried your suggestion.

I've never worked with outside folders and .txt commands. How does this work? And will it only affect my computer or will it work on other computers aswell once I publish the map?

Konke wrote:
I did try to switch the volume by a trigger, first with a logic_auto but just in case I even tried your suggestion.

I've never worked with outside folders and .txt commands. How does this work? And will it only affect my computer or will it work on other computers aswell once I publish the map?

Listen, what you chose for your ambient_generic is already a ".txt" file, that all of us have in our computers, and that ".txt" file is a "soundscript". Every soundscript plays an actual .WAV file that all of us also have in our local folders; so don't worry about that. Just put the following as the Sound Name in your ambient_generic and try to change its volume now:

vfx/vfx_ntoxin_lp.wav

Another thing you could try is to use the SourceEntityName property of your ambient_generic to select the pipe that is emitting the steam or whatever (in the case it's a prop_static, you might need to turn it into a prop_dynamic to give it a name), and reduce its range or radius so it's hearable only some units around the entity you chose.

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]

I watched TopHattWaffle's tutorial on how to import custom sounds to the game, and he also explains some of how to config some .txt files manually. I think I'm getting it even more now but some problems still remain.

I did actually manage to implement my custom made song to my map, however, it's very (and I mean very) low in volume. The volume is set to 10 and even if I set the ambient_generic to play everywhere, the volume is insanely low. Is there a way to increase the volume in any way? Perhaps it's time for some .txt configuration but I don't know where to find my song.

Could it be that your custom song is actually recorded at low volume? I don't think that you can raise its volume in game by using soundscripts: there is a volume limit, which is value 1.0, the same as there's one in the ambient_generic (10)... and if you already tried playing it via the ambient_generic and its volume is so low, I really think your issue could be your song's volume. Could you try checking that? could you save your song at higher volume maybe?

ImageImageImageImageImageuseful tools and stuff here on TWP :thumbup:
[spoiler]ImageImageImageImageImage[/spoiler]
josepezdj wrote:
Could it be that your custom song is actually recorded at low volume? I don't think that you can raise its volume in game by using soundscripts: there is a volume limit, which is value 1.0, the same as there's one in the ambient_generic (10)... and if you already tried playing it via the ambient_generic and its volume is so low, I really think your issue could be your song's volume. Could you try checking that? could you save your song at higher volume maybe?

It's a very good point, and one that I checked early on. I checked it three times. The song is recorded in GarageBand on my MacBook. The sound is in perfect volume. I then converted it to .wav in Audacity on my PC and again the volume was perfect. In Hammer, when checking my song in the sound browser, the song is at perfect volume. Now this last one is what really makes me wonder. In the Hammer editor the volume is good but ingame it isn't. Could there be anything else that I've missed?

I've been trying to work some on sound scripts, following TopHattWaffles tutorial on how to create my own (http://www.tophattwaffle.com/hammer-tut ... mentation/). I can't seem to make my own sound scripts to work. Has anyone tried it for Portal 2? Perhaps a stupid question, of course someone must have. The reason I'm asking is if there's a way to easy check if custom sound scripts are working.