Hi all,
I'm making my first custom story now and im kinda stuck at scripting... I thought I knew pretty much already but I still seem to get stuck
Here is my script for my map:
void OnStart()
{
AddEntityCollideCallback("Player", "ScriptArea_1", "playsound", true, 1);
AddUseItemCallback("StudyKey", "studykey_1", "mansion_2", "UsedKeyOnDoor", true);
SetEnemyIsHallucination("servant_grunt_1", true);
AddEntityCollideCallback("Player", "ScriptArea_2", "EnemyAppear", true, 1);
AddEntityCollideCallback("servant_grunt_1", "ScriptArea_3", "EnemyDisable", true, 1);
AddEntityCollideCallback("Player", "ScriptArea_4", "LookTimer", true, 1); // TROUBLE HERE?
}
void playsound(string &in asParent, string &in asChild, int alState)
{
PlayMusic("break_wood1.ogg", false, 1, 0, 1.0, false);
}
void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_2", false, true);
PlaySoundAtEntity("unlock_door.snt", "unlock_door", "mansion_2", 0.0f, false);
RemoveItem("studykey_1");
}
void EnemyAppear(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 1, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
}
void EnemyDisable(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("servant_grunt_1", false);
}
// HAVING TROUBLE FROM HERE
// makes sure the player looks at Compound_5
void LookTimer(string &in asTimer)
{
AddTimer("LookAtEntity_1", 0, "LookAt_1");
}
// makes sure the player looks at chest_of_drawers_nice_broken_1
void Timer_1(string &in asTimer)
{
StopPlayerLookAt();
AddTimer("LookAtEntity_2", 1, "LookAt_2");
}
// makes sure the player looks at painting03_1
void Timer_2(string &in asTimer)
{
StopPlayerLookAt();
AddTimer("LookAtEntity_3", 1, "LookAt_3");
}
//LookTimer
void LookAt_1(string &in asEntity)
{
StartPlayerLookAt("Compound_5", 1, 1, "Timer_1");
}
// Timer_1
void LookAt_2(string &in asEntity)
{
StartPlayerLookAt("chest_of_drawers_nice_broken_1", 1, 1, "Timer_2");
}
// Timer_2
void LookAt_3(string &in asEntity)
{
StartPlayerLookAt("painting03_1", 1, 1, "Timer_3");
}
void OnLeave()
{
}
after the part that says "// HAVING TROUBLE FROM HERE" (obviously) I got stuck.. as well as the part at OnStart: "// TROUBLE HERE??" I want the player to look at 3 entities and then fall down as your sanity goes to 0. After that happened I want it to load a new map.. Though I didn't even got the player to look at certain entities... not any entity at all
Can someone please help me?
I hope you guys can figure it out a bit..
Thanks!