Jump to content

Recommended Posts

Hello! I've started work on my second mod, and while it's been going smoothly so far, I do have a question or two. The first one is this: How would I change the rate at which my character dries off? Basically, said character has thick fur, and as a result it holds water longer than short fur would. Is there a way I can make her dry off slower? And in a similar vein, is it possible to make my character more susceptible to cold only when wet? (As it currently stands, she's less likely to freeze and more likely to overheat overall.) Thanks!

to change drying rate try changing player.components.moisture.maxDryingRate
By default this is 0.1, so try how quick he dries, if you set it to 0.01 eg. or to 1 (just to see if it does what you want to see)
As you can see in the name of this variable, it is the max! drying rate. So even if you set it to 1, it could be that you still only dry with 0.1 or lower values, since drying depends on several factors.

in components/moisture you can see this function, which calculates the drying rate:

function Moisture:GetDryingRate(moisturerate)
    -- Don't dry if it's raining
    if (moisturerate or self:GetMoistureRate()) > 0 then
        return 0
    end

    local heaterPower = self.inst.components.temperature ~= nil and math.clamp(self.inst.components.temperature.externalheaterpower, 0, 1) or 0

    local rate = self.baseDryingRate
        + easing.linear(heaterPower, self.minPlayerTempDrying, self:GetSegs() < 3 and 2 or 5, 1)
        + easing.linear(TheWorld.state.temperature, self.minDryingRate, self.maxDryingRate, self.optimalDryingTemp)
        + easing.inExpo(self:GetMoisture(), 0, 1, self.maxmoisture)

    return math.clamp(rate, 0, self.maxDryingRate + self.maxPlayerTempDrying)
end

You could also hook into this function and return for your character half of the original value. I guess this would be the best solution...
 

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