////////////////////////////
// Run first time starting map
void OnStart()
{
AddUseItemCallback("", "Key_1", "door1", "FUNCTION", true);
SetEntityPlayerInteractCallback("Key_1", "PickedUpKey", true);
SetEntityPlayerInteractCallback("phonograph_2", "phono1", true);
//PlayMusic("/music/06_amb", true, 1, 0, 0, true);
AddEntityCollideCallback("Player", "script_wellwhine", "func_whine", true, 1);
AddEntityCollideCallback("Player", "script_prision_slammer", "prisiondoorslammer", true, 1);
AddEntityCollideCallback("Player", "memorial_windwhirl", "func_memorialwhine", true, 1);
/////INTRO////
TeleportPlayer("Intro_0");
FadeOut(0);
SetPlayerActive(false);
SetSanityDrainDisabled(true);
ShowPlayerCrossHairIcons(false);
AddTimer("fadein", 5, "TimerIntroOutro");
PlayMusic("silent_intro", false, 1, 0, 1, true);
////WAKEUP////
wakeUp();
}
//////////////////////////////
//Intro//////////////////////
////////////////////////////
void TimerIntroOutro(string &in asTimer)
{
if(GetLocalVarInt("Intro") < 1) {
if(asTimer == "fadein") {
TeleportPlayer("intro_" + GetLocalVarInt("Intro"));
FadeIn(3);
AddTimer("fadeout", 5, "TimerIntroOutro");
}
if(asTimer == "fadeout") {
FadeOut(3);
AddTimer("fadein", 5, "TimerIntroOutro");
AddLocalVarInt("Intro", 1);
}
}
else
{
TeleportPlayer("PlayerStartArea_1");
FadeIn(2);
SetPlayerActive(true);
SetSanityDrainDisabled(false);
ShowPlayerCrossHairIcons(true);
PlayMusic("silent_intro", false, 0.2, 1, 2, true);
}
if(asTimer == "outro") {
StartCredits("in_motion.ogg", false, "Credits", "Ending", 3);
}
}
void wakeUp () {
FadeOut(0); // Instantly fades the screen out. (Good for starting the game)
FadeIn(20); // Amount of seconds the fade in takes
FadeImageTrailTo(2, 2);
FadeSepiaColorTo(100, 4);
SetPlayerActive(false);
FadePlayerRollTo(50, 220, 220); // "Tilts" the players head
FadeRadialBlurTo(0.15, 2);
SetPlayerCrouching(true); // Simulates being on the ground
AddTimer("trig1", 11.0f, "beginStory"); // Change '11.0f' to however long you want the 'unconciousness' to last
}
void beginStory(string &in asTimer){
ChangePlayerStateToNormal();
SetPlayerActive(true);
FadePlayerRollTo(0, 33, 33); // Change all settings to defaults
FadeRadialBlurTo(0.0, 1);
FadeSepiaColorTo(0, 4);
SetPlayerCrouching(false);
FadeImageTrailTo(0,1);
}