Jump to content

Help - abilities and speech


Recommended Posts

Well,i give up,gonna seek help here. Nothing that i found on forums helped.
I have 2 problems

1. trying to make my character resistant to heat but not vurneable to freezing
   

    inst.components.temperature.inherentsummerinsulation = 90
    inst.components.temperature.inherentinsulation = 0        

seems to do nothing,overheats like all other characters

2. Custom speech doesn't work

        RABBITHOUSE =
        {
            GENERIC = "I wish that was a real carrot",

Instead she says ,,this is not a real carrot" which is wilsons line

Its prolly just some dumb rookie mistake but oh well

modmain.lua

cherry.lua

speech_cherry.lua

Link to comment
Share on other sites

Woodie's insulation is set to 240. For some reason, the insulation time is set by "time in a segment of a day". A day segment is 30 time-units (which I'm guessing is seconds), and Woodie's insulation is set to 8 times that (there are normally 16 segments in a day). My GUESS is he takes 8 more day segments to go from 0 degrees to overheat temperature...or something? Pure speculation. Whatever the case, 80 or 120, as you have tried, is not a massive change. Try a higher value.

You're saying you want your character to be more resistant to heat, which is exactly what this variable does, but it won't make the character immune to overheating. It'll still happen, just slower.

Edited by Ultroman
Link to comment
Share on other sites

Take a look at the code for applying insulation effects in the temperature.lua file. self.delta (the change to be applied) has already been calculated, and this code (below) is now going to apply this change depending on several factors.

If the ambient_temperature (current world temperature) is above the starting temperature of the world, it only uses summer insulation if the delta is positive (you're heating up) and does not consider winter insulation if it is negative (you're cooling down). It does the reverse if ambient_temperature is lower than the world starting temperature.

So, in order to test this properly, you need it to be summer. You CAN use a firepit to test this, but it has to be summer i.e. the world has to be warm.

Spoiler

-- Winter insulation only affects you when it's cold out, summer insulation only helps when it's warm
if ambient_temperature >= TUNING.STARTING_TEMP then
	-- it's warm out
	if self.delta > 0 then
		-- If the player is heating up, defend using insulation.
		local winterInsulation, summerInsulation = self:GetInsulation()
		self.rate = math.min(self.delta, TUNING.SEG_TIME / (TUNING.SEG_TIME + summerInsulation))
	else
		-- If they are cooling, do it at full speed, and faster if they're overheated
		self.rate = math.max(self.delta, self.current >= self.overheattemp and -TUNING.THAW_DEGREES_PER_SEC or -TUNING.WARM_DEGREES_PER_SEC)
	end
-- it's cold out
elseif self.delta < 0 then
	-- If the player is cooling, defend using insulation.
	local winterInsulation, summerInsulation = self:GetInsulation()
	self.rate = math.max(self.delta, -TUNING.SEG_TIME / (TUNING.SEG_TIME + winterInsulation))
else
	-- If they are heating up, do it at full speed, and faster if they are freezing
	self.rate = math.min(self.delta, self.current <= 0 and TUNING.THAW_DEGREES_PER_SEC or TUNING.WARM_DEGREES_PER_SEC)
end

 

 

Edited by Ultroman
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...