Frictional Games Forum (read-only)
Bang on the door scare script - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Bang on the door scare script (/thread-9473.html)



Bang on the door scare script - ObsidianLegion - 07-29-2011

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.


RE: Bang on the door scare script - Kyle - 07-29-2011

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.

Code:
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);
}



RE: Bang on the door scare script - Elven - 08-30-2011

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)


RE: Bang on the door scare script - Obliviator27 - 08-30-2011

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.


RE: Bang on the door scare script - Elven - 08-30-2011

thank you Obliviator27 Smile


RE: Bang on the door scare script - Obliviator27 - 08-30-2011

Anytime, good sir.