Page 1 of 1

Preventing volume from overloading

PostPosted: Wed Oct 05, 2011 5:02 pm
by mcavalcanti
Hello, guys. I read the text below on GE site, but I did not understand how to create the user defined function to prevent volume from overloading. Please, anybody can help me to understand this?

"It's best to create sound functions and call them as needed; if you use the specific sound functions all over in various scripts, it will be difficult to control them later on. In addition, you may want to send all explosions and shots to one user defined function, so that there you can limit the number of explosion sounds to play at once (to prevent the volume from overloading)."

Thanks.

Re: Preventing volume from overloading

PostPosted: Mon Oct 10, 2011 12:45 am
by mcavalcanti
Please, I would like to understand this. May anybody help me?

Re: Preventing volume from overloading

PostPosted: Mon Oct 10, 2011 1:01 am
by skydereign
It kind of depends. Not quite sure how DST meant to determine when a sound has ended, but essentially the function can count the number of explosion sounds played. Using that, the function can limit the total number of explosions, or any other type of sound effect. You could create an actor to handle sounds, and use SendActivationEvent and actor variables to determine what sounds to play (and use timers to determine when sounds have stopped). The main point though is that if you use a function to play sounds, then you can change the volume in one place (the function) and have it changed for all instances that you play the sound.

Re: Preventing volume from overloading

PostPosted: Mon Oct 10, 2011 3:31 am
by Hblade
-Sky is right. BUT if you want an easier but less-effective method, (may also intterupt sound from other actors) use this.
Code: Select all
StopSound(1); //Untested but find the stopsound function if this fails

PlaySound(Your sound);


This would stop the sound before playing it.

Re: Preventing volume from overloading

PostPosted: Tue Oct 11, 2011 8:19 pm
by mcavalcanti
Thanks to you both.