02-18-2012, 03:43 PM
Hey everybody! I want the player to look into a certain direction, then shortly after look in the other direction. I also need to display text on both of the actions when the player looks, but something as always fails on me. I seem to have a problem in my script, but I tried so many different variations, that I don't even know where I am now. Could you please enlighten me and help my way out of this mess? Working on my first custom story and still new to this. :p
Here's my script:
Thank you in advance! (:
Here's my script:
Spoiler below!
void OnEnter()
{
}
void Credits(string &in asParent, string &in asChild ,int alState)
{
}
//////////////////////////
///Starts here
void OnStart()
{
AddEntityCollideCallback("Player", "ScareLookArea", "LookAtDoor", true, 1);
AddEntityCollideCallback("Player", "ScareDoorArea", "CollideScareDoor", true, 1);
AddEntityCollideCallback("Player", "ScareLookWallArea", "LookAtWall", true, 1);
}
void LookAtDoor(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
StartPlayerLookAt("mansion_1", 5, 50, "");
AddTimer("", 2, "TimerStopPlayerLook");
}
void LookAtWall(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("wall_default_short_13", 10, 50, "");
AddTimer("", 4, "TimerStopLook2");
}
void TimerStopPlayerLook(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(true);
StopPlayerLookAt();
SetMessage("LookAtDoor", "LookDoor", 2);
AddTimer("", 2, "LookAtWall");
}
void TimerStopLook2(string &in asTimer)
{
StopPlayerLookAt();
SetMessage("LookAtWall", "LookWall", 4);
}
void CollideScareDoor(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("mansion_1", true, true);
}
void OnLeave()
{
}
{
}
void Credits(string &in asParent, string &in asChild ,int alState)
{
}
//////////////////////////
///Starts here
void OnStart()
{
AddEntityCollideCallback("Player", "ScareLookArea", "LookAtDoor", true, 1);
AddEntityCollideCallback("Player", "ScareDoorArea", "CollideScareDoor", true, 1);
AddEntityCollideCallback("Player", "ScareLookWallArea", "LookAtWall", true, 1);
}
void LookAtDoor(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(false);
StartPlayerLookAt("mansion_1", 5, 50, "");
AddTimer("", 2, "TimerStopPlayerLook");
}
void LookAtWall(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("wall_default_short_13", 10, 50, "");
AddTimer("", 4, "TimerStopLook2");
}
void TimerStopPlayerLook(string &in asParent, string &in asChild, int alState)
{
SetPlayerActive(true);
StopPlayerLookAt();
SetMessage("LookAtDoor", "LookDoor", 2);
AddTimer("", 2, "LookAtWall");
}
void TimerStopLook2(string &in asTimer)
{
StopPlayerLookAt();
SetMessage("LookAtWall", "LookWall", 4);
}
void CollideScareDoor(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("mansion_1", true, true);
}
void OnLeave()
{
}
Thank you in advance! (: