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
Sanity hit when looking at area
Kyzer Offline
Junior Member

Posts: 17
Threads: 6
Joined: Sep 2015
Reputation: 0
#1
Sanity hit when looking at area

I need a better explanation as to how this works and what I need to do to make it work

I also want a specific thing to happen for this, like in the storyline when Daniel sees something surprising and unnerving, he makes a gasp noise and (from what I remember) the screen FOV goes through a sudden change and back to normal.

[Image: 0ab0120079.jpg]

I've been doing level design for years, just not for Amnesia. It's far different from hammer. I'm used to everything being a specific function done in the program :p (I mean I'm not used to scripting)
(This post was last modified: 09-23-2015, 02:39 AM by Kyzer.)
09-23-2015, 02:35 AM
Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#2
RE: Sanity hit when looking at area

I think that you could use AddEntityCollideCallback that binds to the area and use the Sepia and Trail screen effects with PlaySound and some Sanity damage to do sort of the same thing although I'm not quite sure.

Example:
Spoiler below!

PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Player""AreaName""Sanity"true1); //Command that tells the area what happens when you hit the area
}

void Sanity(string &in asParentstring &in asChildint alState)
{
GiveSanityDamage(15.0ftrue); //Command that damages the sanity. Let's just say 15. Let's put true in the effect because why not?
FadeSepiaColorTo(1.0f0.3f); //Command that turns the screen red. Let's set the time to full effect to 0.3 seconds.
FadeImageTrailTo(1.0f0.3f); //Command that sort of gets a trail effect. Let's put the same thing as FadeSepia but you can edit that.
PlayGuiSound("gasp.snt"1.0f); //Command that gives the sound. Now I AM NOT SURE WHAT THE FILE IS, but you can search the Amnesia sound directory to find the appropriate sound. Make sure you put .snt after the name as the original command demands it.



This is just an example as I haven't tested it out yet and I made this on the spot.

"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 09-23-2015, 07:57 AM by PutraenusAlivius.)
09-23-2015, 07:56 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#3
RE: Sanity hit when looking at area

The GiveSanityDamage is all that is required for the FOV, sound, and loss of sanity. Anyway, I answered your other thread. You should stick to one and not make duplicates.

For the sake of it, I'll just quote my reply here for now.

(09-23-2015, 08:03 AM)Mugbill Wrote: Ah, yes here it is:
PHP Code: (Select All)
SetEntityPlayerLookAtCallback(stringasNamestringasCallbackbool abRemoveWhenLookedAt); 

The callback syntax is void MyFunc(string &in asEntity, int alState)

If you're not familiar with scripting, this should look like so:

PHP Code: (Select All)
void OnStart()
{
    
SetEntityPlayerLookAtCallback("NAME_OF_AREA""NAME_OF_CALLBACK"true);
}

void NAME_OF_CALLBACK(string &in asEntityint alState)
{
    
GiveSanityDamage(15.0ftrue);


(This post was last modified: 09-23-2015, 08:11 AM by Mudbill.)
09-23-2015, 08:09 AM
Find
Kyzer Offline
Junior Member

Posts: 17
Threads: 6
Joined: Sep 2015
Reputation: 0
#4
RE: Sanity hit when looking at area

(09-23-2015, 08:09 AM)Mugbill Wrote: The GiveSanityDamage is all that is required for the FOV, sound, and loss of sanity. Anyway, I answered your other thread. You should stick to one and not make duplicates.

For the sake of it, I'll just quote my reply here for now.

(09-23-2015, 08:03 AM)Mugbill Wrote: Ah, yes here it is:
PHP Code: (Select All)
SetEntityPlayerLookAtCallback(stringasNamestringasCallbackbool abRemoveWhenLookedAt); 

The callback syntax is void MyFunc(string &in asEntity, int alState)

If you're not familiar with scripting, this should look like so:

PHP Code: (Select All)
void OnStart()
{
    
SetEntityPlayerLookAtCallback("NAME_OF_AREA""NAME_OF_CALLBACK"true);
}

void NAME_OF_CALLBACK(string &in asEntityint alState)
{
    
GiveSanityDamage(15.0ftrue);


I'm getting the effect but I'm not getting the gasping sound. (using 50)
(This post was last modified: 09-25-2015, 02:15 AM by Kyzer.)
09-25-2015, 02:15 AM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#5
RE: Sanity hit when looking at area

The gasp is not part of this line. If you want that, you'll need to add it separately. You can do so with

PHP Code: (Select All)
PlayGuiSound("filename.snt"1.0f); 

I don't remember what the file name is, but you will find it in the sounds folder somewhere, likely under player.

(This post was last modified: 09-25-2015, 07:32 AM by Mudbill.)
09-25-2015, 07:31 AM
Find




Users browsing this thread: 1 Guest(s)