Jump to content

Left death state error


Recommended Posts

I've seen this mentioned elsewhere in default characters, and the patch notes mention an update that was supposed to fix the problem, but I didn't see any specifics about how that was done. Searches didn't bring up anything of the sort, either.

It's happening on a mod character I'm working on, but only when she dies in her alternate form. I'm pretty lost regarding what could even be causing this.

 

For anyone interested...

 

Crash log:


[00:11:49]: Deleting user minimap from session/0110003F152D18B1/KU_28MOElzB_/minimap
[00:11:49]: Deleting user session from session/0110003F152D18B1/KU_28MOElzB_/0000000036
[00:11:49]: SAVING Morgue 40
[00:11:50]: QueryServerComplete no callback
[00:11:52]: Deleting user minimap from session/0110003F152D18B1/KU_28MOElzB_/minimap
[00:11:52]: Deleting user session from session/0110003F152D18B1/KU_28MOElzB_/0000000036
[00:11:52]: [string "scripts/stategraphs/SGwilson.lua"]:812: Left death state.
LUA ERROR stack traceback:
=[C]:-1 in (global) assert © <-1--1>
scripts/stategraphs/SGwilson.lua:812 in (field) onexit (Lua) <810-813>
inst = 133186 - wara (valid:true)
scripts/stategraph.lua:456 in (method) GoToState (Lua) <444-505>
self =
tags = table: 3BFCAAB8
mem = table: 2D702490
statemem = table: 3BFCAA90
currentstate = table: 3E0A4420
timelineindex = 1
timeinstate = 0.033333335071802
sg = Stategraph : wilson
inst = 133186 - wara (valid:true)
statestarttime = 215.10001121834
bufferedevents = table: 1045C720
lastupdatetime = 215.13334455341
laststate = table: 2D6F5CB8
prevstate = table: 3E0A4420
statename = death
params = nil
state = table: 3E0A4420
scripts/stategraphs/SGwilson.lua:416 in (field) fn (Lua) <407-430>
inst = 133186 - wara (valid:true)
scripts/stategraph.lua:398 in (method) HandleEvents (Lua) <389-409>
self =
tags = table: 3BFCAAB8
mem = table: 2D702490
statemem = table: 3BFCAA90
currentstate = table: 3E0A4420
timelineindex = 1
timeinstate = 0.033333335071802
sg = Stategraph : wilson
inst = 133186 - wara (valid:true)
statestarttime = 215.10001121834
bufferedevents = table: 1045C720
lastupdatetime = 215.13334455341
laststate = table: 2D6F5CB8
prevstate = table: 3E0A4420
buff_events = table: 1045C720
k = 1
event = table: 44668A08
handler = table: 31225828
scripts/stategraph.lua:143 in (method) Update (Lua) <107-146>
self =
updaters = table: 14636708
OnEnterNewState = function - scripts/stategraph.lua:27
tickwaiters = table: 0DA9B9E0
haveEvents = table: 44659AF8
hibernaters = table: 0DA9CB88
instances = table: 0DA9BAA8
current_tick = 6535
waiters = table: 1CFBC928
updaters = table: 146365F0
evs = table: 14636DC0
k = sg="wilson", state="death", time=2.73, tags = "busy,pausepredict,nomorph,"
v = true
scripts/update.lua:205 in () ? (Lua) <146-219>
dt = 0.033333335071802
tick = 6535
i = 6535

[00:11:52]: SCRIPT ERROR! Showing error screen
[00:11:53]: QueryServerComplete no callback
[00:11:53]: SAVING Morgue 39
[00:11:53]: QueryServerComplete no callback
[00:11:53]: QueryServerComplete no callback
[00:12:03]: Force aborting...

 

Wara prefab:

 

local MakePlayerCharacter = require "prefabs/player_common"


