Frictional Games Forum (read-only)
[SCRIPT] How to make music fade out and new music fade in? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] How to make music fade out and new music fade in? (/thread-20999.html)



How to make music fade out and new music fade in? - serbusfish - 04-01-2013

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?


RE: How to make music fade out and new music fade in? - PutraenusAlivius - 04-01-2013

Sorry, but there is no script that mentions how to fade out a sound. But you can fade in a sound, though.


RE: How to make music fade out and new music fade in? - Statyk - 04-01-2013

(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.