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

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

Hi do anybody know how i can play 2 musics at the same time???

(SRY FOR MY TERRIBLE ENGLISH)

Here is my script:

////////////////////////////
// Run first time starting map
void OnStart()
{
PlayMusic("27_amb.ogg", true, 1, 3, 0, true);
FadeOut(0);
SetMessage("IntroCategory", "Intro1", 0);
AddTimer("", 5.0f, "Intro2Start");
AddEntityCollideCallback("Crowbar2", "BarArea", "Crush", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_1", "BackToCorridor", true, 1);
AddUseItemCallback("PutRight", "Crowbar", "prison_section_1", "PutRight", true);
SetPlayerActive(false);
}

void PutRight(string &in asItem, string &in asEntity)
{
SetEntityActive("Crowbar2", true);
RemoveItem(asItem);
}

void Intro2Start(string &in asTimer)
{
SetMessage("IntroCategory", "Intro2", 0);
AddTimer("", 5.0f, "Intro3Start");
}

void Intro3Start(string &in asTimer)
{
SetMessage("IntroCategory", "Intro3", 0);
AddTimer("", 5.0f, "Intro4Start");
AddTimer("", 5.0f, "StartMusic");
}

void Intro4Start(string &in asTimer)
{
SetMessage("IntroCategory", "Intro4", 0);
AddTimer("", 5.0f, "StartStory");
}

void Grave(string &in asEntity, string &in asType)
{
StartEffectFlash(0.1f, 0.1f, 0.25f);
TeleportPlayer("PlayerStartArea_2");
FadeOut(0);
FadeIn(15);
PlayGuiSound("flashback_flash3.ogg", 1);
PlayMusic("21_event_pit.ogg", false, 1, 3, 0, false);
AddTimer("", 12.0f, "BackTo");
AddTimer("", 4.0f, "Cold");
}

void Cold(string &in asTimer)
{
PlayGuiSound("12_girl_cry_07.ogg", 1);
}

void BackTo(string &in asTimer)
{
PlayMusic("18_amb.ogg", true, 1, 3, 0, true);
StartEffectFlash(0.1f, 0.1f, 0.25f);
TeleportPlayer("PlayerStartArea_3");
PlayGuiSound("react_breath3.ogg", 1);
FadeOut(0);
FadeIn(15);
GiveSanityDamage(25.0f, true);
}

void StartStory(string &in asTimer)
{
SetPlayerActive(true);
FadeIn(15);
PlaySoundAtEntity("Door1", "close_gate_low.snt", "Player", 0, false);
GiveSanityDamage(1, true);
SetPlayerSanity(20);
FadePlayerFOVMulTo(1.5f, 0.5f);
AddTimer("", 4.0f, "PlayerLook1");
}

void Crush(string &in asParent, string &in asChild, int alState)
{
CreateParticleSystemAtEntity("", "ps_hit_metal.ps", "BarArea", false);
PlayGuiSound("break_wood_metal3.ogg", 1);
SetEntityActive("Crowbar2",false);
SetEntityActive("Crowbar3",true);
AddPropImpulse("prison_section_2", 0, 0, 0.8f, "");
GiveSanityBoost();
SetEntityActive("prison_section_2",true);
SetEntityActive("prison_section_1",false);
}

void PlayerLook1(string &in asTimer)
{
PlayGuiSound("react_scare5.ogg", 1);
PlayGuiSound("27_break.ogg", 1);
AddTimer("", 1.0f, "StopLook1");
StartPlayerLookAt("Crowbar", 3.0f, 3.0f, "");
AddTimer("", 1.0f, "PlayerLook2");
}

void StopLook1(string &in asTimer)
{
StopPlayerLookAt();
}

void PlayerLook2(string &in asTimer)
{
AddTimer("", 1.0f, "StopLook2");
StartPlayerLookAt("sketch_mechanical01_1", 3.0f, 3.0f, "");
AddTimer("", 1.0f, "PlayerLook3");
}

void StopLook2(string &in asTimer)
{
StopPlayerLookAt();
}

void PlayerLook3(string &in asTimer)
{
AddTimer("", 1.0f, "StopLook3");
AddTimer("", 0.5f, "Glassbreak");
StartPlayerLookAt("prison_section_1", 13.0f, 13.0f, "");
PlayGuiSound("react_breath1.ogg", 1);
}

void Glassbreak(string &in asTimer)
{
AddTimer("", 1.0f, "PlayerLook4");
}

void PlayerLook4(string &in asTimer)
{
StartPlayerLookAt("Creek", 13.0f, 13.0f, "");
PlayGuiSound("react_breath1.ogg", 1);
PlayGuiSound("scare_steps_big1.ogg", 1);
AddTimer("", 1.0f, "StopLook4");
}

void StopLook4(string &in asTimer)
{
StopPlayerLookAt();
}

void StopLook3(string &in asTimer)
{
StopPlayerLookAt();
}

void StartMusic(string &in asTimer)
{
PlayMusic("amb_extra01.ogg", true, 1, 3, 0, true);
FadePlayerFOVMulTo(1, 0.1f);
}

////////////////////////////
// Run when entering map
void OnEnter()
{

}

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

}
04-09-2011, 10:56 AM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#2
RE: Music OnTop??

Err, why would you want to do that though?
04-09-2011, 06:07 PM
Find
palistov Offline
Posting Freak

Posts: 1,208
Threads: 67
Joined: Mar 2011
Reputation: 57
#3
RE: Music OnTop??

You can't play two music files at the same time. The music with the highest alPrio value will be the only one heard. You can play a sound, however, but I don't think the .ogg files will work with sound (not sure, I could be wrong!)

04-10-2011, 12:35 AM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#4
RE: Music OnTop??

You can, you just gotta make a .snt file for it.
04-10-2011, 02:08 AM
Find
Henriksen Offline
Senior Member

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

The reason that i want to do it is because i want to have an ambient sound in the background and some music at the same time Smile
04-10-2011, 03:03 PM
Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#6
RE: Music OnTop??

So there's probably a .snt file for it. Just use PlaySoundAtEntity.
04-10-2011, 03:25 PM
Find
Henriksen Offline
Senior Member

Posts: 308
Threads: 71
Joined: Dec 2010
Reputation: 2
#7
RE: Music OnTop??

Ok it worked Big Grin
04-10-2011, 03:26 PM
Find




Users browsing this thread: 1 Guest(s)