Frictional Games Forum (read-only)

Full Version: Need help with multiple direction forcing.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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:

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()
{

}


Thank you in advance! (:
For starters, you gave TimerStopPlayerLook the wrong callback syntax. I would suggest you take the time to better understand the functions available to you by the engine, as the current code is showing signs that you are more willing to get things done than to learn how things work first.
Thanks for your response ! This time I've done my homework and I've got things working :p and I have learned a lot too. When you said that the code showing signs of me being more willing to get things done.. Actually I just threw a crappy code here and started a thread 'cause I was too frustrated trying to get it to work. Anyways got it all figured out now Smile