#mod_development
1 messages Ā· Page 330 of 1
AnimSets, animations
Scripts we can hot reload them now apparently tho I haven't looked at it
Sounds I think you need to restart
I have no idea whether it actually works because I've never used it, but you can right click object fields & there's a context menu
What does that do ?
In theory, adds fields to a window that displays the value
the fact that the debug configuration is the same interface as the context menu ingame is hilarious
Can't be the only one who thinkgs that, can I? xD
presumably you can see the value of that field no matter what part of the code you're in, and get breakpoints when that field is written to/read from
if i remember right there's a blog post explaining that the debugger was made ten years ago in a week with a lot of alcohol involved
Explains the shitiness of it I guess
you really have to git it a chance š
I DID !
THAT'S WHAT I KEEP TELLING YOU
I keep trying to use it !
I keep trying it !
And I just cannot figure out how to navigate it !
is it updated or maintained still? or has it been untouched for 10 years? xD
Step into, step over, continue
None of the windows placement makes sense or it's completely unclear what these even show and they don't even show what I expect them to see
well, it still works; it's not like the language has changed so i guess it doesn't need much maintanence
Damn you think that's the thing that blocks me lmao ?
Heck if I know lol
sometimes trying to inspect objects throws errors but it's not like everything crashes when that happens
You want me to start using this piece of shit and praising it ? Make a guide for it!
oh, are there no guides for it?
From a very quick check it seems the watch window is not all that reliable, but that's from testing exiting and re-entering the debugger
Maybe it works better when actually stepping through code
Be aware that the modding wiki dates from december 2024 for the majority of the stuff you can find on it currently
but the debugger has 10 years! Far more than enough time for someone to make a guide for it
x_D
I don't know that it warrants a guide beyond labeling the things that are in it (& maybe how to get to it since people probably don't think to hit F11), but things are already labeled
If you have prior experience with a debugger it's pretty much just a barebones version of a normal one
yeah, well doggy is more or less the only person seriously working on the modding side of the wiki so if he doesn't use it it's not likely to be on there š
a guide makes everything easier and helps lots of people. Obviously most experienced people wont need it but, its always a good thing to bring to the world
Exactly, I'd love to tell about it, I'd love to manage to use it, trust me
But I just cannot figure out, and in 2 months I'll try again, realize that anything that I expect to be right clickable actually isn't and that none of the windows can be moved around, adding to my confusion of navigating this shit, there's no going back button or idk what, there's nothing to allows me to properly navigate the whole UI
And I'm just completely lost
So until someone shows me in real time a complete usage example and how to navigate this crap, I just can't write anything about it
if somebody sends a screenshot of the debugger i can point out the basic usage
@swift loom and @frank elbow , you make this sound easy. Why dont you show him in a short discord call? sounds like a good evening time xD
Yea that's what I don't get, that it looks easy to them and I just can't figure it out lol
I'll send a screenshot in a moment, but letting you know it'll be from b41 in case anything has changed (I don't remember there being changes, but pointing that out regardless)
oh man, my spacebar is starting to show signs of death. This is not what I was expecting the day I convinced myself to learn this xD
jesus
Tho most of these I kind of knew, I just have issues navigating the whole UI overall
But I'll note it down and next time I end up with a potential usage of the debugger I'll try AGAIN
Anyone know the max item displayname length
Good question
If you find out I'm interested
Hi, I wanted to know if there is a script or some kind of database were all the "FootstepMaterial" values are located
Is a Property of IsoGridSquare
does anyone know how to change the text that displays when you right click? For example, if you want to change the text about dismantling a cabinet from "dismantle" to "destroy"?
any way in lua to get what procedural list was used when filling container ie. container is crate and then what proc list was chosen like CrateFitnessWeights, CrateTools or CrateCanning?
so, question, can we make new vehicle scenes in B42, and how does spawning work for those?
The fear is setting in that I might actually need to learn useful coding skills like Lua to make what I want work
@silent zealot HEY!
I think one of the updates you did to the easydistro mod broke alot of my subscribers saves.
What update, and broken in what way?
The one yesterday at 5 AM EST.
I've had complaints since then, though I directed them to subscribe to your mod. It looks fine on my end.
Do you use his API ?
it's because you added a dependency
the game won't load a mod without its dependencies, and nothing makes them automatically get the dependency mod/enable it on that save
Not a warning
Just a straight up require
So activating your mods requires the dependency mods
Also when adding a new dependency in your mods, make sure to announce it everywhere on your modpage
Comments, patch note + description
the require is the problem
because it's required the mod no longer loads for anyone who doesn't already have it, which is probably everyone
i also don't think it'll load for people who do have it unless they already had it enabled on that save
you don't really want to add requirements after a mod's release if you can avoid it
Anyone know if thereās a timeline for Britaās?
Just properly announce it
?
Timeline ?
Like when it releases for B42 ?
No idea
doesn't really matter how well you announce it, plenty of people will get in-game without seeing it
most even
it'll stop the mod from loading, which will permanently remove every item, tile, etc from your mod from their save
Yes, but then they'll see something is wrong for the majority of them so they check the mod page
So if you properly announce it you won't get any issues
I've done that multiple times already without any problems
I've never gotten a single comment saying they got issues, bcs I wrote a big ass comment in header format saying there's a ndw dependency
because your mods don't add very many items or tiles right?
How would that stop those. Scripts are independent from Lua files ?
the mod doesn't load whatsoever if the dependency is not enabled
it will be as if the mod isn't even enabled
Tbf, I wouldn't give a shit anyway
they just have to reenable the mod and it's fine, but for item + tile mods it permanently damages the save file of more or less everyone who uses the mod, to the extent that they might want to start over their save entirely - people will be really pissed in this case, and it's kind of justifiable
Embrace the chaos 8)
if you remember the kind of harrassment honesty received a few months ago for a way less serious issue it's really not worth it
He caused it actually, he meant to do that
that's not what he said
he came into the modding discord and said that he hadn't meant to make people's saves unplayable (and it is kind of unintuitive that it does that)
I talked with him in vc, and he stated multiple times that he decided to nuke them
He was proud of it at least
he wanted to remove the map permanently but did he really say that he intended to brick every save file using the map?
Maybe a change of state of mind ?
Yea it really sounded like that
well if he was just lying about it being accidental then i'm kind of mad at him again š
not that the sheer level of harrassment he received was justifiable either way
Idk tbf, I get the desire to give a lesson to mod users
Kind of extreme, but I get it
That's why he stated he meant it, because he was annoyed at mod users complaining
if it really was intentional then i think it was really stupid of him but it didn't sound like it was when he spoke about it
Guess we got two different story š
Stupid ? Perhaps. Kind of feels nice to show them you don't owe them anything tho
it didn't sound like he came out of the situation 'feeling nice' though š
That can definitely be understandable at the time with the amount of hate you receive
I think purposely bricking people's saves to "teach them a lesson" is well beyond the level of stupid
You could leave out the dependency in mod.info, detect if the mod is active and have a pop up window on every game start saying "WARNING: you have until June 30 to subscribe and enable Easy Distro and if you do not all your boxes will vanish! Until then, no boxes will spawn in the world."
People will still complain though. Because they are people.
I think they want the new firearm system to be stable before they start to port their "we changed everything about guns" code over.
Personally I think they should cut back on the bloated feature list in their framework, and just start with "here are all the guns in B42 with vanilla-style features"
That makes a lot of sense lol
There is a lot of stuff in that mod lol
I never used any of it other than the different magazine sizes, and that wouldn't be hard to do (having looked around while letting the survival rifle use two calibres automatically)
Their armour pack would be easy but time consuming to port to B42.
So many items, lots of tweaks to better work on B42 (tags, discomfort, etc) and all recipes need to be redone.
Which mod was that?
it was a map mod
he removed it from the workshop, but you can't remove maps from a save, nor can you launch the save without them, so it bricked every save using the mod
it was a really major drama, he received a crazy amount of harrassment over it
Funnily enough, a while ago I was working on a mod that was basically that, a purely vanilla gun pack
You can, but it involves fiddling around with the save file in a way most people are unlikely to be comfortable with.
well yeah, you can do anything, but it's not something the game just lets you do
I've had fun releasing a few guns that are distinct from Rain's Gun Pack, which I feel is a good collection of weapons to expand the limited range in vanilla without being excessive.
With the new fluid system it's finally possible to make a vickers water-cooled machine gun.
My idea was basically a light version of something like Brita's or Rain's. No new systems but I think at its peak my gun idea list was nearing 100
im trying to make a trap give me a dead deer, whats the name for a dead deer types?
Looking through the britas weapon list, so many redundant weapons in there.
Trapping now trap live animals.
I'm not sure if you can get it to do dead ones anymore
im aware, its just that they run off
(without coding your own variation)
i think i might be able to depending on if i can find the name of the deer corpse
My list was basically all redundancy
For Example you had: The M16, M16A1, XM16E1, The Colt SP1, M16A2, and then variants and civilian versions.
just dont know where i would find it in the items list
A better option would probably to be to hook the "check trap" function and kill the deer after it is spawned in the world
dead animals are weird not-quite-items
i aint that good at coding lol but i can try
When I had a look a while ago I couldn't see an easy "dead animal item" to spawn
yeah me neither, where would i look to find the check trap ui interaction
One approach: you know it says "check trap" on the context menu so you search for that knowing it will be in the translation files: ContextMenu_Check_Trap = "Check Trap",
then search for ContextMenu_Check_Trap which has one hit in a fish net thing and one in ISTrapMenu.doTrapMenu() in media\lua\server\Traps\ISUI\ISTrapMenu.lua
that leads you to ISTrapMenu.onCheckTrap, which leads you to the timed action ISCheckTrapAction
and the timed action will do somethingin the :complete() step
i will put this together, you have been a great help, i greatly appretiate that.
Is there a way to see if my distributions script is working without teleporting around and checking crates
yes
cheats -> enable lootzed
right click a container in the inventory view, LootZed
You can see what can spawn in it.
Ah, thank you.
Note: this tool reads the lua distribution table, if you change that the normal way (i.e. when the lua script is loaded) this is fine but if you do something fancy later on you need to re-sync the lua and java loot tables.
the cheats -> item picker will also indicate if an item is in any loot tables (one of the columsn on the right side, at least in B42)
I might have an even easier way: try setting deer.canBeAlive to false in the TrapAnimals settings
May need to make a DeadDeer item, like the existing Deadrabbit etc items
yeah thats what i was trying to find out what the item was called for a deer corpse
Wait, that was meant for @bleak mortar
I was gonna say lol
i just dont know where to look for that item name
if i can find it i can code it easily
theres a search function?
A really fast one!
I keep a VSCode open with media and zombie (decompiled java) as a reference.
Can add other mods in if I want to include them too:
ill have to come back to this later but i appretiate all your help man, incredibly thoughtful and kind, but right now my freind is wanting to play with me so ill have to put my mod on hold.
So it turns out PZ already has a Racecar spawn zone at Irvington, it's just unused due to the game lacking Racecars
If only someone was making a mod to add racecars....
Yeah if only
gotta figure out how to use them now
So here's what I can see, racecar/parkingstall, but I can't find a racecar zone in the vehicle zone defs
got em working now
So the only issue is that it covers every parking stall in the race track, which while not much, does cause some issues
not many though
I want to let guns be dismantled into Base.Reinforcement_Points. The number of Reinforcement Points received should be based on the gunās metalValue : you get 1 Reinforcement Point for every 5 metalValue, with remainders of 2 rounded down and 3 rounded up. But I keep getting errors. Iāve even asked ChatGPT and still canāt fix itāwhere am I going wrong? @@
Events.OnFillInventoryObjectContextMenu.Add(function(player, context, items)
for _, item in ipairs(items) do
local actualItem = item
if instanceof(item, "InventoryItem") then
actualItem = item
elseif item.items then
actualItem = item.items[1]
end
if actualItem and actualItem:getSubCategory() == "Firearm" then
context:addOption("IGUI_GetReinforcementPoints", actualItem, function()
local metalValue = actualItem:getMetalValue() or 0
local points = math.floor((metalValue + 2) / 5)
local inv = player:getInventory();
if points > 0 then
inv:AddItem("Base.Reinforcement_Points", points)
player:getInventory():Remove(actualItem)
player:Say("IGUI_Get" .. points .. "IGUI_Points")
else
player:Say("IGUI_CantBreakDown")
end
end)
end
end
end)
Been deep in the wells of GLSL shaders. I am working on making a UI framework around them. Here is my progress from the past week of free time:
3D transforms with parent-child UI elements, borders, rounded-border settings, colors, and a rewrite of the game's font renderer so that they can be transformed in 3D space.
HTML / CSS-like rendering is possible in PZ UI using GLSL shaders.
This next week I'll work on getting a functioning layout tree where things like z-index CSS rules and width / height rules will be taken into account.
If that's done I'll work on pagination for things like <textarea> or <p> elements.
Don't trust chat GPT. Did it write the code, or did you write it then used it to help troubleshoot?
I hate embedding function definitions in a function call like that, I find it makes it a lot harder to troubleshoot (it is a valid thing to do, I just hate it!)
Also, what errors are you getting?
Is there a way to go from an ISO location to a screen location, or from a 3d model to a 3d model? For example, if I made a laser gun and wanted to draw a line from the gun model to a target
I'm not sure if that is completely outside the scope of shaders or not
They seem to do almost everything, instead of just shading as the name implies
I just finished a Lua beginner tutorial today XD. The code was written by ChatGPT, and then I tried modifying it where I understood.
Here is the error message:ā
LOG : Lua f:8351, t:1748919026151> addAttachment
LOG : General f:8526, t:1748919029065> -----------------------------------------
STACK TRACE
-----------------------------------------
function: actualItem -- file: CA_Reinforcement_Points.lua line # 14 | MOD: CA Firearm
function: onMouseUp -- file: ISContextMenu.lua line # 92 | Vanilla
LOG : General f:8526, t:1748919029065> Object tried to call nil in actualItem
ERROR: General f:8526, t:1748919032567> ExceptionLogger.logException> Exception thrown
java.lang.RuntimeException: Object tried to call nil in actualItem at KahluaUtil.fail(KahluaUtil.java:100).
Stack trace:
se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:100)
se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:954)
se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:173)
se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1963)
se.krka.kahlua.vm.KahluaThread.pcallBoolean(KahluaThread.java:1902)
se.krka.kahlua.integration.LuaCaller.protectedCallBoolean(LuaCaller.java:104)
zombie.ui.UIElement.onMouseUp(UIElement.java:1633)
zombie.ui.UIElement.onConsumeMouseButtonUp(UIElement.java:1695)
zombie.ui.UIManager.updateMouseButtons(UIManager.java:855)
zombie.ui.UIManager.update(UIManager.java:715)
zombie.GameWindow.logic(GameWindow.java:328)
zombie.GameWindow.frameStep(GameWindow.java:917)
zombie.GameWindow.mainThreadStep(GameWindow.java:643)
zombie.MainThread.mainLoop(MainThread.java:76)
java.base/java.lang.Thread.run(Unknown Source)
LOG : General f:8526, t:1748919032567> -----------------------------------------
STACK TRACE
-----------------------------------------
function: actualItem -- file: CA_Reinforcement_Points.lua line # 14 | MOD: CA Firearm
function: onMouseUp -- file: ISContextMenu.lua line # 92 | Vanilla
LOG : General f:8526, t:1748919032567>
When I click IGUI_GetReinforcementPoints in the context menu, an error pops up. The same happens when I right-click other items.
My response to a previous "fix this AI code" request
Look at line 14, look at what function of actualitem you're calling, think about why it is nil interest of a valid function
Most likely actualitem is nil or the AI made up a function call that does not exist. Because AI does that. A lot.
Remember large language models are for text, not code. And with text it's fine to use a slightly different word or phrase things a little differently, but in code it is not.
https://steamcommunity.com/sharedfiles/filedetails/?id=2779627490
Mb somebody can update this mod?
this should probably get pinned or smth xD
Check this out for more detail
is this faster than total commander?
I don't use that,. so I don't know how long it takes.
Searching feels near-instant
Oh, I modified line 14. I saw someone else write something like this before, so I used it:
local inv = player:getInventory();
inv:AddItem("DLTS.LTSCharcoalPowder");
inv:AddItem("NoLS.Rubber");
end
Iām sorry, I really canāt come up with a solution⦠Could you please show me a correct example so I can work backwards to find the issue?
example of adding something to right click context menu:
local doDIYContextMenu = function(playerNum, context, items)
print("##### doDIYContextMenu()")
local primaryItem = items[1]
if not instanceof(primaryItem, "InventoryItem") then
primaryItem = primaryItem.items[1]
end
if primaryItem:hasTag("DIYSchematic") then
print("##### It's a DIY Scematic")
local playerObj = getSpecificPlayer(playerNum)
readOption = context:addOption(getText("ContextMenu_ReadDIY"), items, DIYonLiteratureItems, playerObj);
end
end
Events.OnFillInventoryObjectContextMenu.Add(doDIYContextMenu)
Then the function DIYonLiteratureItems is what gets called by the context menu option that was added
I'm not sure what you're trying to do with adding CharcoalPowder and Rubber to the player inventory before an end statement that doesn't match up to anything, or why that is relevant.
There's a B42 Repair Anything mod
Rip Anything is a problem because if you can't programmaticly add tags then they are ignored by the recipe system, which has already decided which recipes affect which items and it doesn't re-check. Might be away to force it to refresh, but I've not looked hard for that.
@silent zealot i see you know a lot about code, especially java one, am i right that you can't get information about chosen procList for the container, from any lua function?
I tried changing it to this, and there are no errors. It feels really interestingāthank you so much.
local GetReinforcementPoints = function(playerNum, context, items)
print("##### GetReinforcementPoints()")
local primaryItem = items[1]
if not instanceof(primaryItem, "InventoryItem") then
primaryItem = primaryItem.items[1]
end
if primaryItem:hasTag("Firearm") then
print("##### It's a DIY Schematic")
local playerObj = getSpecificPlayer(playerNum)
readOption = context:addOption(getText("ContextMenu_GetReinforcementPoints"), items, DIYonLiteratureItems, playerObj);
else
print("##### It's not a DIY Schematic")
end
end
Events.OnFillInventoryObjectContextMenu.Add(GetReinforcementPoints)
Next, Iāll try to add functionality to the menuā¦
That is going to call DIYonLiteratureItems() which will fail
That code is just for adding the contect menu option. Then it calls a function when that option is selected.
Instead of DIYonLiteratureItems, you need it to be calling a function that turns guns into your reincforcement items.
Speaking of which , you need to make the item definitions for those if you have not already done so.
Iāve been thinking for a long time and still donāt know where to start. Iāve been awake for nearly 24 hours and feel a bit dizzy. Could you please help me once more and give me a few more hints? Oh, the items are already defined.