local assets = {

Asset( "ANIM", "anim/player_basic.zip" ),
Asset( "ANIM", "anim/player_idles_shiver.zip" ),
Asset( "ANIM", "anim/player_actions.zip" ),
Asset( "ANIM", "anim/player_actions_axe.zip" ),
Asset( "ANIM", "anim/player_actions_pickaxe.zip" ),
Asset( "ANIM", "anim/player_actions_shovel.zip" ),
Asset( "ANIM", "anim/player_actions_blowdart.zip" ),
Asset( "ANIM", "anim/player_actions_eat.zip" ),
Asset( "ANIM", "anim/player_actions_item.zip" ),
Asset( "ANIM", "anim/player_actions_uniqueitem.zip" ),
Asset( "ANIM", "anim/player_actions_bugnet.zip" ),
Asset( "ANIM", "anim/player_actions_fishing.zip" ),
Asset( "ANIM", "anim/player_actions_boomerang.zip" ),
Asset( "ANIM", "anim/player_bush_hat.zip" ),
Asset( "ANIM", "anim/player_attacks.zip" ),
Asset( "ANIM", "anim/player_idles.zip" ),
Asset( "ANIM", "anim/player_rebirth.zip" ),
Asset( "ANIM", "anim/player_jump.zip" ),
Asset( "ANIM", "anim/player_amulet_resurrect.zip" ),
Asset( "ANIM", "anim/player_teleport.zip" ),
Asset( "ANIM", "anim/wilson_fx.zip" ),
Asset( "ANIM", "anim/player_one_man_band.zip" ),
Asset( "ANIM", "anim/shadow_hands.zip" ),
Asset( "SOUND", "sound/sfx.fsb" ),
Asset( "SOUND", "sound/wilson.fsb" ),
Asset( "ANIM", "anim/beard.zip" ),

Asset( "ANIM", "anim/wara.zip" ),
Asset( "ANIM", "anim/ghost_wara_build.zip" ),
Asset( "ANIM", "anim/waraalt.zip"),
}
local prefabs = {}
local start_inv = {
}

-- This initializes for both clients and the host
local common_postinit = function(inst)
-- Minimap icon
inst.MiniMapEntity:SetIcon( "wara.tex" )
end

local function applyForm(inst)
if inst.form == "demonic" then

inst.components.combat:SetDefaultDamage(25)
inst.components.hunger:SetRate(TUNING.WILSON_HUNGER_RATE * 1.5)
inst.components.locomotor.walkspeed = TUNING.WILSON_WALK_SPEED * 1.3
inst.components.locomotor.runspeed = TUNING.WILSON_RUN_SPEED * 1.3

inst.components.sanity.dapperness = -1
inst.components.sanity.neg_aura_mult = 0.5

inst.entity:AddLight()
inst.Light:Enable(true)
inst.Light:SetRadius(5)
inst.Light:SetFalloff(.6)
inst.Light:SetIntensity(0.9)
inst.Light:SetColour(235/255,12/255,235/255)

end

if inst.form == "normal" then

inst.components.combat:SetDefaultDamage(10)
inst.components.hunger:SetRate(TUNING.WILSON_HUNGER_RATE)
inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.05)
inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.05)

inst.components.sanity.dapperness = 0.05
inst.components.sanity.neg_aura_mult = 0

inst.entity:AddLight()
inst.Light:Enable(false)
inst.Light:SetRadius(0)
inst.Light:SetFalloff(0)
inst.Light:SetIntensity(0)
inst.Light:SetColour(0/255,0/255,0/255)

end

end

local function becomenormal(inst, silent)

if inst.form == "normal" then
return
end

if inst.demontask then
inst.demontask:Cancel()
inst.demontask = nil
end

inst.form = "normal"
inst.AnimState:SetBuild("wara")

end

local function becomedemonic(inst, silent)

if inst.form == "demonic" then
return
end

inst.demontask = inst:DoPeriodicTask (0.005, function()
if inst.components.health then
inst.components.health:DoDelta(0.05, true, "Curse")
end
end)

inst.form = "demonic"
inst.AnimState:SetBuild("waraalt")

end

local function onsanitychange(inst, data, forcesilent)

if inst.sg:HasStateTag("nomorph") or
inst:HasTag("playerghost") or
inst.components.health:IsDead() then
return
end

local silent = inst.sg:HasStateTag("silentmorph") or not inst.entity:IsVisible() or forcesilent

if inst.form == "demonic" then
if inst.components.sanity.current > (49) then
becomenormal(inst, silent)
end
elseif inst.form == "normal" then
if inst.components.sanity.current < (46) then
becomedemonic(inst, silent)
end
end
applyForm(inst)

end

local function onnewstate(inst)

if inst._wasnomorph ~= inst.sg:HasStateTag("nomorph") then
inst._wasnomorph = not inst._wasnomorph
if not inst._wasnomorph then
onsanitychange(inst)
end
end

