Frictional Games Forum (read-only)

Full Version: How to make music fade out and new music fade in?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a set up where when an enemy appears alternative music will start playing (rather than the default enemy music), however when the enemy leaves I want the music to return to the normal level music so I use stopmusic and playmusic commands, but the stopmusic is instant which I would prefer to be a fade, is there any way to do this as the music suddenly stopping is quite jarring?
Sorry, but there is no script that mentions how to fade out a sound. But you can fade in a sound, though.
(04-01-2013, 06:09 AM)JustAnotherPlayer Wrote: [ -> ]Sorry, but there is no script that mentions how to fade out a sound. But you can fade in a sound, though.

Wrong, as well, it's music he's asking for, not a sound.
Code:
void StopMusic(float afFadeTime, int alPrio);

Stops music.

afFadeTime - time in seconds until music stops
alPrio - the priority of the music that should stop

Simply increase the FadeTime.