#mod_development

1 messages ยท Page 372 of 1

bright fog
#

No docs no

#

It'll involve a character rig and overwriting the character model file

icy fjord
#

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?

bright fog
#

An item scripts is what you'll want and a model scripts associated to a model file

#

Also see this guide

icy fjord
left pecan
#

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.

bright fog
left pecan
#

Oh, thx a lot!

left pecan
#

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:

bright fog
#

Also I highly advise you move to VSCode and use Umbrella which will detect whenever you use non-existent code

bright fog
left pecan
vast pier
#

the hell happened to SpecialLootSpawns.CreateSchematic

bright fog
#

Open jacket

vast pier
arctic flicker
#

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?

tranquil kindle
#

Escape From Tarkov Backpacks B42 is a example with just One Custom Body location, which would be for front version of Sling Bag

latent pagoda
#

or is there any good videos or guides to help with this?

bright fog
#

What's your goal ?

latent pagoda
willow tulip
#
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

latent pagoda
#

I will give this a try and see if I can figure it out

willow tulip
#

if it uses those instead

left pecan
latent pagoda
willow tulip
#

np ๐Ÿ™‚

shy minnow
#

Is there a weapon editor in-game on project zomboid ?

willow tulip
#

You can also try pressing F1 through F10 to see random editors and stuff pop up lol

tranquil kindle
pastel wolf
#

I've woken back up!!

#

Now I'm all full of energy to troubleshoot my mod and figure out why its not working

tough oxide
#

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)

pastel wolf
#

so when i wear the pants, im getting this error

#

pretty much every frame it seems

shrewd tundra
# pastel wolf

You should document your clothing mod journey on youtube haha

pastel wolf
#

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?

tough oxide
#

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

pastel wolf
#

at this point I'm kind of stuck, i dont really know what is breaking

bronze yoke
#

if you add a translation it should work

pastel wolf
#

oh okay, how do i do that?

tough oxide
#

albion to the rescue

pastel wolf
#

so adding a translation to the script file?

willow tulip
#

and be named correctly -_-

pastel wolf
#

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?

stiff vessel
#

Hey, anyone managed to use clothing.xml to override base game outfits successfully in 42.14?

tough oxide
stiff vessel
#

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.

tough oxide
#

from my experience we've been given* the base guidelines and told to figure it out

stiff vessel
#

Thanks for the heads up mate

tough oxide
#

im very enthusiastic that i can kinda solve some of that

#

but im also very enthusiastic

pastel wolf
#

Mabye i rigged it wrong? or exported the model wrong?

tough oxide
#

start simple and work backwards

clear aurora
#

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

shrewd tundra
pastel wolf
#

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

vast pier
analog mesa
#

My occupation mod has suddenly stopped working on dedicated servers, zero errors

winter bolt
#

you have to add any vanilla items used in it to your fileguidtable tho or they wont appear

stiff vessel
#

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

pastel wolf
#

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

bright fog
clear aurora
# bright fog https://pzwiki.net/wiki/Umbrella_(modding)

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

bright fog
#

And you open the same workspace

tough oxide
#

also the .emmyrc.json in the root which i use "Users\<user>\Zomboid\Workshop\MyCustomMods"

#

thats the folder i open in vscode

primal forge
#

what do yall think of this icon?

echo inlet
#

Looks good

blazing raven
#

Can someone PLEASE make a map that is JUST forest and a river, I beg of you

fossil merlin
#

hi all, is Slayers bandit mod discord gone?

vivid imp
primal forge
#

already done :)

vivid imp
#

Whaaaaaaaat

#

I need to figure out how to install that, sounds like a fun project

#

How exactly does it get the game files tho?

primal forge
#

Wiki in the menu

vivid imp
#

I see. Ill give it a shot!

bright fog
#

Oh Zomdroid

#

Figured that was probably it

#

So you're the person who's continuying that project ? That's cool

bright fog
primal forge
#

i added gamepad support

#

and currently working on ui\

bright fog
#

Noice

#

I never tested Zomdroid but I made the wiki page for it

primal forge
#

ooh

#

cool

blazing raven
bright fog
#

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

oblique viper
primal forge
#

yes

oblique viper
#

sick

#

you gotta let me know when it comes out lol

primal forge
oblique viper
#

oh sick

#

link?

oblique viper
#

ty

blazing raven
frank elbow
#

