ambient_generic wont play on trigger
Post Reply
Quote
Re: ambient_generic wont play on trigger
Posted by MrBehemoth on Mon May 14th at 6:04pm 2007


hi folks!

I've searched everywhere and I keep finding people who seem to have had the same problem with HL2 ambient_generics but it seems like nobody ever got to the bottom of it. So if this is old news, forgive me for bringing it up again. Also, if this a double-post then sorry again, something screwy just happened to IE.

What happens is this:

I have an ambient_generic and I want it to play once when triggered with the PlaySound input, so I check the 'Start Silent' and 'Is NOT Looped' flags. But it doesn't play. There are no error messages.

If I uncheck 'Start Silent' so that it will play once on spawn then it works.

It ocurred to me that maybe the 'Is NOT Looped' flag is only supposed to be used when you do have a looping sound (mine isn't) but you don't want it to loop, so I tried unchecking that. It will still play on spawn if 'Start Silent' is blank, but not when triggered if 'Start Silent' is checked.

Incidentally, the sound I'm trying to use is a 44100 Hz mono mp3 in the root of my mod's sound folder, registered in a sound script and played as a game sound. Since it will play on spawn, I'm assuming that the file-type and sound scripts are all set up properly. I've also had the same problem in the past using what Hammer calls 'raw' sounds (some of them looping, I think). It also doesn't matter whether I use a custom sound or a Valve-made one.

I've had this problem for a while in a few different maps, but I've been modding HL2 on and off since it was released and I don't remember always having this problem. Anyone got any ideas?





Quote
Re: ambient_generic wont play on trigger
Posted by Stadric on Mon May 14th at 11:49pm 2007


How are you triggering the ambient_generic? Different inputs do different things.


Also change the texture of the dock. Docks are rarely tile. -Facepunch
As I Lay Dying



Quote
Re: ambient_generic wont play on trigger
Posted by MrBehemoth on Tue May 15th at 7:11am 2007


I am typing 'ent_fire dogbarksound PlaySound' or whatever at the console to test it, but I'm sure that does exactly the same thing as if I set up up a trigger brush or logic entity to trigger it.



Quote
Re: ambient_generic wont play on trigger
Posted by Riven on Tue May 15th at 1:10pm 2007


Hmm, I've never tried that before on an ambient_generic, but I wouldn't count on it either. Go ahead and try using a trigger_once or some logic entity and let us know if that works. Their not that hard to set up.





Quote
Re: ambient_generic wont play on trigger
Posted by MrBehemoth on Tue May 15th at 4:48pm 2007


Thanks guys! I wouldn't've thought of that. When triggered by another entity it behaves exactly like it's supposed to, it's only when I use ent_fire that it doesn't work.

I usually set up my entities in 2 stages: 1st I create them all and set up all their properties and test them, then I set up the interdependencies. I guess I'm going to have to rethink this strategy.

Thanks again.





Quote
Re: ambient_generic wont play on trigger
Posted by Stadric on Tue May 15th at 11:18pm 2007


I like to draw a diagram if it gets too complex. With simple things I just plan it in my head.


Also change the texture of the dock. Docks are rarely tile. -Facepunch
As I Lay Dying




Post Reply