#mod_development
1 messages ยท Page 372 of 1
It'll involve a character rig and overwriting the character model file
Probably this rig
https://pzwiki.net/wiki/Nik_rig
Hi everyone, I have started reading through mod wiki as I want to try something myself, but everything is messed up in my head. I hope someone could bring some clarity and point in the right direction.
I want to try to create a simple mod for a new firearm which doesnt exist in vanilla game. Do I understand this correctly that it is implemented through scripting & modelling, rather than proper modding including Lua/Java?
Yes
An item scripts is what you'll want and a model scripts associated to a model file
Also see this guide
Thanks!
Hello, I am trying to update my mod to 42.14 from 42.12 and can't understand how to create new ItemBodyLocation after update. In previous versions I could just copy-paste original BodyLocations.lua from the game folder and change it as I want. Now I can't. So how to add new bodyloc now?
P.S.: if I try to make it like in prev versions, game spams errors and can't show bodylocs in character creation menu if I set unlock all clothes.
First off, the method you did was horribly wrong bcs you were overwriting the vanilla file and made your mod incompatible with mods that did the same
Secondly, that was changed and this is done from a registries file
Oh, thx a lot!
So, now I don't need to identify bodyloc anywhere except of registries.lua? Cause it doesn't appear if I try to do smth like this:
The methods were changed too and I'm not familiar with it
Also I highly advise you move to VSCode and use Umbrella which will detect whenever you use non-existent code
I suggest checking existing clothing mod so you can see how they do, idk if thr clothing guides available were updated yet
I wanted to do so but finding one with new bodylocs is kinda hard. Also searched guides but found nothing((( Anyways, thx a lot for your advice! Now I know in which way to move ๐
the hell happened to SpecialLootSpawns.CreateSchematic
Check Spongie's mod
Open jacket
I think it got moved over to java side, but now idk how to hook into it to make my own schematics
I did find a way to do this with lua but it felt pretty hacky, I couldn't find a way to stop the vanilla 'sandbox_title_' prefixing my headers though, but its semi functional at least. There has to be an easier way surely.... anyone?
Most of my mods add at least one ๐
Escape From Tarkov Backpacks B42 is a example with just One Custom Body location, which would be for front version of Sling Bag
Thanks, I will check it
or is there any good videos or guides to help with this?
What's your goal ?
plan to make 5.56 ammo boxes give 50 rounds again. I got that part down but can't get the vanilla recipe out
You can use my recipe replacer code.
function replaceRecipeOutput(recipeName,targetLine,newLine)
local recipe = getScriptManager():getCraftRecipe(recipeName)
if recipe == nil then
DebugLog.log("Could not find recipe " .. recipeName);
return
end
local outputs = recipe:getOutputs()
local foundLine = false;
for i=0, outputs:size()-1 do
local output = outputs:get(i)
if string.find(output:getOriginalLine(), targetLine) then
outputs:remove(output)
foundLine = true
recipe:Load(recipe:getName(), "{ outputs { ".. newLine .. " } }")
break
end
end
if not foundLine then
DebugLog.log("Could not find targetLine " .. targetLine);
end
end
use it like:
replaceRecipeOutput("MakeImprovisedGasMask","Base.Hat_ImprovisedGasMask_nofilter","item 1 Base.Hat_ImprovisedGasMask,");
(recipe, something from the line you want to replace, entirely new line of code)
though if it uses a mapper you might need to use other code. shrugs
I will give this a try and see if I can figure it out
https://pzwiki.net/wiki/CraftRecipe some code here exists for dealing with mappers
if it uses those instead
Managed to fix it. Thanks a lot for helping everyone!
Didn't need it luckily, your script worked. Thank you so much. I will credit you on this in the workshop page
np ๐
Is there a weapon editor in-game on project zomboid ?
Hmm there is a right click 'edit item' mode that lets you change some parameters, no idea how much of weapons are exposed.
You can also try pressing F1 through F10 to see random editors and stuff pop up lol
There is attachment editor? If you want to like... move attachment points for stuff like scopes or change world model position (when dropped on ground)
I've woken back up!!
Now I'm all full of energy to troubleshoot my mod and figure out why its not working
if its lua and you are trying to use debug prints - be sure to change Lua to Noise inside the Lua Debugger (f11 by default) -> Debug Options I believe - this setting doesnt stay between sessions
im not even gonna share my shame on why my mod wasnt working..
-# (i didnt add it on the first load and then never used the "Load" option to bring it in and beat my head against the wall not understanding why it wasn't loaded in the Lua Debugger but loaded fine in the main menu)
You should document your clothing mod journey on youtube haha
I should because im probably hitting every single error possible lol
another one of note is
for some reason its taking the scratch and bite resistance and other stats from the script page, but not the encumberance?
skinningdata is null sounds to me like i might have named the texture wrong?
yeah, from the Lua side - i would assume something isn't be "required" properly
could be a case thing though they attempt to solve this on their own
at this point I'm kind of stuck, i dont really know what is breaking
for some reason items without a translation are made weightless
if you add a translation it should work
oh okay, how do i do that?
so adding a translation to the script file?
seperate .txt file that has to go into special dir
and be named correctly -_-
other 42 mods ive been trying to look at I can't seem to find a translation file in them and they don't have this issue though?
Hey, anyone managed to use clothing.xml to override base game outfits successfully in 42.14?
@winter bolt might know how
you gotta be willing to just try shit and hope for the best - i completely changed my entire file-layout today to troubleshoot
It was working perfectly in b42.13 for me. I'm using spongie's mods too and have seen the open jacket folk regularly show up in 42.14, so I'll check how they did it.
from my experience we've been given* the base guidelines and told to figure it out
Thanks for the heads up mate
im very enthusiastic that i can kinda solve some of that
but im also very enthusiastic
Mabye i rigged it wrong? or exported the model wrong?
start simple and work backwards
hey everyone, im making my 2nd mod and i have a problem: the umbrella extension doesnt seems to work anymore, (and for the 1st mod doesnt too) like, i tried everything, unistalling and reinstalling, cheking if the rutes are bad writted... all though i dont remember touching any of this, but ive been all day stuck in this error were i cant do nothing and i think maybe its some dumb error im not noticing, i would apreciate any tip or help
Nice tool didnt know it existed I gonna install it right away
I am still getting
WARN : General , f:2384, t:1771469289475> AnimatedModels$AnimatedModelInstanceRenderData.initMatrixPalette> skinningData is null, matrixPalette may be invalid
and I have no idea whats wrong, The model can be imported as a static mesh and texture, but as soon as i try to make it clothing it works fine
https://steamcommunity.com/sharedfiles/filedetails/?id=3669082431
Restores SpecialLootSpawns.CreateSchematic function that was removed in 42.14
My occupation mod has suddenly stopped working on dedicated servers, zero errors
if you give it the same name and guid you can replace the outfit
you have to add any vanilla items used in it to your fileguidtable tho or they wont appear
Thanks Spongie :)
I figured it out
There was another mod that I had newly added to my load order, "SpnOpenCloth" that was overwriting my overwrites
I wonder how hard it would be to make a script for making melee weapons, blunt especially cause hand pain when hitting zombies, which can be mitigated with gloves or hand wrappings/tool wrappings
There's a project for hand combat being worked on rn
I did everything just like the wiki and it works, but i closed the vs and when i openned again the problem showed up again, its like, i have the extension installed and everything made propertly, but if i close the program it breaks
i have a friend who tried to do it too and for him works without any problem though we done it at the same time doing the same things
You open your project as a workspace right ?
And you open the same workspace
also the .emmyrc.json in the root which i use "Users\<user>\Zomboid\Workshop\MyCustomMods"
thats the folder i open in vscode
what do yall think of this icon?
Looks good
Can someone PLEASE make a map that is JUST forest and a river, I beg of you
hi all, is Slayers bandit mod discord gone?
Trying to port PZ to android or something? Haha
already done :)
Whaaaaaaaat
I need to figure out how to install that, sounds like a fun project
How exactly does it get the game files tho?
there's a guide in the app
Wiki in the menu
I see. Ill give it a shot!
It's nice but what is it for ?
Oh Zomdroid
Figured that was probably it
So you're the person who's continuying that project ? That's cool
There's such a map already no ?
yeah
i added gamepad support
and currently working on ui\
There was, someone made it for me but then they added stuff at the request for others.
If it was a commission by you, then tell them to keep you a copy without all the other stuff ?
If it wasn't a commission, then they didn't make it for you ?
And if they did make it for you for free, same as the commission, respectfully ask them that they give a copy without all the other shit
Also why don't you make that map ? Such a map would quite easy to do
is this for some sort of mobile port?
yes
it's out lol
ty
This was in 2020 my guy, I'm not even on the same discord account anymore
Seems like the same recommendations apply as long as you can get in contact with this person
Yea, the problem now is that the map is outdated if it was 2020 ๐
Also that means the map I was talking about is in fact not the one who were talking about
@primal schooner Yea I came across that too (isAdmin)
I ended up doing this for my 'cancheat' code:
function ISEngineMechanics:CanCheat()
return ISVehicleMechanics.cheat and ((getDebug() and not isClient()) or getSpecificPlayer(self.playerNum):getRole():hasAdminPower())
end
if you look up getRole() in vanilla source you can see other examples too, like getPlayer():getRole():hasCapability(Capability.IgnoreChatSlowMode)
Weirdest part is iv seen some places isAdmin seems to work. shrugs
i went with getAccessLevel() == "admin", works for now, but marked as deprecated. Meanwhile getPlayer():getRole():hasAdminPower() was returning false on admin in mp
isAdmin() also only shows up 11 times in PZ vanilla LUA
yeah and it worked well in b41
Im 99% sure hasAdminPower() power works as its what I use -_-;
and is not marked as deprecated either
well i tried it within OnCreatePlayer on dedicated server and it failed
oh, maybe they don't have admin yet then?
they have because getaccesslevel works
you also have to setaccesslevel (or have some mod auto assign admin) because admin seems to... disappear after relog?
no? admin persists after relogs
not if you click host -_-;
resets you to user every, damn, time...
unless I need to set some other stuff up
well i dont click host i set up dedicated server in local network on old ass imac from 2013 which runs arch btw specifically because host button is not a good way to test MP
shrugs
@LuaMethod(name = "isAdmin", global = true)
public static boolean isAdmin() {
return GameClient.client && GameClient.connection.getRole() == Roles.getDefaultForAdmin();
}
also pz server can run just fine for 1 person with -Xmx2g haha
Just have an open question: I've noticed the majority of the PZ mod crowd don't seem to use github or similar for their projects. What are your thoughts for why/why not? An opposite example would be the Valheim mod community and partially the CP 2077 community where large numbers are publically hosted.
i use local .git for my mods but i dont upload to github
i might use gitlab maybe at some point
the majority of pz modders don't have any prior programming experience
^this me kek
added: but im like 3 years into it at this point
I am heading toward migrating to gitlab, seems decent these days
Makes sense, I first got into programming because of Quake
Plus lua's a pretty forgiving language
Difference is that the two methods y'all mentioned are either checking the player's role directly or checking the role name
isAdmin seems to check the connections role...
This is comparing two Role references, which a quick glance shows could end up as two different objects (see ExtraInfoPacket.processClient)
https://github.com/etonedemid/zomdroid-/releases/tag/v1.6
1.6 release, fixed Dpad, ui refinements
Yea. Also HasAdminPower is... wow.
public boolean hasAdminPower() {
return this.hasCapability(Capability.ToggleInvisibleHimself)
|| this.hasCapability(Capability.ToggleInvincibleHimself)
|| this.hasCapability(Capability.ToggleGodModHimself)
|| this.hasCapability(Capability.ToggleNoclipHimself)
|| this.hasCapability(Capability.UseTimedActionInstantCheat)
|| this.hasCapability(Capability.ToggleUnlimitedCarry)
|| this.hasCapability(Capability.ToggleUnlimitedEndurance)
|| this.hasCapability(Capability.ToggleKnowAllRecipes)
|| this.hasCapability(Capability.ToggleUnlimitedAmmo)
|| this.hasCapability(Capability.UseFastMoveCheat)
|| this.hasCapability(Capability.UseBuildCheat)
|| this.hasCapability(Capability.UseFarmingCheat)
|| this.hasCapability(Capability.UseFishingCheat)
|| this.hasCapability(Capability.UseHealthCheat)
|| this.hasCapability(Capability.UseMechanicsCheat)
|| this.hasCapability(Capability.UseMovablesCheat)
|| this.hasCapability(Capability.CanSeeAll)
|| this.hasCapability(Capability.CanHearAll)
|| this.hasCapability(Capability.ManipulateZombie)
|| this.hasCapability(Capability.GetStatistic)
|| this.hasCapability(Capability.UseBrushToolManager)
|| this.hasCapability(Capability.UseLootTool);
}
literally.. do they have any admin powers lol
I do recall seeing that ๐
I should prob restrict to UseMechanicsCheat or something for summer car but whatever...
I just picked a capability that seemed like it fit what I was doing when I realized isAdmin didn't work (and neglected to report it because I'm not as diligent as somewhatfrog)
Everywhere it currently appears in vanilla is in some boolean expression, so I can certainly see how it was missed
If ExtraInfoPacket really is the culprit then even unit tests wouldn't have found it
Unrelated but for the sake of my mental health I hope this is just the decompiler being silly (but I haven't seen a decompiler do this so I'm not so sure)
Out of curiosity, has anyone tried implementing a "fast travel system" mod or a automated driving mod?
Is there some sort of secret sauce to getting the decompiler by demiurge to work? I am just continually get the unsupported major.minor version error
Yes
There's an auto driving mod which was made not too long ago
Not sure I remember what the problem with that is
@bronze yoke
And waystone which is just a teleport 'fast travel' sort of deal
There is a game, Elite Dangerous, that has an auto-dock/land module which occasionally and mysteriously fucks up and flies your space ship straight into the side of the station. Would be fun having something like that in PZ
That would be really easy to make a mod for. Just make the driver switch place with any one of my friends and they'll get that car wrapped around a tree or light pole immediately.
that usually means your java version is too old
it should be compatible with any version java 17+, you can run java --version to double check what you have
I thought as much, but my jre and jdk both show as 25.0
Perhaps there is an older version ahead in the path?
Make sure you don't have multiple Java versions installed
I'd suggest uninstalling Java completely, verify it's not present on your system anymore, then reinstall it
Will do. Thanks!
i've seen more than a few people get java 8 stuck on their path because of minecraft
I guess it makes sense but also a bit surprised its still stuck at 8
i don't think minecraft itself is anymore but modding some older versions needed you to manually install java 8 to work properly
that's from back when *i* cared about minecraft so you probably haven't had to do that for years, but most people don't really reset their computers ever
Forgive the silly question: Java 8 Update 481 (January 2026) release date is what is shown as the latest JRE for download from Oracle. I don't want that version?
This page explains how to install Java
https://pzwiki.net/wiki/Java
You want 17 or higher as 8 doesn't have the more advanced features of newer/higher versions
What happen in b41 when you save in the attachment editor?
Managed to fix the whole loading model being broken in b42, but the save button is broken and it would help to know what it's even suppose to do.
Does it overwrite the existing attachment .txt file in every mod? Does it output a file a new file in the Zomboid/Lua folder?
It overwrites the attachment blocks within the model block you're modifying attachments for
@bright fog How do you select a specific mod to work on? It just list all the attachment for FemaleBody for example. Not just the attachment that my mod add to FemaleBody
It was amazon corretto messing with the java_home, by the way.
Thanks for the help, guys. And thanks @bronze yoke for the tool. Worked flawlessly.
glad to help!
How did you add those attachments to the model ?
Also just enable the mod you're work on
Don't dev with other mods enabled besides debug mods
i could be misremembering as i never used it myself, but i think save overwrote the vanilla file so you weren't supposed to use it (the in-game tools are mostly for TIS after all), you were supposed to just copy down the values into your script
Like in b41 on the left when you pick the FemaleBody it load all the attachment point of the character, all the vanilla one, all the modded one in one list.
But @bronze yoke answer make sense it probably would just overwrite the vanilla one that are probably in one file.
My issue anyway is that I don't want to copy the value by hand since I want to add quite a bunch. I'll just dump the combined file to console I instead ๐ค
ELITE DANGEROUS MENTION?
Are you attempting to add/edit an attachment point for a custom item you made?
@stuck tapir I'm working on a mod that make some improvement to the Archery mod. Currently it use the knife attachment to place arrow on the body but that kinda make no sense because they are positioned for knife. Like when you stab a zombie from under the head. The arrow look out of place. It also destroy arrow when an attachment slot is already occupied by an arrow.
I found a sketchy way of finding what body part got hit by an arrow and I want to add a bunch more custom attachment point on each body part to put arrow in the right spot and have them horizontal. But placing them one by one is kinda too much, hense fixing the attachment editor first lol.
Kinda got it all working now, just a question of passing a bunch of painful time positioning all these arrow in both human model now.
I wonder if there a high cost to having too many. I solved the arrow disappearing problem by placing them in the Z inventory when the slot is occupied, but I would like to add 2-5 attachment slot per body part so if you aim in the same place multiple time in a row, it add more than one arrow.
As long as you make the custom model a child of the actual female/male vanilla model, any saving you do for the attachment points will overwrite only the modded item's values within its definition file.
I agree, that sounds like a lot of work ahead of you. But hey.
Is that archery nexus?
@stuck tapir I ended up trying it in b41 and it overwrote my mod file, but not the vanilla one. But it put ALL the attachement possible in my mod file, not just the one I had. Bit weird.
I ended up making the b42 one dump a txt file in the Lua folder with all the attachment, safer ๐คทโโ๏ธ
@silent zealot Yup
cool.
The attachment points are all in AttachedLocations.lua
AttachedWeaponDefinitions.lua is also helpful since that is all the "zombie spawns with weapon stuck in them" stuff
Yeah there this lua file that give them better name I guess, but there also a txt file that define the actual attachement position, rotation and what bone they attach to. That's the one that interest me more
From memory, the "knife" attached locations worked for arrows, so I went with just picking one of those at random because the firearms system is a stupid and confusing mess that seems to move hit locations around based on damage or skill or something (and also behaves differently with sandbox variable)
models_characters.txt
Because we love redundency, AttachedLocations.lua maps those to the names used in AttachedWeaponDefinitions.
@silent zealot Some of them seems to work and some other seemed way out of place. I started just investigating why all my arrow disappeared at way too high of a rate, then ended up realizing the already occupied attachment slot issue.
Then I made a small debug util that attach arrow to all slot to see what it looked like and I got that ๐
But they don't look that goofy in game so not sure what went wrong. The AI did a bunch of that part so could be slop.
The way to detect hit in game didn't really give you where it hit like you said. What I found so far is that getHitReaction can give you that info, but it get updated after it fire the event you use to detect hit.
So I have to wait a tick and look for it, bit of a mess ๐
But it give you more precise hit location, like back or front of shoulder if I remember. Would look so much better if I can put arrow that precisely ๐
I figured that was acceptable, since you shoudln't have 100% arrow recovery IMO
@silent zealot I don't know if I'm too precise but the amount of arrow I go through it a bit too crazy loll.
But not judging your mod, it's a great mod. Just trying to improve it a bit in my own vision. You invite people to do that in the description, so I took the invite. I will be depending on your mod and giving all the credit of course
So far I add XP on crafting, Turkey feather as alternative, hopefully improve the arrow placement and I might add a few alternative recipe, still thinking about what. Possibly a way to fix broken arrow with a chance to break them instead of poofing into oblivion.
It's @sonic needle 's mod, I just helped with the stick-arrows-in-people code
Dunno if anybody would care but I would love if someone could implament a normal plate carrier and plate system into a game
I mean ofc as a mod but dam those mollies look good.
did that
I mean build 42
yep. in 42
But like you are waiting for someone to pay ?
Bruh dunno I nver saw it.
Looks nice. But desight is way ahead of game so I wouldn't say it is what I'm looking for
But this look good anyway
Good job
@silent zealot hows easydistro doing after the update
I haven't checked, but probably fine unless they renamed/restructured the loot tables.
I saw they removed a few things, but that's fine
i believe they did
because smokes and guns stopped working properly
and that entire mod was based on the loot tables
Except, smokes & guns probably cares about the names of the entireis in teh loot tables
EasyDistro does not, it just iterates through everything
So if Distributions[OldLegacyLocation] gets removed EasyDistro won't care, but a mod that tries to access Distributions[OldLegacyLocation] will
EasyDistro doesn't throw any errors on startup, that's all I've tested of it so far and I'm not going to regression test every mod for every patch
What is the problem? If you have something specific not working with EasyDistro that's something I can look into, instead of a general "is it broken"
my mods probably calling for some 223 items or similar
make my cat in to pet and you get kiss from cat
Is there by chance a mod or set of mods that can turn the game into a warzone without zombies? Just PVE with humans and guns
Bandits mod and just sandbox setting with no zombies ?
yall think this looks vanilla enough? took me like an hour cause replicating the moodle artstyle is so hard
it's for when you eat something really spicy. obviously. not anything else
Im making a clothing mod and I made a simple sweatshirt as a test model and to get the file structure and everything set up, and i got it showing up in the clothing list but when i try to put it on the character nothing shows up and it gives an error, what could be the cause?
Did you read the error ?
Check the console file directly instead, I'm not sure if error magnifier shows the whole error here
hmmm this?
Caused by: java.lang.NullPointerException: Cannot invoke "zombie.inventory.InventoryItem.setAlcoholPower(float)" because "item" is null
This feels important
I just dont understand it
what does the item script look like
my brain mightve gone numb already so theres a high chance theres like a dumb typo or something I just cant see it
are you in b41 or 42
b42
is something different? because the guides are most likely b41 and i didnt see a b42 one
in 42 they changed stuff in item scripts but yours is using the b41 stuff
i cant remember which things changed but you can look in media/scripts/generated(?) and find the vanilla clothing and copy it
I suggest downloading VSCode and using my extension ZedScripts
It'll highlight formatting mistakes and deprecated parameters
Okay i no longer get the error
now it does let me select it
its just invisible ๐ !!!!!!!!!
Is there a timed Action for a shovel or pouring for a building mod dont find anything on the wiki tho
You mean a script timed action ?
ah yes mybad
Nothing stops you from making your own you know ?
Hi guys, where can I find more details on UIElements? Iยดm trying to build a CollapsableWindow with no success to split it in 3 and show 2 ISScrollingListBox on sections left and middle and a rich text on the right section. Any help is appreciated.
I'm sure I'm missing something obvious and simple, but in trying to update my mods for b42, they don't show up under mods in the main menu to be enabled/disabled
Do you have a '42' and 'common' folder in the root? Inside 42 should go your media folder, mod.info, poster etc
What kind of detail do you want
ah shit man, yeah i didnt have a common folder. I owe you a beer
Iยดve found Lua objects documentation but they do not include descriptions of objects and functions, just the list of parameters and return types. Iยดm looking for use cases of the differnet UI elements.
i assume the common folder lets you place assets used across versions rather than multiple copies in different version folders?
Its one of these days... 
Yep thats pretty much spot on. To add to this, if you have version incompatibility's for what ever reason or just need to do things differently between builds, you can also specify the folders to the version. EG you might have a 42 folder and then a 42.14 folder etc.
right on man, does that work for maintaining b41 compatibility or does that still need the media folder in the root? is the common folder+version folder thing a 42 update?
You can just make a B41 folder if needed as well. I tend to avoid using the common folder honestly. Steam workshop can be a bit silly and if you ever decided to remove things from that folder it might not delete them for existing subscribers, causing them to need to resub.
The only things ive really put in common are textures and what not but I tend to make those their own sub mod, keeping it seperate from the core. Could just be me though, I'm still pretty green, more experienced guys might wanna chime in on how they use it.
oh thats not a bad idea for a way to do it, that could come in handy for certain things
Was this on the Fili mod for STVU lol?
He must not know KI5 already have armor
Nah it's the apocalypse engineer where you can craft and place vehicle frames
Oh, dope mod btw.
The description on that one is tiny compared to my wall of text, how do people even skip past the "It should work with any car mod" ๐คฆโโ๏ธ
quick question when i do
itemScript:DoParam("AmmoType = base:bullets_556")
Its working for new weapons but when i load the game the item looses the parameter
iam doing it on Events.OnLoad is that to late? i mean new items work but the already existing items lose that parameter
ok i need a second event to already have the script changed in the main menu.
Events.OnGameBoot``` did it 
Chech the LuaDocs
But even, then that doc is a bit limited and needs some work
Rn it's hard to use
Yes, usually heavy assets
What I suggest instead is to check existing UIs
They are rough to navigate tho...
Also check this
https://pzwiki.net/wiki/User_Interface
Although limited, this one gives a good starting point. Iยดve also navigated through the lua scripts from game UI and that also helped. Iยดm half way through my UI design.
Nice
im feeling so stupid im doing a building mod rn and im not able to place a functionally generator ๐ halp pls
The required folder structure changed on B42 make sure to adapt your files or the game wont recognize them
You can also check this video guide
This guide goes in detail on setting up a basic mod to work on for Project Zomboid.
WIP: this is currently my first ever video guide for PZ modding and serves mostly as a concept currently. It's likely I'll rework this video in the future.
Relevant Wiki pages:
https://pzwiki.net/wiki/Mod_structure
https://pzwiki.net/wiki/Mod.info
https://pzwik...
Thanks man, really appreciate how helpful you guys are around here
looks like i got my hats mod working again for 42, in no small part thanks to you guys lol
Whats your mod
There are plenty high demand mods still not updated to b42
I would like to try updating the "More makeup" mod
its nothing big, basically textures lol
As long as people like it ๐
I also did an extremely simple mod
617 subscribers, so better than i expected haha
But its helpful to the pvp community
oh whats your mod?
A simple script mod to provide bullet defense to all military helmets
Im planning to add a feature where your helmet can get destroyed after X amount of hits
oh nice man
Buuuut, im learning Blender first. Its more fun than scripting
Somebody got experience with a buildable generator need some help mine doesnt overright the ghostgenerator
i gave up i just make them as craftable recipes ,,.
How to make a mod for non-standard zombies if Zomboid Forge is abandoned?
im trying to make a mod that simply turns the zombies lime green and removes all hair, clothes, and sound from them
how do i do that lol
im willing to do whatever i gotta do to write it
๐
legit question
anyone experiencing random crashes to desktop?
since the last update?
Hey everyone - is there a way to spawn items directly in the editor/via Lua (without an additional mod) (B42)? For example: In my map, there's a crashed plane. I'd like suitcases to spawn freely on the ground nearby. Ideally, the suitcases would be filled with items.
I could imagine creating a zone, or individual fields, or specifying coordinates via Lua... I don't think suitcases are tiles that I can place similarly to other storage items - or have I overlooked them?
@bright fog You said it's possible in the mapping channel - could you please tell me how? ๐
Yeah almost almost everytime I play on MP my game suddenly crashes
No error, just straight to desktop
Happens on multiple servers
well currently im not so concern with MP, but the game is just chilling in the menu and explodes lol
https://github.com/etonedemid/zomdroid-/releases/tag/v1.8
Now with multiplayer support!
To retexture the zombies its pretty simple, you just need to replace their vanilla texture bodies with whatever texture you want
Then its probably a matter of adding your own custom zombie without any clothings, have a way to default it to bald and remove the other zombies spawns? Or something like that
You can probably check out one of the mods that retextures zombies like occult zombies and see how they did it and apply it on your own way
ok
i do also wanna make them faster than sprinters, and scream too
oh yeah btw i changed the zombie's textures and it gave me 7000 errors
require 'recipecode'
function Recipe.OnCreate.FromConditionInheriter(craftRecipeData, player)
local items = craftRecipeData:getAllConsumedItems();
local results = craftRecipeData:getAllCreatedItems()
local box = items:get(0);
for i = 0, results:size() - 1 do
local resultItem = results:get(i);
if box:getModData()["condition" .. i] then
resultItem:setCondition(box:getModData()["condition" .. i])
end
end
end
function Recipe.OnCreate.ToConditionInheriter(craftRecipeData, player)
local results = craftRecipeData:getAllCreatedItems()
local items = craftRecipeData:getAllConsumedItems();
local box = results:get(0);
for i = 0, items:size() - 1 do
local item = items:get(i);
if item:getCondition() ~= item:getConditionMax() then
box:getModData()["condition" .. i] = item:getCondition();
end
end
end```
this keeps throwing me exceptions, persistent since before 42.13/14. im gonna try and sort it out myself but ill leave it here incase someone would like to help me out
Did you read the error ?
i did, says attempted index of non-table at line # 3
what non-table is being indexed here
Did you copy the vanilla one, retexture it as you wanted without changing sizes and then had it on the same path as the vanilla one and the same name on your mod?
That can be harder but there are a few mods that do that
Soul Filcher Turning Time for Screaming might be an option
And to be faster than sprinters... Probably a mod that adds a volatile? A dying light mod
What's on line 3 ?
function Recipe.OnCreate.FromConditionInheriter(craftRecipeData, player)
What do you think is a table in this line ?
im not sure, i dont think there was meant to be a table
it might be interpreting it that way, the purpose of the script is to preserve the condition of items that go in and out of boxes
You do in fact try to access a table here
Recipe was a table used by the game to store functions for scripts, but now it's not a thing anymore and the vanilla functions are Java sided
That table no longer exists
So you need to make your function simply a global function or store it in your own global table for recipes
require 'recipecode'
ConditionInheriter = ConditionInheriter or {}
function ConditionInheriter.FromConditionInheriter(craftRecipeData, player)
local items = craftRecipeData:getAllConsumedItems();
local results = craftRecipeData:getAllCreatedItems()
local box = items:get(0);
for i = 0, results:size() - 1 do
local resultItem = results:get(i);
if box:getModData()["condition" .. i] then
resultItem:setCondition(box:getModData()["condition" .. i])
end
end
end
function ConditionInheriter.ToConditionInheriter(craftRecipeData, player)
local results = craftRecipeData:getAllCreatedItems()
local items = craftRecipeData:getAllConsumedItems();
local box = results:get(0);
for i = 0, items:size() - 1 do
local item = items:get(i);
if item:getCondition() ~= item:getConditionMax() then
box:getModData()["condition" .. i] = item:getCondition();
end
end
end
if type(Recipe) == "table" then
if type(Recipe.OnCreate) ~= "table" then
Recipe.OnCreate = {}
end
Recipe.OnCreate.FromConditionInheriter = ConditionInheriter.FromConditionInheriter
Recipe.OnCreate.ToConditionInheriter = ConditionInheriter.ToConditionInheriter
end```
so this should work?
Yes
alright cool
Does anyone know if there is recipe code for OnCanPerform that rotates the player to face the items? I have items on the ground that I'd like the player to rotate and face if possible.
I'm pretty sure I've seen this with other timed actions, but not sure how to do it from a recipe.
I don't think its possible with recipes automatically, you can try the hacking some of the recipe functions to see if thats close enough for you...
timed actions generally do it by stuff like:
function ISCheckAnimalInsideTrailer:update() self.character:faceThisObject(self.vehicle) end
and
function ISCheckAnimalInsideTrailer:waitToStart() self.character:faceThisObject(self.vehicle) return self.character:shouldBeTurning() end
Yeah, this is what I was thinking. Not sure I want to rebuild this as a timed action or not, as recipes are much simpler. But I may do that. Thanks!
You could maybe force the onCreate to throw the user into a timed action, and hope he doesn't notice the crafting technically already finished? ๐
Should I disallow adding raw things to cooked evolved recipes (Allow cooked things?), or cause adding raw things revert it back to uncooked?
Why do you need that ?
I've created a fun wood splitting/lumberjack mod for my server. I would like to have the player turn to the item while it performs the animation.
I may turn this into a timed action instead of using it as a recipe to do this, since I'm not sure I can manage it with a recipe script.
Any recommendations?
@queen oasis made a wood cutting mod I think ?
I've seen that. Looks pretty awesome. I'm still working with B41 for now, and am working on a mod for my server, which is why I asked.
think I forgot a small setting heh
can keep it as a meme ?
of course lol
giant casings
is there some new way that MP registers items? a lua script i have that sets up distributions failed because it one of my items didnt exist, when i check the files its there
might also be the classic "you gotta add your mods as workshop items too"
oh ok
i cant even fix it this time
Hello all!! I've been away for a bit, and my mod hasn't been updated since B42.12, and users are reporting issues since 42.13. Someone said there has been changes on items, so maybe that's the issue. Is there some information someone could point me to? Thanks!!
Idk what you mean by that but that's not a thing
what's the code that's triggering this error?
Does anyone know if the moodle icons can be changed depending on the severity/tier/level so that each one can have a different individual icon to represent it?
Is that not how they already work, or have I just been running moodle mods for so long I don't even remember?
Oh my bad I think I misunderstood. You meant the actual moodle face itself and not just the levels.
i'd imagine its possible - i think right now (ive been playing in code not the game) it gets more red?
yeah, the background gets more red, but i'd imagine you could swap them out
i don't know about the new moodles, but the old moodles used a fixed icon with a separate changing background
Oh I see, too bad, my idea was to have a different icons for each stage, I've looked through some mods and tutorials, but did not find anything that does something close to that.
just searching through the lua files for Moodles it almost seems like it's some sort of string constant like "Hungry", "Sick"
or attached to MoodleType
I've found where each moodles types text and description are stored, but not anything connected to the icon itself
yeah, thats what im searching for
it looks like there are 4 levels defined in the translations
so all hope isnt lost yet
but albion is usually right..
whats that section of the screen called?
how do i create a script where project zomboid guns draw from so that each gun doesnt have shared sounds and that each gun uses their own sounds
I've been trying to find where the moodles are drawn on the screen since I've seen the "Moodles in lua" mod work with that when redrawing the backgrounds to make them individualized to show different background icons, but I couldn't find it :(
yeah, it looks like you might be able to do it through the player - playerObj:getMoodles():getMoodleLevel(MoodleType.PAIN)
I could definitely get the level of the moodle with that, but if the icon is hardcoded to just be 1 image file I don't know how to go about making it change to a different one
yeah, thats why im still searching
its look like the levels might only be used for the text descriptor for display
heres a question albion - are you able to "hot swap" files via their filemanager?
so if they wanted to they could change out the image based on levels?
no, there's nothing lik ethat
most moodle mods just rewrite the entire system because it's basically unworkable
yeah, im looking at the java side and it looks like what you said
private static final Color colorNeg = new Color(0.88235295F, 0.15686275F, 0.15686275F); private static final Color colorPos = new Color(0.15686275F, 0.88235295F, 0.15686275F);
i think im near the right area
thats inside Moodle.java
I think those are the colors it give to the background, since in b42 the background is 1 white image that gets it's color changed
yeah, it starts as white then it looks like it changes based on the level
Looks legit, the new 50bmg (no decimal) is lit.
so for his moodle project - do people just draw over the original to simulate the override?
you can hide the normal moodle ui and then just draw your own
neat
alright, that was my rabbit hole for the day
thank goodness for umbrella - it really helped locate the things i was looking for in the core
Thank you for the help guys, really appreciate it!
So yeah you can do it but you got some legwork
There's a few API to mod Moodles
Iโd also be interested in keeping some of the default behavior like the shake
Iโd imagine through either the UIManager or getCore or both
Iโd love it if more people shared their git there or even use git but I could see reasons not to
For modding projects documented on the wiki, if there's a git it's linked usually
does someone know the Lua for generators ?
Yea, much of it is java based however.
what's the name of it? want to see the logic behind it
ProjectZomboid\media\lua\client\ISUI\ISGeneratorInfoWindow.lua
ProjectZomboid\media\lua\server\Map\MapObjects\MOGenerator.lua
theres a few other IS*Generator.lua files for timed actions dealing with generators but they don't do much
MOGenerator is like 70 lines lol... rest is all java
oh so I do have a lot of fun with it ? ๐
I just want to know which function is used for generating power like for objects
@willow tulip btw any clue why that is happening? there is no key, so why? xD https://streamable.com/ep2en6
you "just" set the tile to be powered
Vanilla bug. Im suprised the key doesn't still just appear ๐
so there is a ghost key?
Something internal to the 1000000 line basevehicle.java that I don't want to touch
ok power."just" = true ๐
Iv considered trying to fix it at least for W in realistic car physics but never got around to it
back to the interior rendering of ki5, cant you exclude the glovebox from beeing affected from the settings, its not rly a part that you can repair anyway without an extra mod
F11
Hopefully someone has some experience with this, i'm running out of ideas. I'm adding a hat to my hats mod, and the new one just disappears when you try to wear it. all my files are identical to the other hats i added yesterday, other than the obvious things like the texture, name, guids etc. at this point i've triple checked everything and compared to the working hats, corrected some typos in the first pass of checks, and even tried generating new GUIDs for the them, updated in the xml file and reverse variant xml file as well as the file guid table. any idea what else to check?
Did you give it a translation name?
Not having a name (used to?) be a way to signify an item was hidden and weightless. I dunno exactly what functionality it retains nowadays.
I don't have translation names for anything, just the DisplayName in the txt file in scripts/clothing, and everythign else is workign fine, even the ones i added yesterday. you think that could somehow be affecting this one item but not the others?
it looks liek the new item txt file in 42 doesnt use Display Name, maybe i need to sort out translation names now
Prob not, but it is something you'll need, displayName is obsolete
anyone got a clue why the gravel placed with the bulldozer is not safe from erosion, the tile properties are exactly the same
if newSprite then
-- Remove old floor object first
if isClient() then sledgeDestroy(treetree)
else
treetree:getSquare():transmitRemoveItemFromSquare(treetree)
end
-- Create new IsoThumpable for gravel (like build menu does)
local thump = IsoThumpable.new(getCell(), square, newSprite:getName(), false, nil)
thump:setName("GravelFloor")
thump:setCanBarricade(false)
thump:setCanPassThrough(true)
thump:setBlockAllTheSquare(false)
square:AddSpecialObject(thump)
thump:transmitCompleteItemToServer()
end
end```
ok there is square:disableErosion()
that was too easy, time to go to bed 
Updated my mod (Protos bones to compost) after deciding I wanted a bulk optionโฆ. And bugs started appearing.
Reddit log: https://www.reddit.com/r/projectzomboid/s/QQfChYri93
anyone know how i get started, and maybe some basic mods i can try and code (like examples) to get started?
Sure, have a look at my pack of half finished mods lol: https://steamcommunity.com/sharedfiles/filedetails/?id=3587204390
tytyt
"Realistic Calories" is pretty simple for a beginner, shows how you can tweak items via LUA
its just one short Lua file
ah mk
Similar methods can be used to tweak.. well, just about anything really, weapons, food values, weights of items, and adjust said tweaks via sandbox settings (it has some)
ah alrighty, i appreciate the help :D
Finally working on proper multiplayer support for my mods.
I hate it.
Playing "guess what stuff happens on the server and what happens on the client"
And having to write your own custom sync commands because the built in ones 1) don't sync all fields and 2) are private functions
what did you need custom sync for?
DeviceData and the "use mains power instead of battery" flag
But 42.14 added IsoGridSquare:getDeviceData() which is nice for going from a square back to a radio's deviceData
Now I'm working on cosmetic attachments (magazines) adding/removing when magazines are loaded/removed.
Yea, or fail under certain conditions like the container being a cars trunk/etc.
Does anyone had issues with uploading your mods with steamcmd or from game client?
Im now constatly seeing
Uploading content...[2026-02-22 14:07:19]: ERROR! Timeout uploading manifest (size 22126)
ERROR! Failed to update workshop item (Failure).
Try with Steam Uploader ?
Alrighty! I think the mod is feature complete? I was going to add an extra large dufflebag but I think i'll hold that off for the Nurses+ pack
so since the last update we dont need the generatorbook anymore? ๐
i was wondering why the check is not working anymore for my mod, turns out you can connect without lvl and knowledge the normal way
I think it's level 3 electrical to use a generator without instructions. Was added a while ago, I'm not sure which update
yea its either lvl3 or the magazine, but the magazine is not registering the recipe in the item but in the healt panel
and when i check the char for the recipe its false
It's not a Craftrecipe
it's... um... a magical not-really a recipe recipe?
But this code works: getPlayer():isRecipeActuallyKnown("Generator")
so there was a change
i had this local hasGeneratorKnowledge = playerObj:getKnownRecipes():contains("Generator")
I assume isRecipeKnown() is for back compatability and isRecipeActuallyKnown() is teh one that actually works.
thx
That worked for me with a quick lua console test
O.O"
level 0 electrical, read magazine
so. Good luck. Sounds liek you will need it ๐
is your magazine updating right when you read it? like i shown in the picture its still on unread
hm, maybe i should reinstall zomboid
well i have the checkmark too, but in the tooltip its unread
tsarlib 500FuelTank capacity is 461, tsarlib 1000FuelTank capacity is 1000. I hesitate to switch the 500FuelTank capacity to 500. If you have an opinion, can you thumb up this message if you think I should change it so and thumb down if you think I should keep it to 461 ?
Hey there. This could be a silly question but I was thinking about starting modding for zomboid to add a few things to our server(And mb someone else would find it usefull too). But let's say I'm too dumb to learn new code from scratch. Is there some guides with examples I can learn from as it will be far easier for me?
Im 95% sure existing cars will stay with the 461 capacity, or that it will otherwise cause no harm to existing saves
Loot at all the PZ modding guide videos from this channel https://www.youtube.com/@SimKDT
Working on a mod that adresses the "Frozen" corpses in single player when you use mods that cause zed deaths to happen offscreen. These are before and after screenshots of a 24 NPC vs 500 zed fight. Everything in these screens is a corpse. I would say I'm making progress. Pic on the left is a fight without my mod, pic on the right is with.
Just tightening up a few edge cases an I'll be ready to publish.
Wiki modding guides/tutorials: https://pzwiki.net/wiki/Modding
Ask questions in this channel
Look at existing mods that do something you want to learn how to do
Look at the lua code in the game's media/lua folder
Do NOT ask AI any PZ specific questions. Use it for general coding questions or "explain this code to me" but it will hallucinate an impossible to fix mess if you ask it to make a PZ mod.
For locally hosted multiplayer (i.e.: click the "host" button) is there any way to make myself always an admin so I don't need to type in "/setaccesslevel Nepenthe admin" every time I restart?
maybe in the server settings ?
I can't see anything through the GUI, just settings about what admins do/how admin powers affect chat etc.
i don't believe so
how do i get ammotype for my custom ammo? I tried base:bullets_(ammotypename) but it doesn't work
Did you add a new type with a registies.lua?
Unless they added a method, the only time you can get the custom type is when you create it. So in registries.lua you need to assign it to a global variable:
NEPTRAIT_EXPERTDRIVER = CharacterTrait.register("nep:expertdriver")
then you use NEPTRAIT_EXPERTDRIVER to refer to it in LUA, because you can't use nep:expertdriver. (Also, you can't add a new entry to base:)
That looks so much better than the vanilla cooking UI
Or "Cooking UI" since it's not really a cooking UI. ๐
Thanks :0
YOU DID NOT ADD ANY GARLIC! 0/10 literally uneatable.
It was stale ๐
stale garlic in a stew is still better than no garlic!
blah, when you have the mod you can cook your stew how you want ๐
Me? Im going to be making buckets of stew and eating them all week long.
Does it also fix the ridiculous weight bug in vanilla stews?
And - well done making a complicated UI. I want to quit modding forever whenever I touch Zomboid UI code, and I've never done anything more complicated than a box with text and an OK button.
Dunno! lol. haven't been looking at weight but considering I had to rewrite/port all the evolved recipe code to lua, likely?
Im also rewriting how cooking works -_-
Like, you now need a knife, and at low skill your likely to cut yourself :p
I have now, I'm not sure what I'm doing wrong
-- media/registries.lua
local goldenItemKey = ItemKey.new("BulletsGolden", ItemType.NORMAL)
AmmoType.register("base:bullets_golden", goldenItemKey)
still gives me issues with the weapon that uses
AmmoType = base:bullets_golden,
I had a friend who had blunt kitchen knives. Like hard to cut anything levels of blunt. So I bought her a new chefs knife; not a fancy super-sharp one, just an easy to use IKEA one.
The next day she was in the emergency room getting stitches.
blunt .... get stitches.
the docs are just wrong about this
don't create an item key
It was finally having a normal-sharpness knife that got her, so I assume she was cutting in a dangerous way and the blade went further
just do AmmoType.register("base:bullets_golden", "ModuleNameHere.BulletsGolden")
Also, don't use base: because it will be rejected.
oh that too
You can use base.thing for items, but not base:thing for registries.
Yea, not used to the knife actually cutting without trying to use the knife as a slap chop
I work all day with RAZOR sharp knives and get tons of tiny cuts
this was it thanks
My cooking knives are not that sharp. I keep them sharp for cutting food up, but not razor sharp. That would be too scary for me to use.
I make wood carving knives. Honestly iv never been able to get any kitchen knives remotely close to as sharp and don't even try anymore (except the few knives iv made outta the steel I use)
(its a high carbon/nickel steel that I use. Not stainless, does like to rust unless kept dry and/or oiled/waxed)
For reference, typical kitchen knives are 25~35 degrees bevel edge... Mine are 15 degrees, and survive for ages without sharpening while cutting soft woods like cedar.
Mine is high quality Chineseium with laser-etched Damascus. Really good for the price. Not really good if compared to actually good knives.
Bringing this back on topic - it would be nice if tool quality impacted crafted item quality in some way; using proper tools shoudl give better results than using sticks and rocks. But that would need an entire quality system.
Yea, I might make dullness impact injury chance and time though
also make the knife take just sharpness damage instead of cond unless you get it really dull
That makes sense, since unless you have a really cheap knife you're not going to break the overall structure by cooking... just the edge.
10/10
Is there a place to request mods? Or commission one?
My friends are scared of zombies, so I was looking for a mod that replaces zeds with just normal people (nothing super crazy like the raiders mod). I want them to scream and run away from us when they hear gunfire/see violence, as opposed to running towards us and trying to eat us.
B42.14
Thanks :0
Hi guys, Iยดm facing a weird issue here.. Iยดm working with ISRichTextPanel and Iยดm pulling strings from a lua table like "First Steps: Shelter" and it is not showing anything after the ":" so it becomes only "First Steps:". Anyone faced the same with this UI object?
What you're asking for is a massive change; you're pretty much asking for NPCs to be implemented.
You can look at NPC mods like Bandits Week One, maybe try those with zombies disabled... but if your friends don't want to play a zombie game trying to mod Zomboid is not the right approach.
But there is a commissions channel in the unofficial modding discord.
That sounds familiar... strings being interpreted for escape sequences meaning some characters can't be used.
Maybe try replacing ":" with ":" to see if it uses html style escape codes.
You should try a crossed mod
Also... any text that appears in-game should be done via the translation system. That makes it easier for people to translate your mod to other languages.
Dm me that
Please
Hey, I've got the idea for a mod that allows you to use bleach to purify water. This can be done IRL. According to the United States Environmental Protection Agency, 8 drops of 6% sodium hypochlorite bleach can kill all pathogens in a gallon of water. Around 2 drops per liter.
This would require, in a mod, to simply untaint water if bleach is added to it with the B42 liquids system. There shouldn't be a need to change the lethality of bleach, as a very small amount of it can be consumed anyway without damage in-game (less than 30ml I believe, according to discord user murphcool).
^ I am somewhat familiar with LUA, I'd be willing to try developing this mod myself. Is there some kind of guide of PZ modding?
Can already think of one particular melee item that could be gained from butchering horses
There are a few general starting points
for what you want, I can see two ways: 1) add a recipe. IL water, 5 ml bleach, produces 1L water. Big downside is it only works with a fixed amount of water.
2) add a context menu option if you right click on a container of tainted water AND you have bleach in your inventory to "Purify with bleach" that removes the tainted flag and reduces the amount of bleach by (water amount * <some number like 0.005 >)
A club made from the large leg bones. Nothing weird about that. ๐
im using IsoObject and changing its image every frame to create visual sprites. is there no way to offset them pixel-wise (not ingame grid)? is there a better alternative than isoobject for this?
AFAIK world sprites are fixed to grid location, or possibly to several positions (floor/low surface/high surface)
what's the ideal way to make a player trip/stagger/fall, player:setBumpFall(true) doesn't seem to be doing anything
Bandits mod ?
I don't want them to defend themselves. Think the citizens from the "no russian" call of duty mission
Hello, I'm new to the server and I would like to learn how to modify this game, how can I learn?
That's still "you need NPCs" behavior. right now in Zomboid you have players and zombies; the game has no concept of "person who runs away" Zombie behavior is not easily accessible to modders, and NPC mods do a lot of really tricky janky stuff to make things sort-of work.
See stickies in this channel, and a few places I posted earlier today: #mod_development message
Also welcome!
I wanted it to be more realistic and interactive, like just by adding the bleach using the B42 liquid system it would automatically run a function that checks for the tainted attribute and removes it. But I feel like that would be confusing for players without clear explanation and rather cumbersome. I think the next best alternative is the context menu option, I'll try to get that working. Thanks!
The fluid system is somewhat incomplete, especially the lack of real mixing.
Also, mixing alcohol should give you the name of the cocktail you just made. ๐
Animals run away
Fine, I give up. Making humans that run away from the players is super easy and I'm just trying to hide the existence of the config setting EnableHumansThatRunAway = false in the default setup. Good luck with your mod.
Thanks
Hello everybody.
So im finishing the 3d model and textures for a testing item I want to upload.
Just to make sure im on the right way. Once my assets are done, in order to upload them I need to use a script right?
Would it be possible to make a weapon use different animations depending on skill level? Was thinking of learning lua and making a rock sling mod for wilderness runs/super late game when ammo runs low, and I was gonna have the character just throw overhand like the apache style at low aiming levels, then after a couple levels they start spinning the sling a bit instead
I feel like you could look into the 'advanced placement mode' UI
it renders things without them being real world objects
in 3d
Yeah its possible. I wish this was included into the vanilla game
You would need to handcraft every animation tho
Yeah, I don't mind making all the animations
Was gonna have either 2 or 3 different slinging animations, then the reload and idle stuff too
Is there a way to delay the shot until after the animation is done, since the way slings work is a fair bit slower than a bow or a gun?
I still gotta learn lua so this is just a question for later, this is probably gonna be a pretty long project
I don't know much about scripting, but what if you change the aiming animation for the sling instead of the fire animation, so at higher skills it swings the sling around like you wanted?
I'd probably have to change the firing animation too though since slings function VERY differently to firearms, and the slow shooting can be a balancing thing too
Since slings are absurdly cheap to make, there's gonna be a couple downsides
Spinning it could be the aiming animation for higher skill levels too for sure, at lower levels it could be them preparing the overhand swimg
Firing for low levels would just be finishing the swing, higher levels maybe a bit of flair before launching it
Yeah there are custom properties for that
Actually right now im reading some code from one famous firearm mod
Here are some properties you can add to a firearm
AimingPerkCritModifier = 23,
AimingPerkHitChanceModifier = 9,
AimingPerkMinAngleModifier = 0.05,
AimingPerkRangeModifier = 1.5,
Aimingtime = 15,
AimReleaseSound = M9AimRelease,
AmmoBox = Bullets9mmBox,
AmmoType = base:bullets_9mm,
AttachmentType = Holster,
BreakSound = M9Break,
BringToBearSound = M9BringToBear,
ClickSound = M9Jam,
Aiming time is how many frames it takes before you can shoot, right?
I guess so. The name its very self descriptive
Ill send you the whole file by dm
Could have it be around a second while the character is getting enough momentum for it to be lethal
Alrighty, thanks
Damage is probably gonna be slightly less than an M9, since properly made slings with the right load can reach the velocity of a 9mm round but it'd be crushing instead of penetrating damage
It would be cool that time could be based on your strenght level
Historically, slings were sometimes used to crush armor from afar because they flew so fast and with so much force iirc
So maybe it could be interesting if it didn't lose as much damage on armored zombies
Id say a slingshot shouldnt be able to pierce armor but they could deal kinetic damage?
Still lose some force but not as much maybe
Yeah, it crushes it, doesn't penetrate
Since it's basically throwing a rock REALLY hard
Looked it up, they could crush bones through even plate armor sometimes with the right loads and a very skilled slinger
I can see a player with lvl 10 strengh killing a fully armored player thwroing 25 rocks at him
Slingshots don't have as much force as the kinda slings I'm thinking of, but they could be an easier to operate option too
Also I guess they would break after a few shots
One thing that would probably balance the sling some on its own without needing many changes would be stones weighing 1, so that's 1 weight per round
Then a big upside is being able to literally pick up ammo off the ground
Are you planning to use the normal stones?
I think those stones are hand sized
You need something smaller
Seen folks use tennis balls as safer alternatives to rocks when practicing with a sling, but yeah maybe adding a new item for ammo would be better
Yeah I can think of a recipe to create "Small stones" using two normal sized stones and breaking them hitting each other
Yep, maybe a bit of knapping XP for it
That would be a good mod
Im playing on a insane rare loot server and there are no options for long range weapons beside a revolver I found with 4 bullets XD
do i use ItemName_Base.* or should Base be replaced with the name of my module?
e.g. ItemName_jwah.*
and only tangentially related, but if the new hat i added disappears when you try to equip it, could it be a guid issue? I've quadruple checked that everything is functionally identical to the other hats in my mod, and even tried giving it a new GUID for forward and reverse versions (and updated the GUID table) but the Cubs cap just won't seem to work no matter what i try lol
looks like i was missing the closing tag for the hat right above it in the guid table, i'm guessing that's the source of the issue
Was thinking maybe I could use this as a sound effect for launching a rock with it, dunno if I could change the sound too so this may have to do for all the animations
Clean it up a bit maybe, this is pretty much a raw recording of me spinning a sling and hitting something with it lmao
The crack is a fair bit more pronounced when actually shooting a rock fast enough to kill something, it almost sounds like a gunshot
oh wow that first crack was the release?
Was me smacking something with it, didn't have any rocks in there for safety
It's too windy and loud outside to properly shoot it or record it
(also I made my sling myself with pretty low quality materials so it's not great at throwing)
ah k
Wow nice crack
Yeah, iirc that guy's more of an archer so he's not super trained in shooting a sling accurately, people can hit crazy shots with them
Yea its amazing how accurate humans can become with tools
I pull off fits of 0.005" or better routinely with just a hand chisel -_-
And archery is like, yea pointing your bow at the correct fraction of a degree.. Many people doing so without any optical sight whatsoever.
I bet the sling takes a fair bit more skill though, due to having to time it to get the release angle correct
thats pretty good for a chisel, damn lol I'm a machinist
Yep, Most of my knive tangs press fit into the handle made for them.. at least, at the very end where you'll see the gap if they don't ๐
rest of the slot? Well thats what glue is for...
How do I find out what to reference when making a mod? Like I want to be able to check if an inventory item, when right clicked, is a liquid container, if so, if it has water, if so, check if it's tainted, if so, remove the tainted status. I'm familiar with LUA code but I have no idea how to check where the attribute is listed on each item. I don't know how to check through the players inventory to see if they have an item to allow the context menu to appear either and I see nowhere to learn these things.
declaration: package: zombie.inventory, class: InventoryItem
Just released an update to the version of this in Moons mods if anyone wants to try it out
When are you gonna release this I need to cook some stews
I dont wanna sound mean but you gotta improve that mod description, name and profile picture xd
I cant easily tell whats that mod about
You could name it.. "Moon's Better Cooking UI"?
Does it work for MP?
Yes it works for MP
Its mainly just a repo of all my mods before I release them proper because doing a full release is a pain in the ass ๐
Do you use git?
nope
good luck, he doesn't even use an ide
You should tbh
A monolith of mods? Damn
How many open file browser screen do you use while editing your mods?
shrugs
I mean I have programmers notepad at least, it has tabs..
Try downloading antigravity or VSC
I wonder if theres any CLI tool for creating the basic file structure for modding
...Are you calling me fat? ๐ "Just download some more antigravity he said"
Antigravity, Google's IDE
Ah, never heard of it before
I wish I could do something like...
pz new "MyMod"
yea I just copy one of my mod folders and start changing stuff.
Why spend 5 seconds copying a file when you can spend 4 hours automating it with a CLI tool?

i think pz studio does something like that
but it's always been too scary so i've never looked into it
@shrewd tundra Anyway, lemme know what you think of it... I get so little feedback from people who actually try out my mods -_-
I cant find that tool anywhere can you share the link?
I will download your mod and let you know once I tested
Thanks
Probably you are not aware but theres this bug where if your character push while doing the cooking animation, it gets stucked on the pushing animation and you need to restart the game
In the mod?
It happened to me on MP
Hey does this ranking system works?
Why does you name have an Axe and mine has that weird thing
I dunno, I found the axe on some dead guy. did you steal yours off some plumber?
But yea, it works, takes time to level up/msgs (once per minute max)
im not seeing it on the api page, is it ISUIElement
doesn't it just use Render3DItem()
i need 2d image sprites sadly not 3d
im trying to do visual vfx but insanely limited because i cant offset/rotate/resize
i think you can just use SpriteRender directly for things like this, though i don't know if it'll interact with stuff like depth properly
Hey! I have a question! Can you make this so I can rotate the position of weapons on the back?
It was an absolute lifesaver for weapons in the hands, but I have issues with weapon on the back right now.
Maybe like a different command like SaucedCartsTweaker.enable_for_back()
thanks this seems to be moving me closer, what do i put in for the consumer texturedraw variable though
hello modder friends
where would i find this โBombBoxโ container?
iโm having trouble finding it
i need it for cool environmental storytelling stuff
so i can make explosives spawn
butttt iโm missing the container that it defines :/
that doesn't define a container, it defines a spawn table that might spawn in some other container like a suitcase, or crate
is texturedraw not exposed to the lua side? I can't get this thing to work ๐
If it doesn't error when you call the function, it means it's exposed
isoobject = you can color but not offset/rotate/glow
uielement = you can offset and make it glow but not rotate
You need to call it every ticks
it returns nil
Bcs it returns void
for TextureDraw() and TextureDraw
to use GetRenderer() (spriterenderer) render/renderi you need texturedraw but you can't create texturedraw
from my understanidng
so basically there is no way to use SpriteRenderer
Im using UIManager.DrawTexture now it does the trick more or less but now i cant color/rotate
not a big deal
pretty sure you can rotate with the advanced 3d placement thingy
idk which one that is
whats the class name
Dunno, its what you get when you place an item in the world, then click 'extended 3d placement' and during the preview its rendered via a totally different API
how do i find the spawn table?
that was the spawn table
those are the only mentions of โbombโ in the whole definitions fileโฆ and the singular mention of โBombBoxโ
Yes look for BombBox in other files
which ones to look in thoe?
prob *.txt, maybe .lua
hmm ok, thanks!
use a find in files like programmers notepad or something
I wonder how difficult the process of adding new moodles/effects is? straight forward, or more complicated?
Requires good knowledge of Lua usually
There's APIs for moodles
ahh gotcha, i'll probably hold off on that for a bit then since im not too too familiar with it
I have a Mod Template mod that I copy, which is why one of my mods has the ModID NepModTemplate because I uploaded it to the workshop and didn't notice I forgot to change it until a few hundred people had subscribed.
New fork of PZStudio for B42 MP
(WIP) The roadmap is to separate the mod template into a ready-to-clone Git repo so anyone can build any template that suits their code style.
hows modding for build 42, i have some experience in gta modding and i wanna try out PZ now. Is the documentation ready or is it better not ot starta?
you can check the pinned messages
I got u bro
Thanks!
It's good to see ya. How've ya been!
Pretty good, vacation from work in T-minus 4 days ๐น -- hey could you confirm the name of the bone on the back is it: Bip01_BackPack?
How would I confirm that?
Look at your model script see what bone its trying to attach too
Oooh, it's old. ๐
It's trying to attach to shovel_back
I think it's wrong because the weapon disappears
When I remove the old one, the weapon connected to the default spot.
I see yeah try Bip01_BackPack basically if we figure out what bone you're trying to attach to I can wire up the script to tweak attachments there
cool let me know if that attaches and doesn't disappear
Yeah, I looked at the vanilla scripts, and the attachment for rifles goes onto the Bip01_BackPack slot.
But the attachment for long axes goes to the Bip01_Spine1 spot.
right, okay so that makes me think that either or could be used realistically. I'm not sure how the game handles back attachments when you're wearing a backpack, if it smartly reattaches to the backpack or what have you.
Well, you can walk with a rifle on your back and a backpack iirc.
So it probably just clips through each other.
I'll dig a bit, and hit you up when the changes are done ๐
Okay, it's done and working.
They're still at wild ass angles but they are connecting up high on the backpack slot.
niiiice okay
Hhmmm. Looks like there is also issues when I attach small weapons to the hip slots too.
So left and right hip attachments must have something new as well.
Oooooh, so the belt looks like it's on Bip01_Pelvis bones.
And they have two different attachments...
So like
attachment wrench_left
and
attachment wrench_right
in vanilla, but they all use the pelvis attachment point for weapons.
i see okay we can add hip slots
Sweet!
I'm good with what ever you come up with! I'd be totally fiddling with all this for hours without ya
lol
Okay @normal moth instructions, attach the item to whatever slot then :
SaucedCartsTweaker.list()
=== Attached Items ===
#1 [Rifle On Back] Bone: rifle_back Model: Shotgun
#2 [Hip Left] Bone: wrench_left Model: Wrench
#3 [Hip Right] Bone: wrench_right Model: Knife
Usage:
SaucedCartsTweaker.enable_slot(1) -- tweak slot #1 from list above
SaucedCartsTweaker.enable_slot(2) -- tweak slot #2, etc.
SaucedCartsTweaker.enable_slot(2) -- tweaks the left hip wrench
Should be g2g from there
Thanks!
no prob, glad you found it useful, definitely saved me a headache more than once.
๐ this makes me lol
Elephant gun
Hello, I made a mod on Project Zomboid with food, and I don't know how to distribute the food in refrigerators, in stores, etc., can you help me?
Thanks man this is totally amazing!!
I'm able to do everything I need to and tweak it all right there. This is an absolute lifesaver!
I spent like two months trying to do this by hand and guessing, and then this tool made it like the work of a weekend!
You need to look at the item distribution scripts from other mods and from the vanilla game.
The scripts randomly generate what is in each box from a list of loot. And there are lots of different box types.
Thanks to you I finally got the mod working!
thats what im talking about!!!
I totally feel you on that dude, I was ripping my hair out trying to get the models to look right in game ๐ I was like there has to be a better waaaay
guys is it allowed to rework and repost a mod to steam that hasn't been updated since 2021?
Because there is a mod called Refurbish, and its not working on B42, and author doesnt seem to care about it anymore
Night guys, i create a little mod for 42.12.3. But he dont show in Mod Manager for enable him. What the possible reason?
these are the files
structure is wrong, needs a \42 folder and a \common folder
ty buddy
firefighter mod releases soon, i am making dinner and fixing some long standing weight painting errors
so yeah, fuck animation and modeling
i spent too many hours trying to scale the base MaleBody model and got nowhere
screw you blender and screw you modeling
sorry for the language
im not built for that no feedback process
_ _
I have a question I hope someone can answer.
I have an event that gets called/added after a TimedAction completes. It has a couple small timers, performs some actions, and then self deletes itself when the timers are finished.
Sometimes the player may uninentionally interrupt or bypass the timer's completion, and the event handler remains active and isn't removed.
Is there a way to check if the event still exists before the TimedAction re-adds the new event? I would like it to be removed as a failsafe in the case I can't prevent the player from accidently bypassing it's normal removal.
Let me know if anyone has any ideas, thank you!
This can't be posted because it contains content blocked by this server. This may also be viewed by server owners.
make it globaly accessible, set it when used, and remove it if different of nil
you may also wanna remove it from timed action queue clear on your target character
Do you have an example by chance?
thats not gona work
cuz it will get affected by animation files
you need to modify all the anim files
Ask for permission
Boooo - yeah I tried scaling with code, with a clothing object, and the actual model - that modding idea can go in the dumpster
yeah.
its pretty insane
you just want resize you end up having to do all the animations there is
owell
I might still do it - whatโs a good easy win I can do with modeling to make sure I have a reasonable workflow?
I initially thought the animations were attached to the model but I think I only saw bob_walk or something along those lines
the model scaling is annoying but at least for attachment items I wrote code to make it not suck
but yeah im not about to guess and check ๐ i realized that was the workflow and immediately started automating
what changed for the mods from build 42.13 to build 42.14?
@bright fog Sorry for bothering you, but is there any manual or something like that that helps you update your mod from the 42.13 to 42.14 like they did after releasing the build 42.13?
i am having a hell of a time finding information about this.
I was about to release the mod and i was hit with the update lol
It didn't change anything that would break your mod
The API didn't change much
that is so weird, i can't open a door or drink from the sink without an error
is there a changelog or something only with the api? everything that i read doesn't really touch on the mod side of the thing.
share the error
the way this error works is funny, when i create the world, i cannot do anything that this error will show up, when i leave and open the world again, everything works fine
so you must be overriding some TimedAction logic in your mod yea?
its a null pointer, so something has gone wrong somewhere in the ISWaitWhileGettingUp timeaction
or in something that is calling/using that timed action
belive it or not, but the main reason why this was happening had nothing to do with timed actions at all. I had a functionality on my mod that allow you to spawn in a barricaded house with some stuff inside. It broke so i removed it for now. i will release this mod soon, so i might fix this later on after the release. But i will keep in mind what you said here so i can fix it later. Thanks.
O_e
Bcs it didn't change
The changelog has some of the technical changes
And if they make major changes, you can easily know about it in the changelog, or rare indications to modders about the changes
thanks for the help
Does anyone know if there is any mod that adds cool stuff like that?
I believe this is from britas armor pack but man, i would love to see a standalone mod just for these. It looks amazing. ๐ฉ
Does multiplayer time go by every ten minutes or every minute now? I am thinking a mod has done something with ours.
what, like the time displayed on watches? they only show ten minute increments regardless of gamemode
it's not like the game actually simulates only ten minute increments though, the watches are just set to display that way because it looks better
I really need to get that watch mod someday, it would be so much nicer for debugging stuff to see individual minutes tick
Wall Clocks in game actually capture the per-minute time, so it is ticking on a per minute basis
"minute" basis
the game tick isn't tied to a specific period at all
the time isn't tracked that way either
it's just how they choose to display it
i was just saying its reading from the same float value, and displaying a per-minute resolution
Hi, does anyone here know how to make a sound come from the player itself? And follow them instead of focusing on the tile they're on.
player:getEmitter()
Use the player emitter
See JavaDocs for details
thanks
Is there any event I can hook up to know when sandbox options are updated?
I made this mod that changes some clothing properties, property values can be change by sandbox options, but I need to detect when this happens so I can apply the new values
Can the "OnResetLua" event happen on MP?
no
the only time that event triggers is after lua fully reloads, either manually (main menu button) or automatically (usually caused by changing your mod list on the main menu)
Thank you. Is there any way I can give server admins the ability to update a mod setting while the server is on?
I gave my bullet defense mod the ability to get the bullet defense value from sandbox settings, and I would like to give admins the option to change this value without restarting the server
But I cant quite find the right event https://demiurgequantified.github.io/ProjectZomboidLuaDocs/md_Events.html
i don't think there is an event appropriate for this, and i don't think it would work properly anyway, the game doesn't handle item scripts changing at runtime
All right then I can keep the values on sandbox settings but it will be require to restart the server
Thank you Albion ๐
Pssttt don't tell everyone my secret of how I adjust tire traction in realtime
that is a very rare exception
Nah im pretty sure all mods work that way. /s
Did TIS forget to give you the per-item variable you need? just change the item script as needed! and hope the player never manages to get a 2nd one.
anyone knows if there is someone making a sewers mod or subways
using the basement feature from build 42
Okay, I just realized I don't know where the Javadoc is located.
package index
It's worth using Zomboid Decompiler to make your own local copy of the java source, so you can see what functions actually do
I just wanted the sound to follow the character, and now I'm getting myself into a completely new language.
You can do a lot with the various scripts, but you'll always end up eventually having to do some lua.
And then you'll end up having to learn enough java to make sense of the other half of the game.
The problem isn't Lua, but rather having to hunt down how to use it in Javadocs.
No matter which way I try to go, it seems like there's a wall.
looking at examples helps a lot too. I have a Visual Studio Code "reference Workspace" that opens the game's media folder and the decompiled java folder.
and.. sometimes you will straight up hit a wall when you find out what seemed simple is actually deeply embeded in Java.
like "how do I change what items a washing machine can clean?" and it's hardcoded in java.
'-'
Always feel free to ask in this channel if you need help tracking something down... some of us have spent far too much time poking the code and there's a good chance someone can give at least an initial direction
Thanks, currently I just want to get the sound to follow the player, I spent all afternoon trying, and I just kept seeing crash after crash.
What sounds it this?
Also, do you mean a sound that the player hears or the "sound" that attracts zombies?
It's an external sound I have that I want to play on the player so that he, the people around me, and the zombies can hear itโsomething to mess with my friends.
Ok cause in our mp game it goes by each minute like 9:30 to 9:31 etc.. so im wondering if a mod is doing that.
Try looking at SoundManager.java and WorldSoundManager.java (or lua that calls getSoundManager():someFunction())
there is a mod for that, but i'd be a bit confused how you installed it without knowing
But I think worldsounds are always at a fixed location, since they are more of a "ping" to alert zombies.
Maybe it's enabled on the MP server, and they didn't notice it in the server modlist?
... Ok but..... you know users
"ohhhh 300+ modpack and its only 6 months out of date! subscribe to all"
proceeds to enable every last mod without reading what a single one does
picks random mod, posts on the comments page that this mod caused the game to crash, refuses to elaborate
that is far too much detail. No, they post "It doesn't work"
Well then, screw that mag in particular!
Should require being racked between misfires though.
haha, just wanted to show off that it simulates going through each section when empty
Maybe in the future
each section?
It's based off an italian prototype magazine.
It would have several mini mags aligned in a row and chamber over to the next one when it's empty
yea my next question was gonna be "Unless thats some super weird prototype/obscure weapon I don't think thats how guns work" lol
Presumably this was before double stacked modern mags were a thing
In game reason for me adding this, is to compensate for not having access to stronger springs.
As the makeshift magazine you craft only holds 15 rounds when it looks like it should hold a standard 30
that looks like a LOT more then double stack ๐ that looks like a replacement for the notoriously shitty drum mags
Like a luty magazine
Springs in general, no matter how 'good' tend to have a limit on just how much you can compress them, making good high capacity mags take a lot of space for springs
lol each section only holds 5 rounds.
Entire mag holds 35
seems like this was a choice to keep the mag from being stupid long, and avoiding all the rattling issues and spring tension issues that drum mags have
Ok, but now imagine it expanded to 15 round sections
thats a drum mag that might actually feed reliabily without rattling like a tin can full of bullets while you march
would have to make it bulkier lol
that's it compared to the 15rnd mag
Absolutely would have make it bulkier, but sure would store a lot lol
also, guns need people willing to try new things.
look at warfair. 'oh we need more tanks and helicopters and why is all our shit getting rocked by little drones?'
Im disappointed that like gun weilding drones hasn't become a thing yet though ๐ just ones that drop grenades on things.
I think explosives usually weigh less and cost less than guns, so that makes sense
yea, easier to use if your nowhere near the splash zone
least they got some land based sniper/machinegun drones now.
Also if you're in PZ Modding Community, I post progress on this mod over there
https://discord.com/channels/908422782554107904/1470838623225122983
as a kid I was always like "Why the hell would you risk a solder where you could slap together a sniper rifle or machinegun on a little tracked thingy for 5~15 grand?"
soldier cost less
I was always a little iffy on how on earth you'd actually command the thing, other then just having it shoot anything that moves within a mile radius... But then Ukraine was like "fiber optics bro" and I was like "oh yea, that'd work"
Nah see you gamify the entire process. Either skill based or P2W
zerg rush
