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
Drain sanity while looking at something?
SonOfLiberty796 Offline
Senior Member

Posts: 371
Threads: 39
Joined: Aug 2011
Reputation: 2
#1
Drain sanity while looking at something?

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.
09-21-2011, 02:44 AM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: Drain sanity while looking at something?

I haven't used them yet, but you might want to try insanity areas.

Tutorials: From Noob to Pro
09-21-2011, 02:56 AM
Website Find
SonOfLiberty796 Offline
Senior Member

Posts: 371
Threads: 39
Joined: Aug 2011
Reputation: 2
#3
RE: Drain sanity while looking at something?

(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?
09-21-2011, 03:00 AM
Find
Rapture Offline
Posting Freak

Posts: 1,078
Threads: 79
Joined: May 2011
Reputation: 30
#4
RE: Drain sanity while looking at something?

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
Find
SonOfLiberty796 Offline
Senior Member

Posts: 371
Threads: 39
Joined: Aug 2011
Reputation: 2
#5
RE: Drain sanity while looking at something?

(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
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: Drain sanity while looking at something?

(09-21-2011, 03:08 AM)Xvideogamer720X Wrote: Ohhh...Well isnt there another way to do what I mentioned without insanity areas?

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

SetEntityPlayerLookAtCallback("script_area_name", "LowerSanity", false);

Tutorials: From Noob to Pro
(This post was last modified: 09-21-2011, 03:26 AM by Your Computer.)
09-21-2011, 03:22 AM
Website Find
MrBigzy Offline
Senior Member

Posts: 616
Threads: 18
Joined: Mar 2011
Reputation: 8
#7
RE: Drain sanity while looking at something?

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.
(This post was last modified: 09-21-2011, 03:37 AM by MrBigzy.)
09-21-2011, 03:37 AM
Find
Homicide13 Offline
Senior Member

Posts: 323
Threads: 41
Joined: Nov 2010
Reputation: 14
#8
RE: Drain sanity while looking at something?

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?

(This post was last modified: 09-21-2011, 08:52 PM by Homicide13.)
09-21-2011, 08:52 PM
Find
SonOfLiberty796 Offline
Senior Member

Posts: 371
Threads: 39
Joined: Aug 2011
Reputation: 2
#9
RE: Drain sanity while looking at something?

Alright Ill try some of these methods out. Thanks guys
09-23-2011, 02:24 AM
Find




Users browsing this thread: 1 Guest(s)