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
How do i increase sanity to a player?
Romulator Offline
Not Tech Support ;-)

Posts: 3,628
Threads: 63
Joined: Jan 2013
Reputation: 195
#2
RE: How do i increase sanity to a player?

(06-15-2014, 01:43 PM)BIgcheker12 Wrote: I know how to increase the Insanity, but i need to increase the sanity.

So your saying that if the player touches an entity, they get more sane? Like the effects of the Sanity Potion? If so, quite easy! Smile

PHP Code: (Select All)
void OnStart()
{
SetEntityPlayerInteractCallback("<Name_Of_Item_to_interact_with>""give_me_sanity"false);
}
//Change the Name_of_Item... to the item you're touching in the Level Editor :3, still within the ""

void give_me_sanity(string &in asEntity)
{
AddPlayerSanity(10.0f);


Change the false in the SetEntityPlayerInteractCallback to true if you only want the player to get their sanity once.
And Change the 10.0f to however much Sanity you want the player to receive.

If you want the "sanity effect" to show up (screen flashes white), instead of AddPlayerSanity, use either:

PHP Code: (Select All)
GiveSanityBoost();
//OR
GiveSanityBoostSmall(); 

ALL of Amnesia's scripts can be found at the wiki at this page:
https://wiki.frictionalgames.com/doku.ph..._functions

Discord: Romulator#0001
[Image: 3f6f01a904.png]
(This post was last modified: 06-15-2014, 01:57 PM by Romulator.)
06-15-2014, 01:53 PM
Find


Messages In This Thread
RE: How do i increase sanity to a player? - by Romulator - 06-15-2014, 01:53 PM



Users browsing this thread: 1 Guest(s)