Jump to content

Silencer / Suppressor Mod


nolanri

Recommended Posts

Now gun lovers can be stealthy too!

 

I made a Mod that just adds a Silencer / Suppressor as a weapon part that can be attached to Pistols, and Rifles.  It reduces the sound the gun makes by 90% and lowers max range slightly and slows down the fire rate by adding recoil time.

The silencer can be found in gunstore and police station locations. Also in any crate or locker but at a much rarer rate.

 

you can craft a home made silencer from a pipe or flashlight with saw, screwdriver and a few aiming skill points. This home made silencer does not work as well as the real one. And lowers fire rate and max range more than the real silencer as well.

 

Download Link - Version 1.1
Steam Workshop

 

Though it worked fine in testing I just put it together recently and pretty quickly so let me know if you find something wrong with it and i'll get it fixed ASAP.

 

Enjoy!

Edited by nolanri
Link to comment
Share on other sites

It's funny, I was literally thinking about an hour or two ago about how someone should mod in silencers. Awesome work, keep it up! :) 

 

Should maybe look into making craftable ones! pop bottle (one time use), flashlight silencers are both a thing.

Link to comment
Share on other sites

@nolanri I get this error:

 

Loading: C:/Users/franc/Zomboid/mods/ORGM Silencer/media/lua/server/Loading.lua
-------------------------------------------------------------
attempted index: items of non-table: null
-----------------------------------------
STACK TRACE
-----------------------------------------
function: Loading.lua -- file: Loading.lua line # 19
java.lang.RuntimeException: attempted index: items of non-table: null
        at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1549)
        at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:473)
        at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
        at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1727)
        at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1642)
        at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:63)
        at se.krka.kahlua.integration.LuaCaller.protectedCall(LuaCaller.java:77)
        at zombie.Lua.LuaManager.RunLua(LuaManager.java:630)
        at zombie.Lua.LuaManager.RunLua(LuaManager.java:576)
        at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:460)
        at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:381)
        at zombie.gameStates.GameLoadingState.enter(GameLoadingState.java:101)
        at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:145)
        at zombie.GameWindow.logic(GameWindow.java:619)
        at zombie.GameWindow.run(GameWindow.java:1173)
        at zombie.GameWindow.maina(GameWindow.java:974)
        at zombie.gameStates.MainScreenState.main(MainScreenState.java:173)
-----------------------------------------
STACK TRACE
-----------------------------------------
function: Loading.lua -- file: Loading.lua line # 19
mar 08, 2016 6:51:51 PM zombie.Lua.LuaManager RunLua
SEVERE: null
mar 08, 2016 6:51:51 PM zombie.Lua.LuaManager RunLua
SEVERE: null
java.lang.RuntimeException:
        at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:91)
        at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:1285)
        at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
        at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1727)
        at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1642)
        at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:63)
        at se.krka.kahlua.integration.LuaCaller.protectedCall(LuaCaller.java:77)
        at zombie.Lua.LuaManager.RunLua(LuaManager.java:630)
        at zombie.Lua.LuaManager.RunLua(LuaManager.java:576)
        at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:460)
        at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:381)
        at zombie.gameStates.GameLoadingState.enter(GameLoadingState.java:101)
        at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:145)
        at zombie.GameWindow.logic(GameWindow.java:619)
        at zombie.GameWindow.run(GameWindow.java:1173)
        at zombie.GameWindow.maina(GameWindow.java:974)
        at zombie.gameStates.MainScreenState.main(MainScreenState.java:173)

 

Edited by francogp
Link to comment
Share on other sites

On 7/3/2016 at 0:00 AM, nolanri said:

Added link to steam workshop

You should use the ORGM spawn algorithm for this items, because inserting that object in the vanilla table with 0.1 prob... it will spawn almost every 10 zombies if you hace lucky or unlucky traits.

Edited by francogp
Link to comment
Share on other sites

Here, I rewrite all your Loading.lua to work perfectly using ORGM mod and their spawning algorithms.
I tested it, it work fine!

 

