Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ambient Music/Sound Fix
Daemian Offline
Posting Freak

Posts: 1,129
Threads: 42
Joined: Dec 2012
Reputation: 49
#4
RE: Ambient Music/Sound Fix

If you call a song that it's currently playing, it ignores the call and keeps playing the song.
So in your case of two areas that the player may go from one to the other, the song wouldn't stop cause he entered one of the areas, it finds it's the same and keeps playing.

This only applies to music, so you should use PlayMusic function instead of PlaySound:
PlayMusic( "my_theme_001.ogg", false, 0.1f, 1.0f, 0, true );
Spoiler below!
PlayMusic( file, loop?, volume, fade, priority, resume? );

If a given set of areas play a different theme each, when the player steps into one, it's gonna stop the current song and start another.

In your function AmbienceHandler you can have this:
Spoiler below!

PHP Code: (Select All)
void AmbienceHandler string &in pstring &in asAreaint s )
{
 
string myTheme "";

     if ( 
asArea == "AmbientScriptKitchen" ) { myTheme == "theme_kitchen.ogg"; }
     if ( 
asArea == "AmbientScriptOutside" ) { myTheme == "theme_outside.ogg"; }
     if ( 
asArea == "AmbientScriptGallery" ) { myTheme == "theme_gallery.ogg"; }

PlayMusicmyThemefalse0.1f1.0f0true ); 



This way you can point all your ambient callbacks to the same function AmbienceHandler and just add a condition to change the name of the file.

02-06-2014, 08:16 PM
Find


Messages In This Thread
Ambient Music/Sound Fix - by RaideX - 02-05-2014, 06:08 PM
RE: Ambient Music/Sound Fix - by DreamScripters - 02-06-2014, 05:27 AM
RE: Ambient Music/Sound Fix - by RaideX - 02-06-2014, 07:38 AM
RE: Ambient Music/Sound Fix - by Daemian - 02-06-2014, 08:16 PM
RE: Ambient Music/Sound Fix - by RaideX - 02-06-2014, 09:45 PM
RE: Ambient Music/Sound Fix - by MyRedNeptune - 02-06-2014, 09:59 PM
RE: Ambient Music/Sound Fix - by RaideX - 02-07-2014, 01:41 PM



Users browsing this thread: 1 Guest(s)