//Everything with "//" at the start of the text and at the end is just a comment.//
//Everything starting with "//" only, may not be needed in the script.//
//When game starts for first time (e.g. mostly used in full conversion modes)//
//void OnGameStart()
//{
//
//;}
//On start of a map for first time.//
void OnStart()
{
TeleportPlayer("PlayerStartArea_1");
AddEntityCollideCallback("Player", "Quest1", "Tired", true, 1);
AddEntityCollideCallback("Player", "Scare", "PlayerScare", true, 1);
AddEntityCollideCallback("Player", "StartLookAt", "StartLookAt", true, 1);
AddEntityCollideCallback("Player", "ForcedLookAt", "ForcedLookAtStop", true, 1);
AddEntityCollideCallback("Player", "Quest1Done", "TiredDone", true, 1);
SetEntityPlayerLookAtCallback("Tim", "Tim", (false));
AddUseItemCallback("", "MysteriousKey", "AwaysLockedDoor", "AwaysLockedUnlock", true);
;}
//ExtraScripts for OnStart//
//AddEntityCollideCallback Scripts//
void PlayerScare(string &in asParent, string &in asChild, string &in alState)
{
SetSwingDoorClosed("AwaysLockedDoor", true, true);
AddTimer("Lock", 2.0f, "LockDoor");
;}
void LockDoor(string &in asTimer)
{
SetSwingDoorLocked("AwaysLockedDoor", true, true);
PlaySoundAtEntity("", "lock_door.snt", "Player", 0.0f, false);
SetEntityActive("JumpScare", true);
ShowEnemyPlayerPosition("JumpScare");
;}
void Tired(string &in asParent, string &in asChild, int alState)
{
AddQuest("Tired", "Tired");
;}
void StartLookAt(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("ForcedLookAt", 2.0f, 4.0f, "");
;}
void ForcedLookAtStop(string &in asParent, string &in asChild, int alState)
{
StopPlayerLookAt();
;}
void TiredDone(string &in asParent, string &in asChild, int alState)
{
StopPlayerLookAt();
CompleteQuest("Tired", "Tired");
AddTimer("FadeOutTimer", 0.5f, "FadeOutFunc");
;}
void FadeOutFunc(string &in asTimer)
{
FadeOut(2.0f);
AddTimer("FadeInTimer", 2.5f, "FadeInFunc");
;}
void FadeInFunc(string &in asTimer)
{
PlaySoundAtEntity("PlayerScare", "BruteEnabled.snt", "Player", (5.0), (false));
FadeIn(4.0f);
SetEntityActive("MysteriousKey", (true));
AddTimer("SoundQuest", 5.0f, "SoundQuest");
;}
void SoundQuest(string &in asTimer)
{
AddQuest("SoundQuest", "SoundQuest");
;}
//AddUseItemCallback Scripts//
void AwaysLockedUnlock(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("AwaysLockedDoor", (false), (true));
PlaySoundAtEntity("", "unlock_door", "Player", 0, false);
RemoveItem("MysteriousKey");
;}
void AwaysLockedMessage(string &in asEntity, string &in type)
{
SetMessage("Messages", "MysteriousKey", 0.0f);
;}
//SetEntityPlayerLookAtCallback Scripts//
void Tim(string &in asEntity, int alState)
{
SetMessage("Messages", "Tim", 0.3f);
;}
//On enter of the map (e.g using a map multiple times).//
void OnEnter()
{
;}
//On leaving the map.//
void OnLeave()
{
;}
//EXTRA SCRIPTS (Functions, codes and etc.)//