Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Stop Music/Sound?
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#1
Stop Music/Sound?

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

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();
}

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

(This post was last modified: 03-31-2012, 07:49 AM by JetlinerX.)
03-31-2012, 01:41 AM
Website Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: Stop Music/Sound?

Check your priorities.

Tutorials: From Noob to Pro
03-31-2012, 02:05 AM
Website Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#3
RE: Stop Music/Sound?

I tried 0 as well, no luck.

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

03-31-2012, 02:13 AM
Website Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: Stop Music/Sound?

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

Tutorials: From Noob to Pro
03-31-2012, 02:28 AM
Website Find
JetlinerX Offline
Senior Member

Posts: 599
Threads: 49
Joined: Jun 2011
Reputation: 19
#5
RE: Stop Music/Sound?

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

All fixed, and working.

/thread.

Lead Developer of "The Attic"
~Slade Mitchell

Chapter 3 (REL)

(This post was last modified: 03-31-2012, 07:48 AM by JetlinerX.)
03-31-2012, 02:39 AM
Website Find




Users browsing this thread: 1 Guest(s)