Jump to content

HELP WITH HP ABSORPTION


Recommended Posts

hey :3!
I'm trying to mod in a character with a beard that provides extra defense while it's larger, which did work well for a bit.
but it started crashing my game every time it reached the 3rd beard level.
Can anyone provide any advice?
Thanks!
 

worraine.lua

If it helps. I believe this error might have something to do with it:
 

[00:01:46]: [string "scripts/components/beard.lua"]:54: attempt to perform arithmetic on field 'bits' (a nil value)
LUA ERROR stack traceback:
scripts/components/beard.lua:54 in (method) GetInsulation (Lua) <53-55>
   self =
      prize = beefalowool
      callbacks = table: 000000004667E620
      isgrowing = true
      onreset = function - ../mods/worraine1/scripts/prefabs/worraine.lua:22
      insulation_factor = 1
      inst = 119665 - worraine (valid:true)
      is_skinnable = true
      daysgrowth = 3
scripts/components/temperature.lua:250 in (method) GetInsulation (Lua) <228-265>
   self =
      inherentsummerinsulation = 0
      totalmodifiers = 0
      shelterinsulation = 180
      mintemp = -20
      maxmoisturepenalty = 30
      hurtrate = 1.25
      inherentinsulation = 0
      ignoreheatertags = table: 000000002FCB10B0
      maxtemp = 90
      rate = 0
      usespawnlight = true
      sheltered_level = 1
      delta = -0.87508750391372
      externalheaterpower = 0
      sheltered = false
      overheattemp = 70
      _ = table: 000000002FCB0CA0
      inst = 119665 - worraine (valid:true)
   winterInsulation = 0
   summerInsulation = 0
scripts/components/temperature.lua:432 in (method) OnUpdate (Lua) <273-453>
   self =
      inherentsummerinsulation = 0
      totalmodifiers = 0
      shelterinsulation = 180
      mintemp = -20
      maxmoisturepenalty = 30
      hurtrate = 1.25
      inherentinsulation = 0
      ignoreheatertags = table: 000000002FCB10B0
      maxtemp = 90
      rate = 0
      usespawnlight = true
      sheltered_level = 1
      delta = -0.87508750391372
      externalheaterpower = 0
      sheltered = false
      overheattemp = 70
      _ = table: 000000002FCB0CA0
      inst = 119665 - worraine (valid:true)
   dt = 0.033333335071802
   applyhealthdelta = nil
   mintemp = -20
   maxtemp = 90
   ambient_temperature = 28.125514051045
   owner = nil
   inside_pocket_container = false
   sleepingbag_ambient_temp = false
   ents = table: 00000000314D4CD0
scripts/update.lua:257 in () ? (Lua) <219-293>
   dt = 0.033333335071802
   tick = 587
   k = 119665
   v = 119665 - worraine (valid:true)
   cmp = table: 000000002FCB0520

[00:01:46]: [string "scripts/components/beard.lua"]:54: attempt to perform arithmetic on field 'bits' (a nil value)
LUA ERROR stack traceback:
    scripts/components/beard.lua:54 in (method) GetInsulation (Lua) <53-55>
    scripts/components/temperature.lua:250 in (method) GetInsulation (Lua) <228-265>
    scripts/components/temperature.lua:432 in (method) OnUpdate (Lua) <273-453>
    scripts/update.lua:257 in () ? (Lua) <219-293>
    

Link to comment
Share on other sites

Looks like it might be because on line 63 of your file, its setting your beard's bits to the 6th in the table instead of 3rd like I'm assuming you want. Since there is no 6th value in the table its setting bits to nil, which is causing the crash. Hope this helps!

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