Prince143 Posted September 12, 2014 Share Posted September 12, 2014 (edited) Hi could someone give me the code when it is day, sanity is going down a little bit and when it is dusk and night the sanity is increasing. TNX Edited September 12, 2014 by Prince143 Link to comment https://forums.kleientertainment.com/forums/topic/40654-code-for-losing-sanity-at-day-and-gaining-sanity-at-dusknight/ Share on other sites More sharing options...
lynn Posted September 12, 2014 Share Posted September 12, 2014 I don't know the code or where you can find it in the game files but if you check the code for the custom char "Hella Merdurial" on steam, it should be easy to spot it, or any other mod that use the same effect. Link to comment https://forums.kleientertainment.com/forums/topic/40654-code-for-losing-sanity-at-day-and-gaining-sanity-at-dusknight/#findComment-534770 Share on other sites More sharing options...
MidrealmDM Posted September 12, 2014 Share Posted September 12, 2014 (edited) In your character lua inst.components.sanity.dapperness = TUNING.DAPPERNESS.MED*-1-- where Tuning.Dapperness is your default (daytime) sanity loss/gain rate-- this is adapted from the character waxwell.lua-- Dapperness rates are shown in the Tuning.Lua file DAPPERNESS_TINY = 100/(day_time*15), DAPPERNESS_SMALL = 100/(day_time*10), DAPPERNESS_MED = 100/(day_time*6), DAPPERNESS_LARGE = 100/(day_time*3), DAPPERNESS_HUGE = 100/(day_time), day_time default is 300* but is dependent on day segments (daylight time) so probably changes slightlywith seasons as the number of segments of day light increase and decrease.At default day_time 'Tiny' comes out to 0.02 and 'Huge' comes out to 0.33 * 30 seconds per segment, 10 segments of daylight. I think dapperness is the sanity change per real time second, and 30 real time seconds per day 'segment' resulting in 480 real time seconds per day, (300 in daylight by default). At night the dapperness is affected by other factors and (while you might normally be gaining sanity) you loose sanity faster than any gain. My point being at 'Tiny' there is (barring any other factors light night and monsters) a change of about 11 sanity per full day, 16 at 'Small', 27 at 'Med', 53 at 'Large' and 160 at 'Huge'. inst.components.sanity.night_drain_mult = -0.5-- multiplier for sanity drain at night, in theory the negative multiplier will result in sanity gain.-- this is adapted from the character wolfgang.lua-- be careful of this, the character might rapidly gain sanity just by standing in the pitch black inst.components.sanity.neg_aura_mult = 1.0-- multiplier for sanity drain around creatures (if you want a change in that)-- this is adapted from the character wolfgang.lua Edited September 12, 2014 by MidrealmDM Link to comment https://forums.kleientertainment.com/forums/topic/40654-code-for-losing-sanity-at-day-and-gaining-sanity-at-dusknight/#findComment-534780 Share on other sites More sharing options...
Prince143 Posted September 12, 2014 Author Share Posted September 12, 2014 Thanks ! but the inst.components.sanity.dapperness = TUNING.DAPPERNESS.MED*-1 doesn't work ... it always crashes. Link to comment https://forums.kleientertainment.com/forums/topic/40654-code-for-losing-sanity-at-day-and-gaining-sanity-at-dusknight/#findComment-534791 Share on other sites More sharing options...
MidrealmDM Posted September 12, 2014 Share Posted September 12, 2014 Thanks ! but the inst.components.sanity.dapperness = TUNING.DAPPERNESS.MED*-1 doesn't work ... it always crashes. That may because it is a negative dapperness,or maybe the format.try this insteadinst.components.sanity.dapperness = (-TUNING.DAPPERNESS.MED) Link to comment https://forums.kleientertainment.com/forums/topic/40654-code-for-losing-sanity-at-day-and-gaining-sanity-at-dusknight/#findComment-534836 Share on other sites More sharing options...
Prince143 Posted September 13, 2014 Author Share Posted September 13, 2014 (edited) That may because it is a negative dapperness,or maybe the format.try this insteadinst.components.sanity.dapperness = (-TUNING.DAPPERNESS.MED) Doesn't work neither Edited September 13, 2014 by Prince143 Link to comment https://forums.kleientertainment.com/forums/topic/40654-code-for-losing-sanity-at-day-and-gaining-sanity-at-dusknight/#findComment-535030 Share on other sites More sharing options...
Prince143 Posted September 13, 2014 Author Share Posted September 13, 2014 Oh , wait I made a mistake ... It works fine now Thanks! Link to comment https://forums.kleientertainment.com/forums/topic/40654-code-for-losing-sanity-at-day-and-gaining-sanity-at-dusknight/#findComment-535045 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