Frictional Games Forum (read-only)
[SCRIPT] Music dont continue [Solved] - 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] Music dont continue [Solved] (/thread-25138.html)



Music dont continue [Solved] - ShipinShen - 04-22-2014

Hey i want to stop the Outside-Mood-music, when i'm entering a building so i decided to add 2 areas. The one area stops the music and the other start it again, when your leaving the building.. everything works except the area, which should start the music again.

The Area which starts the music again
[Image: playmusicepqbmfojuw.jpg]

The Area which stops the music
[Image: stopmusicovycsudi01.jpg]

Here is the script
Quote:void OnStart()
{
//Stops WindMood
AddEntityCollideCallback("Player" , "StopMusic" , "Stop" , true , 1);
//Starts WindMood
AddEntityCollideCallback("Player" , "PlayMusic" , "Play" , true , 1);
}

//Starts WindMood
void Play(string &in asParent, string &in asChild, int alState)
{
PlayMusic("WindMood.ogg", true, 1, 3, 1, true);
}

//Stops WindMood
void Stop(string &in asParent, string &in asChild, int alState)
{
StopMusic(1, 1);
}

//The first time, where the music starts.
void Teleport(string &in asParent, string &in asChild, int alState)
{
FadeRadialBlurTo(25, 0.0f);
FadeOut(2);
ChangeMap("01_traum.map", "TeleportSpawn", "", "");
StopMusic(2, 1);
PlayMusic("WindMood.ogg", true, 1, 3, 1, true);
}


RE: Music dont continue - Mudbill - 04-22-2014

In your AddEntityCollideCallbacks you need to change "true" to "false" if you want the checks to repeat. What happened is likely that you went through one area on your way to the other, causing it to be finished so that when you returned, nothing happened.


RE: Music dont continue - ShipinShen - 04-22-2014

(04-22-2014, 10:00 PM)Mudbill Wrote: In your AddEntityCollideCallbacks you need to change "true" to "false" if you want the checks to repeat. What happened is likely that you went through one area on your way to the other, causing it to be finished so that when you returned, nothing happened.

Thanks that worked fine, even the sound file resume the location where it has stopped Smile THANKS!