Seems like the same recommendations apply as long as you can get in contact with this person

bright fog
#

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

willow tulip
#

@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

primal schooner
#

i went with getAccessLevel() == "admin", works for now, but marked as deprecated. Meanwhile getPlayer():getRole():hasAdminPower() was returning false on admin in mp

willow tulip
#

isAdmin() also only shows up 11 times in PZ vanilla LUA

primal schooner
#

yeah and it worked well in b41

willow tulip
primal schooner
#

and is not marked as deprecated either

primal schooner
willow tulip
#

oh, maybe they don't have admin yet then?

primal schooner
#

they have because getaccesslevel works

willow tulip
#

you also have to setaccesslevel (or have some mod auto assign admin) because admin seems to... disappear after relog?

primal schooner
#

no? admin persists after relogs

willow tulip
#

resets you to user every, damn, time...

#

unless I need to set some other stuff up

primal schooner
#

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

willow tulip
#

shrugs

#
        @LuaMethod(name = "isAdmin", global = true)
        public static boolean isAdmin() {
            return GameClient.client && GameClient.connection.getRole() == Roles.getDefaultForAdmin();
        }
primal schooner
#

also pz server can run just fine for 1 person with -Xmx2g haha

worthy ocean
#

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.

primal schooner
#

i use local .git for my mods but i dont upload to github

#

i might use gitlab maybe at some point

bronze yoke
#

the majority of pz modders don't have any prior programming experience

primal schooner
#

^this me kek

added: but im like 3 years into it at this point

worthy ocean
worthy ocean
#

Plus lua's a pretty forgiving language

frank elbow
willow tulip
frank elbow
#

This is comparing two Role references, which a quick glance shows could end up as two different objects (see ExtraInfoPacket.processClient)

primal forge
willow tulip
#
    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

frank elbow
#

I do recall seeing that ๐Ÿ˜“

willow tulip
#

I should prob restrict to UseMechanicsCheat or something for summer car but whatever...

frank elbow
#

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)

willow tulip
#

Yea

#

isAdmin is still in like 11 places in vanilla LUA too -_-

frank elbow
#

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)

worthy ocean
#

Out of curiosity, has anyone tried implementing a "fast travel system" mod or a automated driving mod?

stuck tapir
#

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

bright fog
#

There's an auto driving mod which was made not too long ago

bright fog
stuck tapir
#

And waystone which is just a teleport 'fast travel' sort of deal

worthy ocean
#

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

stuck tapir
bronze yoke
#

it should be compatible with any version java 17+, you can run java --version to double check what you have

stuck tapir
#

I thought as much, but my jre and jdk both show as 25.0

worthy ocean
bright fog
#

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

stuck tapir
#

Will do. Thanks!

bronze yoke
#

i've seen more than a few people get java 8 stuck on their path because of minecraft

worthy ocean
bronze yoke
#

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

stuck tapir
#

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?

bright fog
worthy ocean
plucky sluice
#

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?

bright fog
plucky sluice
#

@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

stuck tapir
#

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.

bronze yoke
#

glad to help!

bright fog
#

Also just enable the mod you're work on

#

Don't dev with other mods enabled besides debug mods

bronze yoke
#

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

plucky sluice
#

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 ๐Ÿค”

stuck tapir
#

Are you attempting to add/edit an attachment point for a custom item you made?

plucky sluice
#

@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.

stuck tapir
#

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.

plucky sluice
#

@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

sonic needle
#

cool.

silent zealot
#

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

plucky sluice
#

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

silent zealot
#

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.

plucky sluice
#

@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 ๐Ÿ˜„

silent zealot
plucky sluice
#

@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.

silent zealot
#

It's @sonic needle 's mod, I just helped with the stick-arrows-in-people code

shut robin
#

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.

shut robin
sonic needle
#

yep. in 42

shut robin
sonic needle
#

no?

#

Chimera has been out since day one of 42

shut robin
#

Bruh dunno I nver saw it.

shut robin
#

But this look good anyway

#

Good job

cinder storm
#

@silent zealot hows easydistro doing after the update

silent zealot
#

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

cinder storm
#

because smokes and guns stopped working properly

#

and that entire mod was based on the loot tables

silent zealot
#

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

cinder storm
#

i see

#

so thats probably my problem then

silent zealot
#

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"

cinder storm
#