Computational Anti-Aliasing is a thing yeah.
I'm more concerned right now with getting the maths right first.
It'll be interesting getting anti-aliasing working for this:
It's nice to be able to take all the normal operations for these sorts of things and then apply it in a 3D space as well.
You've told the game "add an entry to the context menu when I right click on the firearm"
But you havn't told it what to do when you select that entry.
@silent zealot Sorry wrong reply.
@slim swan Above was for you on the modding discord.
Also, get some sleep. š
"Computational Anti-Aliasing" as a way of converting from 2d to 3d is a very odd name, but it wouldn't be teh first time in computing that something has a nonsensical name.
No that's not what I mean't. There're two statements in that.
I'm simply happy to have a solution where I can use proper matrix transforms to augment what is traditionally painted in 2D space in 3D.
That is helpful
Computational Anti-Aliasing was for Rocco.
And it's not nonsensical. It's actual practice.
yes, but probably not for what I asked about.
Render-Shader passes are for more proper anti-aliasing techniques. Because I'm doing more hackish ways to get shading working, I don't have this option.
Nope.
TurboEncabulator.ReticulateSplines()
I wonder if we can repeat that often enough that AI starts to pick it up š¤£
Iāve already thought of many QoL mods that could be built using this framework.
What I want to see are inventory mods.
For example, when Iām near a campfire or fireplace, it could directly display the remaining time or fuel amount.
Here was my hardcoded tech demo of shaders being used:
It's building up a proper API and framework to get that to be streamlined in a mod production sense.
Imagine having menus like floating cards that can "fall away" when disabled.
There's a lot of potential here.
If people can look at the 3d models that closely they are going to realize how terrible they are lol
Like a good example would be say a card-game mod.
But it is a great dvelopment in potential UI uses
Dynamic and modular shaders takes time and testing / adjustments to make unfortunately but I think it's worth the time.
I could quickly make hardcoded UI for my own needs but I don't think this community has many rendering programmers. =)
I suspect this community has one, and it's you.
We do have lots of people that coudl learn if motivated.
I think it'd be fun to write a shader UI + mod that emulates old MsDOS computers from the 90's.
I tried writing a block of code, but it still throws an error. I think the problem is with getTag("MetalValue").
I can't stay up any longer ā I'll continue trying after I wake up.
Good night, fellow survivors...
function DIYonLiteratureItems(playerObj, items)
local MetalValue = getTag("MetalValue")
local points = (MetalValue / 5)
local inv = player:getInventory();
if points > 0 then
inv:AddItem("Base.Reinforcement_Points", points);
player:getInventory():Remove(primaryItem)
player:Say("IGUI_Get" .. points .. "IGUI_Points")
else
player:Say("IGUI_CantBreakDown")
end
end
You should really give the function a more appropriate name instead of copying the example name from DIY literature code
Also, that looks like AI generated code.
It makes no sense.
Hey guys wrong chat but what should I do by this errors? ERROR: General , 1748895359701> 134,561,989,223> LuaManager.getFunctionObject> no such function "Recipe.OnGiveXP.MetalWelding50"
ERROR: General , 1748895359702> 134,561,989,223> RecipeManager.LoadedAfterLua> no such function LuaGiveXP = "Recipe.OnGiveXP.MetalWelding50" in recipe "Craft Silencer"
ERROR: General , 1748895359704> 134,561,989,226> LuaManager.getFunctionObject> no such function "Recipe.OnGiveXP.Reloading3"
ERROR: General , 1748895359704> 134,561,989,226> RecipeManager.LoadedAfterLua> no such function LuaGiveXP = "Recipe.OnGiveXP.Reloading3" in recipe "Make 5.7x28mm [VFE]"
ERROR: General , 1748895359704> 134,561,989,226> LuaManager.getFunctionObject> no such function "Recipe.OnGiveXP.Reloading3"
ERROR: General , 1748895359704> 134,561,989,226> RecipeManager.LoadedAfterLua> no such function LuaGiveXP = "Recipe.OnGiveXP.Reloading3" in recipe "Make 4.6x30mm [VFE]"
It's made up a whole new way of using metalValue that doesn't work
My guess would be one of A) don't put functions that don't exist in recipes or B) figure out why those functions do not exist
Like I donāt know which mod that is
[VFE] is a pretty big hint
Ok
As are references to "craft silencer" and "make 5.7x28mm"
I donāt know how to get the MetalValue parameter. Earlier I saw you used hasTag, so I thought maybe itās getTag.
I did use the previous code because I really donāt know how to write it correctly š¦
Vanilla firearms expanded probably, if not it's something else to do with firearms
You can't make a random guess, give up when it doesn't work, and ask other people to do the work for you
Lookup "Zomboid javadocs" and see what functions exist when you search for "metalValue"
There is probably a function for InventoryItem objects to get the metal value as a number
getTag is not a global function
Show the code
Another good point lol
I'm not even sure if there is a getTag. There is getTags and hasTag
@opal temple @neon palm both of you check this link
Yea I thought about it
Tho no idea, I'd have to check the java doc
@neon palm may be looking for #mod_support given the message before the errors
(I see now that they have a message there already)
Oh, youāre my hero. Itās getType, right?
I had no idea such a thing existed before. Iāve always wondered how everyone knows about these things and how to use them.

