Project Zomboid

Project Zomboid

Silencer / Suppressor Mod (Build 41)
istepan 12 Apr, 2016 @ 7:49am
Error!
script: loading C:\Program Files\Steam\steamapps\workshop\content\108600\639909479\mods\Silencer\media\scripts\Silencer.txt
java.security.InvalidParameterException: Error: and chance to hit is not a valid parameter in item: Silencer
java.security.InvalidParameterException: Error: and chance to hit is not a valid parameter in item: HMSilencer
< >
Showing 1-8 of 8 comments
istepan 12 Apr, 2016 @ 8:12am 
FIX:
Silencer.txt
item Silencer
{
Type = WeaponPart,
DisplayName = Silencer,
Icon = Silencer,
Weight = 1,
MaxRangeModifier = -1,
RecoilDelayModifier = -1,
WeightModifier = 1.2,
MountOn = Pistol; VarmintRifle; HuntingRifle,
PartType = Canon,
Tooltip = "Reduces sound radius but Slightly lowers range, and chance to hit",
}
item HMSilencer
{
Type = WeaponPart,
DisplayName = Home Made Silencer,
Icon = Silencer,
Weight = 1.2,
MaxRangeModifier = -2,
RecoilDelayModifier = -1,
WeightModifier = 1.4,
MountOn = Pistol; VarmintRifle; HuntingRifle,
PartType = Canon,
Tooltip = "Reduces sound radius but lowers range, and chance to hit",
}

Loading.lua
-- Add items for Police Storage
--table.insert(SuburbsDistributions["policestorage"]["locker"].items, "Silencer.Silencer");
--table.insert(SuburbsDistributions["policestorage"]["locker"].items, 35);

--table.insert(SuburbsDistributions["hunting"]["locker"].items, "Silencer.Silencer");
--table.insert(SuburbsDistributions["hunting"]["locker"].items, 35);

--table.insert(SuburbsDistributions["storageunit"]["crate"].items, "Silencer.Silencer");
--table.insert(SuburbsDistributions["storageunit"]["crate"].items, 8);
istepan 12 Apr, 2016 @ 8:16am 
Look
c:\Program Files\Steam\steamapps\common\ProjectZomboid\media\lua\server\Items\SuburbsDistributions.lua

policestorage = {
all ={
rolls = 4,
items = {
"Base.Shotgun", 3,
"Base.Pistol", 3,
"Base.BulletsBox", 2,
"Base.ShotgunShellsBox", 2,
"Base.223Box", 2,
"Base
VakumNET 18 Nov, 2021 @ 9:00am 
function: SilencerLoading.lua -- file: SilencerLoading.lua line # 12.
[18-11-21 21:57:43.422] ERROR: General , 1637254663422> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: locker of non-table: null at KahluaThread.tableget line:1689..
Ryoko-Sha 6 Jan, 2022 @ 2:09pm 
LOG : Lua , 1641506420625> Loading: D:/Games/SteamLibrary/steamapps/workshop/content/108600/639909479/mods/Silencer/media/lua/server/SilencerLoading.lua
ERROR: General , 1641506420626> ExceptionLogger.logException> Exception thrown java.lang.NullPointerException: Cannot invoke "se.krka.kahlua.vm.KahluaTable.len()" because "<local2>" is null at TableLib.insert line:217.
ERROR: General , 1641506420626> DebugLogStream.printException> Stack trace:
java.lang.NullPointerException: Cannot invoke "se.krka.kahlua.vm.KahluaTable.len()" because "<local2>" is null
at se.krka.kahlua.stdlib.TableLib.insert(TableLib.java:217)
at se.krka.kahlua.stdlib.TableLib.call(TableLib.java:89)
at se.krka.kahlua.vm.KahluaThread.callJava(KahluaThread.java:182)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:1007)
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:550)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:496)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:482)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:329)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:256)
at zombie.gameStates.GameLoadingState.enter(GameLoadingState.java:89)
at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:145)
at zombie.GameWindow.logic(GameWindow.java:289)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:745)
at zombie.GameWindow.run_ez(GameWindow.java:647)
at zombie.GameWindow.mainThread(GameWindow.java:475)
at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1641506420629> -----------------------------------------
STACK TRACE
-----------------------------------------
Callframe at: table.insert
function: SilencerLoading.lua -- file: SilencerLoading.lua line # 12

Jan. 06, 2022 11:00:20 PM zombie.Lua.LuaManager RunLuaInternal
SCHWERWIEGEND: java.lang.RuntimeException
Jan. 06, 2022 11:00:20 PM zombie.Lua.LuaManager RunLuaInternal
SCHWERWIEGEND: java.lang.RuntimeException:
Jan. 06, 2022 11:00:20 PM zombie.Lua.LuaManager RunLuaInternal
SCHWERWIEGEND: at table.insert
at SilencerLoading.lua:12

LOG : Lua , 1641506420634> Loading: D:/Games/SteamLibrary/steamapps/workshop/content/108600/2680473910/mods/TheWorkshop(New Version)/media/lua/server/TW.lua
<<< Remove error message at game start >>>

Short summary : Remove rooting table. Use "--" or delete text.

File : "SilencerLoading.lua"
location : "Steam\steamapps\workshop\content\108600\639909479\mods\Silencer\media\lua\server"

Edit:
1. all Gun Store "table.insert..." line delete.
2. all Police Storage "table.insert..." line delete.


Example :

no delete all : ...
no delete : print("Silencer:Textures and Sprites Loaded.");
no delete :end

delete line : -- Add items for Gun Store locker
delete line : table.insert(SuburbsDistributions["gunstore"]["locker"].items, "Silencer.Silencer");
delete all : ...
delete line : table.insert(SuburbsDistributions["storageunit"]["all"].items, "Silencer.Silencer");
delete line : table.insert(SuburbsDistributions["storageunit"]["all"].items, 2);

no delete : -- Avery rare in crates, locker and metal shelves
no delete : table.insert(SuburbsDistributions["all"]["crate"].items, "Silencer.Silencer");
no delete all : ...
Shepa_Gang 25 May, 2024 @ 10:53pm 
`Callframe at: table.insert
function: SilencerLoading.lua -- file: SilencerLoading.lua line # 12 | MOD: Silencer
java.lang.NullPointerException: Cannot invoke "se.krka.kahlua.vm.KahluaTable.len()" because "<local2>" is null
at se.krka.kahlua.stdlib.TableLib.insert(TableLib.java:217)
at se.krka.kahlua.stdlib.TableLib.call(TableLib.java:89)
at se.krka.kahlua.vm.KahluaThread.callJava(KahluaThread.java:182)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:1007)
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)
`
kaosAxis 23 Jun, 2024 @ 12:57am 
^-- same here
TiniVini 5 Nov, 2024 @ 8:50am 
^ same here ^
< >
Showing 1-8 of 8 comments
Per page: 1530 50