Mudbill Wrote:Most likely the game doesn't use the value 0.0 for sanity, at least not for long enough for the timer to pick it up. Perhaps once it hits 0.0, the value is immediately bumped up to the recovery value as the sanity collapse happens.
When Daniel gets back up at the end of the sanity collapse is when it restores to the recovery value - the game keeps Sanity locked down at the "min" value but it doesn't update/lower when Daniel collapses.
RaXZerGamingZ Wrote:the lowest sanity goes by draining from darkness is 0.001250 i think, the strange part is i originally put in the code " <=0.0f "
By that logic, the if-conditional would have been correct if sanity reached a point where it was less than 0.0 with a bunch of zeros appended, since 0.0 implies just 0. This would also therefore work if no matter
low sanity must be 0 exact for Daniel to collapse, then any sort of "negative" sanity (an instance where you receive sanity damage at an already low enough state) should reset the sanity to be exactly 0.
The issue is, if the engine is doing rounding to determine when Daniel is to collapse, it doesn't exactly correspond with the sanity value. If Daniel collapses but still is at 0.000125 sanity, the sanity is still technically greater than 0. Therefore, it didn't pass the if check but continued to loop correctly.
This is why I mentioned looking at the sanity values for when Daniel collapses. With a few tweaks to the game.cfg file, I bet you can find an "exact" value to test for to see when Daniel collapses, and then update your if to check if the sanity is less than or equal to that value.