Where?
You want the metal value ?
Then no that's not it
If you're asking which message I'm referring to, I mean the text in your message prior to the error text
i.e., it implied you were not developing a mod but were instead having mod problems
Can you give more info ? That's in B42 ? That's a crafting function ?
Yes, this is B42.
It determines how many items to give based on the firearmās metal value.
I'm fairly certain the metal value does not vary
I remember it just being for metal or 0 for non metalic or some shit like that
Did you check if it's different for different firearms ?
I saw that the Firearm mod gives guns this attribute, so I used it accordingly.
What about vanilla weapons ?
You can't base yourself on mods for codes unless you're making an addon for one, which I would guess in your case you're not ?
But does it vary between each firearms
I'm not sure about that, but I can set it on my firearms and then disassemble them based on that value.
Rifles are 45, pistols are 30 and when you cut down the barrel of a JS-2000 you remove 10 units of metal. But cutting down the barrels on a double barreled shotgun doesn't remove any metal at all.
So, typical zomboid accuracy. š
Anyone know if vomiting was planned and scrapped, or if its still planned
There's an animation for it, but I've never heard anything else about it
Nice
Only mention I could find is https://projectzomboid.com/blog/news/2016/03/re-animator, which suggests to me that it was just something added as an animation among many that might've been useful at the time
2016, damn
holy shit, 9 years ago
well, guess I don't have to worry about them releasing the mechanic a day after I release my mod lol
I guess it's there if someone wants to mod in vomiting
If you're adding vomiting remember to check for the CanEat tag on any facewear, and if it's not set... well that's really bad.
Instant max discomfort meter
howdy- has anyone here happened to look into how the new jog-bumping mechanics work? i've been looking to revert it back to the previous b42.7 behaviour but unfortunately i'm quite a novice modder and haven't been able to figure it out myself.
not totally sure where that is in the game files, or if it's even easily modifiable
New jog bumping ?
What is it ?
the random turn your character does when you bump into zombies- it feels really bad because it doesn't just shunt you to the side, it actively changes your direction which then forces you into the turn-around animation to move in the direction you were already holding
also it doesn't turn you if you do it while using the walk-to command
Ooooh is that the shit that's happening with zombie lunges pushing you in random directions ?
i think it's different but it feels very similar to that, imo
No someone was talking about the game randomly changing your direction
It's not the thing where if you aim your character can end up rotating around and being terribly placed
- getting knocked back, even falling over from a lunge? cool, that's fine, makes it risky if you're ill-prepared
- getting knocked back and randomly turning a full 180 degrees somehow? there's the problem
I think they explained it's something where the character will end up in the wrong orientation
great idea
that's actually really helpful lol, I probably would've thought about it somewhere along the way, but I wouldn't have realized the CanEat tag would held me detect it. I probably would've made a table and tried to manually add each mask
not familiar with what you're mentioning myself, unfortunately
the random turns i mean, not the caneat tag stuff
see, i tried that here, but then i get an error in a STrapGlobalObject at line 291
something here is bugging out and i have no idea why
Looking smooth.
Doing pixel-padding on quad render so there's room for the AA code to breathe.
SoundGain and NPCSoundBoost, what the heck are they? all I get from the wiki is DEPRECATED yet people keep adding them to the weapon mods. Any help?
they don't do anything, people just guess when they add them to their mods
(āÆĀ°ā”°)āÆļøµ ā»āā»
don't trust other mods, most modders genuinely have no idea what's going on š
Yeah, I'm running through CJ's firearms mod. He did a ton of work and I respect that but a lot of it looks copy/paste. VSS with subsonic rounds and built in suppressor with 130 SoundRadius š¦
Going to edit his 40-50 guns for my server before I start throwing my own stuff in.
Can I generally ignore anything listed as depreciated on the pz wiki?
yeah, when we say 'deprecated' we actually mean 'removed' lol
oh hey fancy seeing you here.
yeah deprecated stuff on item scripts are just bloat but its not gona do harm or anything.
game will probably just consider it as moddata
so if you want to test it then call the items moddata via lua console or use a moddata tool of some sort
Yeah I figured I could test the setting I messaged you about but these two I wasnt sure how to figure out
if they aren't recognised by the game at all they won't be on the wiki
when they're marked as deprecated that means the game does recognise and handle them, but that they just don't actually do anything
so they won't go to moddata
I need modding assistance with making custom vehicles (blood/damage overlay textures)
With just how to make the textures or what?
Nah I got em all made but damage and blood textures show together when a hood is damaged for example instead of damage only
Does your script look something like this
textureLights = Vehicles/vehicle_dodgeram_lights,
textureDamage1Overlay = Vehicles/fr_Veh_Blood_Mask,
textureDamage2Overlay = Vehicles/fr_Veh_Blood_Hvy,
textureDamage1Shell = Vehicles/fr_Veh_Damage1,
textureDamage2Shell = Vehicles/fr_Veh_Damage2,
textureRust = Vehicles/fr_Veh_Mud,
What is the error? Guessing from just a screenshot, you don't have baseHunger defined so baseHunger defaults to 0 and the next line is a divide by zero error.
Which isn't something that normally happens, because the deer woudl be generated as a live animal not a corpse item with food values assigned in that function.
My scripts look like that yea
textureMask = Vehicles/vehicle_Humvee_Vehicle_Mask,
textureLights = Vehicles/vehicle_Humvee_Base_Lights,
textureDamage1Shell = Vehicles/vehicle_Humvee_Base_Damage_Mask1,
textureDamage2Shell = Vehicles/vehicle_Humvee_Base_Damage_Mask2,
textureDamage1Overlay = Vehicles/vehicle_Humvee_Base_Blood1,
textureDamage2Overlay = Vehicles/vehicle_Humvee_Base_Blood2,
textureRust = Vehicles/vehicle_Humvee_Base_Rust-Dirt,
Shush you Ash xD
what should I do to ensure a custom variable added to my IsoPlayer is correctly synchronized in MP ? I use playerObj:setVariable("myFancyVariableName", true)
@silent zealot
Could you please take another look and see whatās wrong?š
I want to show a confirmation dialog when the menu option is clicked, and only perform the dismantle action after confirming.
But right now the rightāclick menu option doesnāt even appear.
I referenced the Split Items modās UI creation code.
local GetReinforcementPoints = function(playerNum, context, items)
print("##### GetReinforcementPoints()")
local firearms = {}
for _, item in ipairs(items) do
local actualItem = item
if not instanceof(actualItem, "InventoryItem") then
actualItem = actualItem.items[1]
end
if actualItem and actualItem:hasTag("Firearm") then
table.insert(firearms, actualItem)
end
end
if #firearms > 0 then
local playerObj = getSpecificPlayer(playerNum)
context:addOption(
getText("ContextMenu_GetReinforcementPoints"),items,useConfirmUI,playerObj,firearms)
else
print("##### No Firearm selected")
end
end
useConfirmUI = ISCollapsableWindow:derive("ReinforcementPointsConfirmUI") --建ē«UIēå
Øåå¼å«
function useConfirmUI:new(x, y, width, height, player, firearms, totalPoints) -- 建ē«UI Building UI
local o = {}
o = ISCollapsableWindow:new(x, y, width, height)
setmetatable(o, self)
self.__index = self
o:setResizable(false)
o.pin = true
o.title = getText("UI_BreakDown_Title", items[1]:getDisplayName())
o.player = player
o.items = items
o.firearms = firearms
o.totalPoints = totalPoints
return o
end
function useConfirmUI:initialise() --åØUIäøå å
„確čŖčåę¶ęé Add confirm and cancel buttons to the UI
ISCollapsableWindow.initialise(self)
self.splitButton = ISButton:new(10, 140, 135, 30, getText("UI_CA_BreakItems_Confirm"), self, useConfirmUI.onMouseDown)
self.splitButton.internal = "CONFIRM"
self.splitButton:initialise()
self.splitButton:instantiate()
self:addChild(self.splitButton)
self.closeButton = ISButton:new(155, 140, 135, 30, getText("UI_CA_BreakItems_Cancel"), self, useConfirmUI.onMouseDown)
self.closeButton.internal = "CLOSE"
self.closeButton:initialise()
self.closeButton:instantiate()
self:addChild(self.closeButton)
end
function useConfirmUI:onMouseDown(button) --ęŖ¢ę„ē©å®¶ęēęÆåŖåęé äø¦ååŗęäøå¾ēåä½ Check which button the player pressed and perform the action after pressing it
if (button.internal == "CONFIRM") then
local inv = playerObj:getInventory()
local totalPoints = 0
for _, primaryItem in ipairs(firearms) do
local MetalValue = primaryItem:getMetalValue() or 0
local points = math.floor((MetalValue / 5) + 0.5)
if points > 5 then
totalPoints = totalPoints + points
while points >= 0.5 do
inv:AddItem("CrisisAction.Reinforcement_Points")
playerObj:getInventory():Remove(primaryItem)
points = points - 1
end
else
playerObj:Say("IGUI_CantBreakDown")
end
end
if totalPoints > 0 then
playerObj:Say("IGUI_Get" .. totalPoints .. "IGUI_Points")
end
self:close()
elseif (button.internal == "CLOSE") then
self:close()
else
ISCollapsableWindow.onMouseDown(self, button)
end
end
But right now the rightāclick menu option doesnāt even appear.
Why did you remove the Event Add to add GetReinforcementPoints to teh list of functions called when the context menu is being populated?
Also, rename your functions so it is easier to tell what things do. GetReinforcementPoints should be called something like DisassembleFirearmContextMenu or some such
I would say double check your image nemes, make sure you dont have any layer issues on the files
A quick look through vanilla lua suggest that there is no need, or at least I can't find any case of setVariable() followed by a sync of any sort.
Oh, I accidentally deleted it. Iāve now added it back, but when I click the option, it throws an error from ISContextMenu.lua.
I'm not sure if setVariables is client-only though, that seems to mainly be how they are used and I've not played with them before.
Is using player:modData an option?
Does anyone know of any mod that adds something along the lines of high tech equipment? I've always wondered if its possible to have a sort of shoulder-mounted turret or something along the lines of that.
I've seen power armor, but mechanically that's just armor with high protection stats.
Also: rayguns, electromagnetic rifles, electric weapons, automated fixed turrets...
Are we allowed to make total conversion mods
Wdym by that ?
Like to completely overhaul the game ?
Turn Zomboid into... Not Zomboid
Like Turn the game into something else
Like how Counterstrike is a Total Conversion of Half Life
Or Fallout London is a Total Conversion of Fallout 4
Or Starwind, which is a mod that converts Morrowind into Star Wars
Yea you can
Probably gonna be both extremely hard and possibly hopeless but imma try
No-one will stop you, but Zomboid is not a good game for that sort of conversion.
It's very much built around survivor vs: horde of zombies
Really? I honestly saw it more as just a Survival Sandbox in general, with realism foundations
And lots of game logic is in the java side, which while not impossible to mod... you want to think very carefully before modding any java.
You could get rid of the zombies, it's just going to be hard to repalce them with any other sort of enemy.
If you want to go full-on mundane survival, there's definitely an audience for hardcore survival stuff. (not me!)
I think itās worth a shot, If I did a total conversion thereād probably be only one aspect of it thatās wildly apart from the game
But everything else at least from what Iāve observed is entirely possible within the game
Do you have a plan for your total conversion?
Or just "chaneg all the things!" lol
Yeah, we have a plan on what we need to do, and we want to do a basis of whatever that is before actually building something cohesive
Make bricks before building with them
We can probably help you identify likely stumbling blocks so you can investigate those early on/plan around them.
Isn't that already in B42? Clay & sand -> bricks
Thatās a metaphor
Also, be aware B42 crafting is still getting worked on, so you might end up duplicating the official changes
oh, that's fine then.
Changing the way the leveling works, Monsters, NPCās, Dialogue, etcā¦
An RPG, basically.
When I said we'd help you identify stumbling blocks?
Monsters
NPCS
two big ones right there
Monsters canāt be that difficult
I assume itās mostly behaviors that need work, otherwise itās animations & health & damage
Modeling as well
There isn't any layers for them ill try though!
Have you noticed teh lack of new animal mods for B42?
You have animals to work with in b42, but since we don't have NPCs monsters in mods have pretty much always just been repurposed zombies (same with NPCs)
Then again, I have limited experience modding in the first place
AFAIK the animation stuff for animals is broken in a way that stops you adding anything new.
I guess you don't have animals to work with then lol
And overriding zombies selectively is... a challenge.
Because it's all built for one type of enemy only
This is also a stumbling blockāthe simplest one to get over (with practice and research), but nonetheless
True, Iām probably gonna be coming in the help channels often asking for help or advice
that's not correct
The idea itself requires a bit of innovation. People have done NPCās, theyāve done a few things like that, but never to this scale.
NPCs... you can have a loot at Bandits/Week One/etc. Those mods are 1) a horrible janky mess and 2) absolutely amazing that so much was done as mods with the current base
we've already added a new animal, there's no significant hurdle, the people saying it's impossible are just making it up for some reason (as with most things people say are impossible i've noticed???)
I thought about dming Slayer ab it
I thought we were still at the point where the only new animals were just reskinned existing ones?
Other than the NPCās, Monster, Dialogue, and⦠I guess aspects like quests or whatever that are expected in an RPG, Everything else should be standard. New Tiles, new armor, new items, new guns. Lots of modeling but Iām willing to endure
New Cars
These are all things people have done before iirc
i'm not sure if there are any released animal mods
it's a LOT of asset work
but there isn't any specific technical reason why you can't, you just do it
https://steamcommunity.com/sharedfiles/filedetails/?id=3394755161&searchtext=animal This is the only new animal I know of, and it's more or less a pig.
I honestly would like to know if what Iām proposing, if any of it is even possible?
A lot of it can be done yes, just a matter of time and effort
Then I guess I should try and just do it then.
Monsters & NPCs are the only two I see as potential big issues.
I suggest break it up in scope and choose what to focus on to start with.
I mentioned dialogue, quests, and things like that too
Iām someone who believes in doing the hard things first. So probably the monsters and NPCās.
If you have NPCs I don't think dialogue will be a huge problem to implement
Think old RPGās
Dialogue box
Depending on what is said will influence certain behavior/actions of the world or NPCās
Yes, you can just track whatever stats you want with the NPC data
Weād have to probably add a new skill
Again, also possible
But something speech related
I guess(?)
Not essential, but probably something you want.
All of this while keeping most of the core mechanics of Zomboid
Sounds like a party tbh
I don't know if you can add a new skill as a "this is a skill" but if you can't, you can definitely just track XP/level in player modData to get the same result.
I know some mods have added skills
Like that one brewing mod
My hope is we can get a good enough framework with everything to where we can finally get into the design aspect of it. Basically, design the LEGO pieces, and then build something out of it.
Yeah, not something I'd worry about; just something to code when you get to it.
But thank you, I appreciate your wisdom
I canāt say for sure this will become a thing, but weāll see. It simply has to leave the āPipe-Dreamā Phase
Methinks
Itās just me and a buddy
but that has it's own challenges dealing with people lol
2 people canāt possibly do it by themselves, it could take much longer than a group doing it
But weāre both insane and thuggish enough
We will probably get more people if we need to
Not on the workshop yet?
it's not finished
Those horses are kind of cool
does anyone know where can i ask a commsion for a map someone can make me ?
If i hypothetically want to make a map based on my home city, what should I know?
There's a PZ Modding Community Discord that has a commissions channel.
If you're on B42 there is a fan-made tool update; check the sticky posts in the mapping channel.
Thanks! Is there a limit to map size?
can you send me the discord channel @silent zealot please
Hello, I'm currently creating a mod for fun.
But I'm encountering an error:
ERROR: General , 1749044677211> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: Object tried to call nil in checkForInfections
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.gameStates.IngameState.updateInternal(IngameState.java:1624)
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)
I have no idea how to fix it, and I don't really understand it.
Do you have any solutions?
Here is the GitHub link:
Adds configurable bite immunity system to Project Zomboid. Players can have a chance to be immune to zombie bites, scratches, and lacerations based on configurable percentage. - ToRaNek/BiteMunity-PZ
The error should tell you which line has the issue
"tried to call nil" normally means you're trying to call a methoid that does not exist, either because of a typo or because the object with the method isn't the right thing (e.g.: it's nil instead of something useful)
Ahh okay, but the method exists in biteMunityClient
function BiteMunityClient.checkForInfections()
if not player then return end
-- VƩrification de sƩcuritƩ pour getGameTime()
local gameTime = getGameTime()
if not gameTime then return end
-- Alternative plus sƻre pour calculer le temps
local currentFrame = gameTime:getWorldAgeHours()
if not currentFrame then
-- Fallback vers un compteur simple si getWorldAgeHours() Ʃchoue
currentFrame = lastInfectionCheck + 1
else
currentFrame = currentFrame * 3600 + (gameTime:getTimeOfDay() or 0)
end
if currentFrame - lastInfectionCheck < CHECK_INTERVAL then
return
end
[...]
end
Which call is triggering the error?
it's something in the checkForInfections function
the full error should give a line number
yeah line 82 but its all function ahah
I'll add a few debug print and get back to you
@sweet cipher happy birthday
So... I've added a lot of debugging at each step but actually it doesn't even fit in the function š
Do scripts need to use case sensitivity when running on Linux? I have file path references in my clothing files and stuff, some all lowercase which doesn't seem to matter on windows, but will thst break the mod in Linux or does zomboid automatically handle it
Good afternoon. Is there a way to edit the UI and see the results? Because sometimes, when you reload from Lua, some features don't work. I don't know if there's a way to edit and see how the interface looks before entering the game.
Isn't there a difference between reloading and restarting lua
Debug mode features restart Lua button
Check that
yes - reload from the debug interface re-runs a lua script, but it doesn't cleanup anything it has already done... so that means if the script changed other things or added functions to events it won't be a clean restart. "reload lua" throws everything out and starts over for all lua (and I think all script files too)
i've created another website that hosts documentation of the game's lua, similar to the unofficial javadocs i've been hosting
https://demiurgequantified.github.io/ProjectZomboidLuaDocs/
Agreed, even for mods that woudl be easy to backport it's time to set things up, test, then re-assemble in the workshop folder and upload
And then people will want support on B41.
i'll be honest that my disk space situation is so dire that just having both versions installed is problematic for me š
I'm kind of sad.
Wanted to make that but my older projects got me tied down.
it's pretty basic as of yet, a better solution could definitely come in the future
it only took an hour of development (and 4 hours of fucking about with github workflows š )
Terrifying.
I'm an oldie so I'll do it manually. x)
i'd been planning to as well but when publishing from github pages, it takes an absurd amount of time to push a full website to git (and because of bizarre things doxygen does behind the scenes presumably for performance, every push is a full website push)
the workflow basically just uploads a zip to github instead and that trims off literally ten minutes š
might look into doing something similar for the javadocs (they have a similar issue since they store the time of generation inside every file, every file has to be updated every time) but i probably can't generate them from a workflow like i can the lua docs because i actually need a copy of the game to do it
the lua docs generate purely from rosetta data so there's no issues with that there
Is it just because it's a whole lot of pages? I've not experienced slow uploads with gh pages but mine have always been like 20~30 files (incl. css and js)
i assume it's mostly file count yeah, i think the javadocs have a few thousand for example
If you're not on a laptop, SSD's are constantly getting faster and cheaper.
Grrr, is there any docs for B42 for the new craftRecipe, specifically why recipes seem to be empty in the Craft Recipe Debugger with an unfortunately less than useful error 'ISStringListView -> parsing error. out of bounds'?
Do timed actions have to be in a TimedActions folder, or can I put them anywhere
I've always seen them in that folder, but my mod's getting bigger and some fit better in different places
they can be anywhere
other than client/shared/server, folder never matters
(and even those rarely matter)
Thanks
As for the issue, check console.txt for any mention of the recipe name.
But it might be something that gets past the parser but then breaks things that try to display the recipe.
Hello good evening, does anyone here know how to create mods for the game?
Oh wow it shows what it derives from too, that looks neat
Perhaps the arrows should be the other way around ?
What do you think ?
Yes.
Multiple modders hang out here.
Has anything regarding clothes modding changed between b41 and b42?
Some new tags, discomfort...
But the process of making a model/texture/etc is all the same. At least I had no isses using B41 intsructions on B42.
Good to know, gonna try and get my clothing done over the next few days.
I'm starting to want to move onto new projects so I need to force myself to finish the stuff I don't find as fun as modelling and texturing
#musicmaniacpins b42 docs
Note this is Lua doc not Java doc
Also I'll make a wiki page about this later today
Combine them into Jluva docs
I know
Hello I am new Making custom mods is there anyway somebody can help me make a gun from models i have for b42
i got custom weapon models but i need help with it to make them work
I would really like to meet someone to see if we could meet up so they can make some united mods for my server.
Someone's working on that, I'm in contact with them
boop
I'm just not a huge fan of their current lack of transparency but they have stated everything will be open source
I'm actually so excited just got done with the model; but idk how to add the paint to it
See a Blender tutorial
Also
the thing is right I already have a model But I'm trying to figure out how to add the textures to it lol
Then I have to see how to import it into pz
Check the modding Discord to commission modders
Just watch a Blender tutorial
And check that Steam guide I sent anyway
It has some directives to getting gun models in the game
#handpainted #blender3d #modelling
UPDATE - BLENDER 4.3 - https://youtu.be/_-zAhCOUpog
Learn how to use the texture painting tools within blender by painting this hammer model
Want to learn take this learning further then take my hand painting course only $13 (plus local
https://bit.ly/blenderTexturePaint
Hammer Model: https://gdev.tv/gr...
Thank you I do have a question again doesn't project have like detachable magazines
like guns with no mag
Just so I know if I'm gonna combine the two models together like the magazine and the weapon or keep them separate
Yea
I think so
But I'm not too knowledgable on guns
Do you think somebody can join vc and help me out a little bit
I doubt it
wanna give it a try hahaha
Depends if someone's available but it's unlikely you'll manage to post your message at the same time as someone who's available
I believe the Steam guide is really decent to do most of what you need
Besides maybe some modeling and texturing
I already text the model
It's just getting it zomboid compatible
I'm not going to lie the guns that I'm doing right now I can already tell it's going to be a banger haahhhaha
What are you going to use as the texture? Do you have an image file ready?
I already have the texture on the gun
That's how I did my gun mods. I made the texture image up in krita, then used UV mapping to map the faces of the model to areas on the texture
The only thing I'm trying to like understand is how to get this ready because I'm reading how to do it but like my brain is not braining
How did you do the texture in blender
Specifically, what is the base colour for the material?
Ok, so grip1_diff is already an image file
Ohh I already have everything on the gun already
Like I'm looking at it right now and it's fully finished it just needs to become compatible and like work for Zomboid
Did you use only one image file for the model?
yep
What resolution is the image
Not file type, resolution. It needs to be in powers of 2 to work in Zomboid
I used 512x512, but you could go list because of how tiny the models are in game
What do you mean "all three"
like all 3 are 1024x1024
do you want to join vc
No, I'm not up for voice chat
hmm ok
Why are there three textures
one for the base one for the grip one for the clip
Did you use different image files for different parts of the gun?
yep
One model to one texture in Zomboid
Now the clip should be an attachment so it is it's own model
I mean if you want to join vc and we can both mute and I can screen share I can show you what I mean
if thats ok
I'm tired and sick and warm in bed, I'm not committing to a screen share troubleshooting session
So basically these are the files of the photos
The grip, assuming that is part of the gun and not an optional grip attachment, needs to use the same texture image
Basically for a single model you want one material in blender for every part of it
Also, you can drop the resolution way down... you wont see that level of detail in game
You can probably do something fancy in blender to map everything into one texture image, but that's beyond my blender knowledge. Maye texture baking, but that's meant for lighting effects.
Yeah if I wanted to do that right I would have to make the model all in one but that thing is right I want the magazine to be detachable
Or you can open up your favourite image editor, make a 512x512 image that has all the textures you need by combining the images, then redo the UV maps
A detachable mag is a seperate model and can have its own texture file. But it doesn't need to have a seperate texture, and can probably fit into the same image as the rest of the gun used.
The grip cannot have a seperate texture image. You will export the gun body and grip as one .FBX model, and in the model definition for Zomboid you will specify one texture image
hmm i see
Like I said, I don't know of an easy way to get there from where you are now; you'll either have to learn some blender tricks or make a single image with the gun body and stock (and may as well add the magazine too) and redo the UV mapping.
If I add an attachment slot to a Female/MaleBody model like Authentic Z, is there a problem with the Attachment Editor that causes an error when I select the Player Model in the Editor? Or is it because of the way the attachment is added (to Female/MaleBody)?
I too would like to add a Slot and implement the coordinate settings on the Player Model side, but I am having trouble because the Attachment Editor stops working, although usually play is not a problem.
module Base
{
model FemaleBody
{
mesh = Skinned/FemaleBody,
static = false,
animationsMesh = Human,
attachment Canteen_L
{
offset = -0.1410 -0.0890 0.0700,
rotate = -180.0000 -105.0000 154.0000,
bone = Bip01_Spine1,
}
The error is below.
[05-06-25 20:42:59.059] ERROR: General f:476, t:1749123779059> ExceptionLogger.logException> Exception thrown
java.lang.RuntimeException: attempted index: getName of non-table: null at KahluaThread.tableget(KahluaThread.java:1667).
Stack trace:
se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1667)
se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:624)
se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:173)
se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1963)
se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1805)
se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:38)
zombie.ui.UIElement.render(UIElement.java:1985)
zombie.ui.UIElement.render(UIElement.java:1995)
zombie.ui.UIElement.render(UIElement.java:1995)
zombie.ui.UIManager.render(UIManager.java:409)
zombie.gameStates.AttachmentEditorState.renderUI(AttachmentEditorState.java:186)
zombie.gameStates.AttachmentEditorState.render(AttachmentEditorState.java:106)
zombie.gameStates.GameStateMachine.render(GameStateMachine.java:28)
zombie.GameWindow.renderInternal(GameWindow.java:469)
zombie.GameWindow.frameStep(GameWindow.java:941)
zombie.GameWindow.mainThreadStep(GameWindow.java:643)
zombie.MainThread.mainLoop(MainThread.java:76)
java.base/java.lang.Thread.run(Unknown Source)
I don't know if it's due to mods or just broken in B42, but I can't load the player model into the attachment editor without it breaking
I keep forgetting to try with all mods disabled
If I add attachment settings for Base.Female/MaleBody, as in the attachment settings in the previous post, the Editor breaks. On the other hand, if I disable those mods, the Editor works fine.
That's probably what kills it for me then, I have a "shove a gun or canteen on back of belt" thingy in my personal tweaks mod.
Hmm I wrote the attachment editor from B42 and it worked back then
I also added expansion slots in my own mod, but ended up using vanilla slots (e.g. back, backpack_left) and setting the coordinates on the item side model. However, this is not scalable, so I would like to add my own slots to Player Model if possible.
You can probably answer this then; what is the secret to making a weapon model line up properly in attachment editor? I've had no trouble getting weapons to work correctly when help/used/etc, but in attachment editor they always seem to display with the wrong rotation so moving attachment points to match is guesswork.
Except for the latest gun, which was perfect.
So it seems to be something like "you need to have the wepon at this orientation in blender, but you need to have it that away with a specific unapplied rotation transformation."
Or, might be because the latest one was a rifle not a handgun.
Sorry I meant I wrote the attachment editor wiki page š
ah that makesa lot more sense lol
Yea indeed I'm not a dev š
Sadly for some reason adding attachments points on player kinda prevents you from using attachment editor in b42. If you want, you could probably still do it in b41 to save exact location and simply insert it in txt file. Or do everything in txt file in 42, but that's Pain in the rear
I had same issue, but I know I did it the same way as in b41.
ok so my custum gun doesnt show in my hand
like its Invisible
anyone know a fix
Many reasons for that. You need to provide more
like the gun is Invisible when its spowned in
I suggest not developping mods whike playing with other mods
Reduces the sources of potential issues
Does anyone know how to make a sprite with an inventory container lockable using the padlock system?
According to ISPadlockAction.lua, I understand that it should be enough to define the sprite in question as an IsoThumpable, but how do I define it?
I've already tried mimicking the tiledefs of wooden crates in the .tiles file and even creating the item and defining it as thumpable, but it doesn't work.
Does anyone have any idea how I can do it?
The thing is right the model is completely invisible I even try to without mods etc
I went through the subject probably three times triple chacking
I don't know if I'm dumb tbh
i might be to brain dead
From the top of my head:
-exported empty model (you have file, but there is no actual model in there),
- You have more than 1 material assigned to it
-Its too big/small to be visible
-You put your model/texture in wrong folders,
-a typo in script.txt or model.txt
A gun, which is 1,5 mb fbx file. Something seems fishy by just that to be fair
hmmm
Just show it in blender aswell as show us your txt files
i sent in dms
This discord and those channles here are made to Help modders, why should we use DM's for this?
Someone else might have same issue and it might just help them
thats the model
Okay, but this doesn't tell me much apart from how its supposed to look like. Just show whole screen, could also use material tabs and still waiting to see your script files where you gun model and gun itself are
Press N
Show us the info box that pops up, especially the scale
Actually no need it's on the right
The scale is wrong
It's stupid but... You need to have the scale set to 0.01
So when your model is the correct size in blender (you can compare to existing gun models) you need to make it 100 times bigger, Ctrl-A apply scale transform, then put 0.01 in the scale fields
Its only for firearms, or any weapon model you want to use with "attachment system"
You could export a machete with 1x1x1 and it would work, but the models that appear on top of you models in case of attachments do require for base model of weapon to be in that scale
Or they .... get messy
Rotation matters too; you need it to both look like the model in the example and have the rotation set to same vales as the example
I know, i made that guide 
Less important than scale though
That was for JoystickJester. Also, thank you! That guide was so helpful.
Other less likely reasons a model might be invisible: texture fails to load (wrong path/ filename, etc... the will be an error in the logs)
What should I learn in Lua to start modding?
Still waiting for your item script and model scripts
Or for partial missing textures: polygons with more than 4 vertexes (fix with triangulize) or flipped normals (fix by inverting normals where they are wrong)
Do you have programming experience in any language/script?
If you know the common stuff like variables, functions, objects, conditionals, arrays/tables, then you can muddle your way through changing Lua by googling "Lua how to do X" a bunch
I have smol java experience
I understand basic things like this
Good enough, just jump in and learn as you go is my suggestion
There's some kind of zomboid API for lua, isn't it?
And don't trust AI. You can ask it general Lua questions and it can be helpful, but if you ask for project Zomboid specific stuff it will lie so much
Ikr, AI has no idea about small games internal coding
Look up "javadocs" in this channel, or on the pz wikiās modding page
That's the API for interacting with all the java objects in the core game
Oh, there's some links in pinned
programming in lua is a good fallback for info about the language https://www.lua.org/pil/contents.html
I suggest getting VSCode and opening up the games media folder so you can easily search all the vanilla .Lua and .txt files
A good practice for me to learn Java was dissemination of other mods' source code. This is also a good option here, right?
And you can use Zomboid decompiler to easily make a local city of the java code which is great for seeing how things work in the hidden java side
Absolutely! Find a mod similar to what you want and see how they did things
Don't straight up copy/paste code, but write your own after seeing how to do it
I wanted to start from basic, new medicine items
That would require item itself, distribution and function tied to item
believe me nothing related to the health system is basic š
A lot of that won't even need Lua, other than the distribution.
What's the markup language for project zomboid? XML?
And you can use Easy Distribution mod if you want to make the distribution tables just one line to copy an existing item
A bit of everything lol
Some actual XML, like animation sets and some clothing related stuff
Some stuff that looks like Lua but isn't really
Lots of txt files with a custom script design
It looks like mix of lua and markup language
file that defines properties of item
It's also on wiki for each item
Some things are hard coded in java, like the various random "stories" that can appear
the txt format is called zedscript and it's basically just the result of refusing to ever give up on having their own format
Good summary lol
in the earliest versions of the game it was supposed to actually be a scripting language (hence the name) but they worked out that lua was just way better for that
so now it's just used for defining things, instead of something reasonable like json, yaml or xml
zedscript has really inconsistent syntax and being a unique format there's nothing at all to help with it
i've gotta get back to that language server when i get bored of my current projects š
Xml would be nice, especial with inheritance and xpath patching
You can also break the game by putting in something it can't parse, or by putting in something that does parse but then crashes the game because there was zero safety checking
I wish someone told me algorithm behind sprite style, to me this looks like mess of pixels and i'm unsure how to replicate it
Look up pixel art tutorial?
The inventory icons don't have to be high quality because they are so tiny in game
I mean, i'm used to algorithmes and sequences, and there's no strict way to replicate this
Always had problems with art
Better to be distinctive really to help identify things
I hate how many guns are basically a bit of very dark grey and black on a black background
I made the survival rifle icon a lot lighter than the actual gun, so you can actually see the shape
And my other guns were already lighter by design
What do you need to make an icon for?
Sometimes you can save effort by just editing an existing icon
Some meds.
Activated charcoal, muscle relaxants, anti-anxiety, cough syrup. My plan is to try draw over original textures
You can also look for icons online with a free licensee, or use ai to generate an image that you clean up
AI can't really catch the style of pixel art
is the "Player Spawn Area" on sandbox setting broken atm? for spawning zombies inside the safe zone
I can't seem to make it work with custom spawn points
hey, does anybody know how to add tags to zomboid mods on steam workshop? Ive just made my first one and the only tag i have is B42
For my 32px icons, I usually generate a rough sketch using AI first, then redraw everything myself. I even made a simple workflow in ComfyUI for this.
In the in-game uploader
really? When i uploaded it from Project zomboid workshop it only let me take b42 tag
There's literally dozen others
Sometimes when Iām drawing icons, it feels like Iām just scribbling randomly ,but the result actually looks not too badš
okay let me check
So idk bro but you need to send a screenshot if you don't see others š
ohh my bad, i see it now. Idk why it didnt let me scroll then. Or maybe it just lagged for a while. Can i edit it from there after upload?
I think so ?
Hmm no I don't think you can actually
well i'll try
Wait
Did you mean from the workshop ?
Or change the tags
You can modify the tags after the first upload of course
But you need to do it from the in-game uploader
okay it worked
Still being a pain
Is it possible to force a sneeze
It's not a timed action right? I vaguely remember looking into it and it being hardcoded, but I'm not sure
playerObj:getBodyDamage():setTimeToSneezeOrCough(0) idk if it forces one but this is all i found
Still need some help with this!
Well shit, looks like I'm making a sidecar, for adventures
I made a bowl of pea soup feel free to use it š³š±
I'm clearly late to the B42 party, (at least in terms of actually working on it). sigh, this damned hardcoded weight system...
Did they announce why this was implemented? I'm working on a system that can hold exactly 12 of something, and 12x15kg exceeds that hardcoded value.
Someone has made a fix actually
Other than the Java replacement fix?
TYVM! Best I could find was Zuper which was less than elegant.
Yea the zupper dev kind of went insane since then lol
oh?... (not even going to ask)
Was a joke don't worry 
But I remember talking to the guy that forked the original mod to update to B42
And oh boy he was going crazy over this singular issue if I remember right lol
With this I was contemplating swapping it with number of items instead, but I felt that live-patching items as they're placed into the container to weight '1' would cause more issues.
Yea I think they did
Oh yeah that will most definitely cause issues 
All-in-all for B42 though, I am enjoying the work they did to the crafting / build system; managed to tap into the new build interface to allow the user to immediately place the crafted item in the world.
I haven't looked at it in depth
But it's a whole UI so it's fully Lua sided, which makes it very easy to customize
Something not many people did before B42 actually
module Base {
xuiSkin default {
entity ES_TireRackUnpainted {
LuaWindowClass = ISEntityWindow,
DisplayName = Unpainted Tire Rack,
Icon = Item_TireRackUnpainted,
ToolTip = Tooltip_craft_TireRackUnpainted,
}
}
entity VNGarage.TireRackUnpainted {
...
Threw me off for a bit as they seem to need to run in the base/default namespace, but once I got that namespacing figured out, seems to perform quite nicely.
No need for code
Feel free to use it
Check these out
Would be cool make a dutch foods mod#
Then make it ;)
Item mods usually don't require too much, tho a whole food mod can require some more bits, like crafts and shit
For sure
You like the design?
No
Wait sry
I read that wrong that was so mean š
It's nice !
Sorry I thought you asked if I like to design, I'm too tired lol
OOOH, ok, JB's max weight is still overriding the method at the definition level, so it applies to everything in the application; I was hoping to not have to do that, but at least having that functionality in a shared common library will help minimize performance issues.
Yea it still does some modifications to how Lua interpretes weight and shit I think
yup; it overrides the definition, so every container in the game will run the overridden code. That's generally not the best way to do it, but with limited low-level access, is probably the best we can hope for.
I've seen enough people break their head on the problem to see this as one of the best solution š
Someone doesn't like combo stacks. š
JavaDocs and LuaDocs pages
-
The unofficial JavaDocs now have their own pages
-
The https://pzwiki.net/wiki/JavaDocs page was updated with links to these two new pages
-
The Lua now has a https://pzwiki.net/wiki/LuaDocs thx to Albion
Other
- New video guide to getting into modding by Rainmaker, dating from April 2025 (linked in https://pzwiki.net/wiki/Modding#External_resources_3)
I hate them too, but at least it's easy to copy-paste code to handle them (for a context menu option at least)
Yeah, right now working on integrating JB's fix, though getting the ever-fun attempted index: addContainer of non-table: null on game boot.
I agree, the alternative is you have to override a dozen lua functions from all over the place some of which need to be replaced instead of prefix patched. So buggy, hard to catch every use-case, prone to breaking with updates or not playing nice with other mods that want to do the same for their containers.
Or you hook in to the lua -> java call, decide if you will override or just pass through to the origianl function, and have none of those issues.
ah, JB's code needs to go in client and not shared. That makes sense
Is fileGuidTable still needed in b42?
w00t! it can hold 12 tires again! (and the 1-12 item sprite still works even)
(now just to see if I can get that container icon correct...)
ContainerButtonIcons = ContainerButtonIcons or {}
ContainerButtonIcons.TireRack = getTexture("media/textures/Item_TireRackUnpainted.png")
Well that was easier than I thought... I'm just an idiot.
I've given up on the clothes for now, i don't understand them at all and trying to figure it out is making me mad, just gonna finish the cars and come back the clothes later.
clothes arent that hard just need a clothing item script and a clothing xml and a filetable xml and a model and a model script and and and
No matter what I did they just weren't working, if I keep up with it I'm gonna just abandon the mod. I'm not even trying to make new clothing just retexture some base game ones, but everytime I go in game the clothes throw endless errors and have no tooltips
We can help; when you're ready to revisit that
if you're just doing new textures for existing clothing models it's easy to do
fiddly, but easy.
I'll finish up the other stuff then come back to it, still gotta do schemes and distributions
that way If I get annoyed again I can just release what I have and add clothes later
scope creep hits even solo developer mods. š
releasing clothing later seems sensible.
Nothing truer than this on my behalf.
Now that the unreal engine can manage hundreds of NPCs doing stuff at once on consumer console hardware I expect your shader mod to make Zomboid look like this: https://youtu.be/FJtF3wzPSrY?t=500
Check out this Unreal Engine 5.6 tech demo for The Witcher 4, running on PlayStation 5 with raytracing. This Witcher 4 tech demo shows off the new Fast Geometry Streaming Plugin to load open-worlds faster, and we see how UE 5.6 handles busy scenes full for high-fidelity character models and visual effects like ML Deformer. Additionally, we see N...
HTML browser rendering is fun to reimagine in PZ.
I have a functioning box-shadow now
In some ways doing that in Zomboid is a lot more impressive than 300 NPCs active in Unreal 5.
All I want for Christmas is full access to the OpenGL API.
Since the render code is locked in a single-threaded loop with the logic thread of the game, TIS could expose this for the render-thread invocation via their internal API.
Writing a separate layer like SpriteRenderer is another way but ehh
I get why they did that.
I'm honestly surprised that their SpriteRenderer is exposed with shader commands.
Thatās me with my gun rn lol š
As far as I see I'm one of few that are actually trying to help you. If that's being a "pain in the ass" then I can just simply not. I've seen your model, but I ask for Item Script (your custom item you made with stats and such) as well as model script (assigning mesh and texture) to model ID which is used in item script
Ohh like send you the model in dms
No he's talking about the scripts that are used to define your item
Ohhhhh
Thank you. Yeah I'm at work RN so can't really search for these stuff
You made it visible, congrats!
š¤£
ok, now that I managed to get my mod working in B42 (at least as a suitable proof of concept), time to go back to B41 and un-break my directory structure so folks back on stable don't get upset.
Oh really ?
That's interesting
It might be doable but it depends how the game gives the underweight trait I guess
am I tripping Sir Doggy, or did you username just change colors?
yea don't worry about it, it's to be able to pin and use discord markdown for wiki stuff
which files in build 42 are responsible in rendering vehicle hud? I have 2 mods that disable car hud and im trying to fix it
ahhh, there's a ~/Zomboid/Workshop... I was confused as to why the docs at https://github.com/Project-Zomboid-Community-Modding/pzmc-template wasn't working. (I was deploying my code to ~/Zomboid/mods)
Check the Mod structure page on the wiki for the whole detail
Yeah, I read up on that too, but was confused because I kept trying to implement it inside mods vs Workshop. (My mod for B41 used an automation script to upload to Steam, but it didn't support tags for some reason)
What kind of IDE you use for lua coding?
Hello, a friend and I would like to test a mod in debug modem, but when I try to connect it tells me I'm not an admin, but it puts me as admin when I connect without debug. Do you have any solutions?
Personally, I use IntelliJ Ultimate, but it's a paid IDE.
VI
IntelliJ with a plugin for lua
Do I need a mod.info in my mod's root folder if I have one in the b42 one? it's b42 only, not b41 compatible
no
Modding wiki
https://pzwiki.net/wiki/Modding
https://pzwiki.net/wiki/Getting_started
Getting started
- https://pzwiki.net/wiki/Mod_structure
- https://pzwiki.net/wiki/Mod.info
- https://pzwiki.net/wiki/Uploading_mods
Unofficial Modding/Mapping Discord
These communities exist with different modding/mapping guides:
- https://pzwiki.net/wiki/Unofficial_Modding_Discord
- https://pzwiki.net/wiki/Unofficial_Mapping_Discord
Modding projects
Various pages which list projects related to modding in Project Zomboid, notably custom tools, API or external projects linked to the game. These do not and should not include individual feature mods that simply add new content to the game but to projects that provide something to modders themselves and not users.
https://pzwiki.net/wiki/Category:Modding_projects
-# Want to document a modding tool on the Wiki ? DM me or ping me asking about it ! You are also free to create a wiki account to create a new page regarding it, by following existing pages format !
Settings up a code environment
Visual Studio Code is the norm for programming Project Zomboid mods thanks to many extensions made by the community. See the wiki page about Visual Studio Code to get started.
Lua API
- Explanation of the Lua API
- Learning Lua
- Umbrella - helps with Lua typings and autocompletion for Project Zomboid
Scripts
- Scripts guide
- VSCode Extension for syntax highlight in .txt scripts
Regarding AI modding
You can pin in here?
Never heard of Umbrella till now. Does it automatically get the functions from your local zomboid folder, or is it something that gets updated online?
I asked for an access to use Discord markdown to share wiki stuff, and got the Workshop Mechanic role which gives me access to pinning yes
Alright.
It's updated every game updates, check it out, it exists for both B41 and B42
I'm reorganizing some major bits in the modding channels pinned messages to lead to updated modding resources. This should help new users to start on modding and have access to resources
I need to rework a tiny bit the bottom of the modding page tho
Lots of random links that I need to check out and organize
Also the scripts page I want to rework a tiny bit
Absolutely happy.
Mapping changes
Hello, who knows how to make cars with exclusive designs?
I would like to see if anyone knows how to make unique mods for my server.
You can send commission requests on the modding Discord, however note that vehicles are not modded by many people
Directly contacting people that created vehicle mods might be better overall
Of course, do it with patience and respect when contacting the modders because they might not appreciate the direct contacting
Do you actually use it? If so, what do I do about all the "Undefined global" errors?
You didn't activate it
Umbrella is the norm
Mostly everyone who programs Lua mods use it
"Enable"? or something else
Yea
Weird, I could've sworn I clicked that and it was already pre-filling different zomboid functions. I guess it just didn't register and was only referencing functions I've already used before or something
Either way thanks
ISVehicleDashboard.lua, but it's more likely not rendering because a mod broke something that it uses rather the problem mod editing the dashboard functions directly.
Look for errors in console.txt to give you an idea what is going on, and if you know which mods cause the issue you can also look to see what they are changing
If I make a mod overwriting models in my other mod, should that be above or below the base mod in the load order
you wouldnt have to worry about the load order if you require the mod that you want to overwrite
I just did that. I'm trying to overwrite models, it doesn't seem to work automatically
Models with the same folder structure and names
it should be below, but yeah requires should force it to be below anyway
I've found the require directive in mod.info doesn't reliably set the mod order. Not an issue for me (since a require directive in the lua files will make lua load properly regardless of order) but would be an issue for "replace an asset by using same path and filename" mods.
check the console.txt for any mention of the mod/model.
And doublecheck the path is exactly the same because I have lost hours to weapon vs weapons in the directory structure.
for singleplayer it guarantees the order since singleplayer load order is just the order you enabled the mods in and it's just not possible to enable a dependent mod before the dependency
I've enabled a mod with a dependency and had them added to my mod load order as
existing mods
mod I enabled
the dependency needed for the mod I just enabled
easy to fix, but the game should have added them in the proper order
Any good ideas for hooking āRight click on each menu (Option)ā in the context menu?
I tried hooking ISContextMenu.onMouseUp, but this one only executes if left clicked.
You mean if you bring up the context menu then right click on an option?
Does anything in the game work that way - right click to bring up menu/left click on menu is the standard behavior for that sort of UI
Yes, I have a mod that makes it easier to get items from containers.
This mod adds a context menu for take items, but I want to have the menu (Option) selection ON/OFF by trigger to be āright click on the menuā.
There's a seperate set of events for the right mouse button
OnRightMouseUp
try making a IsCOntextMenu:OnRightMouseUp(x,y) function
I'm not sure if it will get automatically attached to the event or if you will have to manually attach it
ISCOntextMenu:onRightMouseUp(x,y) will be inherited from ISUIElement via ISPanel; it's just an empty function, but you can hook onto it and add your code.
Thanks, it will probably work! I should have looked properly until the succession. Thanks again!
It is now possible to toggle ON/OFF by right-clicking on the context menu, which is very convenient in terms of UI. Thank you so much!
@sonic needle Arrows in Zombies!
No damage to clothes, the retrieved arrow are always full condition, a few more hit locations could be added, but the core logic works.
hell yeah dude š
Hey SirDoggy, found some notes for CraftRecipe OnCreate; that only works for items. For the new building craft (component CraftRecipe within an entity), it appears that the OnCreate should be within component SpriteConfig. (Refer to media/scripts/entities/furniture/entity_wood_windowglass.txt)
I'll check that out
Tho note that I haven't dug in the crafting stations
I should tbf
The parameters are a bit different too; only one param is sent and it's a Thumpable.
That's a different OnCreate then probably
The OnCreate which is documented on the wiki should be for the CraftRecipe
Or for items
So it's confusing, because buildings also have a CraftRecipe
The component things are crafting stations tho right ?
but it's slightly different...
module Base {
xuiSkin default {
entity ES_TireRackUnpainted {
...
}
}
entity VNGarage.TireRackUnpainted {
component UiConfig {
...
}
component SpriteConfig {
canBePadlocked = false,
OnCreate = VNTireRackCommon.OnCreateRecipe,
...
}
component CraftRecipe {
timedAction = BuildMetalStructureMedium,
time = 300,
needToBeLearn = false,
SkillRequired = MetalWelding:2,
xpAward = MetalWelding:20,
category = Welding,
tags = Welding;Furniture,
ToolTip = Tooltip_craft_TireRackUnpainted,
...
}
}
}
Yea that's a different OnCreate
yeah, just confusing that they're named the same thing
I guess
Currently working on getting my code finished, took me a few to get the debugger to stop, because I didn't realize it went in component SpriteConfig. š
So is that code to define a custom crafting station ?
Or is that also for adding a buildable to the build menu ?
