Jump to content

Hunger suddenly drops on character.


Recommended Posts

Alrighty, I do believe something had changed, My character Lyss, has a major bug that makes her unplayable, Her hunger will drop seconds after spawning when it is supposed to be very slightly faster than wilsons hunger drop.

 

local function sanitydelta(inst)
   if inst.components.sanity.current >= 100 then
      	inst.components.combat.damagemultiplier = 1.5 --1.5x damage multiplier
      	inst.components.hunger.hungerrate = 1.5 --1.5x hunger rate
    	inst.components.health:SetAbsorptionAmount (-0.2) -- 20% more damage taken
   elseif inst.components.sanity.current >= 50 then
      	inst.components.combat.damagemultiplier = 2 -- 2x damage multiplier
     	inst.components.hunger.hungerrate = 2 -- 2x hunger rate
    	inst.components.health:SetAbsorptionAmount (-0.4) -- 40% more damage taken
   elseif inst.components.sanity.current <= 50 then
    	inst.components.combat.damagemultiplier = 4 -- 4x damage multiplier
    	inst.components.hunger.hungerrate = 4 -- 4x hunger rate
    	inst.components.health:SetAbsorptionAmount (-6) -- 60% more damage taken
   end
end

 

This is the code that manages her Hunger, the lower her sanity the stronger she is, and the higher her hunger drain is.

Link to comment
Share on other sites

hunger rate is not a multiplier against wilson's hunger rate, which is 75 hunger in 8 minutes.

If you want to make it based off wilson's hunger rate you'll need to multiply it against: TUNING.WILSON_HUNGER_RATE = 75/(30*16)

Which if you do the math is 0.15625 times a second, remember hunger is deducted per second.

It's just eased out over delta's for lag compensation.

Atm you are losing anywhere from 1.5-4 hunger per second vs wilson's 0.15625 hunger per second.

edit:

If you want some examples for default characters, check out wolfgang, and wes who both suffer variable hunger penalties, and they use wilson's hunger rate as a base.

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