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
Solved Bang on the door scare script
Author Message
JackoIsDeath Offline
Member

Posts: 171
Joined: Jun 2011
Reputation: 0
Post: #1
Bang on the door scare script
What script do you use for when people bang on the doors?

Like if I'm walking down a hallway and I pass a door and for scares, something bangs on that door.

(This post was last modified: 07-29-2011 09:58 PM by JackoIsDeath.)
07-29-2011 03:52 PM
Find all posts by this user Quote this message in a reply
Kyle Offline
Posting Freak

Posts: 910
Joined: Sep 2010
Reputation: 7
Post: #2
RE: Bang on the door scare script
For an example, we'll have a hallways like this (the | is hallway, the / is Door01, and the - is ScriptArea_1):

|
|/
|
-
|

The door opens that way -->

Up and down is y, '^'(verticle) is x, '--->'(horizontal) is z.

So we add prop impulse to the door and sound when player collides with ScriptArea_1, also making him look at it for 2 seconds.

void OnStart()
{
     AddEntityCollideCallback("Player", "ScriptArea_1", "Func01", true, 1);
}
void Func01(string &in asParent, string &in asChild, int alState)
{
     AddPropImpulse("Door01", 0, 0, 5, "World");
     PlaySoundAtEntity("", "21_bang_door.snt", "Door01", 0, false);
     StartPlayerLookAt("Door01", 2, 2, "");
     AddTimer("", 2, "TimerFunc");
}
void TimerFunc(string &in asTimer)
{
     StopPlayerLookAt();
     PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);
}

07-29-2011 04:37 PM
Find all posts by this user Quote this message in a reply
Elven Offline
Posting Freak

Posts: 868
Joined: Aug 2011
Reputation: 26
Post: #3
RE: Bang on the door scare script
Sorry to bring it up again Smile, but I have related question.

How to make like banging, not door closed or opened.

Just particle effect on door, make effect like people are trying to get out and banging the door. Just that effect. Thanks Kyle, I know you will help me Smile! (or someone else)

The Interrogation
Chapter 1

My tutorials
08-30-2011 11:40 AM
Find all posts by this user Quote this message in a reply
Obliviator27 Offline
Posting Freak

Posts: 801
Joined: Jul 2011
Reputation: 65
Post: #4
RE: Bang on the door scare script
PlaySoundAtEntity("", "scare_slam_door.snt", "[doorname]", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "[door, or area in front of door]", false);

I simply used that.
08-30-2011 12:07 PM
Find all posts by this user Quote this message in a reply
Elven Offline
Posting Freak

Posts: 868
Joined: Aug 2011
Reputation: 26
Post: #5
RE: Bang on the door scare script
thank you Obliviator27 Smile

The Interrogation
Chapter 1

My tutorials
08-30-2011 12:09 PM
Find all posts by this user Quote this message in a reply
Obliviator27 Offline
Posting Freak

Posts: 801
Joined: Jul 2011
Reputation: 65
Post: #6
RE: Bang on the door scare script
Anytime, good sir.
08-30-2011 12:36 PM
Find all posts by this user Quote this message in a reply
Post Reply 




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