Jump to content

Recommended Posts

My character is supposed to be very tough and wears custom armour that is basically represented with this code:

 

inst.components.health:SetAbsorbAmount(0.95)

 

The problem is that it is also applying to the amount of damage taken when starving. The health goes down very slowly. How can I fix this to make the health go down faster when starving?

 

wrexcharactermod.zip

Edited by dave9664

Huh, starving damage isn't true damage after all.

AddComponentPostInit("hunger", function(self)	local old = self.DoDec	function self:DoDec(dt, ignore_damage)		if self.inst.prefab == "wrex" then			local old = self.current			if self.burning then				if self.current <= 0 then					if not ignore_damage then						self.inst.components.health:DoDelta(-self.hurtrate*dt, true, "hunger", nil, nil, true) --  ich haber hunger					end				else					self:DoDelta(self.burnrate*(-self.hungerrate*dt), true)				end			end		else			old(self, dt, ignore_damage)		end	endend)

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