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
Get Sanity to drain in the dark and increase in the light?
FragdaddyXXL Offline
Member

Posts: 136
Threads: 20
Joined: Apr 2012
Reputation: 7
#12
RE: Get Sanity to drain in the dark and increase in the light?

(04-13-2012, 02:06 AM)DRedshot Wrote: I bolded the thing you missed. You had to recalculate the current sanity after modifying it with the sanityFactor.
Also, I changed a '>' to a '>=' because sanity doesn't recover in light. You are in light when sanity is equal to it's previous value Smile

Hope this helps.

Edit: Bold doesn't work in code format :/

Also, I'd lower the sanity factor by quite a lot, losing 20 sanity per second seems a bit too much, maybe make it = 0.5-1
Yeah, I was staring at my code for a while and noticed the <=. And I was making it lose a lot to speed up the effect for testing. But would you look at that? It works now! (with the addition of that extra

curSanity = GetPlayerSanity();) I thought that because I hadn't changed curSanity in the Update method, I wouldn't need that.



Dark Seclusion Here
04-13-2012, 02:45 AM
Find


Messages In This Thread
RE: Get Sanity to drain in the dark and increase in the light? - by FragdaddyXXL - 04-13-2012, 02:45 AM



Users browsing this thread: 2 Guest(s)