RedHairedHero Posted January 15, 2017 Share Posted January 15, 2017 Hello, I'm attempting to have two different sources drain sanity without them overriding each other. The basic setup is the character should lose sanity during the day, dusk would remain normal, and no sanity drain at night. Along with this they have an alternate mode they can change into by pressing T, this mode drains sanity while you're in it, and when you come out of it it should return back to normal. The issue I'm running into is using inst.components.sanity.dapperness seems to completely override each instance instead of being added or subtracted from each other. Any help would be appreciated. Thank you Link to comment https://forums.kleientertainment.com/forums/topic/73394-help-multiple-sanity-drain-instances/ Share on other sites More sharing options...
RedHairedHero Posted January 21, 2017 Author Share Posted January 21, 2017 I've resolved this issue. Instead of using inst.components.sanity.dapperness to set the sanity drain during the day I setup a custom function for sanity drain. local function sanityfn(inst) local delta = 0 if TheWorld.state.isday then delta = TUNING.SANITY_NIGHT_MID end return delta end --This part will go into the Master Postinit inst.components.sanity.custom_rate_fn = sanityfn Link to comment https://forums.kleientertainment.com/forums/topic/73394-help-multiple-sanity-drain-instances/#findComment-860288 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