Jump to content

Retaining water


Recommended Posts

take a look at GetDryingRate at line 231 of data/scripts/components/moisture.lua:

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

there seems to be a variety of ways to affect the drying rate, like you could override this function to lower its return value for example

Link to comment
Share on other sites

9 minutes ago, Jessie223 said:

take a look at GetDryingRate at line 231 of data/scripts/components/moisture.lua:


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

there seems to be a variety of ways to affect the drying rate, like you could override this function to lower its return value for example

I'll fiddle around with this stuff until I run out ideas. This isn't that big of a priority to be honest, but thanks for the info anyway.

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