end

local function onbecameghost(inst)
if inst._wasnomorph ~= nil then
inst.form = "normal"
inst._wasnomorph = nil
inst.talksoundoverride = nil
inst.hurtsoundoverride = nil
inst:RemoveEventCallback("sanitydelta", onsanitychange)
inst:RemoveEventCallback("newstate", onnewstate)
end
end

local function onbecamehuman(inst)

if inst._wasnomorph == nil then
inst.form = "normal"
inst._wasnomorph = inst.sg:HasStateTag("nomorph")
inst.talksoundoverride = nil
inst.hurtsoundoverride = nil
inst:ListenForEvent("sanitydelta", onsanitychange)
inst:ListenForEvent("newstate", onnewstate)
if inst.demontask then
inst.demontask:Cancel()
inst.demontask = nil
end
onsanitychange(inst, nil, true)
end

end

local function onload(inst)

inst:ListenForEvent("ms_respawnedfromghost", onbecamehuman)
inst:ListenForEvent("ms_becameghost", onbecameghost)

if inst:HasTag("playerghost") then
onbecameghost(inst)
else
onbecamehuman(inst)
end

end

-- This initializes for the host only
local master_postinit = function(inst)

-- This changes the amount of sanity given to Mara by a butterflymuffin
-- Special thanks to rezecib!
local OldEat = inst.components.eater.Eat
inst.components.eater.Eat = function(self, food)
if self:CanEat(food) and food.prefab == ("butterflymuffin") then
food.components.edible.sanityvalue = food.components.edible.sanityvalue + 20
end
return OldEat(self, food)
end

-- choose which sounds this character will play
inst.soundsname = "wickerbottom"

-- Stats
inst.components.health:SetMaxHealth(125)
inst.components.hunger:SetMax(100)
inst.components.sanity:SetMax(95)
inst.components.hunger:SetRate(TUNING.WILSON_HUNGER_RATE)
inst.components.combat:SetDefaultDamage(10)
inst.components.sanity.dapperness = 0.05
inst.components.sanity.neg_aura_mult = 0
inst.components.locomotor.walkspeed = (TUNING.WILSON_WALK_SPEED * 1.05)
inst.components.locomotor.runspeed = (TUNING.WILSON_RUN_SPEED * 1.05)

inst.form = "normal"
inst._wasnomorph = nil
inst.talksoundoverride = nil
inst.hurtsoundoverride = nil

inst.OnLoad = onload
inst.OnNewSpawn = onload

end


return MakePlayerCharacter("wara", prefabs, assets, common_postinit, master_postinit, start_inv)

 

Other than the alt-form death problem (and some needed adjustments here and there, that regen is insane), everything seems to be working fine.

Edited by Pyr0mrcow
Link to comment
Share on other sites

I blame the task, try using a task like:

	inst.demontask = inst:DoPeriodicTask (4, function()		if inst.components.health then			inst.components.health:DoDelta(1, true, "Curse")		end	end)

Then die as a demon.

Link to comment
Share on other sites

Great, that did it! Strange though, the previous one and Phantas-Moon's were both very similar, the only difference being the use of decimals...well, it worked out, that's what's important.

 

Looking at this now and thinking about where I originally got these pieces from, I feel like it's related to the last not-tweaking thing that I definitely want to impliment with her before release. I'm wanting to add an on-hit effect to her 'demon' unarmed attacks that applies a sort of burn; damage over time, for 5 seconds, doing 5 damage per second. I'm trying to make her into someone who specifically benefits from jumping in and out of combat rather than tanking, moreso than other characters.
If possible I'd like it to trigger the 'smoldering' animation on the enemy hit, but that's just an ideal.

 

Haven't looked into the process heavily yet, it just seemed related and I felt like rambling.

Link to comment
Share on other sites

Er...well, maybe it didn't.
Continual testing doing adjustments, and it came up again. Used the backup with no change but what you suggested, and it still happened.

 


[00:06:39]: [string "scripts/stategraphs/SGwilson.lua"]:812: Left death state.
LUA ERROR stack traceback:
=[C]:-1 in (global) assert © <-1--1>
scripts/stategraphs/SGwilson.lua:812 in (field) onexit (Lua) <810-813>
   inst = 133215 - wara (valid:true)
