Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Timer for StartPlayerLookAt?
jens Offline
Frictional Games

Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation: 202
#2
RE: Timer for StartPlayerLookAt?

AddTimer is very simple, AddTimer("NameOfTimer", 1, "NameOfFunction");

So this means that 1 second after you trigger the AddTimer, you will execute what is in NameOfFunction.

Assuming you want the player to look at something when going into an area it would be something like:

void CollidePlayerArea(string &in asParent, string &in asChild, int alState)
{
    StartPlayerLookAt("LooktAtArea", 2, 2, "");    

    AddTimer("Scared", 2, "TimerLookAtEvents");  //After 2 seconds he is scared
    AddTimer("StopLookAt", 4, "TimerLookAtEvents");  //After 4 seconds he stops to look
}

void TimerLookAtEvents(string &in asTimer)
{
     if(asTimer == "Scared")
    {
        PlayGuiSound("react_scare.snt", 1);
    }
    else if (asTimer == "StopLookAt")
    {
        StopPlayerLookAt();
    }
}
09-21-2010, 07:48 AM
Website Find


Messages In This Thread
Timer for StartPlayerLookAt? - by theDARKW0LF - 09-21-2010, 07:36 AM
RE: Timer for StartPlayerLookAt? - by jens - 09-21-2010, 07:48 AM
RE: Timer for StartPlayerLookAt? - by gosseyn - 09-21-2010, 07:52 AM
RE: Timer for StartPlayerLookAt? - by MulleDK19 - 09-21-2010, 02:11 PM



Users browsing this thread: 1 Guest(s)