Project Zomboid

Project Zomboid

Banjo's Reusable/De-Weaponized Pens & Pencils
23 Comments
Banjo Oz  [author] 16 Dec, 2021 @ 8:41pm 
@Fookin Diablo: I will take a look at making a mod for that for you. Might not be right away, but happy to do it if I can.
Fookin Diablo 23 Oct, 2021 @ 11:31am 
Can you de-weaponize silverware? Forks, spoons, knives?
Banjo Oz  [author] 5 Feb, 2021 @ 12:30am 
Sorry for the delay. Now updated for use with build 41.50 and (thanks to Oh God Spiders No letting me know about the new engine changes) now shouldn't have any problems with other mods as patching vanilla UI files are no longer needed.
Banjo Oz  [author] 5 Dec, 2020 @ 8:06am 
@Oh God Spiders No:I am and am definitely interested in an update that doesn't force me to patch the vanilla files every time! Thanks!
Oh God Spiders No 3 Dec, 2020 @ 2:43pm 
Are you still maintaining this? The devs recently added a change that makes it way easier for you to make it so you can write with crayons. It won't require you to patch any of the vanilla lua files so you won't have to update it every time there's a new version.

I'll post the code in a discussion page
Oh God Spiders No 29 Apr, 2020 @ 3:04pm 
I think the game loads all lua files from all mods, and then executes them in alphabetical order. If two mods have lua files with the same name, one of them will get overwritten, although I'm not entirely sure which one gets preference. I think it's the one that's lower on the load order.

Load order depends entirely on the player; they're loaded in the order in which they press the "Enable" button in the Mods menu. The one exception to this is if one mod requires another by adding a require=mod_name, the reqiured mod will load first, and the one that specified the requirement will load second. This is why the game refuses to load if two mods require each other; it doesn't know which one to listen to.

Point being that it's conceivable that the player might load our mods in either order, so it's good that both of them are set up to deal with the other :)
Banjo Oz  [author] 29 Apr, 2020 @ 4:58am 
Thanks heaps, Oh God Spiders No! I've updated my mod for 41.35 here anyway, too (let me know if it doesn't work).
Oh God Spiders No 28 Apr, 2020 @ 11:06pm 
Oh I also added a check to LetMeThink that will change editables if it detects your mod. That way ours should work together regardless of which one the game ends up loading.
Oh God Spiders No 28 Apr, 2020 @ 11:00pm 
41.35 came out yesterday, and I needed to patch ISInventoryPaneContextMenu.lua for LetMeThink. There's only one line difference after that to make it ready for BanjoRDPAP so I figured I'd save you the work. I put it in the discussion section. :ducky:
Banjo Oz  [author] 25 Apr, 2020 @ 11:52pm 
(I've also submitted a bug report to the devs on their site about not being able to use red pens, blue pens and crayons to write with... IMO, it's a bug that you can't use those, only pencils and black pens, and if they fix that, I don't need to mod ISInventoryPaneContextMenu.lua at all).
Banjo Oz  [author] 25 Apr, 2020 @ 11:50pm 
@Oh God No Spiders: thanks! Updated it now for b41.44. Please let me know if there are still issues.
Oh God Spiders No 25 Apr, 2020 @ 7:07pm 
Yo Banjo, ISInventoryPaneContextMenu.lua changed a ton in 41.34, you should update your mod. Right now it's interfering with all the hair dye stuff as well as a few tweaks to first aid stuff.
Oh God Spiders No 6 Apr, 2020 @ 6:50am 
And to answer your other question, yes that looks perfect

That's basically how LetMeThink works. There's a lot of places in the code where it says "don't let the player do anything in this menu if the game is paused" and LetMeThink just takes those parts out.
Oh God Spiders No 6 Apr, 2020 @ 6:48am 
Yes, but it kinda depends. I don't think I can do it with my mod because the isPaused check happens at the top of the page instead of inside any particular function, and I can't think of any way to bypass that without rewriting the file.

If you are changing or adding functions, then yes, you can do that without changing the original file. Basically you start a new file that imports the original function and tweaks it. If there are multiple mods that tweak the same function then you'll have to figure out a new patch or whatever, but that's less likely to occur if you're replacing individual functions instead of whole files.

Soul Filcher's Relaxing Times is a pretty good example of a mod that adds functions. I don't have one off the top of my head that does a great job of modifying existing functions, but here's a tutorial about it:

https://github.com/FWolfe/Zomboid-Modding-Guide#overwriting-vanilla-code
Banjo Oz  [author] 6 Apr, 2020 @ 5:50am 
And I'll include the same fixes for any mod I made that has a ISInventoryPaneContextMenu.lua right? Is there a way to use multiple mods at once that change this file (patch)?
Banjo Oz  [author] 6 Apr, 2020 @ 5:46am 
So, should the "fixed" section look like:

-- if the game is paused, we don't show the item context menu
local letMeThink = getActivatedMods():contains("LetMeThink")
if UIManager.getSpeedControls():getCurrentGameSpeed() == 0 and not letMeThink then
return;
end

?

(lines 14-18)
Oh God Spiders No 3 Apr, 2020 @ 8:28pm 
Thanks! I have a patch up now but yeah, native support is always better
Banjo Oz  [author] 3 Apr, 2020 @ 7:11am 
@Oh God Spiders No: I'd be still interested in "fixing" my mod if it helped! :) Just not sure what I'm changing but if it doesn't break anything, will change it no probs!
Oh God Spiders No 2 Apr, 2020 @ 11:16am 
Wait, I missed something obvious. I can bundle optional patches under the same steam item. Don't sweat it!
Oh God Spiders No 1 Apr, 2020 @ 8:24am 
Hey Banjo, I found an incompatibility with this mod and one of mine. The solutions I can think of on my end are all pretty brutal or have some pretty big drawbacks. Fixing it on your end, on the other hand, would only involve two lines of code. Mind helping a brother out?

in the file "media\lua\client\ISUI\ISInventoryPaneContextMenu.lua" lines 14 and 15 are currently:

-- if the game is paused, we don't show the item context menu
if UIManager.getSpeedControls():getCurrentGameSpeed() == 0 then


you would just have to change those to

local letMeThink = getActivatedMods():contains("LetMeThink")
if UIManager.getSpeedControls():getCurrentGameSpeed() == 0 and not letMeThink then



Thanks! Let me know if you can't do it :)
화밀 wMil 26 Mar, 2020 @ 11:26pm 
If there was john wick, the fucking pistols will be 1 million times stronger
I think I can shoot better than player in this game
Banjo Oz  [author] 26 Mar, 2020 @ 11:01pm 
It would be cool if there was a "John Wick" profession that - when used with this mod - still allowed pens to be weapons. :)
화밀 wMil 25 Mar, 2020 @ 6:56pm 
John Wick : Pencil is a weapon