Project Zomboid

Project Zomboid

[VFE] VANILLA FIREARMS EXPANSION (B41)
Most Recent Update breaks all non-weapon items held in primary hand.
Holding onto a gas can, flashlight, bag, or any other item not flagged as a weapon produces infinite errors.

Debug Mode is pointing directly to line 3 of the flashlight lua, but it looks like there may be others.
< >
Showing 1-9 of 9 comments
Baconcloud 30 Aug, 2023 @ 3:19am 
yuop :D already got to 100k errors in frikin minutes :D
DarthNosaj 30 Aug, 2023 @ 4:27am 
yah I've been swapping between a weapon and any tool I need to use, then relaunching at about 50-60k errors... it's messy but it works. I was in the middle of dismantling cars to get mine un-stuck from traffic. this wasn't the best timing for me... could we re-schedule this bug for tomorrow? lol Propane torch is another, for whatever that's worth.
Last edited by DarthNosaj; 30 Aug, 2023 @ 4:29am
bioinformer 30 Aug, 2023 @ 5:02am 
There are definately others...

`function: WeaponLightBeam -- file: VFE_WeaponLight.lua line # 27 | MOD: Vanilla Firearms Expansion
`

function: WeaponLightBeam -- file: VFE_WeaponLight.lua line # 27 | MOD: Vanilla Firearms Expansion
java.lang.RuntimeException: Object tried to call nil in WeaponLightBeam
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:92)
at zombie.characters.IsoPlayer.updateInternal2(IsoPlayer.java:2141)
at zombie.characters.IsoPlayer.updateInternal1(IsoPlayer.java:1935)
at zombie.util.lambda.Invokers$Params1$CallbackStackItem.run(Invokers.java:37)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.core.profiling.AbstractPerformanceProfileProbe.lambda$invokeAndMeasure$0(AbstractPerformanceProfileProbe.java:83)
at zombie.util.lambda.Stacks$Params3$CallbackStackItem.invoke(Stacks.java:230)
at zombie.util.lambda.Stacks$GenericStack.invokeAndRelease(Stacks.java:26)
at zombie.util.Lambda.capture(Lambda.java:130)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:81)
at zombie.characters.IsoPlayer.update(IsoPlayer.java:1924)
at zombie.MovingObjectUpdateSchedulerUpdateBucket.update(MovingObjectUpdateSchedulerUpdateBucket.java:79)
at zombie.MovingObjectUpdateScheduler.update(MovingObjectUpdateScheduler.java:145)
at zombie.iso.IsoCell.ProcessObjects(IsoCell.java:2955)
at zombie.iso.IsoCell.updateInternal(IsoCell.java:5750)
at zombie.util.lambda.Invokers$Params1$CallbackStackItem.run(Invokers.java:37)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.core.profiling.AbstractPerformanceProfileProbe.lambda$invokeAndMeasure$0(AbstractPerformanceProfileProbe.java:83)
at zombie.util.lambda.Stacks$Params3$CallbackStackItem.invoke(Stacks.java:230)
at zombie.util.lambda.Stacks$GenericStack.invokeAndRelease(Stacks.java:26)
at zombie.util.Lambda.capture(Lambda.java:130)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:81)
at zombie.iso.IsoCell.update(IsoCell.java:5696)
at zombie.iso.IsoWorld.updateInternal(IsoWorld.java:3499)
at zombie.util.lambda.Invokers$Params1$CallbackStackItem.run(Invokers.java:37)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.core.profiling.AbstractPerformanceProfileProbe.lambda$invokeAndMeasure$0(AbstractPerformanceProfileProbe.java:83)
at zombie.util.lambda.Stacks$Params3$CallbackStackItem.invoke(Stacks.java:230)
at zombie.util.lambda.Stacks$GenericStack.invokeAndRelease(Stacks.java:26)
at zombie.util.Lambda.capture(Lambda.java:130)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:81)
at zombie.iso.IsoWorld.update(IsoWorld.java:3427)
at zombie.gameStates.IngameState.updateInternal(IngameState.java:1617)
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)
Vilespring  [developer] 30 Aug, 2023 @ 5:19am 
I've reverted the mod to the July version and while I'll have it fixed soon, I can't upload a fix myself.
Vilespring  [developer] 30 Aug, 2023 @ 8:24am 
Hopefully should be fixed
Jane Helldiver 31 Aug, 2023 @ 12:51am 
Originally posted by Vilespring:
Hopefully should be fixed
Confirmed Fixed!

I'm not versed in lua code, but I "think" it's because it's doing a condition check on the item.

Like with the weapon light. It looks like it's scanning held items for "is this a weapon?", followed by "can this weapon accept a weapon light"

So changes to spawn locations, adding new weapons SHOULD be okay. It looks like it's exclusive to the bit of code scanning for weapons and if they are eligible to be used alongside the weapon light.

I've seen this happen with other mods, specifically Gun Stock Attack, that also scanned for "is this a weapon".

Not sure what the exact lua code is that fixes the error, but I would assume its something like "is this a weapon" "if no, then stop". However, that code is written in PZ coding....

Not sure if this comment helps point you in the right direction, but I thank you for the mod! Kudo's and appreciate your response
Vilespring  [developer] 31 Aug, 2023 @ 3:43am 
Dunno why you’re trying to give me pointers when I already fixed the problem, but it sounds like you’re more curious as to what happened.

The problem was in the laser part of the code on line 27. I was checking the held item for if it had anything in the slot lasers go in order to see if the held weapon had a laser.

Problem is that method I was invoking only exists in the HandWeapon class. HandWeapon extends InventoryItem. So basically all HandWeapons are inventory items, but not all inventoryItems are handweapons.

This resulted in an error every frame when holding something that wasn’t a weapon. The fix was to first check if the player was even holding a hand weapon before checking for weapon parts.
Jane Helldiver 31 Aug, 2023 @ 10:36pm 
Originally posted by Vilespring:
Dunno why you’re trying to give me pointers when I already fixed the problem, but it sounds like you’re more curious as to what happened.

The problem was in the laser part of the code on line 27. I was checking the held item for if it had anything in the slot lasers go in order to see if the held weapon had a laser.

Problem is that method I was invoking only exists in the HandWeapon class. HandWeapon extends InventoryItem. So basically all HandWeapons are inventory items, but not all inventoryItems are handweapons.

This resulted in an error every frame when holding something that wasn’t a weapon. The fix was to first check if the player was even holding a hand weapon before checking for weapon parts.


Apologies on my part. No offense was intended.

I'm still trying to figure out lua stuff myself. Thank you for the response and I appreciate your time
Vilespring  [developer] 1 Sep, 2023 @ 12:29am 
None was taken, just confused as to motivation.

Lua work is mostly poking the java in the correct way. Zomboid's documentation is mandatory but unfortunately a bit poorly explained at times.
< >
Showing 1-9 of 9 comments
Per page: 1530 50