Frictional Games Forum (read-only)

Full Version: Drain sanity while looking at something?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Yet another question I have. Can someone help me and explain how to drain the players sanity when he is looking at something? Like, if he looks at a dead body part (torso or whatever else) he starts to drain sanity, but when he looks away, the draining stops.

Please help and thanks.
I haven't used them yet, but you might want to try insanity areas.
(09-21-2011, 02:56 AM)Your Computer Wrote: [ -> ]I haven't used them yet, but you might want to try insanity areas.
Insanity areas? I suppose those script functions are on the wiki correct? But how do I use them?
I think the insanity areas are only triggered when your Insanity is low (25 or less I think). Thats how I've seem them work so far, you get a random sound played back at you.

I've tried placing multiple ones close to eachother (5 seconds apart) but the 2nd or 3rd one won't trigger.

(09-21-2011, 03:07 AM)Rapture Wrote: [ -> ]I think the insanity areas are only triggered when your Insanity is low (25 or less I think). Thats how I've seem them work so far, you get a random sound played back at you.

I've tried placing multiple ones close to eachother (5 seconds apart) but the 2nd or 3rd one won't trigger.
Ohhh...Well isnt there another way to do what I mentioned without insanity areas?
(09-21-2011, 03:08 AM)Xvideogamer720X Wrote: [ -> ]Ohhh...Well isnt there another way to do what I mentioned without insanity areas?

Possibly:
Code:
void LowerSanity(string &in entity, int state)
{
     if (entity == "script_area_name" && state == 1)
     {
          LowerSanity(entity);
     }

     else RemoveTimer(entity);
}

void LowerSanity(string &in timer_name)
{
     GiveSanityDamage(1, false);
     AddTimer(timer_name, 1, "LowerSanity");
}

Code:
SetEntityPlayerLookAtCallback("script_area_name", "LowerSanity", false);
Insanity areas just make a random insanity event happen, from a predefined list. You can look at and choose an event while in the debug menu too. Things like flies on the screen, screen going red, Daniel talking to himself, that sort of thing.
So first what you're going to do is make a script area to cover the object that drains the person's insanity.
Then you use the
SetEntityPlayerLookAtCallback(string& asName, string& asCallback, bool abRemoveWhenLookedAt); function to check if the player is looking at it. Make sure abRemoveWhenLookedAt is false, and have it call a function that starts a timer function that drains the player's sanity when alState is 1 and removes the timer when alState is -1. You can add in sound effects and screen distortion effects etc too if you would like.

make sense?
Alright Ill try some of these methods out. Thanks guys