Jump to content

Recommended Posts

Is there a way to change how much damage a character takes from overheating/freezing?  I've heard there's also a way to change the  temperature at which these statuses take effect.

I imagine the code will go into the "local master_postinit = function(inst)"

furryeskimo.lua

Edited by FurryEskimo

In the temperature component you can see these functions. These set the amount of health removed from the entity when freezing (hurtrate) and overheating (overheathurtrate). When overheathurtrate is nil, it instead uses the hurtrate for overheating, as well.

function Temperature:SetFreezingHurtRate(rate)
    self.hurtrate = rate
end

function Temperature:SetOverheatHurtRate(rate)
    self.overheathurtrate = rate
end

 

Wonderful, thank you!
I dropped this into the master_postinit and it worked out just fine.

inst.components.temperature:SetFreezingHurtRate(0.25)
inst.components.freezable:SetResistance(2)  

Not totally sure if the freeze resistance is at 200%, but probably.  It's hard to test
The character plays a lot differently than I'd been expecting.  There are lots of benefits to using exclusively endothermic fires, but suddenly the character can't cook their own food.

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