Frictional Games Forum (read-only)
[SCRIPT] Stop Music? - 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] Stop Music? (/thread-16481.html)



Stop Music? - Cetex1337 - 06-25-2012

Hey Guys!

I have used this script, and it is some music starting when the player enters a room. But my issue is that when the player leaves the room / loading a new map, then it keeps going
Quote:void OnEnter()
Quote:{
Quote:PlayMusic("20_event_darkness.ogg", true, 4, 0, 10, true);
Quote:}
Is there any scripts like StopPlayerMusic(); ?


RE: Stop Music? - Cruzore - 06-25-2012

void StopMusic(float afFadeTime, int alPrio);

Stops music.

afFadeTime - time in seconds until music stops
alPrio -
the priority of the music that should stop (in this case, 10)


RE: Stop Music? - Cetex1337 - 07-24-2012

So how should the full script be like?


RE: Stop Music? - SilentStriker - 07-24-2012

PlayMusic("20_event_darkness.ogg", true, 4, 0, 10, true);

the 10 is the priority of the music I usually have it on 1 (or more depends if 1 is used by another PlayMusic) but it doesn't really matter but to stop music you must use

StopMusic(1, 10);

first is how long time you want it to fade out and the second needs to have the same priority as the music you want to stop which is in this case 10.


RE: Stop Music? - Cetex1337 - 07-24-2012

(07-24-2012, 02:24 PM)SilentStriker Wrote: PlayMusic("20_event_darkness.ogg", true, 4, 0, 10, true);

the 10 is the priority of the music I usually have it on 1 (or more depends if 1 is used by another PlayMusic) but it doesn't really matter but to stop music you must use

StopMusic(1, 10);

first is how long time you want it to fade out and the second needs to have the same priority as the music you want to stop which is in this case 10.
Thanks man +1


RE: Stop Music? - SilentStriker - 07-24-2012

You're welcome Smile