Frictional Games Forum (read-only)
Stop Music/Sound? - 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: Stop Music/Sound? (/thread-14362.html)



Stop Music/Sound? - JetlinerX - 03-31-2012

Hey all.

So, I have an ambiance that I made, and added as music. It starts on Map 1, and I want it to be disabled on Map 3. Here is my script, but it WONT STOP! Angry

Code:
void OnEnter ()
{
        AddEntityCollideCallback("Player", "ScriptArea_2", "Startscare", true, 1);
}
void Startscare(string &in asParent, string &in asChild, int alState)
{
        SetPlayerActive(false);
        GiveSanityBoost();
        AddTimer("", 1, "Faint");
}    

void Faint(string &in asTimer)
{
        StopMusic(1.0f, 1);
        StopSound("Map1Ambiance.ogg", 1.0f);
        SetPlayerMoveSpeedMul(1);
        SetPlayerLookSpeedMul(1);
        FadePlayerRollTo(50, 33, 33);
        SetPlayerCrouching(true);
        PlaySoundAtEntity("", "player_bodyfall.snt", "Player", 0, true);
        FadeOut(3.0f);
        AddTimer("", 10, "Gettingup");
}
void Gettingup(string &in asTimer)
{
        FadeIn(7.0f);
        FadePlayerRollTo(0, 33, 33);
        PlaySoundAtEntity("", "react_sigh.snt", "Player", 0, false);
        AddTimer("", 7, "Scare");
}
void Scare(string &in asTimer)
{
        StartPlayerLookAt("level_hub_1", 15.0f, 15.0f, "");
        PlaySoundAtEntity("", "05_event_door_bang.snt", "Player", 0, false);
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Particals", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Particals", false);
        AddTimer("", 1.0f, "Bang2");
}
void Bang2(string &in asTimer)
{
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Particals", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Particals", false);
        AddTimer("", 1.0f, "Bang3");
}
void Bang3(string &in asTimer)
{
        CreateParticleSystemAtEntity("", "ps_dust_impact", "Particals", false);    
        CreateParticleSystemAtEntity("", "ps_door_damage_wood", "Particals", false);
        AddTimer("", 2.0f, "Monster");
}
void Monster(string &in asTimer)
{
        PlaySoundAtEntity("", "notice_long.snt", "Player", 0, false);
        AddTimer("", 4.0f, "React");
}
void React(string &in asTimer)
{
        PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);
        SetPlayerActive(true);
        StopPlayerLookAt();
}



RE: Stop Music/Sound? - Your Computer - 03-31-2012

Check your priorities.



RE: Stop Music/Sound? - JetlinerX - 03-31-2012

I tried 0 as well, no luck.



RE: Stop Music/Sound? - Your Computer - 03-31-2012

Don't do random priorities; you're supposed to provide the same priority you used when you first played the song.


RE: Stop Music/Sound? - JetlinerX - 03-31-2012

I did 0 on start, and 0 to stop. Not turning off still.

All fixed, and working.

/thread.