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
Making a scream play when player enters a room?
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#15
RE: Making a scream play when player enters a room?

Nono, keep the timer you had before in Scream_1, put another one in Scream_Trigger, call another function with it, Scream_Trigger. Put the StopPlayerLookAt function in there. So basically, Scream_1 triggers a timer, after 2 seconds the sound plays, you look at the door, and another timer is called, then 2 seconds or more later, the player stops looking at the door.

void OnStart()
{
AddEntityCollideCallback("Player", "Scream", "Scream_1", true, 1);
}
void Scream_1(string &in asParent, string &in asChild, int alStates)
{
   AddTimer("Somenamedoesntreallymatter", 2.0f, "Scream_Trigger");
}

void Scream_Trigger(string &in asTimer)
{
   PlaySoundAtEntity("Scream_1", "04_scream.snt", "Scream_1", 0, false);
   StartPlayerLookAt("LookArea_1", 1, 1, "");
   AddTimer("Somenamedoesntreallymatter", 2.0f, "LookArea_Trigger");
}
void LookArea_Trigger(string &in asParent, string &in asChild, int alStates)
{
   StopPlayerLookAt();
}

It's all a consecutive thing, this way the timers just from function to function.
(This post was last modified: 03-23-2011, 04:19 AM by MrBigzy.)
03-23-2011, 04:18 AM
Find


Messages In This Thread
RE: Making a scream play when player enters a room? - by MrBigzy - 03-23-2011, 04:18 AM



Users browsing this thread: 4 Guest(s)