void OnStart(){
AddTimer ("MainInit", 0.1f, "MainStart");
AddDebugMessage ("START", true);
//Script Debug Setup
if(ScriptDebugOn()){
GiveItemFromFile("lantern_pig", "lantern_pig.ent");
RemoveTimer("MainStart");
AddDebugMessage ("Debug Activated!", true);
}
//Collide Callbacks
AddEntityCollideCallback("Player", "HatchOpen", "HatchUnlock", true, 1);
}
void MainStart (string &in asTimer) {
FadeOut(0.1f);
AddTimer ("GameInit", 10.0f, "GameStart");
PlayGuiSound ("intro_pig_attack_temp.snt", 1.0f);
}
void HatchUnlock (string &in asParent, string &in asChild, int alState) {
SetSwingDoorClosed("attic_floor_ladderhatch_1", false, true);
AddDebugMessage("Hatch Unlocked!", true);
StartPlayerLookAt ("attic_floor_ladderhatch_1", 10.0f, 50.0f, "LookAtStop");
PlaySoundAtEntity ("HatchScare", "react_scare.snt", "Player", 0.15f, false);
StopSound ("Ambience01", 0.0f);
}
void LookAtStop () {
StopPlayerLookAt();
}
void GameStart (string &in asTimer) {
PlaySoundAtEntity ("IntroScare", "react_breath.snt", "Player", 0.1f, false);
StartEffectFlash(0.1f, 1.0f, 0.2f);
FadeIn (0.1f);
AddTimer ("PianoInit", 2.0f, "PianoStart");
}
void PianoStart (string &in asTimer) {
PlaySoundAtEntity ("Ambience01", "amb_mansion_gallery_piano_2D.snt", "attic_floor_ladderhatch_1", 1.0f, true);
}