Frictional Games Forum (read-only)
StrartMusic Work But not Stop - 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: StrartMusic Work But not Stop (/thread-13631.html)

Pages: 1 2


RE: StrartMusic Work But not Stop - jessehmusic - 02-28-2012

(02-28-2012, 06:44 AM)Mackiiboy Wrote: void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);

Plays music.

asMusicFile - the music to play + extension .ogg
abLoop - determines whether a music track should loop
afVolume - volume of the music
afFadeTime - time in seconds until music reaches full volume
alPrio - priority of the music. Note that only the music with the highest priority can be heard! 0 - lowest, >0 - higher

void StopMusic(float afFadeTime, int alPrio);

Stops music.

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

So, all the pink stuff needs to be the same if you want to stop the music. I would either put StopMusic in OnLeave() in the current map, or in OnEnter() in the next map.

PlayMusic("Music_file_name.ogg", true, 1.0f, 0, 0, true);
StopMusic(0, 0);
Ah Thanx dude Smile Btw i fixed it Smile