Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 2 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Make objects 'scare' the player?
Ungotter Offline
Junior Member

Posts: 11
Threads: 3
Joined: Sep 2012
Reputation: 0
#1
Question  Make objects 'scare' the player?

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
(This post was last modified: 09-16-2012, 03:15 PM by Ungotter.)
09-15-2012, 01:13 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#2
RE: Make objects 'scare' the player?

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

"What you think is irrelevant" - A character of our time

A Christmas Hunt
09-15-2012, 02:04 PM
Find
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#3
RE: Make objects 'scare' the player?

Here's the script you should use:

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:

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/amn...s#insanity

[Image: Tv0YgQb.gif]
Image by BandyGrass
(This post was last modified: 09-15-2012, 02:22 PM by Kreekakon.)
09-15-2012, 02:22 PM
Find
Ungotter Offline
Junior Member

Posts: 11
Threads: 3
Joined: Sep 2012
Reputation: 0
#4
RE: Make objects 'scare' the player?

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!
09-15-2012, 02:25 PM
Find
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#5
RE: Make objects 'scare' the player?

(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

[Image: Tv0YgQb.gif]
Image by BandyGrass
(This post was last modified: 09-15-2012, 02:27 PM by Kreekakon.)
09-15-2012, 02:27 PM
Find




Users browsing this thread: 1 Guest(s)