Project Zomboid

Project Zomboid

Comfy Sleeping [B41 & B42]
Ortus 1 Nov, 2023 @ 11:56pm
Errors
LOG : General , 1698908061770> 1 667 472 199> -----------------------------------------
STACK TRACE
-----------------------------------------
function: findNearbyPillow -- file: ComfySleeping_Client.lua line # 355 | MOD: ComfySleeping
function: mainFunc -- file: ComfySleeping_Client.lua line # 287 | MOD: ComfySleeping

ERROR: General , 1698908061771> 1 667 472 200> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getWorldObjects of non-table: null at KahluaThread.tableget line:1689.
ERROR: General , 1698908061771> 1 667 472 201> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: getWorldObjects of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:641)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
at zombie.Lua.Event.trigger(Event.java:64)
at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:92)
at zombie.gameStates.IngameState.updateInternal(IngameState.java:1624)
at zombie.gameStates.IngameState.update(IngameState.java:1333)
at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:101)
at zombie.GameWindow.logic(GameWindow.java:298)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:765)
at zombie.GameWindow.run_ez(GameWindow.java:681)
at zombie.GameWindow.mainThread(GameWindow.java:495)
at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1698908061772> 1 667 472 202> -----------------------------------------
STACK TRACE
-----------------------------------------
function: findNearbyPillow -- file: ComfySleeping_Client.lua line # 355 | MOD: ComfySleeping
function: mainFunc -- file: ComfySleeping_Client.lua line # 287 | MOD: ComfySleeping
< >
Showing 1-12 of 12 comments
Ortus 1 Nov, 2023 @ 11:57pm 
errors appear when one of my characters dies, I create a new one, and this error is endlessly reproduced and does not allow me to start a new game for a new character
HELP ME FLUFFY, I CANNOT FINDNEARBYPILLOW
Fluffy89  [developer] 13 Nov, 2023 @ 10:08am 
Originally posted by Ortus:
errors appear when one of my characters dies, I create a new one, and this error is endlessly reproduced and does not allow me to start a new game for a new character

Ill look into this now and should have something out soon since Im on break from uni atm.

I probably just forgot to refresh the player object.




Originally posted by Scroobles McDoodle:
HELP ME FLUFFY, I CANNOT FINDNEARBYPILLOW

Are you having the same issue, or whats wrong?
Fluffy89  [developer] 13 Nov, 2023 @ 10:12am 
I am also just now realizing this thread is over a week old, I never got notofied for your messages so Im sorry about reponding so late..
Fluffy89  [developer] 13 Nov, 2023 @ 11:26am 
Originally posted by Ortus:
errors appear when one of my characters dies, I create a new one, and this error is endlessly reproduced and does not allow me to start a new game for a new character

I've uploaded an update that should address this issue. As far as I could tell from testing, it was being caused because the dead player object loses track of it's position in the world. findNearbyPillow() would then fire because the code want's to know if a pillow is nearby, and since the player doesn't know where they are, the function fails and throws that error.

Please let me know if there are any other issues!
Ortus 13 Nov, 2023 @ 6:35pm 
Thanks for the answer and fix! The next time I get ready to play, I'll check and let you know whether the error has disappeared or not (if I remember).
Yeah, same issue as Ortus above. Kept throwing that error at me constantly. Wasn't sure how to fix it so I thought I'd come in here and start yelling :P
Yummy 13 Nov, 2023 @ 7:13pm 
@Fluffy89 errors did not disappear

STACK TRACE
-----------------------------------------
function: findNearbyPillow -- file: ComfySleeping_Client.lua line # 355 | MOD: ComfySleeping
function: mainFunc -- file: ComfySleeping_Client.lua line # 287 | MOD: ComfySleeping

ERROR: General , 1699931446867> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getWorldObjects of non-table: null at KahluaThread.tableget line:1689.
ERROR: General , 1699931446867> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: getWorldObjects of non-table: null

