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 Resume???
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#1
Music Resume???

Hi.

When I play my map the music starts where it should. But then when a event occour and the puzzle music comes the original music doesnt resume after the puzzle music is done.

Here is the full script:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "Stench", "WhatIsThat", true, 1);
AddEntityCollideCallback("Player", "CAVEIN", "OMG", true, 1);
AddEntityCollideCallback("Lever1", "Lever1Area", "UnlockDoor", true, 1);
AddEntityCollideCallback("ladder", "Attach", "AttachLadder", true, 1);
AddEntityCollideCallback("Player", "Bull", "What", true, 1);
}

void What(string &in asParent, string &in asChild, int alState)
{
SetMessage("JohnatanThoughts", "Thought11", 0);
PlaySoundAtEntity("Bully", "react_breath2.ogg", "Player", 0.0, false);
}

void AttachLadder(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("LadderArea_1",true);
GiveSanityBoost();
}

void UnlockDoor(string &in asParent, string &in asChild, int alState)
{
SetLevelDoorLocked("prison_2", false);
PlaySoundAtEntity("Lever1Area", "react_breath2.ogg", "Player", 0.0, false);
SetMessage("JohnatanThoughts", "Thought8", 0);
PlaySoundAtEntity("Lever1Area", "unlock_door.ogg", "Player", 0.0, false);
}

void OMG(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("SoundFromCaveIn", 2.0f, 5.0f, "");
AddTimer("", 1.0f, "StopLookAtArea2");
PlaySoundAtEntity("SoundFromCaveIn", "explosion_rock_large.ogg", "Player", 0.0, false);
SetEntityActive("cave_in_1",true);
SetEntityActive("Bully",false);
CreateParticleSystemAtEntity("", "ps_dust_break_25.ps", "AreaEffects", false);
PlayMusic("11_event_tree.ogg", false, 1, 3, 0, false);
AddQuest("Memento2","Memento2");
}

void StopLookAtArea2(string &in asTimer)
{
SetMessage("JohnatanThoughts", "Thought7", 0);
PlaySoundAtEntity("SoundFromCaveIn", "react_pant6.ogg", "Player", 0.0, false);
StopPlayerLookAt();
}

void WhatIsThat(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Gravel", 2.0f, 5.0f, "");
AddTimer("", 1.0f, "StopLookAtArea1");
PlaySoundAtEntity("Gravel", "react_breath_slow1.ogg", "Player", 0.0, false);
}

void StopLookAtArea1(string &in asTimer)
{
SetMessage("JohnatanThoughts", "Thought6", 0);
StopPlayerLookAt();
}

////////////////////////////
// Run when entering map
void OnEnter()
{
PlayMusic("01_amb_darkness.ogg", true, 1, 3, 0, true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}
03-27-2011, 02:34 PM
Find
Pandemoneus Offline
Senior Member

Posts: 328
Threads: 2
Joined: Sep 2010
Reputation: 0
#2
RE: Music Resume???

Set the priority of the main music to 1 or higher.

03-27-2011, 02:48 PM
Find
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#3
RE: Music Resume???

(03-27-2011, 02:48 PM)Pandemoneus Wrote: Set the priority of the main music to 1 or higher.

What do you mean by that?
Could you edit it so i can see it???
Im a noob at scripting xD
03-27-2011, 02:49 PM
Find
Pandemoneus Offline
Senior Member

Posts: 328
Threads: 2
Joined: Sep 2010
Reputation: 0
#4
RE: Music Resume???

PlayMusic("01_amb_darkness.ogg", true, 1, 3, 1, true);

[edit]
Or might be the other way around, main music to 0 and the other one to something else.

(This post was last modified: 03-27-2011, 03:00 PM by Pandemoneus.)
03-27-2011, 02:57 PM
Find
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#5
RE: Music Resume???

(03-27-2011, 02:57 PM)Pandemoneus Wrote: PlayMusic("01_amb_darkness.ogg", true, 1, 3, 1, true);
DOESNT WORK
Now it looks like this:

////////////////////////////
// Run first time starting map
void OnStart()
{
AddEntityCollideCallback("Player", "Stench", "WhatIsThat", true, 1);
AddEntityCollideCallback("Player", "CAVEIN", "OMG", true, 1);
AddEntityCollideCallback("Lever1", "Lever1Area", "UnlockDoor", true, 1);
AddEntityCollideCallback("ladder", "Attach", "AttachLadder", true, 1);
AddEntityCollideCallback("Player", "Bull", "What", true, 1);
}

void What(string &in asParent, string &in asChild, int alState)
{
SetMessage("JohnatanThoughts", "Thought11", 0);
PlaySoundAtEntity("Bully", "react_breath2.ogg", "Player", 0.0, false);
}

void AttachLadder(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("LadderArea_1",true);
GiveSanityBoost();
}

void UnlockDoor(string &in asParent, string &in asChild, int alState)
{
SetLevelDoorLocked("prison_2", false);
PlaySoundAtEntity("Lever1Area", "react_breath2.ogg", "Player", 0.0, false);
SetMessage("JohnatanThoughts", "Thought8", 0);
PlaySoundAtEntity("Lever1Area", "unlock_door.ogg", "Player", 0.0, false);
}

void OMG(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("SoundFromCaveIn", 2.0f, 5.0f, "");
AddTimer("", 1.0f, "StopLookAtArea2");
PlaySoundAtEntity("SoundFromCaveIn", "explosion_rock_large.ogg", "Player", 0.0, false);
SetEntityActive("cave_in_1",true);
SetEntityActive("Bully",false);
CreateParticleSystemAtEntity("", "ps_dust_break_25.ps", "AreaEffects", false);
PlayMusic("11_event_tree.ogg", false, 1, 1, 1, false);
AddQuest("Memento2","Memento2");
}

void StopLookAtArea2(string &in asTimer)
{
SetMessage("JohnatanThoughts", "Thought7", 0);
PlaySoundAtEntity("SoundFromCaveIn", "react_pant6.ogg", "Player", 0.0, false);
StopPlayerLookAt();
}

void WhatIsThat(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Gravel", 2.0f, 5.0f, "");
AddTimer("", 1.0f, "StopLookAtArea1");
PlaySoundAtEntity("Gravel", "react_breath_slow1.ogg", "Player", 0.0, false);
}

void StopLookAtArea1(string &in asTimer)
{
SetMessage("JohnatanThoughts", "Thought6", 0);
StopPlayerLookAt();
}

////////////////////////////
// Run when entering map
void OnEnter()
{
PlayMusic("01_amb_darkness.ogg", true, 1, 1, 2, true);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{

}

But now it doesnt play the puzzle music???? D:
(This post was last modified: 03-27-2011, 03:22 PM by Henriksen.)
03-27-2011, 03:06 PM
Find
Pandemoneus Offline
Senior Member

Posts: 328
Threads: 2
Joined: Sep 2010
Reputation: 0
#6
RE: Music Resume???

And why did you change that?
PlayMusic("11_event_tree.ogg", false, 1, 3, 0, false);

I said either, not both.

03-27-2011, 06:20 PM
Find




Users browsing this thread: 1 Guest(s)