Please or Register to create posts and topics.

ambient_generic volume problem

I need help to change the volume of an ambient_generic. Whatever I try, I fail. I've only changed three keyvalues and no flags:

  • Name soundtest
  • Sound Name Portalgun.pedestal_rotate
  • Volume 0

I have a func_button which fires the the following output when pressed:

  • Name soundtest
  • My Output OnPressed
  • Target Entity soundtest
  • Target Input Volume
  • Parameter 10
  • Delay 0.00
  • Only Once No

The sound seems to be on full volume (10) before I press the func_button. Any ideas?

I've been playing around with this a bit, and there seem to be some rather strange interactions between the volume property and whether the selected sound loops or not.

For looped sounds:

  • the volume at which the sound plays is always controlled by the volume property. The "volume" event can be used to change the volume property.
  • Independent of this, the sound can be turned on and off with the "PlaySound" and "StopSound" events.

For sounds that do not loop, or if the "not looped" flag is set (as it is by default):

  • the volume property controls the volume of the sound when triggered via a "PlaySound" event.
  • The "volume" event does NOT set the volume property, as it does for looping sounds, instead it plays the sound once at the volume set in the event's parameter.
  • If the volume property is set to 0 in Hammer, the sound plays at a default volume when triggered by a "PlaySound" event. (I think this is 5, but I'm not sure of that.)

I assume that you have set the volume to 0 to prevent the sound from playing initially? If you want the sound to play only when multiple conditions are true, use a logic_relay that you enable / disable, or a series of logic_branch entities and a logic_branch_listener. (It depends on the situation which approach works best.)

Sendificate series: Sendificate | A Beam Too Far | Airtime | 302
Other Portal 2 maps: Medusa Glare
Portal 1 maps: Try Anything Twice | Manic Mechanic

Okey, thanks! This got to be a bug, and not intended by design. I don't think the episode 1 engine works the same in this matter. :?