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
Music Won't Stop [Solved]
D3AD UPR1S1NG Offline
Member

Posts: 64
Threads: 21
Joined: Apr 2011
Reputation: 0
#1
Music Won't Stop [Solved]

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?

The Harrowing Tale Of Redendrew Mansion
(This post was last modified: 05-02-2011, 06:35 PM by D3AD UPR1S1NG.)
05-02-2011, 02:39 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#2
RE: Music Won't Stop

(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 =)
(This post was last modified: 05-02-2011, 02:57 PM by Roenlond.)
05-02-2011, 02:56 PM
Find
D3AD UPR1S1NG Offline
Member

Posts: 64
Threads: 21
Joined: Apr 2011
Reputation: 0
#3
RE: Music Won't Stop

(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

The Harrowing Tale Of Redendrew Mansion
05-02-2011, 03:05 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#4
RE: Music Won't Stop

Just change the place that StopMusic is in, place it under the area collide function.
05-02-2011, 03:07 PM
Find
D3AD UPR1S1NG Offline
Member

Posts: 64
Threads: 21
Joined: Apr 2011
Reputation: 0
#5
RE: Music Won't Stop

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

The Harrowing Tale Of Redendrew Mansion
05-02-2011, 03:16 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#6
RE: Music Won't Stop

and the ClosingIn function works just fine except the music doesn't stop?
05-02-2011, 03:24 PM
Find
D3AD UPR1S1NG Offline
Member

Posts: 64
Threads: 21
Joined: Apr 2011
Reputation: 0
#7
RE: Music Won't Stop

(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

The Harrowing Tale Of Redendrew Mansion
05-02-2011, 06:34 PM
Find
Roenlond Offline
Senior Member

Posts: 331
Threads: 3
Joined: Apr 2011
Reputation: 0
#8
RE: Music Won't Stop

(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
05-02-2011, 06:50 PM
Find
D3AD UPR1S1NG Offline
Member

Posts: 64
Threads: 21
Joined: Apr 2011
Reputation: 0
#9
RE: Music Won't Stop

(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

The Harrowing Tale Of Redendrew Mansion
05-03-2011, 10:31 PM
Find




Users browsing this thread: 1 Guest(s)