The scenario; a scream is heard, the normal level music stops and goes silent, then when the player interacts with a script area a monster noise plays and different (tense) music plays, then once the tense music has finished the normal music comes back on.
Now I have already done most of this, the only bit im having trouble with is making the normal music start playing again, here is my current script:
{
AddEntityCollideCallback("Player", "ScriptArea_1", "LoudNoise", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_5", "SuddenScare", true, 1);
}
void LoudNoise(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "05_event_door_bang", "ScriptArea_3", 0, false);
StartPlayerLookAt("ScriptArea_3", 3, 1, "");
SetPlayerMoveSpeedMul(0);
SetPlayerRunSpeedMul(0);
SetPlayerLookSpeedMul(0);
AddTimer("Murder", 3, "Murder");
StopMusic(1, 1);
}
void Murder(string &in asTimer)
{
PlaySoundAtEntity("", "react_scare", "Player", 0.0f, false);
StopPlayerLookAt();
SetPlayerMoveSpeedMul(1);
SetPlayerRunSpeedMul(1);
SetPlayerLookSpeedMul(1);
}
void SuddenScare(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "04_break", "ScriptArea_4", 0, false);
PlaySoundAtEntity("", "04_break02", "ScriptArea_4", 0, false);
StartPlayerLookAt("ScriptArea_4", 5, 5, "");
SetPlayerMoveSpeedMul(0);
SetPlayerRunSpeedMul(0);
SetPlayerLookSpeedMul(0);
AddTimer("ScarySound", 3, "ScarySound");
}
void ScarySound(string &in asTimer)
{
PlayMusic("01_event_dust", false, 2, 4, 0, true);
StopPlayerLookAt();
SetPlayerMoveSpeedMul(1);
SetPlayerRunSpeedMul(1);
SetPlayerLookSpeedMul(1);
}
As it stands if I try to add the level music in it will start playing at the same time as the tense music, is there anyway to delay it with a timer or something?