Frictional Games Forum (read-only)
Make objects 'scare' the player? - 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: Make objects 'scare' the player? (/thread-18348.html)



Make objects 'scare' the player? - Ungotter - 09-15-2012

I'm unsure as to what exactly it is called that I'm trying to pull off. But essentially, I have come across times in various CS' where for example a body falls out of a cupboard. What happens after that is the screen does some kind of 'zoom-in' action and the player gasps.

Essentially I've placed a dead body in a street for a player to find, upon seeing it I want it to focus on it and have the player gasped as I've described. I've tried searching for such a thing but I've no idea what exactly I'm looking for. Is this a script, something I can enable in the map editor? I'm unsure.

Any help would be appreciated! Thanks in advance Smile


RE: Make objects 'scare' the player? - i3670 - 09-15-2012

SanityDamage and PlaySoundAtEntity.

The sanitydamage will cause the zoom effect and you can choose what sound you want to be played in the react folder in sounds e.g. react_scare.snt


RE: Make objects 'scare' the player? - Kreekakon - 09-15-2012

Here's the script you should use:

Code:
GiveSanityDamage(5.0f, true);

Change the number to whatever you see fit for the situation.

As for focusing on the dead body you can use this:

Code:
StartPlayerLookAt("nameofdeadbody", 4.0f, 4.0f, "");

Change name of "nameofdeadbody" to whatever you named your dead body in the level editor. Also remember to call a StopPlayerLookAt(); when you want him to stop looking, otherwise your player will look at the body forever.

As with sanity damage, mess around with the values to achieve the disired effect. Read up more at script functions:
http://wiki.frictionalgames.com/hpl2/amnesia/script_functions#insanity


RE: Make objects 'scare' the player? - Ungotter - 09-15-2012

Thank you, both of you! I'm new to scripting, I still have to keep referring to tutorials for how to do certain things but hopefully I'll pick up. Thanks again!


RE: Make objects 'scare' the player? - Kreekakon - 09-15-2012

(09-15-2012, 02:25 PM)Ungotter Wrote: Thank you, both of you! I'm new to scripting, I still have to keep referring to tutorials for how to do certain things but hopefully I'll pick up. Thanks again!
The wiki has plenty of those. Read them up along with the script functions, and you'll be ready in no time! Smile