ambient_generic woes

ambient_generic woes

Re: ambient_generic woes Posted by LAzerMANiac on Sat Sep 24th 2005 at 10:31pm
LAzerMANiac
204 posts
Posted 2005-09-24 10:31pm
204 posts 100 snarkmarks Registered: Sep 30th 2003 Occupation: A student/mapper for Xen Rebels Location: Fremont, CA
There are several ambient_generics that I have put into my level. They
each play an mp3 sound. I am trying to make them into a jukebox. So
far, I have 10 ambient_genericas and 10 buttons. Each button triggers a
PlaySound on a corresponding ambient_generic, and triggers a StopSound
on every other ambient generic. The problem is, StopSound doesn't seem
to work for some reason. What can I do to rectify this problem?
The Plane, my ongoing HL2 comic.
Re: ambient_generic woes Posted by Crono on Sat Sep 24th 2005 at 10:35pm
Crono
6628 posts
Posted 2005-09-24 10:35pm
Crono
super admin
6628 posts 700 snarkmarks Registered: Dec 19th 2003 Location: Oregon, USA
Well, if you're not going to use the entity again, you could kill it with a trigger. That'll effectively stop it. (You can spawn them too, not sure about the specifics though)
Blame it on Microsoft, God does.
Re: ambient_generic woes Posted by LAzerMANiac on Sun Sep 25th 2005 at 5:32pm
LAzerMANiac
204 posts
Posted 2005-09-25 5:32pm
204 posts 100 snarkmarks Registered: Sep 30th 2003 Occupation: A student/mapper for Xen Rebels Location: Fremont, CA
see, the thing is, I DO want it to be re-useable.
Re: ambient_generic woes Posted by Crono on Sun Sep 25th 2005 at 8:52pm
Crono
6628 posts
Posted 2005-09-25 8:52pm
Crono
super admin
6628 posts 700 snarkmarks Registered: Dec 19th 2003 Location: Oregon, USA
Besides the fact that you could respawn the entity ... which makes it reusable? :razz:
But, it is a "shoddy" solution ... the more proper solution is harder:

You could just make a logic entity or something as such to manage all sounds in your map.

I can only guess, you have it all set up independently. And doing that will make conflicts. Just like the physics system. If you have a bunch of ropes pulling on one object and they're not controlled by the same restraint system ... it doesn't quite work.

You can try making it a little more complex and structured with a logic entity, and it should work fine. I'm sure there's a way to make it do a "switch" like system. so it has an input (button number) and plays the corresponding sound. But, the point is it's managed and not completely free, like having ten separate sounds which independently triggered. However, I'm curious if you set it to "play once" or something like that, If you did, I believe, it should play one time every time it's triggered.

Now, if I am reading what you said correctly, you said that once they're triggered they don't stop, right? If so, try looking up some stuff on the logic entities (If hl2 still supports a multi-manager, that'd work too)
Blame it on Microsoft, God does.
Re: ambient_generic woes Posted by gozemem on Tue Sep 27th 2005 at 4:11pm
gozemem
1 post
Posted 2005-09-27 4:11pm
gozemem
member
1 post 0 snarkmarks Registered: Sep 27th 2005 Location: UK
I had the same problem. With me it involved a looping sound.

In the ambient_generic properties, on the Flags page, there is an
option "Is NOT Looped". If the sound is looped, untick this option. The
StopSound input should now work.
Re: ambient_generic woes Posted by LAzerMANiac on Wed Sep 28th 2005 at 4:08pm
LAzerMANiac
204 posts
Posted 2005-09-28 4:08pm
204 posts 100 snarkmarks Registered: Sep 30th 2003 Occupation: A student/mapper for Xen Rebels Location: Fremont, CA
The thing is, the sound file does not loop, but I want to be able to stop it in the middle of a song and switch over to another one if the player wants it to. It plays the song onse, but if you press a button corresponding to a different song, it does not stop the currently playing track befoe starting the other one. hat results in ugly sound overlays and lag if more than 5 buttons are pressed at the same time. I tried sending the StopSound trigger to the currently-playing ambient_generic using the console, but to no avail.
The Plane, my ongoing HL2 comic.