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
Bang on the door scare script
ObsidianLegion Offline
Member

Posts: 173
Threads: 53
Joined: Jun 2011
Reputation: 0
#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.

"Good men mean well; they just don't always end up doing well." -Isaac Clarke, Dead Space 2, Chapter 12
(This post was last modified: 07-29-2011, 09:58 PM by ObsidianLegion.)
07-29-2011, 03:52 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#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
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#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
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#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
Elven Offline
Posting Freak

Posts: 862
Threads: 37
Joined: Aug 2011
Reputation: 26
#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
Obliviator27 Offline
Posting Freak

Posts: 792
Threads: 10
Joined: Jul 2011
Reputation: 66
#6
RE: Bang on the door scare script

Anytime, good sir.
08-30-2011, 12:36 PM
Find




Users browsing this thread: 1 Guest(s)