Jump to content

Help with sanity perk

Recommended Posts

Hi there, I've created my own character mod with a custom hat. Everything seems to be working, however I can't seem to get my head around adding perks to her.


The perk I am hoping to add is she loves the darkness, so she has a small increase in sanity during the night. I know Wendy has a similar perk, but I don't know how to include hers into my own and tweak it. I usually get an error.


Some guidance would be wonderful, I'll include my characters prefab!



Link to comment
Share on other sites


I think it's just this line.

inst.components.sanity.night_drain_mult = TUNING.WENDY_SANITY_MULT

WENDY_SANITY_MULT is 0.75 so the total value is reduced when multiplied.


Portion of sanity.lua for reference:

	if day then 		light_delta = TUNING.SANITY_DAY_GAIN	else			local highval = TUNING.SANITY_HIGH_LIGHT		local lowval = TUNING.SANITY_LOW_LIGHT		if lightval > highval then			light_delta =  TUNING.SANITY_NIGHT_LIGHT		elseif lightval < lowval then			light_delta = TUNING.SANITY_NIGHT_DARK		else			light_delta = TUNING.SANITY_NIGHT_MID		end		light_delta = light_delta*self.night_drain_mult	end 

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

  • Create New...