Project Zomboid

Project Zomboid

Working Vending Machines
 This topic has been pinned, so it's probably important
DisgracedPilot  [developer] 17 Feb, 2023 @ 5:26pm
Bug Reports
Please post bug reports here.
< >
Showing 1-15 of 15 comments
JENOVA Absolute 17 Feb, 2023 @ 9:15pm 
Error on world load below. I do have a large modpack, but I don't have anything that alters vending machines that I know of. I'll provide a full console.txt if needed.

`attempted index: items of non-table: null
function: removeVendingItems.lua -- file: removeVendingItems.lua line # 6 | MOD: Working Vending Machines
java.lang.RuntimeException: attempted index: items of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:492)
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.pcall(KahluaThread.java:1782)
at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:76)
at se.krka.kahlua.integration.LuaCaller.protectedCall(LuaCaller.java:117)
at zombie.Lua.LuaManager.RunLuaInternal(LuaManager.java:564)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:510)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:496)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:342)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:264)
at zombie.gameStates.GameLoadingState.enter(GameLoadingState.java:97)
at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:145)
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)
`
DisgracedPilot  [developer] 17 Feb, 2023 @ 11:53pm 
Originally posted by JENOVA Absolute:
Error on world load below. I do have a large modpack, but I don't have anything that alters vending machines that I know of. I'll provide a full console.txt if needed.

Thanks a ton for the report. I looked into it, and it looks like some mods modify the structure of the loot table. My loot table code assumed one specific structure, which doesn't work if a user has a different mod set. I think that I can address this. Hopefully I can get an update out soon.
Last edited by DisgracedPilot; 17 Feb, 2023 @ 11:55pm
DisgracedPilot  [developer] 18 Feb, 2023 @ 1:24am 
I modified the loot table code to allow it to handle variable loot table structure. I believe that the issue is resolved. Please give it a try and let me know if it works for you.
JENOVA Absolute 18 Feb, 2023 @ 2:12am 
Unfortunately, it's still throwing an error on world load. It's slightly different though. Different LUA and different line number. I did make sure to unsubscribe and make sure the old files were completely gone as well when updating.

`attempted index: items of non-table: null
function: WVMRemoveVendingItems.lua -- file: WVMRemoveVendingItems.lua line # 27 | MOD: Working Vending Machines
java.lang.RuntimeException: attempted index: items of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:492)
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.pcall(KahluaThread.java:1782)
at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:76)
at se.krka.kahlua.integration.LuaCaller.protectedCall(LuaCaller.java:117)
at zombie.Lua.LuaManager.RunLuaInternal(LuaManager.java:564)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:510)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:496)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:342)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:264)
at zombie.gameStates.GameLoadingState.enter(GameLoadingState.java:97)
at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:145)
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)
`
Last edited by JENOVA Absolute; 18 Feb, 2023 @ 2:15am
JENOVA Absolute 18 Feb, 2023 @ 2:16am 
I'm going to bed. If you release another hotfix by the time I wake up, I'll test that for you. Good luck again. :steamthumbsup:
DisgracedPilot  [developer] 18 Feb, 2023 @ 2:49am 
Originally posted by JENOVA Absolute:
I'm going to bed. If you release another hotfix by the time I wake up, I'll test that for you. Good luck again. :steamthumbsup:

Thanks again for the reports.

The script name was updated for easier tracing. It also contained the last set of updates, so the line numbers may be different. It's still the same loot table modification script, otherwise.

Line #27 of the updated code only runs when it sees a familiar loot table structure and tries to set the item spawn rate for vending machines to zero. So the fact that it got to that line and crashed means that it found a matching structure but couldn't find the entries for the vending machines. My guess is that there's a naming conflict with another mod, but I can't be sure without setting up debugging in that environment.

For now, I tried to add some additional robustness on the loot table structure check, so hopefully it can handle naming conflicts. If a mod is really making heavy unexpected alterations to the table, at least the code should not throw an error. The result would be that you would still be able to use the vending machines, but you would see random item spawns in the containers at the start of the game.

Please give it another try if you have a chance. Hope that this at least partially resolves the problem this time!
Last edited by DisgracedPilot; 18 Feb, 2023 @ 2:56am
UattO 18 Feb, 2023 @ 3:18am 
After the last update, i noticed an error in debug about the distribution file when i enter in my server
DisgracedPilot  [developer] 18 Feb, 2023 @ 3:52am 
Originally posted by UattO:
After the last update, i noticed an error in debug about the distribution file when i enter in my server

Yikes, that doesn't sound good. Could you post the exact error? Does anything break in game, or is this just a silent error in debug? Also, was this multiplayer?
Last edited by DisgracedPilot; 18 Feb, 2023 @ 4:00am
JENOVA Absolute 18 Feb, 2023 @ 1:53pm 
@DisgracedPilot. The issue is fixed. No error on world load. You were afraid that the change in code would result in items spawning in the machine at the start, and that is not the case. Vending machines are empty as intended on world creation. I only tested one snack machine though. I have not tested a drink machine yet. Will update if there's an issue with that. Awesome work. :steamhappy:
DisgracedPilot  [developer] 20 Feb, 2023 @ 6:49am 
Originally posted by JENOVA Absolute:
@DisgracedPilot. The issue is fixed. No error on world load. You were afraid that the change in code would result in items spawning in the machine at the start, and that is not the case. Vending machines are empty as intended on world creation. I only tested one snack machine though. I have not tested a drink machine yet. Will update if there's an issue with that. Awesome work. :steamhappy:

Great news! Thanks again for helping me track this down!
F1FTY 7 Apr, 2023 @ 5:28am 
There is bug in MP, after I made purchase food appearing in machine's inventory, and after I drag it in my inventory it dissapearing
DisgracedPilot  [developer] 7 Apr, 2023 @ 9:11am 
Originally posted by F1FTY:
There is bug in MP, after I made purchase food appearing in machine's inventory, and after I drag it in my inventory it dissapearing

Thanks for the report. Multiplayer is not exactly supported for now. One person in the comments said that the mod worked on his server except when he moved a machine into a player-claimed location. Did you move the machine?
F1FTY 7 Apr, 2023 @ 1:15pm 
@DisgracedPilot it is possible to use purchased food with just placing it on the ground, then move it in inventory. After that food will not dissapear. And without claimed location.
DisgracedPilot  [developer] 7 Apr, 2023 @ 2:31pm 
Originally posted by F1FTY:
@DisgracedPilot it is possible to use purchased food with just placing it on the ground, then move it in inventory. After that food will not dissapear. And without claimed location.

Thanks again, this helps. I'll think about it and see if I can find a way to fix it.
DisgracedPilot  [developer] 12 Aug, 2023 @ 12:10pm 
Originally posted by F1FTY:
@DisgracedPilot it is possible to use purchased food with just placing it on the ground, then move it in inventory. After that food will not dissapear. And without claimed location.

It's been a few months since you reported this, but the issue should be fixed in the latest version. Some code updates were needed to make this properly compatible with multiplayer.
< >
Showing 1-15 of 15 comments
Per page: 1530 50