Frictional Games Forum (read-only)

Full Version: Stop Music/Sound?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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();
}
Check your priorities.
I tried 0 as well, no luck.
Don't do random priorities; you're supposed to provide the same priority you used when you first played the song.
I did 0 on start, and 0 to stop. Not turning off still.

All fixed, and working.

/thread.