Frictional Games Forum (read-only)
Music Won't Stop [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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Music Won't Stop [Solved] (/thread-7761.html)



Music Won't Stop [Solved] - D3AD UPR1S1NG - 05-02-2011

I've been having this really annoying problem lately where even if I set the StopMusic script the game just overlooks it and the song keeps on playing and it is really annoying Sad so anyone know how to fix this?


RE: Music Won't Stop - Roenlond - 05-02-2011

(05-02-2011, 02:39 PM)D3AD UPR1S1NG Wrote: I've been having this really annoying problem lately where even if I set the StopMusic script the game just overlooks it and the song keeps on playing and it is really annoying Sad so anyone know how to fix this?

Make sure you use the correct priority. For example:



void OnStart()
{
PlayMusic("musicfile", true, 1.3f, 4.0f, 10, true);
}

void OnLeave()
{
StopMusic(0, 10);
}



The bold part is the priority, which in this case is 10. The stopmusic bold part needs to be the same as the playmusic bold part =)


RE: Music Won't Stop - D3AD UPR1S1NG - 05-02-2011

(05-02-2011, 02:56 PM)Roenlond Wrote:
(05-02-2011, 02:39 PM)D3AD UPR1S1NG Wrote: I've been having this really annoying problem lately where even if I set the StopMusic script the game just overlooks it and the song keeps on playing and it is really annoying Sad so anyone know how to fix this?

Make sure you use the correct priority. For example:



void OnStart()
{
PlayMusic("musicfile", true, 1.3f, 4.0f, 10, true);
}

void OnLeave()
{
StopMusic(0, 10);
}



The bold part is the priority, which in this case is 10. The stopmusic bold part needs to be the same as the playmusic bold part =)

Hasn't worked although I didn't want the music to stop when the player leaves the area, It was when they entered a script area thanks for your help though


RE: Music Won't Stop - Roenlond - 05-02-2011

Just change the place that StopMusic is in, place it under the area collide function.


RE: Music Won't Stop - D3AD UPR1S1NG - 05-02-2011

(05-02-2011, 03:07 PM)Roenlond Wrote: Just change the place that StopMusic is in, place it under the area collide function.

It already is this is the script

void OnStart()
{
AddTimer("", 100.0, "SpawnMrFace");
SetEntityPlayerInteractCallback("castle_1", "Barricaded", true);
AddQuest("FirstQuest", "QuestOne");
SetDeathHint("DeathHints", "DeathHint01");
wakeUp();
AddTimer("", 4.0, "SwapSound");
AddTimer("", 5.0, "WakeUpStart");
AddEntityCollideCallback("Player", "ScriptArea_1", "ClosingIn", true, 1);
}

void wakeUp ()
{
PlayGuiSound("explosion_rock_large.snt", 100.0);
FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
SetPlayerActive(false);
SetMessage("Messages", "OpeningText", 7.0);
}

void beginStory(string &in asTimer){
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33); // Change all settings to defaults
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
AddTimer("", 100.0, "SpawnMrFace");
}

void SwapSound(string &in asTimer)
{
PlayGuiSound("player_bodyfall.snt", 100.0);
AddTimer("", 5.0, "WakeUpStart");
}

void WakeUpStart(string &in asTimer)
{
StopMusic(3.5, 1);
PlayMusic("Resident Evil 3 - Nightmare Theme_Resident Evil 3 OST - The Beginning of Nightmare.ogg", true, 100.0, 0.0, 10, true);
SetEntityActive("Servant_grunt_1", true);
SetEntityActive("servant_grunt_2", true);
FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(20); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220); // "Tilts" the players head
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true); // Simulates being on the ground
AddTimer("trig1", 11.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last
}

void Barricaded(string &in entity)
{
SetMessage("LockedDoors", "BarricadedDoor", 5.0);
}

void SpawnMrFace(string &in asTimer)
{
SetEntityActive("Servant_Grunt_3", true);
AddEnemyPatrolNode("Servant_grunt_3", "FirstNode", 10.0, "Walk");
}

void ClosingIn(string &in asParent, string &in asChild, int alState)
{
StopMusic(3.5, 10);
SetDeathHint("DeathHints", "DeathHint02");
SetEntityActive("Servant_grunt_4", true);
SetEntityActive("Servant_grunt_5", true);
}
//===========================================
// This runs when the player enters the map
void OnEnter()
{
}
//===========================================
// This runs when the player leaves the map
void OnLeave()
{
}


RE: Music Won't Stop - Roenlond - 05-02-2011

and the ClosingIn function works just fine except the music doesn't stop?


RE: Music Won't Stop - D3AD UPR1S1NG - 05-02-2011

(05-02-2011, 03:24 PM)Roenlond Wrote: and the ClosingIn function works just fine except the music doesn't stop?

It's alright I got it working thanks for the help Big Grin


RE: Music Won't Stop - Roenlond - 05-02-2011

(05-02-2011, 06:34 PM)D3AD UPR1S1NG Wrote:
(05-02-2011, 03:24 PM)Roenlond Wrote: and the ClosingIn function works just fine except the music doesn't stop?

It's alright I got it working thanks for the help Big Grin

Would you mind telling us what you did wrong, and what you did to fix it? It'll be useful for future searches of the same issue Smile


RE: Music Won't Stop - D3AD UPR1S1NG - 05-03-2011

(05-02-2011, 06:50 PM)Roenlond Wrote:
(05-02-2011, 06:34 PM)D3AD UPR1S1NG Wrote:
(05-02-2011, 03:24 PM)Roenlond Wrote: and the ClosingIn function works just fine except the music doesn't stop?

It's alright I got it working thanks for the help Big Grin

Would you mind telling us what you did wrong, and what you did to fix it? It'll be useful for future searches of the same issue Smile

Oh I would but i didnt change anything it just decided to work lol