Loading.lua NEW content (replace ALL other content):

require "ORGMDistribution"

SSilencer = {}

SSilencer.getSprites = function()
	getTexture("Item_Silencer.png");	
end
   
table.insert(CivModTable, "Silencer.Silencer");
table.insert(NonCivModTable, "Silencer.Silencer");
	
print ("* Silencer / Suppressor Mod Loaded");

Events.OnGameBoot.Add(SSilencer.getSprites);


 

Edited by francogp
Link to comment
Share on other sites

5 hours ago, francogp said:

@nolanri I get this error:

 


Loading: C:/Users/franc/Zomboid/mods/ORGM Silencer/media/lua/server/Loading.lua
-------------------------------------------------------------
attempted index: items of non-table: null
-----------------------------------------
STACK TRACE
-----------------------------------------
function: Loading.lua -- file: Loading.lua line # 19
java.lang.RuntimeException: attempted index: items of non-table: null
        at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1549)
        at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:473)
        at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
        at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1727)
        at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1642)
        at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:63)
        at se.krka.kahlua.integration.LuaCaller.protectedCall(LuaCaller.java:77)
        at zombie.Lua.LuaManager.RunLua(LuaManager.java:630)
        at zombie.Lua.LuaManager.RunLua(LuaManager.java:576)
        at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:460)
        at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:381)
        at zombie.gameStates.GameLoadingState.enter(GameLoadingState.java:101)
        at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:145)
        at zombie.GameWindow.logic(GameWindow.java:619)
        at zombie.GameWindow.run(GameWindow.java:1173)
        at zombie.GameWindow.maina(GameWindow.java:974)
        at zombie.gameStates.MainScreenState.main(MainScreenState.java:173)
-----------------------------------------
STACK TRACE
-----------------------------------------
function: Loading.lua -- file: Loading.lua line # 19
mar 08, 2016 6:51:51 PM zombie.Lua.LuaManager RunLua
SEVERE: null
mar 08, 2016 6:51:51 PM zombie.Lua.LuaManager RunLua
SEVERE: null
java.lang.RuntimeException:
        at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:91)
        at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:1285)
        at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
        at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1727)
        at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1642)
        at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:63)
        at se.krka.kahlua.integration.LuaCaller.protectedCall(LuaCaller.java:77)
        at zombie.Lua.LuaManager.RunLua(LuaManager.java:630)
        at zombie.Lua.LuaManager.RunLua(LuaManager.java:576)
        at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:460)
        at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:381)
        at zombie.gameStates.GameLoadingState.enter(GameLoadingState.java:101)
        at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:145)
        at zombie.GameWindow.logic(GameWindow.java:619)
        at zombie.GameWindow.run(GameWindow.java:1173)
        at zombie.GameWindow.maina(GameWindow.java:974)
        at zombie.gameStates.MainScreenState.main(MainScreenState.java:173)

 

As this to do with my loading lua? Did it fix when you remade the loading lua with that above code? Or still get that error? If so, can you tell me all the mods you have enabled when you get this error?

Link to comment
Share on other sites

16 hours ago, nolanri said:

As this to do with my loading lua? Did it fix when you remade the loading lua with that above code? Or still get that error? If so, can you tell me all the mods you have enabled when you get this error?

that error was with YOUR code... My code fix it that and improve the spawning algorithm using ORGM code :D

Link to comment
Share on other sites

7 hours ago, francogp said:

that error was with YOUR code... My code fix it that and improve the spawning algorithm using ORGM code :D

Yes I understood. I was just wanting to confirm if you still had the error you posted or not. i'll take it as it's gone now.

Link to comment
Share on other sites

  • 2 months later...

every time I try to hit someone with a broken knife (v34.28) I get:

 