scripts/stategraph.lua:456 in (method) GoToState (Lua) <444-505>
   self =
      tags = table: 3FB38258
      mem = table: 0E033718
      statemem = table: 3FB38208
      currentstate = table: 0E870C80
      timelineindex = 1
      timeinstate = 0.033333335071802
      sg = Stategraph : wilson
      inst = 133215 - wara (valid:true)
      bufferedevents = table: 3D2BB0C0
      lastupdatetime = 284.5333481729
      statestarttime = 284.50001483783
      laststate = table: 0E67AB98
      prevstate = table: 0E870C80
   statename = death
   params = nil
   state = table: 0E870C80
scripts/stategraphs/SGwilson.lua:416 in (field) fn (Lua) <407-430>
   inst = 133215 - wara (valid:true)
scripts/stategraph.lua:398 in (method) HandleEvents (Lua) <389-409>
   self =
      tags = table: 3FB38258
      mem = table: 0E033718
      statemem = table: 3FB38208
      currentstate = table: 0E870C80
      timelineindex = 1
      timeinstate = 0.033333335071802
      sg = Stategraph : wilson
      inst = 133215 - wara (valid:true)
      bufferedevents = table: 3D2BB0C0
      lastupdatetime = 284.5333481729
      statestarttime = 284.50001483783
      laststate = table: 0E67AB98
      prevstate = table: 0E870C80
   buff_events = table: 3D2BB0C0
   k = 1
   event = table: 4429BB18
   handler = table: 0E866CD0
scripts/stategraph.lua:143 in (method) Update (Lua) <107-146>
   self =
      updaters = table: 442911D0
      OnEnterNewState = function - scripts/stategraph.lua:27
      tickwaiters = table: 1578C3D0
      haveEvents = table: 4483C6B0
      hibernaters = table: 1578BD18
      instances = table: 1578BD40
   current_tick = 8670
   waiters = table: 43B90B30
   updaters = table: 441AC568
   evs = table: 441AD670
   k = sg="wilson", state="death", time=4.50, tags = "busy,pausepredict,nomorph,"
   v = true
scripts/update.lua:205 in () ? (Lua) <146-219>
   dt = 0.033333335071802
   tick = 8670
   i = 8670

[00:06:39]: SCRIPT ERROR! Showing error screen    
[00:06:40]: QueryServerComplete no callback
[00:06:40]: QueryServerComplete no callback
[00:06:40]: SAVING Morgue    39    
[00:06:41]: QueryServerComplete no callback
[00:06:56]: Force aborting...

 

As far as I can tell, it's happening or not happening at random...

Link to comment
Share on other sites

I usually spawn a garland or flowers to lower sanity, then either run into a fire or spawn a deerclops to do some testing of unarmed damage. Two birds with one stone.
I also forgot that that was even a command.

 

The last few times I've died with no items on me, just to see if it made a difference, but it hasn't.
I thought for a bit that it was caused by dying a second time during one world load, but then I died the first time.

I died twice after bringing my sanity to 0 with flowers, and was killed by crawiling horror. No crash.

 

Crash if I die to a fire.
Crash if I die while on fire and attacked by a crawling horror.

Crash if I die to deerclopse.

 

Mod's here:

wara.zip

Edited by Pyr0mrcow
Link to comment
Share on other sites

I have killed myself many times in normal and demon form and I got no crashes.

Killed myself with deerclops.

Killed myself on fire with deerclops.

Killed myself wearing garland and fire, with a terrorbeak.

 

Nothing.

 

What game mode are you playing at, survival, wilderness?

Are you in a dedicated server with the mod loaded or playing as host?

Do you have other mods active?

 

If anything, I will remove the unnecessary wolfgang code, like all the _nomorphs hanging around.

 

I believe I got the functionalities right.

Try dying with this.

waraop.zip

Edited by DarkXero
Link to comment
Share on other sites

Sorry about the delayed reply.

Died to Deerclops fine a few times.
Died to fire (insane, both above and at 0) and it crashed.

 

The crashes only seem to happen when I'm in the alt mode. Deerclops and fire both previously triggering a crash made me think it was something with status effects, however they work, but your changes seem to fix the Deerclops crash...that or I'm just on a lucky spree of dying correctly to it.

 

I've been testing on a self-hosted (not Dedicated) Wilderness server, but tried dying to fire on Endless and the crash still happened.

