Jump to content

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! 

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...