Jump to content

character perks (wet inventory/no wetness damage)


Recommended Posts

Hello,

I've started working on my first character mod today, but have hit a bit of confusion with perks. I want her to be able to not take damage from moisture, but as a downside to this have her inventory be in a constant wetness state (for context, it is a slime character). I'm new to this, so sorry if i'm asking simple questions or impossible things. Here is my yourcharacter.lua

akane.lua

Link to comment
Share on other sites

58 minutes ago, hotsaucemiku said:

Hello,

I've started working on my first character mod today, but have hit a bit of confusion with perks. I want her to be able to not take damage from moisture, but as a downside to this have her inventory be in a constant wetness state (for context, it is a slime character). I'm new to this, so sorry if i'm asking simple questions or impossible things. Here is my yourcharacter.lua

akane.lua

What damage are you referring to exaclty? Sanity drop or Temperature drop?

Link to comment
Share on other sites

For the sanity loss due to moisture, you can extend the function Sanity:Recalc(dt) on your particular character's sanity-component. So, you make a custom function that saves the original function and the value of GLOBAL.TUNING.MOISTURE_SANITY_PENALTY_MAX, then you set GLOBAL.TUNING.MOISTURE_SANITY_PENALTY_MAX to 0, then call the original function, and set GLOBAL.TUNING.MOISTURE_SANITY_PENALTY_MAX back to normal. This function should replace the original Sanity:Recalc(dt) on your particular character's sanity-component.

For the temperature-penalty, it's super easy, though. You simply set maxmoisturepenalty on the temperature-component of your character to be 0.

For the constant wetness of items, this presents a problem, since the items should work normally when they leave your inventory. You'd have to do something on each item you pick up, where you save their initial values of the variables wetnessThreshold and drynessThreshold in their inventoryitemmoisture-component when they enter your inventory, and then set wetnessThreshold to 0 and drynessThreshold = -1. Then when the inventory item leaves your inventory, you set the values back.

 

I hope there's a better way of doing these things, but these solutions are plausible.

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...