Frictional Games Forum (read-only)

Full Version: Introduction music won't stop
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
As the title says, i'm a big phat phony who's stuck again.

void OnStart()
{

FadeOut(0);

AddTimer("", 4, "intro1");

AddEntityCollideCallback("Player", "WakeUpSpeech", "WakeUpSpeechFunc", true, 1);
}


void intro1(string &in asTimer)
{
SetMessage("Messages", "Introtext1", 5);

AddTimer("", 6, "intro2");

PlayMusic("Introduction.ogg", true, 1.0f, 0, 0, true);
}

void intro2(string &in asTimer)
{
SetMessage("Messages", "Introtext2", 5);

AddTimer("", 6, "intro3");
}

void intro3(string &in asTimer)
{
FadeIn(2);

AddTimer("", 1, "musicstart");
}

void musicstart(float afFadeTime, int alPrio)
{
AddTimer("", 4, "ambientstart");

PlayMusic("Ambient_Ghost.ogg",true,1,0,0,false);

StopMusic(0, 0);

}


void ambientstart(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("WakeUpSpeech", true);
}


void WakeUpSpeechFunc(string &in asChild, string &in asParent, int alState)
{
AddEffectVoice("ItsQuiet.ogg","","Voice","ItsQuiet",false,"",0,10);
}
void musicstart(float afFadeTime, int alPrio)
wrong callback syntax, it's
void MyFunc(string &in asTimer)

Edit:
PlayMusic("Ambient_Ghost.ogg",true,1,0,0,false);
It has the same priority, so it will either bug out or won't play at all, since priority 0 is stopped right after. Better change it
Thank you dear sir, it is working.