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?
BIgcheker12 Offline
Junior Member

Posts: 34
Threads: 8
Joined: Aug 2011
Reputation: 0
#3
RE: How do i increase sanity to a player?

(06-15-2014, 01:53 PM)Romulator Wrote:
(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

Alright 2 more questions: 1. Whats the max sanity you can have? And 2. Can you make it work, that when you touch this item, your game will be auto-saved?

Trying to do something completely new Big Grin

Work in Progress:
Big-Dark-House
Lost but not alone...
06-15-2014, 02:05 PM
Find


Messages In This Thread
RE: How do i increase sanity to a player? - by BIgcheker12 - 06-15-2014, 02:05 PM



Users browsing this thread: 1 Guest(s)