Project Zomboid

Project Zomboid

Immersive Solar Arrays (v41, GitHub reupload)
Lu5ck 2023 年 5 月 1 日 上午 2:51
Error -> function: chargeBatteries
I am seeing this in console log
STACK TRACE ----------------------------------------- function: chargeBatteries -- file: ISAPowerbank_server.lua line # 132 | MOD: Immersive Solar Arrays [23.5.1] function: updatePowerbanks -- file: ISAPowerbankSystem_server.lua line # 166 | MOD: Immersive Solar Arrays [23.5.1] ERROR: General , 1682934555017> 10,803,378> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in chargeBatteries at KahluaUtil.fail line:82. ERROR: General , 1682934555017> 10,803,378> DebugLogStream.printException> Stack trace: java.lang.RuntimeException: Object tried to call nil in chargeBatteries at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82) at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:973) 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:65) at zombie.GameTime.update(GameTime.java:671) at zombie.gameStates.IngameState.UpdateStuff(IngameState.java:566) at zombie.gameStates.IngameState.updateInternal(IngameState.java:1623) at zombie.gameStates.IngameState.update(IngameState.java:1333) at zombie.network.GameServer.main(GameServer.java:903) LOG : General , 1682934555017> 10,803,379> ----------------------------------------- STACK TRACE ----------------------------------------- function: chargeBatteries -- file: ISAPowerbank_server.lua line # 132 | MOD: Immersive Solar Arrays [23.5.1] function: updatePowerbanks -- file: ISAPowerbankSystem_server.lua line # 166 | MOD: Immersive Solar Arrays [23.5.1]
< >
正在显示第 1 - 5 条,共 5 条留言
Poltergeist  [开发者] 2023 年 5 月 1 日 上午 4:25 
最后由 Poltergeist 编辑于; 2023 年 5 月 1 日 上午 5:24
Lu5ck 2023 年 5 月 1 日 上午 10:02 
That's troubling, I use it on a server, I like the noticeable performance difference, yes my server load the maps faster now. It is quite difficult to get everybody onboard to do those steps, given that I have dozens of players online throughout the the day and also people who logon only on weekends.

Does replacing (pick up & place) the battery rack sufficient to switch to the new mechanic?
最后由 Lu5ck 编辑于; 2023 年 5 月 1 日 上午 10:04
Poltergeist  [开发者] 2023 年 5 月 1 日 上午 10:46 
The specific error is from having items that are not batteries in the container. As far as I know, you only need to take the bad items out of the containers. After that, they are not allowed to be put in.

The other changes were about missing items, this one is rather random and might cause minor glitches.
Lu5ck 2023 年 5 月 3 日 上午 3:42 
So the error is from non-batteries so I assume is technically non-drainable items?

If I modified the code like this
function SPowerbank:chargeBatteries(container,charge) local items = container:getItems() for i=0,items:size()-1 do local item = items:get(i) if item:IsDrainable() then item:setUsedDelta(charge) else container:Remove(item) end end end
Then let it run for a week like that, it will programmatically remove all the invalid items, yes?
Poltergeist  [开发者] 2023 年 5 月 3 日 上午 5:15 
*check patch here
https://psteamcommunity.yuanyoumao.com/workshop/filedetails/discussion/2857548524/3762229314896836679/#c3823036783898362025

You can remove the AddWorldInventoryItem line if you don't want the items to be dropped on ground.
最后由 Poltergeist 编辑于; 2023 年 5 月 5 日 上午 12:16
< >
正在显示第 1 - 5 条,共 5 条留言
每页显示数: 1530 50