seronis Posted February 20, 2015 Share Posted February 20, 2015 (edited) Is the penalty applied in a sanityaura really supposed to be applied globally, ignoring distance to player? In the sanity component you see the following code for determining penalty:function Sanity:RecalculatePenalty() self.penalty = 0 for k,v in pairs(Ents) do if v.components.sanityaura and v.components.sanityaura.penalty then self.penalty = self.penalty + v.components.sanityaura.penalty end end self:DoDelta(0)endUnless im forgetting something 'Ents' is the global entity list. The code above isnt checking how far away these sources are. Is this intended behavior ? Edited February 20, 2015 by seronis Link to comment https://forums.kleientertainment.com/forums/topic/51222-curious-about-sanitypenalty-being-applied-globally/ Share on other sites More sharing options...
Mobbstar Posted February 20, 2015 Share Posted February 20, 2015 Is it used by the game? No. Is it possibly more complicated to arrange than it seems at first? I don't know. Link to comment https://forums.kleientertainment.com/forums/topic/51222-curious-about-sanitypenalty-being-applied-globally/#findComment-614955 Share on other sites More sharing options...
seronis Posted February 20, 2015 Author Share Posted February 20, 2015 (edited) Except it is called by the game. GameLogic.lua line 873 during world init. Err also shadowwaxwell.lua line 29 and waxwelljournal.lua line 53. So its being used by the game definitely. Im just curious if its a bug that distances are not checked. Edited February 20, 2015 by seronis Link to comment https://forums.kleientertainment.com/forums/topic/51222-curious-about-sanitypenalty-being-applied-globally/#findComment-614961 Share on other sites More sharing options...
Blueberrys Posted February 20, 2015 Share Posted February 20, 2015 (edited) @seronis The sanity penalty is not applied to the current sanity, but to the max sanity.(sanity.lua)function Sanity:GetMaxSanity() return (self.max - self.penalty)endYou are correct that it checks globally, and that is the intended behaviour. Shadowwaxwell decreases the player's max sanity when spawned, regardless of where he is in the world. Edited February 20, 2015 by Blueberrys Link to comment https://forums.kleientertainment.com/forums/topic/51222-curious-about-sanitypenalty-being-applied-globally/#findComment-614966 Share on other sites More sharing options...
seronis Posted February 20, 2015 Author Share Posted February 20, 2015 (edited) Yeah i know its applying to max sanity which will drop your current sanity if it was above the new max. Im making some personal tweaks to how max sanity is determined and I wanted to make sure I wasnt making bad assumptions about the penalty, and if this was considered a bug i was just gonna fix the bug in my code. And mostly since im making max sanity a dynamically changing thing i didnt want to introduce any bugs as i mess around with it. Edited February 20, 2015 by seronis Link to comment https://forums.kleientertainment.com/forums/topic/51222-curious-about-sanitypenalty-being-applied-globally/#findComment-614985 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now