Jump to content

Modify sanity loss against Monsters only?


Recommended Posts

Hi I'm new to modding characters in DST and was wondering if there was a way to increase the sanity loss multiplier by a little bit around monsters?

 

I have a character who is scared of monsters and would be losing sanity more than the regular character when near them. 

This Sanity drain should not affect near evil flowers or darkness! only monsters!

Im just struggling to find the code for it. If anyone could help me that would be greatly appreciated! 

Link to comment
Share on other sites

you need to create an extra function for sanity loss rate instead of just using the multiplier and link it like this:
 

inst.components.sanity.custom_rate_fn = sanityfn

then you can create the definition of the function above like this:


local function sanityfn(inst)
	/*-- HERE YOU NEED TO DETECT THE TAGS OF THE MONSTERS WICH WILL MODIFY THE SANITY LOSS --*/
    /*-- THEN JUST MODIFY THE SANITY RATE AS YOU NEED --*/
end

hope it is of use to you, take care and good luck.

Link to comment
Share on other sites

Archived

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...