and this errors appear not only when you hide under the bed, but anywhere
Last edited by Yummy; 13 Nov, 2023 @ 7:15pm
Fluffy89  [developer] 13 Nov, 2023 @ 7:44pm 
Originally posted by Yummy:
@Fluffy89 errors did not disappear

STACK TRACE
-----------------------------------------
function: findNearbyPillow -- file: ComfySleeping_Client.lua line # 355 | MOD: ComfySleeping
function: mainFunc -- file: ComfySleeping_Client.lua line # 287 | MOD: ComfySleeping

ERROR: General , 1699931446867> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getWorldObjects of non-table: null at KahluaThread.tableget line:1689.
ERROR: General , 1699931446867> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: getWorldObjects of non-table: null

and this errors appear not only when you hide under the bed, but anywhere

Unsub from the mod on the workshop, and resub. I double checked, and I can hide underneath a bed and wardrobe and both result in no errors being thrown. Sometimes Steam has issues seeing and downloading the proper workshop mod version.

Once you do the above, errors should go away.



Originally posted by Ortus:
Thanks for the answer and fix! The next time I get ready to play, I'll check and let you know whether the error has disappeared or not (if I remember).

Much appreciated!

Originally posted by Scroobles McDoodle:
Yeah, same issue as Ortus above. Kept throwing that error at me constantly. Wasn't sure how to fix it so I thought I'd come in here and start yelling :P

Valid response lol. I did experience the problem Ortus posted when I went to test and killed a character, haven't noticed it in my current MP save as nobody had died up until that point, or at least nobody did with debug on so nobody would've noticed the errors.
In both b42 and b41, with no other mods loaded, I am not seeing any effect from clothing.

After investigation: comfortmodmap and clothing list were not being populated in init

changing inputs of comfortmodmap to include ComfySleeping precursor, eg:
ComfySleeping.options.hatcomfymod instead of options.hatcomfymod
caused comfortmodmap be populated again

clothinglist required this change:
local itemType = tostring(item:getType())

working again
Fluffy89  [developer] 5 Mar @ 12:20am 
Originally posted by 9kgsofrice:
In both b42 and b41, with no other mods loaded, I am not seeing any effect from clothing.

After investigation: comfortmodmap and clothing list were not being populated in init

changing inputs of comfortmodmap to include ComfySleeping precursor, eg:
ComfySleeping.options.hatcomfymod instead of options.hatcomfymod
caused comfortmodmap be populated again

clothinglist required this change:
local itemType = tostring(item:getType())

working again

Well... ♥♥♥♥, lol. I know I wasn't going crazy one day when I had my bag on and my comfort status wasn't changing at all haha.

Massive thanks for bringing this to my attention, I implemented the fixes you mentioned (huge help, thank you). item:getType() returns something different now from what I can tell, but changing this to item:getTypeString() fixes that issue.

Bags also didn't count at all because they don't have a body location, and the ifelse for handling Container type items wasn't getting an itemName declared locally, and the comfortModMap needs a body location. Fixed these two by adding in a local variable for the name, and setting the comfort modifier for bags to the bagComfyMod option, instead of checking the comfortModMap.

ComfySleeping should be working properly now! :spiffo:
(Update will be out in a moment)
Fluffy89  [developer] 5 Mar @ 12:37am 
Originally posted by 9kgsofrice:
In both b42 and b41, with no other mods loaded, I am not seeing any effect from clothing.

After investigation: comfortmodmap and clothing list were not being populated in init

changing inputs of comfortmodmap to include ComfySleeping precursor, eg:
ComfySleeping.options.hatcomfymod instead of options.hatcomfymod
caused comfortmodmap be populated again

clothinglist required this change:
local itemType = tostring(item:getType())

working again

Update 2.9.0 should be live and contain fixed code for both B41 and B42!
< >
Showing 1-12 of 12 comments
Per page: 1530 50