my mods probably calling for some 223 items or similar

fallen torrent
#

make my cat in to pet and you get kiss from cat

mossy smelt
#

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

knotty stone
#

Bandits mod and just sandbox setting with no zombies ?

autumn sierra
#

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

calm obsidian
#

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?

calm obsidian
#

i mean yeah but i cant get much from it

bright fog
# calm obsidian this?

Check the console file directly instead, I'm not sure if error magnifier shows the whole error here

calm obsidian
#

Caused by: java.lang.NullPointerException: Cannot invoke "zombie.inventory.InventoryItem.setAlcoholPower(float)" because "item" is null
This feels important

#

I just dont understand it

winter bolt
calm obsidian
#

my brain mightve gone numb already so theres a high chance theres like a dumb typo or something I just cant see it

winter bolt
calm obsidian
#

b42

#

is something different? because the guides are most likely b41 and i didnt see a b42 one

winter bolt
#

in 42 they changed stuff in item scripts but yours is using the b41 stuff

calm obsidian
#

ah

#

๐Ÿ˜”

winter bolt
#

i cant remember which things changed but you can look in media/scripts/generated(?) and find the vanilla clothing and copy it

bright fog
#

It'll highlight formatting mistakes and deprecated parameters

calm obsidian
#

Okay i no longer get the error

#

now it does let me select it

#

its just invisible ๐Ÿ˜„ !!!!!!!!!

calm obsidian
#

less go

#

my first clothing item

#

it only took hours

#

for a very simple item

next vine
#

Is there a timed Action for a shovel or pouring for a building mod dont find anything on the wiki tho

bright fog
next vine
bright fog
hardy hearth
#

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.

knotty cradle
#

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

arctic flicker
knotty cradle
#

ah shit man, yeah i didnt have a common folder. I owe you a beer

hardy hearth
# bright fog What kind of detail do you want

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.

knotty cradle
#

i assume the common folder lets you place assets used across versions rather than multiple copies in different version folders?

knotty stone
#

Its one of these days... abraxsDerp

arctic flicker
knotty cradle
#

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?

arctic flicker
#

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.

knotty cradle
#

oh thats not a bad idea for a way to do it, that could come in handy for certain things

arctic flicker
#

He must not know KI5 already have armor

knotty stone
#

Nah it's the apocalypse engineer where you can craft and place vehicle frames

arctic flicker
#

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" ๐Ÿคฆโ€โ™‚๏ธ

knotty stone
#

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

knotty stone
#

ok i need a second event to already have the script changed in the main menu.