Log from that attempt:

[00:09:13]: [string "scripts/stategraphs/SGwilson.lua"]:812: Left death state.
LUA ERROR stack traceback:
=[C]:-1 in (global) assert © <-1--1>
scripts/stategraphs/SGwilson.lua:812 in (field) onexit (Lua) <810-813>
   inst = 110916 - wara (valid:true)
scripts/stategraph.lua:456 in (method) GoToState (Lua) <444-505>
   self =
      timelineindex = 1
      tags = table: 2F391008
      mem = table: 30210340
      statemem = table: 2F3879E0
      currentstate = table: 2ECAC438
      timeinstate = 0.033333335071802
      sg = Stategraph : wilson
      inst = 110916 - wara (valid:true)
      bufferedevents = table: 2F388188
      lastupdatetime = 282.43334806338
      statestarttime = 282.40001472831
      laststate = table: 16BB2A48
      prevstate = table: 2ECAC438
   statename = death
   params = nil
   state = table: 2ECAC438
scripts/stategraphs/SGwilson.lua:416 in (field) fn (Lua) <407-430>
   inst = 110916 - wara (valid:true)
scripts/stategraph.lua:398 in (method) HandleEvents (Lua) <389-409>
   self =
      timelineindex = 1
      tags = table: 2F391008
      mem = table: 30210340
      statemem = table: 2F3879E0
      currentstate = table: 2ECAC438
      timeinstate = 0.033333335071802
      sg = Stategraph : wilson
      inst = 110916 - wara (valid:true)
      bufferedevents = table: 2F388188
      lastupdatetime = 282.43334806338
      statestarttime = 282.40001472831
      laststate = table: 16BB2A48
      prevstate = table: 2ECAC438
   buff_events = table: 2F388188
   k = 1
   event = table: 31236DA0
   handler = table: 0DAB6C60
scripts/stategraph.lua:143 in (method) Update (Lua) <107-146>
   self =
      updaters = table: 31232868
      OnEnterNewState = function - scripts/stategraph.lua:27
      tickwaiters = table: 10A43E58
      haveEvents = table: 3123FE28
      hibernaters = table: 10A43EA8
      instances = table: 10A43E30
   current_tick = 8500
   waiters = nil
   updaters = table: 31235FE0
   evs = table: 312360A8
   k = sg="wilson", state="death", time=0.93, tags = "busy,pausepredict,nomorph,"
   v = true
scripts/update.lua:205 in () ? (Lua) <146-219>
   dt = 0.033333335071802
   tick = 8500
   i = 8500

[00:09:13]: SCRIPT ERROR! Showing error screen    
[00:09:13]: QueryServerComplete no callback
[00:09:14]: QueryServerComplete no callback
[00:09:15]: QueryServerComplete no callback
[00:09:19]: Force aborting...

Edited by Pyr0mrcow
Link to comment
Share on other sites

@Pyr0mrcow, well, I'm stupid.

 

I replicated it.

 

It was the task after all. With the 4 seconds there was a small chance you weren't going to disappear fast enough to trigger an incorrect heal. With that close to 0 number, it was more obvious, I changed it to 1 to trigger the error more easily.

 

The health component wasn't deleted and the curse was giving you health, so you exited death to another state and you crashed.

 

Solution: add an extra condition when going to heal with the task, to avoid this.

I also made the task self cancel if you don't have the health component or you are dead.

wara.lua

Link to comment
Share on other sites

I was a little suspicious of it being something to do with the task due to how it was acting between timing changes and the random-seeming nature, but I thought you would've caught it if it was and I wasn't sure of the exact part of it that was causing the problem anyway xD Oh well, I'll be a little more confident next time.

Though, I should've been a bit more careful reversing the health tick from from the start.

Seems to be working as intended now. Woo! Now I just need to get the alt form onhit burn effect going without being a crash machine.

Edited by Pyr0mrcow
Link to comment
Share on other sites

I'd like to make Alt-Mara hit someone, causing the target's health to drain small amounts for a few seconds.

Ideally, the effect would only trigger when she attacks while unarmed, and would play the smoldering effect or something similar on the affected individual, but...that's just the ideal. Not sure of how reasonable it is to do those last two parts, still looking into files and posts and whatnot between paperwork.

 

EDIT: Easiest to say it is that I'm going for something that looks like an acidic burning effect.

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