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?
1
Re: ambient_generic woes
Posted by LAzerMANiac on Sat Sep 24th at 10:31pm 2005

LAzerMANiac
member
204 posts
70 snarkmarks
Registered: Sep 30th 2003
Location: Fremont, CA
Occupation: A student/mapper for Xen Rebels
Posted by LAzerMANiac on Sat Sep 24th at 10:31pm 2005
LAzerMANiac
member
204 posts
70 snarkmarks
Registered: Sep 30th 2003
Location: Fremont, CA

Occupation: A student/mapper for Xen Rebels
Re: ambient_generic woes
Posted by Crono on Sat Sep 24th at 10:35pm 2005
Posted by Crono on Sat Sep 24th at 10:35pm 2005
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 at 5:32pm 2005

LAzerMANiac
member
204 posts
70 snarkmarks
Registered: Sep 30th 2003
Location: Fremont, CA
Occupation: A student/mapper for Xen Rebels
Posted by LAzerMANiac on Sun Sep 25th at 5:32pm 2005
see, the thing is, I DO want it to be re-useable.
LAzerMANiac
member
204 posts
70 snarkmarks
Registered: Sep 30th 2003
Location: Fremont, CA

Occupation: A student/mapper for Xen Rebels
Re: ambient_generic woes
Posted by Crono on Sun Sep 25th at 8:52pm 2005
Posted by Crono on Sun Sep 25th at 8:52pm 2005
Besides the fact that you could respawn the entity ... which makes it reusable?
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)
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 at 4:11pm 2005
Posted by gozemem on Tue Sep 27th at 4:11pm 2005
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.
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 at 4:08pm 2005

LAzerMANiac
member
204 posts
70 snarkmarks
Registered: Sep 30th 2003
Location: Fremont, CA
Occupation: A student/mapper for Xen Rebels
Posted by LAzerMANiac on Wed Sep 28th at 4:08pm 2005
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.
LAzerMANiac
member
204 posts
70 snarkmarks
Registered: Sep 30th 2003
Location: Fremont, CA

Occupation: A student/mapper for Xen Rebels
1
© Snarkpit.net 2001 - 2023, about us, donate, contact
Snarkpit v6.1.0 created this page in 0.0247 seconds.

Snarkpit v6.1.0 created this page in 0.0247 seconds.

