Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved Stop Music/Sound?
Author Message
JetlinerX Offline
Senior Member

Posts: 601
Joined: Jun 2011
Reputation: 19
Post: #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
Visit this user's website Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,267
Joined: Jul 2011
Reputation: 223
Post: #2
RE: Stop Music/Sound?
Check your priorities.

Tutorials: From Noob to Pro
03-31-2012 02:05 AM
Visit this user's website Find all posts by this user Quote this message in a reply
JetlinerX Offline
Senior Member

Posts: 601
Joined: Jun 2011
Reputation: 19
Post: #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
Visit this user's website Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,267
Joined: Jul 2011
Reputation: 223
Post: #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
Visit this user's website Find all posts by this user Quote this message in a reply
JetlinerX Offline
Senior Member

Posts: 601
Joined: Jun 2011
Reputation: 19
Post: #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
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)