Events.OnGameBoot``` did it ![schobiNote](https://cdn.discordapp.com/emojis/1299094922288435220.webp?size=128 "schobiNote")
bright fog
#

But even, then that doc is a bit limited and needs some work

#

Rn it's hard to use

bright fog
#

They are rough to navigate tho...

hardy hearth
bright fog
#

Nice

next vine
#

im feeling so stupid im doing a building mod rn and im not able to place a functionally generator ๐Ÿ™ halp pls

shrewd tundra
#

You can also check this video guide

https://www.youtube.com/watch?v=MUGQ647o5M4

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...

โ–ถ Play video
knotty cradle
#

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

shrewd tundra
#

There are plenty high demand mods still not updated to b42

shrewd tundra
#

I would like to try updating the "More makeup" mod

knotty cradle
#

its nothing big, basically textures lol

shrewd tundra
#

I also did an extremely simple mod

knotty cradle
#

617 subscribers, so better than i expected haha

shrewd tundra
#

But its helpful to the pvp community

knotty cradle
#

oh whats your mod?

shrewd tundra
#

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

knotty cradle
#

oh nice man

shrewd tundra
#

Buuuut, im learning Blender first. Its more fun than scripting

next vine
#

Somebody got experience with a buildable generator need some help mine doesnt overright the ghostgenerator

next vine
#

i gave up i just make them as craftable recipes ,,.

ionic crown
#

How to make a mod for non-standard zombies if Zomboid Forge is abandoned?

acoustic bolt
#

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

primal forge
#

๐Ÿ‘€

buoyant violet
#

legit question

#

anyone experiencing random crashes to desktop?

#

since the last update?

honest sierra
#

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? ๐Ÿ˜„

shrewd tundra
#

No error, just straight to desktop

#

Happens on multiple servers

buoyant violet
#

well currently im not so concern with MP, but the game is just chilling in the menu and explodes lol

marble folio
#

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

acoustic bolt
#

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

cinder storm
#
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
cinder storm
#

what non-table is being indexed here

marble folio
marble folio
bright fog
cinder storm
bright fog
cinder storm
#

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

bright fog
#

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

cinder storm
#
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?

cinder storm
#

alright cool

rich reef
#

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.

willow tulip
#

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

rich reef
#

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!

willow tulip
#

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? ๐Ÿ˜›

willow tulip
#

Should I disallow adding raw things to cooked evolved recipes (Allow cooked things?), or cause adding raw things revert it back to uncooked?

rich reef
# bright fog 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.

rich reef
bright fog
rich reef
#

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.

buoyant violet
#

cant stop thiking this bullet textures reminds me off

buoyant violet
paper ibex
buoyant violet
cinder storm
#

giant casings

cinder storm
#

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"

#

i cant even fix it this time

nimble yew
#

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!!

bright fog
tough oxide
weak belfry
#

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?

arctic flicker
#

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.

tough oxide
#

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

bronze yoke
#

i don't know about the new moodles, but the old moodles used a fixed icon with a separate changing background

weak belfry
#

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.

tough oxide
#

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

weak belfry
#

I've found where each moodles types text and description are stored, but not anything connected to the icon itself

tough oxide
#

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?

celest cloak
#

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

weak belfry
# tough oxide whats that section of the screen called?

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 :(

tough oxide
#

yeah, it looks like you might be able to do it through the player - playerObj:getMoodles():getMoodleLevel(MoodleType.PAIN)

weak belfry
#

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

tough oxide
#

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?

bronze yoke
#

no, there's nothing lik ethat

#

most moodle mods just rewrite the entire system because it's basically unworkable

tough oxide
#

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

weak belfry
#

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

tough oxide
#

yeah, it starts as white then it looks like it changes based on the level

willow tulip
tough oxide
#

so for his moodle project - do people just draw over the original to simulate the override?

bronze yoke
#

you can hide the normal moodle ui and then just draw your own

tough oxide
#

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

weak belfry
#

Thank you for the help guys, really appreciate it!

tough oxide
#

So yeah you can do it but you got some legwork

bright fog
tough oxide
#

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

tough oxide
#

Iโ€™d love it if more people shared their git there or even use git but I could see reasons not to

bright fog
next vine
#

does someone know the Lua for generators ?

willow tulip
next vine
willow tulip
#

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

knotty stone
#

yea power is no fun to play around with abraxsLUL

#

learned that the hard way^^

willow tulip
#

MOGenerator is like 70 lines lol... rest is all java

next vine
#

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

knotty stone
#

you "just" set the tile to be powered

willow tulip
knotty stone
#

so there is a ghost key?

willow tulip
#

Something internal to the 1000000 line basevehicle.java that I don't want to touch

next vine
willow tulip
#

Iv considered trying to fix it at least for W in realistic car physics but never got around to it

knotty stone
#

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

willow tulip
#

yea I can likely do that.

#

Anyone know what button opens that debug display?

knotty cradle
#

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?

willow tulip
#

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.

knotty cradle
#

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

willow tulip
knotty stone
#

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() schobiNote that was too easy, time to go to bed abraxsDerp

manic swift
somber steppe
#

anyone know how i get started, and maybe some basic mods i can try and code (like examples) to get started?

willow tulip
#

"Realistic Calories" is pretty simple for a beginner, shows how you can tweak items via LUA

#

its just one short Lua file

somber steppe
#

ah mk

willow tulip
#

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)

somber steppe
#

ah alrighty, i appreciate the help :D

silent zealot
#

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

bronze yoke
#

what did you need custom sync for?

silent zealot
#

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.

willow tulip
graceful hamlet
#

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).
pastel wolf
#

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

knotty stone
#

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

silent zealot
#

I think it's level 3 electrical to use a generator without instructions. Was added a while ago, I'm not sure which update

knotty stone
#

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

silent zealot
#

It's not a Craftrecipe

#

it's... um... a magical not-really a recipe recipe?

#

But this code works: getPlayer():isRecipeActuallyKnown("Generator")

knotty stone
#

so there was a change

#

i had this local hasGeneratorKnowledge = playerObj:getKnownRecipes():contains("Generator")

silent zealot
#

I assume isRecipeKnown() is for back compatability and isRecipeActuallyKnown() is teh one that actually works.

knotty stone
#

thx

silent zealot
knotty stone
#

O.O"

silent zealot
#

level 0 electrical, read magazine

#

so. Good luck. Sounds liek you will need it ๐Ÿ˜›

knotty stone
#

is your magazine updating right when you read it? like i shown in the picture its still on unread

silent zealot
knotty stone
#

hm, maybe i should reinstall zomboid

#

well i have the checkmark too, but in the tooltip its unread

mellow frigate
#

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 ?

smoky kelp
#

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?

willow tulip
shrewd tundra
harsh lion
#

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.

silent zealot
# smoky kelp Hey there. This could be a silly question but I was thinking about starting modd...

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.

silent zealot
#

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?

bright fog
#

maybe in the server settings ?

silent zealot
#

I can't see anything through the GUI, just settings about what admins do/how admin powers affect chat etc.

bronze yoke
#

i don't believe so

oak python
#

how do i get ammotype for my custom ammo? I tried base:bullets_(ammotypename) but it doesn't work

silent zealot
#

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")
silent zealot
#

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:)

silent zealot
#

Or "Cooking UI" since it's not really a cooking UI. ๐Ÿ˜›

willow tulip
#

Thanks :0

silent zealot
#

YOU DID NOT ADD ANY GARLIC! 0/10 literally uneatable.

willow tulip
#

It was stale ๐Ÿ™

silent zealot
#

stale garlic in a stew is still better than no garlic!

willow tulip
#

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.

silent zealot
#

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.

willow tulip
#

Im also rewriting how cooking works -_-

#

Like, you now need a knife, and at low skill your likely to cut yourself :p

oak python
# silent zealot Did you add a new type with a registies.lua?

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,
silent zealot
#

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.

willow tulip
bronze yoke
#

don't create an item key

silent zealot
#

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

bronze yoke
#

just do AmmoType.register("base:bullets_golden", "ModuleNameHere.BulletsGolden")

silent zealot
#

Also, don't use base: because it will be rejected.

bronze yoke
#

oh that too

silent zealot
#

You can use base.thing for items, but not base:thing for registries.

willow tulip
#

I work all day with RAZOR sharp knives and get tons of tiny cuts

silent zealot
#

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.

willow tulip
#

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.

silent zealot
#

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.

willow tulip
#

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

silent zealot
#

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.

willow tulip
#

Yea

#

I believe sharpening also has a chance to lower condition anyway

charred haven
#

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

willow tulip
hardy hearth
#

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?

silent zealot
#

But there is a commissions channel in the unofficial modding discord.

silent zealot
#

Maybe try replacing ":" with ":" to see if it uses html style escape codes.

silent zealot
#

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.

rigid field
#

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?

arctic flicker
silent zealot
#

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 >)

silent zealot
oak python
#

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?

silent zealot
#

AFAIK world sprites are fixed to grid location, or possibly to several positions (floor/low surface/high surface)

oak python
#

what's the ideal way to make a player trip/stagger/fall, player:setBumpFall(true) doesn't seem to be doing anything

charred haven
#

I don't want them to defend themselves. Think the citizens from the "no russian" call of duty mission

cloud anchor
#

Hello, I'm new to the server and I would like to learn how to modify this game, how can I learn?

silent zealot
silent zealot
#

Also welcome!

rigid field
# silent zealot for what you want, I can see two ways: 1) add a recipe. IL water, 5 ml bleach, ...

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!

silent zealot
#

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. ๐Ÿ˜›

silent zealot
#

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.

shrewd tundra
#

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?

teal nacelle
#

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

willow tulip
#

it renders things without them being real world objects

#

in 3d

shrewd tundra
#

You would need to handcraft every animation tho

teal nacelle
#

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

knotty cradle
#

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?

teal nacelle
#

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

shrewd tundra
#

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,
teal nacelle
#

Aiming time is how many frames it takes before you can shoot, right?

shrewd tundra
#

Ill send you the whole file by dm

teal nacelle
#

Could have it be around a second while the character is getting enough momentum for it to be lethal

#

Alrighty, thanks

teal nacelle
shrewd tundra
teal nacelle
#

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

shrewd tundra
teal nacelle
#

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

shrewd tundra
#

I can see a player with lvl 10 strengh killing a fully armored player thwroing 25 rocks at him

teal nacelle
#

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

shrewd tundra
teal nacelle
#

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

shrewd tundra
#

I think those stones are hand sized

#

You need something smaller

teal nacelle
#

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

shrewd tundra
teal nacelle
#

Yep, maybe a bit of knapping XP for it

shrewd tundra
#

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

knotty cradle
#

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

knotty cradle
#

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

teal nacelle
#

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

willow tulip
#

oh wow that first crack was the release?

teal nacelle
#

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)

willow tulip
#

ah k

willow tulip
teal nacelle
#

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

willow tulip
#

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

knotty cradle
willow tulip
#

rest of the slot? Well thats what glue is for...

rigid field
#

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.

shrewd tundra
willow tulip
shrewd tundra
#

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?

willow tulip
#

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 ๐Ÿ˜›

willow tulip
#

nope

bronze yoke
#

good luck, he doesn't even use an ide

shrewd tundra
#

A monolith of mods? Damn

#

How many open file browser screen do you use while editing your mods?

willow tulip
shrewd tundra
#

I wonder if theres any CLI tool for creating the basic file structure for modding

willow tulip
willow tulip
#

Ah, never heard of it before

shrewd tundra
willow tulip
#

yea I just copy one of my mod folders and start changing stuff.

shrewd tundra
bronze yoke
#

i think pz studio does something like that

#

but it's always been too scary so i've never looked into it

willow tulip
#

@shrewd tundra Anyway, lemme know what you think of it... I get so little feedback from people who actually try out my mods -_-

shrewd tundra
shrewd tundra
bronze yoke
willow tulip
#

Thanks

shrewd tundra
# willow tulip 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

shrewd tundra
#

I hope your mod fixes that

willow tulip
#

Oh. dunno.

#

I thought vanilla cooking didn't even have an animation?

shrewd tundra
#

Yeah its not an "animation"

#

A loading bar with a spoon sound

willow tulip
#

seems to work just fine

#

Or at least I couldn't get it to get stuck

shrewd tundra
#

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

willow tulip
#

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)

oak python
willow tulip
#

Nope, it uses some weird API call

#

the 3d extended placement mode thing

oak python
#

ui3dmodel maybe

bronze yoke
#

doesn't it just use Render3DItem()

oak python
#

i need 2d image sprites sadly not 3d

oak python
bronze yoke
#

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

normal moth
#

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()

oak python
mystic shore
#

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 :/

willow tulip
oak python
bright fog
oak python
#

isoobject = you can color but not offset/rotate/glow
uielement = you can offset and make it glow but not rotate

bright fog
#

You need to call it every ticks

bright fog
oak python
#

for TextureDraw() and TextureDraw

bright fog
#

So it returns nil

#

Ah

#

Idk about these what they return

oak python
#

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

willow tulip
oak python
#

whats the class name

willow tulip
# oak python idk which one that is

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

mystic shore
willow tulip
#

that was the spawn table

mystic shore
mystic shore
willow tulip
#

prob *.txt, maybe .lua

mystic shore
willow tulip
#

use a find in files like programmers notepad or something

pastel wolf
#

I wonder how difficult the process of adding new moodles/effects is? straight forward, or more complicated?

bright fog
#

There's APIs for moodles

pastel wolf
#

ahh gotcha, i'll probably hold off on that for a bit then since im not too too familiar with it

silent zealot
paper ibex
limber sentinel
#

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?

paper ibex
normal moth
blissful seal
#

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?

normal moth
#

How would I confirm that?

blissful seal
#

Look at your model script see what bone its trying to attach too

normal moth
#

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.

blissful seal
#

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

normal moth
#

Okaydokey!

#

I'll do BackPack.

blissful seal
#

cool let me know if that attaches and doesn't disappear

normal moth
#

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.

blissful seal
#

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.

normal moth
#

Well, you can walk with a rifle on your back and a backpack iirc.

#

So it probably just clips through each other.

blissful seal
#

I'll dig a bit, and hit you up when the changes are done ๐Ÿ‘

normal moth
#

They're still at wild ass angles but they are connecting up high on the backpack slot.

blissful seal
#

niiiice okay

normal moth
#

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.

blissful seal
#

i see okay we can add hip slots

normal moth
#

Sweet!

#

I'm good with what ever you come up with! I'd be totally fiddling with all this for hours without ya

blissful seal
#

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

blissful seal
#

no prob, glad you found it useful, definitely saved me a headache more than once.

#

๐Ÿ˜‚ this makes me lol

willow tulip
cloud anchor
#

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?

normal moth
#

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!

normal moth
normal moth
blissful seal
#

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

hollow tree
#

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

tawdry light
#

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?

willow tulip
pastel wolf
#

firefighter mod releases soon, i am making dinner and fixing some long standing weight painting errors

tough oxide
#

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

rich reef
#

_ _
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.

mellow frigate
#

you may also wanna remove it from timed action queue clear on your target character

rich reef
ancient grail
tough oxide
ancient grail
tough oxide
#

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

blissful seal
#

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

bleak remnant
#

what changed for the mods from build 42.13 to build 42.14?

bleak remnant
#

@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

bright fog
#

The API didn't change much

bleak remnant
#

that is so weird, i can't open a door or drink from the sink without an error

bleak remnant
blissful seal
#

share the error

bleak remnant
#

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

blissful seal
#

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

bleak remnant
#

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.

blissful seal
#

O_e

bright fog
#

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

bleak remnant
#

thanks for the help

quiet socket
#

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. ๐Ÿ˜ฉ

steel wadi
#

Does multiplayer time go by every ten minutes or every minute now? I am thinking a mod has done something with ours.

bronze yoke
#

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

willow tulip
#

I really need to get that watch mod someday, it would be so much nicer for debugging stuff to see individual minutes tick

blissful seal
#

Wall Clocks in game actually capture the per-minute time, so it is ticking on a per minute basis

#

"minute" basis

bronze yoke
#

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

blissful seal
#

i was just saying its reading from the same float value, and displaying a per-minute resolution

slow wind
#

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.

bright fog
#

Use the player emitter

#

See JavaDocs for details

slow wind
#

thanks

shrewd tundra
#

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?

bronze yoke
#

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)

shrewd tundra
#

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

bronze yoke
#

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

shrewd tundra
#

Thank you Albion ๐Ÿ™‚

willow tulip
bronze yoke
#

that is a very rare exception

willow tulip
#

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.

twin nest
#

anyone knows if there is someone making a sewers mod or subways

#

using the basement feature from build 42

slow wind
silent zealot
#

It's worth using Zomboid Decompiler to make your own local copy of the java source, so you can see what functions actually do

slow wind
#

I just wanted the sound to follow the character, and now I'm getting myself into a completely new language.

silent zealot
#

And then you'll end up having to learn enough java to make sense of the other half of the game.

slow wind
#

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.

silent zealot
#

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.

slow wind
#

'-'

silent zealot
#

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

slow wind
#

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.

silent zealot
#

What sounds it this?

#

Also, do you mean a sound that the player hears or the "sound" that attracts zombies?

slow wind
#

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.

steel wadi
silent zealot
bronze yoke
#

there is a mod for that, but i'd be a bit confused how you installed it without knowing

silent zealot
#

But I think worldsounds are always at a fixed location, since they are more of a "ping" to alert zombies.

silent zealot
willow tulip
#

"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

silent zealot
#

picks random mod, posts on the comments page that this mod caused the game to crash, refuses to elaborate

willow tulip
willow tulip
willow tulip
vast pier
vast pier
willow tulip
#

each section?

vast pier
#

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

willow tulip
#

yea my next question was gonna be "Unless thats some super weird prototype/obscure weapon I don't think thats how guns work" lol

vast pier
#

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

willow tulip
#

that looks like a LOT more then double stack ๐Ÿ˜› that looks like a replacement for the notoriously shitty drum mags

willow tulip
vast pier
willow tulip
#

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

willow tulip
#

thats a drum mag that might actually feed reliabily without rattling like a tin can full of bullets while you march

vast pier
#

that's it compared to the 15rnd mag

willow tulip
#

Absolutely would have make it bulkier, but sure would store a lot lol

vast pier
willow tulip
#

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.

vast pier
#

I think explosives usually weigh less and cost less than guns, so that makes sense

willow tulip
#

yea, easier to use if your nowhere near the splash zone

#

least they got some land based sniper/machinegun drones now.

vast pier
willow tulip
#

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?"

vast pier
#

soldier cost less

willow tulip
#

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"

willow tulip
vast pier
#

zerg rush