function: useSilencer -- file: Silencer.lua line # 43
function: onAttack -- file: Silencer.lua line # 9
java.lang.RuntimeException: attempted index: getCanon of non-table: null
        at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1549)
        at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:623)
        at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
        at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1727)
        at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1672)
        at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:53)
        at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:81)
        at zombie.Lua.Event.trigger(Event.java:37)
        at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:117)
        at zombie.ai.states.SwipeStatePlayer.enter(SwipeStatePlayer.java:116)
        at zombie.ai.StateMachine.changeState(StateMachine.java:48)
        at zombie.characters.IsoPlayer.DoAttack(IsoPlayer.java:4891)
        at zombie.characters.IsoPlayer.DoAttack(IsoPlayer.java:4760)
        at zombie.characters.IsoLivingCharacter.AttemptAttack(IsoLivingCharacter.java:73)
        at zombie.characters.IsoPlayer.update(IsoPlayer.java:3390)
        at zombie.iso.IsoCell.ProcessObjects(IsoCell.java:1353)
        at zombie.iso.IsoCell.update(IsoCell.java:4659)
        at zombie.iso.IsoWorld.update(IsoWorld.java:2534)
        at zombie.gameStates.IngameState.update(IngameState.java:1273)
        at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:101)
        at zombie.GameWindow.logic(GameWindow.java:630)
        at zombie.GameWindow.run(GameWindow.java:1233)
        at zombie.GameWindow.maina(GameWindow.java:1015)
        at zombie.gameStates.MainScreenState.main(MainScreenState.java:177)

 

Edited by francogp
Link to comment
Share on other sites

  • 2 years later...
2 hours ago, ZombieHunter said:

Apparently this mod doesn't work anymore, any hope of finding out what caused it to break?

What problems are you having specifically?


If it's specifically getting it to work in MP, it's possible Steam is having workshop issues today.  It'd really help to confirm if this is connected or not.

Link to comment
Share on other sites

4 hours ago, EnigmaGrey said:

What problems are you having specifically?


If it's specifically getting it to work in MP, it's possible Steam is having workshop issues today.  It'd really help to confirm if this is connected or not.

 

5 hours ago, Fenris_Wolf said:

If its the workshop version of the ORGM silencers mod, it should be fine. Non-ORGM version or copies hosted outside the workshop I can't verify.

 

So I double checked to make sure all the parts are installed correctly made sure the versions I got were

https://steamcommunity.com/sharedfiles/filedetails/?id=514618604

https://steamcommunity.com/workshop/filedetails/?id=640674707

 

What seems to be happening is even though the Surpressor installs correctly on the weapon, and makes the "noise" as if silenced. The noise reduction function and noise spread does not actually occur. It still pulls zombies  from very larges distances as if not installed at all.

 

You can check out the other steam comments,

again thanks for the reply and continued interest in the mod.

Edited by ZombieHunter
Link to comment
Share on other sites

7 minutes ago, ZombieHunter said:

What seems to be happening is even though the Surpressor installs correctly on the weapon, and makes the "noise" as if silenced. The noise reduction function and noise spread does not actually occur. It still pulls zombies  from very larges distances as if not installed at all.

If the sound has changed, the radius has changed. There's a bar in the weapons tooltips for noise (this is the sound radius) and will have a drastic drop when the suppressor is attached. The mod used to reduce the radius down to 10%...so a 150 range pistol would only be 15 tiles, but a few updates ago orgm shifted it to 20% instead of 10% (30 tiles vs 15), which tends to make the radius larger then the players view.

Last update for ORGM also included a option in the PZ settings screen (on the ORGM tab) so you can set the sound reduction level yourself.

 

Link to comment
Share on other sites

27 minutes ago, ZombieHunter said:

So I will have to manually edit it in SP then copy that file onto my dedicated? 

Ya it only saves if there's changes. You can manually edit it, or make sure you're not connected and edit using the PZ options screen from the main menu, then upload the finished .ini file to the server

Link to comment
Share on other sites

1 hour ago, Fenris_Wolf said:

Ya it only saves if there's changes. You can manually edit it, or make sure you're not connected and edit using the PZ options screen from the main menu, then upload the finished .ini file to the server

 

Thanks, I will post all the information you provided to steam to help others!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...