Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Shelf | Store

Privacy Policy


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with multiple direction forcing.
Author Message
Asphex Offline
Junior Member

Posts: 26
Joined: Feb 2012
Reputation: 2
Post: #1
Need help with multiple direction forcing.
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. Tongue

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! (:

My stories: The Haunted Stairwell v1.0
02-18-2012 03:43 PM
Find all posts by this user Quote this message in a reply
Your Computer Offline
SCAN ME!

Posts: 3,268
Joined: Jul 2011
Reputation: 223
Post: #2
RE: Need help with multiple direction forcing.
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.

Tutorials: From Noob to Pro
02-18-2012 09:39 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Asphex Offline
Junior Member

Posts: 26
Joined: Feb 2012
Reputation: 2
Post: #3
RE: Need help with multiple direction forcing.
Thanks for your response ! This time I've done my homework and I've got things working Tongue 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

My stories: The Haunted Stairwell v1.0
02-24-2012 12:21 AM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)