#mod_development
1 messages Ā· Page 346 of 1
Override the image
And pretty sure thing like "1993" are not translated, just a number
nada?
I dont have modding experience
https://steamcommunity.com/sharedfiles/filedetails/?id=3477331640 ya arregle el error que tenia con los objetos de la guantera. Espero que les guste el resultado!
Neither did anyone else until they made their first mod.
Wouldint know where to start
Pinned messages, that one is full of resources.
There is also the good old "find a mod that does something you want to do and look at how they did it" way of learning.
Like DrStarlker was saying, download a mod, look at how it was coded, then do something similar.
Don't copy and paste it over that's forking and will get you bad rep, you can even get hit with a takedown request.
Just look at how a coder did something and give it a twist and do it yourself
In other words, inspire yourself from more experienced coders
Does anyone know what the vehicle equivlant to player:getForwardDirection():getDirection() is? I've tried some variations, but I can't seem to get it on my own.
I think it's player:getVehicle():getForwardIsoDirection()
or getForwardMovementIsoDirection() if that works better for you
- Idk about 41, I never messed with vehicles in 41
Im working on a mod for jumping over desks and counters etc i've been looking at some code that others have done outthewindow guy and trying to get context menu to show up but even when i take his code directly and change the var names nothing appears but when i don't edit his it works local JumpOver = require('JumpOver/JumpOver')
function JumpOver.OnFillWorldObjectContextMenu(playerId, context, worldobjects, test)
local player = getSpecificPlayer(playerId)
for _, object in ipairs(worldobjects) do
local objects = object:getSquare():getObjects()
for i = 0, objects:size() - 1 do
local jumpType, jObj = JumpOver.getJumpType(player, objects:get(i))
if jumpType then
context:addOption(getText('ContextMenu_JumpOver' .. jumpType), worldobjects, JumpOver.onJumpOver, player, jObj)
return
end
end
end
end
Events.OnFillWorldObjectContextMenu.Add(JumpOver.OnFillWorldObjectContextMenu)
-------- local JumpOver = {}
JumpOver.jumpTypeDesk = 'TheDesk'
JumpOver.jumpTypeCounter = 'TheCounter'
function JumpOver.getJumpType(player, object)
return JumpOver.jumpTypeDesk, object
end
function JumpOver.onJumpOver(worldobjects, player, object)
print("[JumpOver] Jumping")
end
return JumpOver
new to the modding scene but experinced programmer
I just tested and it doesn't seem to work right or maybe I'm not using it right
it always says S
You're not hooking to any Lua events here
So it's never going to trigger
Wait
I know it exists SOMEWHERE because when you exit a vehicle it sets your character's angle to the vehicle's
Ok you need to put your code in code block here
Events.OnFillWorldObjectContextMenu.Add(JumpOver.OnFillWorldObjectContextMenu) what about this ?
Bcs it's unclear what is your code, if everything's in the same etc
Use code blocks please
You're making it hell
sorry will do
Also your snipet is unclear if it's your code or the one you copied
I actually need the radian not the cardinal direction, so while this does actually return something at least, it's a letter lol
What's your file structure here
this is my one
media/lua/client/JumpOver
and shared/Translate/En for the text
within the lua folder
Is your mod loaded ?
did you activate it
Add a print to the function being triggered, and see if it prints
which version
build 41
You've put a print right under JumpOver.OnFillWorldObjectContextMenu ?
At the start of the function
i had one in my old code yes
ill add one now and see if that helps
also i get this
no
Use that, don't add the game files to your Lua environment
I mean I think you can add it to your workspace but not sure
If you need them
Also Umbrella isn't downloaded as an extension
In case that's what you did
It's a Lua extension from the Lua extension (yes confusing)
yeah nearly did that haha
Yea some people make the mistake š
they use the term 'addon' to distinguish it a bit
Ah yea, I forgot the name
do you know whats the best practice to get sprite names from objects ?
there actually is an 'umbrella' in the extensions, it's something to do with dota, but we had the name first š
Get the IsoObject, and there should be methods to get those
However, there might be a tile tag to distinguish counters
That you could use
ik that's why I said some people make the mistake
do you enable umbrella in media folder ?
we might actually become an extension in the future so that might make it easier for people
Nice ! Why that ?
Not really, but you can check this out:
https://pzwiki.net/wiki/Getting_started_with_modding#Programming_environment
Thank you
- emmylua (which is seeming like the better lua language server) doesn't have an addon manager, and manual installation will be hard to explain
- the zedscript language server could be included in it
- forking emmylua to allow communication between the zedscript and lua language servers would be really cool
- forking the language server would also let us change some pz-specific things to work better
most of those are 'it would be really cool's though š
I loaded it up and the print doesn't do anything still
Alright
Sadly I have to go so I can't help more rn
ahh okay no worries thank you for the help
vehicle:getForwardVector() and you can calc the radian. really, there's probably a better way that I'm not finding
Can you give me a general idea of how to make a container accept only certain items? I donāt know of any mod that does it either. I remember trying it once and couldnāt get it to work. For clothing containers, the base game handles it and itās simple, but for world containers I remember I couldnāt get it done. If not, no worriesāI might try again one of these days and maybe Iāll figure it out.
time to declutter the inventory options. wish me luck
This is failing for some reason
Is it because I'm using getNearVehicle instead of getVehicle?
there isn't a way to do it for tile containers
that shouldn't make a difference, it returns a base vehicle.
I came across getAngleX, Y and Z. that might be better to work with
getAngleY is the only relevant one and it returns values 0, 90, 0, -90 (doesn't pass 90, so it there are 2 of every angle except for 90 and -90) where player angle returns an actual circle related values, pi/2, 0, -pi/2, pi. I don't know how I would differentiate between NE -45 vs NS -45 if I use getAngleY, and then I could convert that.
So for some reason the debug menu uses the proper full 180 and -180, but getting the value returns it as something else
I'm just gonna quickly force place the player in a seat regardless, take the player value, and immediately take them back out of the car
if all else fails of course
That's fine, I've tried a bunch of different variations at this point
It's time to jank it
me: bangs on keyboard until it does what you want
I hope this is a bug and not a limitation, or maybe we're just missing it
maybe you can get the vehicle poly and shoot out a ray along the y to get the angle. now, that's janky
vehicle:enter(0, player) vehicle:transmitCharacterPosition(0, "inside") vehicle:playPassengerAnim(0, "idle") vehicle:exit(player)
the solution all along
I really just had to turn the player to face the vehicle by quickly entering/exiting the vehicle lol
That's actually not that janky tbf
I say as my game crashes
I hate context menus
resisting. the. urggggeee
"jim, it would break other peoples stuff, just don't"
"but if you check recipeList:size() > 0 it works soooo welll unnnggg"
You can calculate the absolute vehicle direction from 2 of the angles, but can't remember the exact formula... You can tell which half of the full circle the Y values are based on the X or Z (can't remember which)
Can't check it right now, but I can post the solution I used later
Is food considered a consumable, like lighters and matches now?
Lets say butter; it has 3200 calories and 24 hunger. Are the calories the uses left? Or is it the hunger?
the hunger is
I think what I did is a lot simpler, but if any issues come up I'll look into doing it the "normal" way, thanks
I now have an actual working climb on vehicles thingy I think
Can someone help me with my custom professions mod?
hello all
first time here
if i would like to commission a mod, is this the right channel to make a request?
xD
Ill pay 10 usd to whoever makes a mod where you can dissolve zomboids in acid in barrels
@prisma hamlet @snow hatch
https://pzwiki.net/wiki/Unofficial_Modding_Discord
For commissions
thanks boss
i dont see the #audio channel here though...
Why do you care about the audio channel ?
That's not where you put commissions
the mod has to do with an audio mod
ah ok commissions
the wiki page is kinda confusing if i'm being honest
is the Unofficial Modding Discord this discord group?
nvm found it
If you don't read things ...
there was no discord channel link, but i already googled and found it
is it even called the Unofficial Modding Discord?
There's literally a link in the wiki page
I guess I can add an about template to not confuse it with the official Discord
No, it's the PZ Modding Community discord. I thought the unofficialness was implied. š
The reason I named the modding and mapping wiki pages like that was because of how confusing the name of the server was, since this place here also exists
Pretty sure I wouldn't have named it that way without asking either back then too
So we can change it back if you want
Then I'd do the same with the mapping one
I think the mapping one is actually has Unofficial in its name
For the modding one you could name the article "PZ Modding Community Discord (Unofficial)"
When Konijima and I were deciding on a name we both agreed unofficial sounded strange in this context
I just checked and the mapping discord has discord in its name
Reminds me of that API joke someone made in here
I like how "nil" is centered so well
Hey guys, I'm working on an Avrix plugin for a zombie kill counter. I've been digging through the ProjectZomboid-core-41.78.16.jar decompiled code but I'm stuckāI can't find where the game actually increments the kill stat. Any pointers? (Sorry for my English)
because some trees are not really trees? there's a couple trees so far that don't cast to IsoTree
isValid only checks if square:HasTree() btw
Maybe it's a bush
Evolved recipes are still a thing in 42, right?
I got a script load error just earlier;
ERROR: General f:0, t:1757204354967> ExceptionLogger.logException> Exception thrown
java.security.InvalidParameterException: Could not find evolved recipe or template: 'HotDrinkRed' in item: CKRations.CKRSugarCube at Item.OnScriptsLoaded(Item.java:4167).
Stack trace:
zombie.scripting.objects.Item.OnScriptsLoaded(Item.java:4167)
zombie.scripting.ScriptBucketCollection.OnScriptsLoaded(ScriptBucketCollection.java:166)
zombie.scripting.ScriptManager.loadScripts(ScriptManager.java:1925)
zombie.scripting.ScriptManager.Load(ScriptManager.java:1831)
zombie.GameWindow.initShared(GameWindow.java:160)
zombie.GameWindow.init(GameWindow.java:1377)
zombie.GameWindow.mainThreadInit(GameWindow.java:756)
zombie.GameWindow.mainThreadStart(GameWindow.java:598)
zombie.MainThread.mainLoop(MainThread.java:64)
java.base/java.lang.Thread.run(Unknown Source)
probably somewhere under ProjectZomboid/zombie, i saw some pointers in /characters & /combat but im not sure
though if you're specifically talking about incrementation, its probably a lua script sitting somewhere
I thought that too but it was causing an error with IsChopTreeCursor, no mods. Needed to make sure my shenanigans weren't borking it.
Yes
I think they still are a thing, tho I'm unsure if they still use the same params ?
as the error says, there is no such evolved recipe 'HotDrinkRed'
if you just add your item to HotDrink it should be added to the variants automatically
i ended up just removing it to fix the problem for the moment
but ive come across another problem; i'm gonna have to make a new liquid called "broth" since this recipe is now outdated
{
timedAction = Making,
Time = 80,
Tags = InHandCraft;CanBeDoneInDark,
category = Cooking,
inputs
{
item 3 [CKRations.BouillonPowderSachet],
item 1 tags[CoffeeMaker],
}
outputs
{
item 1 CKRations.CKRMugOfBroth,
}
}```
i intend to have it work similarly to the coffee
as i also had to rework that
{
timedAction = Making,
Time = 80,
Tags = InHandCraft;CanBeDoneInDark,
category = Cooking,
inputs
{
item 1 [CKRations.TinOfCoffee],
item 1 [*],
-fluid 0.2 [Water;TaintedWater],
item 1 tags[CoffeeMaker],
+fluid 0.2 Coffee,
}
outputs
{
}
}```
found it. its here
should i implement it in the existing mod module, or add it into Base?
{
Color = 0.556 : 0.713 : 0.462, , -- The color value here must be an RGB01 value ( Decimal ranges from 0 to 1. Alpha (transparency) input is not supported.
ColorReference = Brown, -- You can also use a plaintext color reference.
DisplayName = Broth,
Categories
{
Beverage,
}
Properties
{
fatigueChange = -10,
hungerChange = -10,
stressChange = 0,
thirstChange = -5,
unhappyChange = -10,
boredomChange = -10,
calories = 20,
carbohydrates = 2,
lipids = 1,
proteins = 1,
alcohol = 0,
fluReduction = 0,
painReduction = 0,
enduranceChange = 0,
foodSicknessReduction = 0,
}
}```
{
timedAction = Making,
Time = 80,
Tags = InHandCraft;CanBeDoneInDark,
category = Cooking,
inputs
{
item 1 [CKRations.BouillonPowderSachet],
item 1 [*],
-fluid 0.2 [Water;TaintedWater],
item 1 tags[CoffeeMaker],
+fluid 0.2 Broth,
}
outputs
{
}
}```
should work?
and then theres foraging
What metalworking items were removed ?
This recipe file was working a few months ago, and I'm assuming it has to do with changes to smithing items
it'd probably be best to look in the console, it usually points to where in the script the problem is
require "Foraging/forageSystem"
Events.onAddForageDefs.Add(function()
forageCategories["Rations"] =
{
name = "Rations",
typeCategory = "Food",
identifyCategoryPerk = "PlantScavenging",
identifyCategoryLevel = 5,
categoryHidden = false,
validFloors = { "ANY" },
zoneChance = {
TrailerPark = 10,
TownZone = 10,
Nav = 10,
DeepForest = 0,
Forest = 0,
Vegitation = 0,
FarmLand = 0,
Farm = 0,
},
}
forageSystem.addCatDef(forageCategories["Rations"]);
local MUnit = {
type = "CKRations.CannedCRationMUnit",
xp = 2,
skill = 5,
categories = { "Rations" },
zones = { Nav = 5, TownZone = 5, TrailerPark = 5, },
spawnFuncs = { doGenericItemSpawn }
};
local BUnit = {
type = "CKRations.CannedCRationBUnit",
xp = 2,
skill = 5,
categories = { "Rations" },
zones = { Nav = 5, TownZone = 5, TrailerPark = 5, },
spawnFuncs = { doGenericItemSpawn }
};
local KRation = {
type = "CKRations.KRation",
xp = 2,
skill = 5,
categories = { "Rations" },
zones = { Nav = 5, TownZone = 5, TrailerPark = 5, },
spawnFuncs = { doGenericItemSpawn }
};
forageSystem.addItemDef(MUnit);
forageSystem.addItemDef(BUnit);
forageSystem.addItemDef(KRation);
end);
also, this foraging lua doesnt seem to work anymore; its from build41. what changed in the foraging system where it has to be revamped?
i looked at the console, it only pointed to the script at line #22
Also found this here; https://www.reddit.com/r/projectzomboid/comments/1lz7nja/b42_exhaustive_list_of_all_foraging_items_in_the/
Ah, must've been why alot of mods broke on that update
Guessing Events.onAddForageDefs is duds then.
Something like this?
require "Foraging/forageSystem"
Events.preAddCatDefs.Add(function()
forageCategories["Rations"] =
{
name = "Rations",
typeCategory = "Food",
identifyCategoryPerk = "PlantScavenging",
identifyCategoryLevel = 5,
categoryHidden = false,
validFloors = { "ANY" },
zoneChance = {
TrailerPark = 10,
TownZone = 10,
Nav = 10,
DeepForest = 0,
BirchForest = 0,
Organic Forest = 0,
Managed Forest = 0,
Primary Forest = 0,
Forest = 0,
Vegitation = 0,
FarmLand = 0,
Farm = 0,
},
}
forageSystem.addCatDef(forageCategories["Rations"]);
end);
Events.preAddItemDefs.Add(function()
local MUnit = {
type = "CKRations.CannedCRationMUnit",
xp = 2,
skill = 5,
categories = { "Rations" },
zones = { Nav = 5, TownZone = 5, TrailerPark = 5, },
spawnFuncs = { doGenericItemSpawn }
};
local BUnit = {
type = "CKRations.CannedCRationBUnit",
xp = 2,
skill = 5,
categories = { "Rations" },
zones = { Nav = 5, TownZone = 5, TrailerPark = 5, },
spawnFuncs = { doGenericItemSpawn }
};
local KRation = {
type = "CKRations.KRation",
xp = 2,
skill = 5,
categories = { "Rations" },
zones = { Nav = 5, TownZone = 5, TrailerPark = 5, },
spawnFuncs = { doGenericItemSpawn }
};
forageSystem.addItemDef(MUnit);
forageSystem.addItemDef(BUnit);
forageSystem.addItemDef(KRation);
end);```
Worked!
Kind of. At least i loaded ingame this time.
Hmm.
Max foraging, not here.
Im gonna have to guess the game couldnt interpret the category
Thanks, ill work on it.
Referenced yours, i dont think i need to move the item defs anywhere but yours did not mention any; is it stored in a separate file?
Note: I did add Events.preAddCatDefs.Add(CKRationForageCatDefs); after posting this
Found this as an example in the faq also; local appleDef = { type = "Base.Apple", zones = { Forest = 1, }, categories = { "ForestGoods" }, months = { 7, }, xp = 10, };
Doesnt skill essentially lock it? Theres no skill associated with finding rations on the floor..
Or is it towards the foraging skill?
Alrighty. For the record, i'm updating one of Arendas mods to b42 (with their consent of course).
Ill see how to implement this
Ill first try it in the same file, for now.
I feel like i'm missing something. Category still not appearing.
Set the foraging skill to 5, nada
It did give me this earlier: ```SEVERE: Error found in LUA file: C:/Users/nikol/Zomboid/Workshop/[B42] C&K Rations/Contents/mods/[B42] C&K Rations/42/media/lua/shared/Foraging/CKRations_ForageDefinitions.lua
ERROR: General f:0, t:1757213207765> ExceptionLogger.logException> Exception thrown
se.krka.kahlua.vm.KahluaException: CKRations_ForageDefinitions.lua:18: '}' expected (to close '{' at line 12) near Forest at LexState.lexerror(LexState.java:278).
Ill keep an eye out for commas, added that
No result.
I see, i added those commas after you told me there might be some missing commas.
Noted
Playtesting now
Nada
Something about line 12 in the file?
Thats when the zonechances are mentioned
List might be wrong and causing issues.
Not sure where to find it, this is where i found some of them from
I have been
I'm updating the mod TO b42
Uh oh
require "Foraging/forageDefinitions"
require "Foraging/forageSystem"
local function generateFirewoodDefs()
local firewood = {
SmallLog = {
type = "JB_Big_Wood.SmallLog",
skill = 0,
xp = 5,
categories = { "Firewood" },
zones = {
DeepForest = 3,
OrganicForest = 5,
BirchForest = 4,
PRForest = 3,
PHForest = 3,
Forest = 2,
Vegitation = 1,
},
bonusMonths = { 9, 10, 11 },
itemSizeModifier = 5,
isItemOverrideSize = true,
},
}
for itemName, itemDef in pairs(firewood) do
forageSystem.addForageDef(itemName, itemDef)
end
end
generateFirewoodDefs()```
not sure if that helps ya but this setup works great for me on 42
will forever hurt my spelling bee heart that vegetation is spelled wrong
where did you find the zones at?
let me go dig in the game files for a proper list...
might be in the faq too
it was
wish I had thought of that before digging through the translation files last week
so i dont need Events.preAddCatDefs/Events.preAddItemDefs?
aw
the function call at the end adds it to the forage defs when the mod is loaded. I'm not messing with much so I didn't. you may want to depending on what you're doing
YES
Now its time to see if it appears or not
actually
code works; too scared to mess with it.
I'll go to making sure all the craftRecipes and such work,
Appreciate the help!
if you have a look at lua\shared\Foraging\forageSystem.lua it lays out what to use and why
think this will work for coffee from a coffee machine in b42?
module Base {
craftRecipe MakeCoffeeMug2
{
timedAction = MakeCoffee,
Time = 40,
OnCreate = Recipe.OnCreate.MakeCoffee,
category = Cooking,
Tags = CoffeeMachine,
inputs
{
item 5 [CKRations.TinOfCoffee],
item 1 tags[CoffeeMaker] mode:destroy flags[InheritColor;InheritModelVariation] mappers[mugShot],
-fluid 0.2 categories[Water] mode:mixture,
}
outputs
{
item 1 mapper:mugShot,
}
itemMapper mugShot
{
Base.HotDrink = Base.Mugl,
Base.HotDrinkWhite = Base.MugWhite,
Base.HotDrinkSpiffo = Base.MugSpiffo,
Base.HotDrinkClay = Base.ClayMug,
Base.HotDrinkCopper = Base.CopperCup,
Base.HotDrinkGold = Base.GoldCup,
Base.HotDrinkMetal = Base.MetalCup,
Base.HotDrinkSilver = Base.SilverCup,
Base.HotDrinkTumbler = Base.GlassTumbler,
Default = Base.HotDrinkWhite,
}
}
}```
alright so it just made the coffee machine menu impossible to open
I wish there was a mod that added more animations like the character fanning himself in the heat, shivering from cold or fear, tiredness animation, clumsy walking when drunk, holding his nose near bodies
or a mod that automatically allows the character to adjust their clothes according to the weather, lift their sleeves, open their jacket, stay in just a shirt, tank top or go shirtless or wrap up and automatically put it in their backpack or take it out of their backpack and get dressed
does anyone have any idea how to add new craftRecipes to the coffee machine menu? i know theres some way to essentially overwrite the existing craftrecipe but i forgot what it was
in b42 ofc
Whats the best way to check the sprite name of a world object using lua
for example check if the item clicked on is a desk
get the sprite name and do a regex string check
You can also check if the tile has a desk property of some sort
But I doubt it, best it could have is a table surface tag of some sort which is used for recipes
want the object name not the floor tile is worldObject not the right one to check
This is so stupid lol
Wait what are you trying to do ?
Why do you get the objects in the worldobject entry
Just use the worldobject you right clicked ?
You're iterating over the worldobjects, so you get the right clicked objects already
Why do you bother going over the objects on the same tiles as every objects
getJumpType if this returns something every time, then jumpType is true everytime and you end up returning directly, so you skip every possible objects
ahhh okay thank you
hello all , just putting this idea out there i have no idea how to make mods but i have an idea for a mod in MP servers if there is a permadeath enabled. having a way to resurrect your friends in game, how that's done is up to you guys could be ritual at some church with specific candles found around the map, really whatever also can have some negative traits applied for some time after resurrections. it would give purpose to some of the map also some items , like the crucifixes neckless found sometimes.
You guys know if it's possible to make zombies to not have stunlock when they get shot or hit? 
Yes, I had done something like that, but due to the game being a fucking piece of shit regarding zombies, my method no longer worked for shotguns specifically
This would work perfectly for me. I'm trying to make a special zombie (blodsucker from stalker) to not have stunlock while others do. If it needs a shotgun to the face to stop it, this fits even better in the atmosphere. Can you please share your knowledge on how this could be done?
Thank you! ā¤ļø I'm kind of a newb when it comes to coding. Hopefully I'll figutre out how to copy and paste some of that code.
But the character does it naturally?
why are my new mods textures missing? ohhh, how'd that happen?
if i wanted to make a voice pack for personal use only, would it be as easy as taking one from the workshop and swapping out the sound files?
probably, yeah
You expect us to go over all of these entries one by one ?
I highly advise you at the very least setup an easier to manage table for the loot distribution which will make both your life and our lives easier ...
apologies
ill look over it
take the recycling bin shortcut out of your mod folder dummy
as much time as I'm spending on debug info, I should probably just leave it all in the trash can
and it's only getting worse
Why not use other colors too ?
well... really, because they don't show up as clear as the green. I thought about it though
Fair, you could also just make it a UI panel with a transparent background
too busy making cursed tables that gives the linter a heart attack
unnng, donnnt
already thinking about re-doing the log textures to match vanilla better since I had forgotten about the camp logs and log containers, etc
and uhh, tree stumps when you kill a tree that you have to dig up with a shovel or pickaxe
and if I knew how or if I could rotate a tree sprite, I would have falling trees too
literally anything to never finish this mod
Shouldn't be too hard, just look at any mod that renders stuff in the world
https://steamcommunity.com/sharedfiles/filedetails/?id=3474836069 I saw this one and learned a bit about the render system from it
best I can tell the period he renders causes it to appear under the characters.
but oddly enough not always. I dunno exactly what the depth is based on because when I tried similar in B42 it seemed I had 0 depth
(always rendered above)
well b42 is kind of The Depth Update
so i would not be shocked if there are behaviour differences there
ahh ok, makes sense
you want falling trees animations?
I do. I did a cursory look in to it but came up empty. Really thought I could just rotate the sprite but I didn't see any provisions for it
that and I'd like to learn how to spell
can only offset
i can make you some falling tree animations, i think it would look cool
a lot of different trees though š
yesss, that's why I was hoping to just rotate the x,y and make it fall
could do a few frames then do offsets
I don't know how hard any of that is. I looked at blender animations and blanked. I'm pretty sure y'all are geniuses knowing how to make animations
Id just take the sprite and do it frame by frame into a spritesheet then in ontick have the tree change its sprite to each frame until it gets to the end
that sounds like a lot of work, and there's probably 40-50 different trees
I would not be adverse to it if you did one so I can see how you did it?
sure. I might be able to do a few in like a day or two
I think making the font white or light-colored with black outline/shadow can also make them stand out?
take your time. I really appreciate it!
ya, I was thinking yellow with black shadow. I'll mess with it and make it pretty before I release it for sure, probably as a mod option to turn on/off
is losing square in ISBuildingObject a normal thing? I lose the square reference every other frame and it's driving me insane
frame/tick/render - idk
forget all that, y'all know I'm an idiot somost of the time.
Is it possible to make a mod that gives characters "memory" by connecting zombies who had relationships with the character when everything was normal?
I don't know, for example, when the character enters the house of someone they know, they have memories of the moments they shared, like: "Oh... [name] and I used to play video games in this room when we came home from school..." (triggering sadness).
That kind of detail would be interesting, having a character who remembered the friendliness of the grocery store employee, you know...
Like a character's lore with others communicating with you via radio, reminders left behind, and things like that.
yeah that could be done
we'll have to wait until build 43 to see that. :/
Why?
Why do both, player:setForwardDirection and player:setDirectionAngle, come with excess twist? Shouldn't it be instant? Why is there a turning animation for setting player direction?
If there is anyway to skip that whole twist thing, I'd like to know
hello, im trying to make a mod that logs exp granted from admin powers, any idea what the trigger word might be?
cause Events.AddXP.Add(onAddXP) only logs exp from doing regular grinding stuff, ie, dismantling furnitures
this is for b41 mp btw
That's completely doable
You'd have to look in the admin menu how it gives xp and either find where you could hook, or directly hook to the admin menu
You could also possibly hook to the java function being called since it's being called lua side
hmm ill do that, thanksss
The best I could figure (at least in B41) was setting the turning speed very high so it would seem near instant, but then you would also have to set it back
Hi all !
I mod on b42, but my mod don't want to appear in the in game manager...
All the files are the same in different folder
You can always learn !
See the mod structure again, you're missing some folders here
And how would I change that?
player:setTurnDelta
Met dans utilisateur/zomboid/mods et pas dans workshop
player:getTurnDelta() returns nil, so that's strange
Hmm. At least it did work in B41. But there seems to be player:setTargetAndCurrentDirection in B42 that rotates the player instantly
It uses the same vector2 as the player:setForwardDirection
Oh yeah, that worked instantly, thanks
Where'd you find out about that long named setTargetAndCurrentDirection ?
I searched the IsoGameCharacter.java from the decompiled files for something that looked right. It is also in the java docs, but then you don't really know what the functions are supposed to do
a bad nights sleep has pushed the stupid mostly to the back of my head... for a bit. I still can't type like a normal human, though.
Digging a tree stump. It's not perfect but it's close enough.
What's up with that line thing lol
Did you make that for your mod ?
it's a debug option. I can't remember what it's called tho
Debug Options / PathFind / PathFind.Render.Path
Think I just posted this in the support channel but I fear this is actually the right channel so apologies;
I'm currently creating my own mod (my first one) which is tailored off a mod I saw an old friend make but I want to remake it for my own server. "Loot_StashGraves" which makes graves lootable containers capable of stashing items. Currently I have the mod "finished" but my server isn't recognising the mod - I think I have it in the right spot in FTP via gportal.. so now I'm wondering if I wrote the mod structure wrong and am wondering if any knowledgeable people would be willing to take a look at it?
Currently looking to make friends in modding that can help me navigate this space as I have a lot of great ideas i'd love to bring to the game. In return, when I'm informed in a space, I'm an exceptional friend to have around for theory-crafting/testing and would have no issue assisting on a friends mods as well ā¤ļø
Feel free to DM me (sorry about novel)
It would be great if, when a pipe bomb explodes, the windows of vehicles and houses also break, and fences and similar objects get destroyed too (textures from the More Destroyable Objects mod could be used)
Do it š
Iāve got no clue at all
Merci de la rƩponse, j'essaie Ƨa demain, mais pour toi, y'a un fichier manquant dans ma structure ?
Je t'ai envoyƩ la page wiki qui resume le tout
Il te manque beaucoup de dossier lĆ
Relis la page wiki, tu vas trĆØs vite capter ce qui manque en une lecture
Il te manque Contents/mods
Va vƩrifier Ƨa
Et non tu travailles pas sur les mods depuis le dossier zomboid/mods
Pareil, je t'invite à lire la page wiki sur le sujet, j'ai écris en détail pourquoi il est fortement conseillé de ne PAS utiliser le dossier mods
Tu test localement comment ducoup ?
Le dossier Workshop est load dans le jeu
Les mods dans le dossier Workshop sont reconnus par le jeu
Vraiment, lis la page wiki, je déconne pas, c'est LA page qui a eu le plus de travail sur wiki modding et les détails de pourquoi et comment sont très bien expliqué normalement
Je lirais en détail tout ça demain, merci, j'ai déjà été dessus avant de trouver ce discord.
Mais nativement dans les dossiers du jeu faut donc crƩer le folder content et mods ?
Comment Ƨa dans les dossiers du jeu ?
C'est dans les dossiers de ton mod
Tu verras Ƨa sur la page wiki
Merci en tout cas !
Je vous redis Ƨa demain š
š
mfw my image is exactly 2.00MB by coincidence but steam won't let me upload the image because is too big
let me just shave off a row of pixels rq
It's finally done, climbable vehicles
I'm hoping people consider their weight when jumping off a vehicle before splatting face first on the ground lol
Good thing for most vehicles I have the "height" set to just before it plays that recovery animation, so damage should be minimal.
Me omw with a full set of scrap metal armour to jump off the back of a bus
i regret my lack of faith š
You joke about this, but someone will legitemately do this and then get mad at me lol
"your mod killed me!"
As someone who regularly carries like 60lb duffle bags of groceries,,,,, Falling over with that weight can kill you

Can't imagine it would be any better as a suit of metal around ya
Oh it will, specifically in B42, they gotta make it a little less harder to die from something like that lol
The range from wearing nothing to everything being the difference from no damage to instant death is crazy
You should never be able to die from 1 floor up, flat out simple as that. I don't care if you're carrying a damn piano on your back
Gonna see a couple negatives pop up in the reviews lol
The next update is going to be a vehicle reworking and all this work will become meaningless lol
Hello!
Do anybody knows if it's possible to extract the array of existing in game npcs names?
It seems there's nothing in the Output decompiled folder
Je ne travail pas directement dans le dossier mods, j'ai un fichier PZ modding sur mon deuxième ssd j'utilise mods uniquement pour les tests mais tous mes fichiers et assets sont présent dans un autre dossier ailleurs sur mon pc
Après si ma méthode n'est pas la bonne pas de problème on est ici pour apprendre ^^
Nice work! Did you manually define the walkable area for each vehicle type or calculate it automatically?
I found it best to insert numbers, reset the file, and test it out to see what fit best for each vehicle type
Having it done automatically sounds more difficult than just plopping in numbers lol
Yeah. I'm working on a license plate mod, so I did the same for their locations. But then it only supports vanilla vehicles
I tried calculating the positions from the physics box, but then it depends on how accurate the modder made it. Doing it properly would require some kind of raycasting or analyzing the mesh manually
The only file I've found is 13 y o
https://github.com/gzhernov/project-zomboid/blob/master/src/zombie/characters/SurvivorFactory.java
Oh yeah... manually getting through every modded vehicle is gonna be a pain, but it's not like I have any other plans for my mod, so this is the equivlant to placing farm tiles on a modded map when you just finished building the city lol
congrats man
Tu peux stocker des assets en plus directement dans le dossier Workshop, c'est pratique pour tout garder au mĆŖme endroit
Oui c'est vrai je vais me pencher la dessus les prochains jours et puis ça ne m'empêche pas de garder mes sauvegardes sur mon autre ssd, merci pour tes explications et ton retour
Hey, quick question
Iād like to create a mod which allows me to place zombie spawn locationd at specific areas in my map mod so I can have guaranteed zombie spawns in specific locations. Does anyone have any reference mod or any direction they could point me in so I could even begin figuring out how this would work?
refer to vanilla horde manager admin panel for the spawn function
shared/NPCs/MainCreationMethods.lua
not sure for b42
Fixing Fix 1T1Ak47
{
Require : 1T1Ak47,
Fixer : BlowTorch=5; SheetMetal=3; MetalYay=4; MetalPipe=2; Aiming=6; MetalWelding=4,
}
I want to add repair to this weapon. But I must be doing something wrong and I can't seem to add repair.
build 41
Hey all! I installed all the extensions that the wiki is suggesting, but I still get stuff like: Undefined global ModData.Lua Diagnostics.(undefined-global)
Is there a way to make VScode understand stuff coming from the Java part of the game? Not sure if I missed something...
Salut, j'ai fait comme Ʃcris sur le wiki...
J'ai cette erreur
[09-09-25 16:13:21.740] WARN : Mod f:0, t:1757427201740> ChooseGameInfo.readModInfoAux > can't find "C:\Users\Utilisateur\Zomboid\Workshop\StaticMerchant\Contents\mods\StaticMerchant\common\mod.info".
[09-09-25 16:13:21.741] ERROR: General f:0, t:1757427201741> ExceptionLogger.logException> Exception thrown
java.lang.NullPointerException: Cannot invoke "zombie.gameStates.ChooseGameInfo$Mod.getId()" because "<local4>" is null at ChooseGameInfo.getModDetails(ChooseGameInfo.java:205).
Stack trace:
zombie.gameStates.ChooseGameInfo.getModDetails(ChooseGameInfo.java:205)
zombie.gameStates.ChooseGameInfo.getAvailableModDetails(ChooseGameInfo.java:222)
zombie.modding.ActiveMods.checkMissingMods(ActiveMods.java:219)
zombie.ZomboidFileSystem.loadMods(ZomboidFileSystem.java:924)
zombie.GameWindow.init(GameWindow.java:1347)
zombie.GameWindow.mainThreadInit(GameWindow.java:756)
zombie.GameWindow.mainThreadStart(GameWindow.java:598)
zombie.MainThread.mainLoop(MainThread.java:64)
java.base/java.lang.Thread.run(Unknown Source)
.
J'essaie de mettre un mod.info dans le folder common, au cas ou
Ducoups ce n'Ʃtais que Ƨa, je vais essayer de lancer le bouzin pour tester le code
Quelle version du jeu ?
Aussi pour la suite je t'invite à demander de l'aide en anglais, comme ça n'importe qui peut t'aider
Et perso je ne suis pas l'assistant perso des gens et je préfère que n'importe qui puisse venir aider à n'importe quel moment
42
Je comprend, mais comme tu m'aidais hier, je me suis dit que ce serait plus simple.
Plus de soucis, j'ai corrigƩ, maintenant je planche sur le LUA
š
Hello everyone!
I wanted to know how useful AI (Gemini, chatgpt) can be in mod creation on PZ.
Mainly for the LUA coding part (I'm much more familiar with UE5 and XML in general).
Can they help from A to Z?
Can they be used to modify an existing mod (without stealing the author's work, of course)?
No they can't help from A to Z
The Lua environment of PZ is different from generic Lua
So it's going to spit out wrong stuff and things that don't actually exist or are not available in the PZ environment
What if you show chatgpt for example how the game code in Lua looks then you ask question about what you wanna achieve being as most specify as possible, would the outcome still be pretty bad? š¤
It'll still fuck up
Because it still was trained on other data
Giving it examples, won't actually train it on proper data to learn how the Lua works
Consider the amount of data you have to feed AI to even teach it something, I doubt you're not teaching shit by just giving an example š
It'll copy the stuff in the example at best but it won't handle every case scenario
Yeah I see what you mean only way to get a proper AI to help is literally to train just for PZ environment which I dont think will happen at least not soon lol
A guy seemed to be interested in training an AI on PZ code tho
He claimed to have vectorized the game code
So eh, who knows
why aren't my textures available in the game? idk idk...
I hate myself sometimes
do recipe oncreate functions need to be in the client folder?
it should be like:
OnCreate:Recipe.OnCreate.InjectSyringe,
and then in another script:
--logic using player
end```
correct?
this is a build41 mod by the way
all the documentation i could find is updated to b42 which seems very different
apparently if the recipe function doesnt have player ingredient and result arguments it just doesnt work
also uh. how do i add a trait to a player through scripts because ive been referencing other mods and stuff and i just have no idea how to do it
every time i reference player i get "tried to call nil"
Is there a minigun mod in the game?
Sorry if this is a dumb question. Is anyone working on or interested in working on an AFK trading/vending machine type mod for 42 mp?
the Oncreate: will directly reference the function name. so it would be Oncreate:InjectSyringe in your case. It can be better to place it in a table to avoid overwriting so you can make the function name Recipe.OnCreate.InjectSyringe and it should work
thank you
i ended up figuring that much out and then had to figure out what arguments i needed, and now im trying to figure out how to set the infection level through script
player:getBodyDamage():SetInfectionLevel(int)
doesnt work for some reason
and i cant figure out how to set infection to false because the game has six different bools called some variation of "isInfected" all in the same script
that parameter is a float
i mean
getInfectionLevel returns a float 0-100
and either way i tried setting it to 0 and nothing happened
are you trying to do zombie infection or regular infection?
zombie infection
basically im trying to make an item that kinda halfway cures the player
i have a script that applies a bunch of extra symptoms based on the infection level
which it gets via player:getBodyDamage():getInfectionLevel()
but then i want to make it so it caps out the infection level so the player can't actually get to high levels of infection and therefore die to it
so for testing purposes i tried
player:getBodyDamage():setInfectionLevel(0)
end```
oh hold on a new development
print("Player infection level: " .. player:getBodyDamage():getInfectionLevel())
end
if player:HasTrait("Cured1") then
print("Player Cured")
if player:getBodyDamage():getInfectionLevel() >= 50 then
player:getBodyDamage():setInfectionLevel(0)
print("Player infection level: " .. player:getBodyDamage():getInfectionLevel())
end
end```
it seems that setInfectionLevel DOES do something in that it changes the infection level for like one tick then it goes back to whatever it was before
might need to change infection time also?
what does infection time do?
i tried setting it to 0 and it didnt change anything
i also tried setInfected(false) and this did nothing
i wonder if i need to set the infection level from client instead of on server
putting the script into client changed nothing
the folders have more to do with load order
only when working on a server and having it run functions i think it can only read from the server folder but the client can read from all of the folders
oh interesting
it looks like infection time should effect the infection level
ill make it print infection time too hold up
infection time seems to be properly being set to 0?
but it seems to affect the speed at which infection level builds? im not too sure
wait when im not infected, infection time is -1??
i think you are right it has to do with the speed
ok so i prayed to the ancient gods at the indie stone and for some reason it works now
if player:HasTrait("Cured1") then
print("Player Cured")
if player:getBodyDamage():getInfectionLevel() >= 50 then
player:getBodyDamage():setInfectionLevel(0)
player:getBodyDamage():setInfectionTime(-1)
player:getBodyDamage():setInfected(false)
print("Player infection level: " .. player:getBodyDamage():getInfectionLevel())
end
end
i have no idea what part of this makes it work
but it works
i didnt understand you'd want it cured. that is how you'd do that. i thought you wanted it to go up and down. i was going to suggest stopping it and then infecting again
oh yeah i do want it to go up and down
i want it to fluctuate between 0 and 50 infection level
the "cured" thing is an internal name for it thats not exactly accurate
hey so while i have you here do you have any idea how to make this do something?
local infectionGrowthRate = player:getBodyDamage():getInfectionGrowthRate();
player:getBodyDamage():setInfectionGrowthRate(infectionGrowthRate * .125)
i want it so when the player is in this "cured" state, the infection increases really slowly compared to normal
most ways i could do this feel really clunky except for the potential "growth rate" but once again, the growth rate is not actually being changed, it seems
this is all handled in java. the issue may be that it is tracking the numbers and updating them separate from lua so even changes you send will be changed back in the next update. I haven't done anything with infections so idk for sure , might have to do some janky stuff to make it work
i think youre right about that, it feels like my changes are being overridden immediately
not sure why all these functions and variables would exist then, though
ok so changing infectiongrowthrate DID work. unfortunately changing it does not affect the rate at which the infection grows
jank solution it is, then
now, what to do when the jank solution doesnt work
Oh my god I think I figured it out.
i swear to god. i think "setinfectionlevel" actually CHANGES the infection level by the inputted amount
nevermind, this isnt working at all
the game has completely stopped recognizing that my script exists at all, and im not even getting any errors
ok i was not correct. the one time this worked must have been some sort of black magic
hey guys, is there a procedure for commissioning mods?
which i can't share š«
Pinned messages
Has there been a mod to bring back carpentry xp when dissasembling?
not a mod, use sandbox options
I believe bitsbytes right about the sandbox option ?
oh i never saw i was looking through the workshop like a dumbass
I think I remember a sandbox option too yea, maybe check it out
You would have probably already seen a mod for it if that wasn't a thing I would guess ?
yah i was really confused why there wasnt one
anyone know where the source code is for how like bandages and disinfectant work, specifically what allows them to be applied to specific body parts? was unable to find it in lua so it might be java
you want where the code is for the functions like SetBandaged? yea that is in java
well iām just looking g for a reference for how an item is able to be applied to a body part
like how splints, bandages, and disinfectant can all be applied to injured body parts
iām looking for a reference on how to make a similar item
well you can make an item with canbandage and set its bandage power. then for how it looks it is a separate clothing item that is added when the chracter bandages themself
i see. thing is iām still working on that syringe thing from the other night and iām trying to make it so its injected into the player via the health panel, so a bandage thing would be a little too jank i think, but i have an idea of how to make it not janky if its my only option
you can add your own context option to the health panel and have it run a custom timed action
is there a surefire way to just get a specific isogridsquare from coordinates that doesnt require the square to be loaded?
idk what i did but this is messed up
no
if it's not loaded it doesn't exist
i'm trying to spawn zombies in a specific place in a specific building even if the player spawns in that building and nothing i have tried has come anywhere close to working
right now im resorting to this:
function spawnExtraZombies(player, square)
player:getCell():getGridSquare(60, 150, 0):getRoom():onSee()
player:getCell():getGridSquare(60, 150, 0):getRoom():spawnZombies()
end
Events.OnNewGame.Add(spawnExtraZombies)
those coordinates in the getgrisquare are cell coordinates right? and is 0 the correct z level for ground level? can zombies just not spawn at all in buildings that the player spawned in? because my first try was
createHordeFromTo(660, 3450, 661, 3451, 40)
this doesnt work in the building the player spawned in even if i set it to run every 10 minutes, it just refuses to spawn them indoors
it works outdoors but not indoors
atp im about to resort to spawning zombies outside nearby and playing sounds inside the building to draw them into that room
zombies don't usually spawn indoors so that might just be it
they can spawn inside a building the first time it is loaded but apart from that they're never allowed to respawn there
i don't think migration is allowed to put them inside either
well then im not sure what IsoRoom.spawnZombies() does
and the game spawns them indoors SOMEHOW when the building is firstloaded, i just need to figure out how they do that
ok so what im trying to do is make it so that the player spawns on floor 3 and zombies spawn on floor 1. could i possibly just make floor 1 a separate building so that zombies spawn in it, and stack floors 2 and 3 ontop?
Based on the lewis gun mag
If i might give my 2 cents, you might wanna try out Auto Shade smooth instead of Shade smoothing everything, I belive some sharp edges especially in grip and magazine area would make this gun look even better
Play around with diffrent degrees, i'd try with 50 for starters, just to make sure most of it is smooth, but not all, so like 80 degree faces will get the Sharp edge
the texture and model aren't final, this was genuinely just a random gun concept I thought of on a walk
It's a left handed mechanically drum fed semi auto pipe pistol that utilizes a chambering system similar to a luger lock
No need to bother with it so much, just wait like a few ticks before spawning the zombie no ?
When do you spawn them ?
why did they change setInvincible mechanics in b42? Before in BodyDamage.Update it looked like this:
} else if (this.getParentChar().isGodMod()) {
...
} else if (this.getParentChar().isInvincible()) {
...```
and now it looks like this with an unreachable else if:
```java
if (this.getParentChar().isGodMod()) {
...
} else if (this.getParentChar().isGodMod()) {
...```
Guessing this is a bug, is there somewhere else I could report this?
Yeah. Looks unintentional. There is a thread under this channel for modding related requests and reports
they tried to remove redundant cheats with b42, looks like a mistake here
does it actually cause an issue with the cheats?
It removes the functionality of "invincible", but it seems they also removed the option from the cheats menu
yeah they got rid of the weird redundant ones
if god mode still works as intended without it it's not really a bug, just dead code
but I needed it in my mod to not die but still retain wounds. God mode restores full health
so there was a definite use case for modders for invulnerability
There is a debug mod, where if you put off the blood decrease, you are invincible but have wound
For b42
They still kept the setter/getter functions for it, so not sure if it was intentional
what mod is that?
Debug mod
that's its name? where do I find it?
thanks I'll check it out
So is mod structure backwards compatible from 42 to 41.
Im talking about common and version folders aka 41 and 42?
thatās the thing, no matter when i spawn the zombies, they wont spawn indoors
i tried setting it to every 10 minutes, and the zombies will spawn outdoors but not indoors, its the weirdest thing
i don't think so 
eh its fine i gave up on spawning them indoors, nothing is working
No
In non of the buildings ?
iām not sure, itās weird and inconsistent. maybe it was the function i was using, but it was ācreatehordefromtoā that only seemed to be working outdoors
i also tried to get the room and do spawnZombies on the room but idk how that works
im gonna five it one last try and just go through the list of functions one by one and try all of them related to spawning zombies
Not sure what you mean
At least addZombiesInOutfit seems to spawn zombies also indoors
Yeah. Tested it in B42 with this local zombieList = addZombiesInOutfit(player:getX(), player:getY(), player:getZ(), 1, "", 1, false, false, false, false, false, false, 1) binded to a key
What's the point of making backwards compat from B42 to B41 in B42.. but not having one beforehand in B41 towards B42
Right, its just pointless 
It's like making a bridge that ends with 200 meters drop right before the destination.
There's no backward compat between B42 and B41
Wait what are you talking about here
Yea 41 folder isn't a thing
Bcs making a change now for common folder would require a lot of work on B41 side
And I agree with this method
You're in the middle of B42 dev or even more, you're not going to go back to the previous version. The change was for the future
VirtualZombieManager.instance:addZombiesToMap(numToSpawn, sq_roomDef, false)
do i reference virtual zombie manager as you did there? with VirtualZombieManager.instance:function
oh wait
addIndoorZombiesToChunk(IsoChunk chunk, IsoRoom room)
Wondering if TIS uses Umbrella for writing vanilla Lua code. š¤
Doesn't sound like it
definitely not, you'd expect to see at least a single type annotation in their code
True lol
We will get there.. One day..
I might get back to writing a transpiler using luaparse to lift code to Typescript.
yes
alright, thank you
you need to get the roomdef, and it will spawn it in that room specifically
if you want to spawn it in the entire bldg you need to loop the rooms in the bldg
Oh no.. It begins. I've been writing enough Python to start muxing my Lua code and question why it's syntactically wrong.
aaaaaaaaaaaaaaaaaaa
I did the if .. : and not if .. then
my other issue is how do i get the room definition of a specific room at specific coordinates? my issue has been that all the squares there are unloaded, so i dont have a way to get the specific room?
if all you need is the roomdef you can get that from the metagrid
oh my god theres literally a
getRoomAt(int x, int y, int z)
uhhhhhh im gonna try something, how do i reference IsoMetaGrid functions? (im very new to java and lua so im still really figuring this all out)
getWorld():getMetaGrid():getRoomAt(...)
local roomDef = getWorld():getMetaGrid():getRoomAt(square:getX(), square:getY(), square:getZ())
tysm
well if you have the square you should just do square:getRoom():getRoomDef()
Not really, its not that difficult to wrap directory pathing in existing environment, but whatevs, TIS has own way.
they messed it up a bunch for b42, if it was existing mods getting broken by an update to b41 people would've been pissed
uhhh so how about this writeup
local function spawnExtraZombies()
fillRoomAt(658, 3489, 0)
end
local function fillRoomAt(z, y, z)
local roomDef = getWorld():getMetaGrid():getRoomAt(x, y, z)
local chunkDef = getWorld():getMetaGrid():getChunkDataFromTile(x, y)
VirtualZombieManager.instance:addIndoorZombiesToChunk(chunkDef, roomDef)
print("Added zombies at " .. x .. ", " .. y)
end
Events.EveryTenMinutes.Add(spawnExtraZombies)
got the ol "object tried to call nil" somewhere in there but i dont know where
OH M GOD WAIT IT ACTUALLY WORKED
thank you for the help you two
oh nevermind every time i spawn into the building it despawns every enemy in the bottom floor uhhhh okay ill just change it to be like whenever anyone spawns in that building itll spawn them in
I have an animnode that worked fine in b41, now in b42 it doesnt play (everything else of the mod works fine), did with animsets something change?
yes, copy paste every anim node into the location it would be in if it was build 41
there's a longstanding bug with b42 that it still scans the original location for animnode files
but it does actually load them from the new location
it just won't see files that don't have a duplicate there
so you need both MyMod/42/media/AnimSets/player/state/foo.xml and MyMod/media/AnimSets/player/state/foo.xml
well my b41 code and structure is still the same so that should be fine
the other couple issues that can come up are that the state folder matters a bit more now, and you may need to set conditionpriority as well
if that doesn't work try adding <m_ConditionPriority>10</m_ConditionPriority> to the node
So I have this true music mod I want to update to b42 but it has a dependency requirement for the b41 version of true music and I don't want to disable the mod for b41
so how do I update the mod to work with b42 without making it unusable for b41 users?
That's just not how things work
It works in B41 if you have the B41 mod structure and it works for B42 mod structure, and you can have both exist together
And there's no "it depends on B41 veesion while on B42", that's just not a thing
This pahe goes in the details of mod structure and shows examples of combined B41 and B42
How do I make my mod have multiple sub mods like this?
The file tree seems to be the same
huh, in the workshop upload only the one is present
I forgot to change the fucking mod ID again how do I make the same mistake every time and never learn 
So I got to playing around with weapon mods again and got frustrated with the HitChance, AimingPerkHitChanceModifier and AimingPerkModifier and made this script to punch in some numbers to find what feels right for whatever weapon I'm working on.
Thought it might help if anyone wanted to know what to enter for these values.
Oops forgot you can type B to go back let me edit that
I did this with a test version of one of my mods and forgot to change workshop ID and it sent my test version to the live server >_< I feel you!
lmfao
s
so, I was panicking because suddenly my mod was bricking pz to the point you couldn't even open it
and I had already uploaded it to the workshop because all it does is change some vanilla values, what's the worst that could happen
so I'm freaking out, trying to figure out what's wrong
Go through everything on the debug log, eventually find something about assaultrifle2 crit multiplier not having a valid value
I go check it out and...
I randomly hit the W key while I was tying in stuff and didn't notice
that was it
that was the entire error
Yuuup that kinda thing is my alarm for its almost 6am, go to bed
2:43 am 
Good luck! Night all, hope the script helps someone. I hate random values!
How can I call my function when the grenade has landed and exploded?
Iirc the explosion is done on Java side so idk outside of a java mod. Might be a point in the lua that leads to it but I couldn't find it
Perhaps OnThrowableExplode event is what you are looking for
Thanks, thatās exactly what I needed.
Not sure if it's known, but there's a way to add new entries to B42 recipe outputmappers.
I was pleasantly surprised that it worked, so figured I would share in case someone else needs to do it:
Events.OnGameStart.Add(function()
local recipe = ScriptManager.instance:getCraftRecipe("SliceHead")
if recipe then
local outputs = recipe:getOutputs()
for i=0, outputs:size()-1 do
local out = outputs:get(i)
local mapper = out:getOutputMapper()
if mapper then
local list = ArrayList.new()
list:add("HorseMod.Horse_Head")
mapper:addOutputEntree("HorseMod.Horse_Skull", list)
mapper:OnPostWorldDictionaryInit(recipe:getName())
end
end
end
end)
I'll add that to the wiki, is OnGameStart needed tho ?
Probably not, I just don't know exactly when things are initialized properly and that worked so I just left it there š
I just call my functions when the script loads. all the recipes are loaded by then
I'll keep the script snipet as is until confirmed to work without the event
I can test it real quick
Since this section will be mostly full of known scripts that work to modify recipes
It's not anything too clean and just random info sent there
I like Alex's way better than mine, which just swaps inputs and outputs with other recipes
Yea but his method is only usable for itemMappers
Which wasn't possible in your case was it ?
I never had a reason to try with an itemMapper
I need to look at the java again. Something is picking at the back of my brain about items and mappers
itemMappers aren't something you just throw around as a solution ... Either it uses one or it doesn't, that's it
yep
So either you need to modify inputs/outputs, or itemMappers, those aren't the same thing at all
Seems the event is needed actually, I tried just doing:
local function addHorseHead()
local recipe = ScriptManager.instance:getCraftRecipe("SliceHead")
if recipe then
local outputs = recipe:getOutputs()
for i=0, outputs:size()-1 do
local out = outputs:get(i)
local mapper = out:getOutputMapper()
if mapper then
local list = ArrayList.new()
list:add("HorseMod.Horse_Head")
mapper:addOutputEntree("HorseMod.Horse_Skull", list)
mapper:OnPostWorldDictionaryInit(recipe:getName())
end
end
end
end
addHorseHead()
In both lua/client and lua/server, but neither worked
š
As far as I understand, a zombieās moddata disappears after the player goes to the menu and comes back, because the zombie isnāt saved and is recreated. How, then, can moddata for a zombie be preserved?
You could make it global moddata, though then its kinda hard to reassign it to the exact same zombie in question
@bright fog @willow tulip Following this, thereās no way to save a zombie, right?
Basically. You can 'sorta' do it, but not entirely.
There is one
But is not suggested for large amounts of zombies
It is to set the zombie as a dead survivor, meaning it will have an inventory and should be saved properly when reloading and be the same zombie
Neat.
I've personally never played with it
Boss zombies
I implemented a kind of grenade that applies an effect to zombies. The problem is that this effect resets after re-joining. So yes, I have to work with a large number of zombies.
well I can't find it so it must have been a fever dream. I thought there was an outputMapper reload triggered at some point. oh well
glad I didn't shake that 'dumbass' out of me
šŗ
How can I make a custom crafting station, like the forge in vanilla? I mean, the player clicks on it and a recipe window shows up. As far as I understand, recipes need to have a tag, but how do I actually create this station?
you need an entity script
not much (or any?) documentation of them currently, take a look in media/scripts/entities
Found it, thanks.
Yea I've yet to write the page about it
So yea to my knowledge, no docs about it
You trying to make a dog mod ?
Tamable wolves mod š
Been working on it for a few days now. finished a good bit so far!
my biggest step next will be coding a framework for the custom taming system ā plus some other AI logic stuff lol
but yee, expect to see a #1162438206516645948 for it very soon š
You managed to make all the needed animations ?
correct! right now, iām doing some polishing work on em in blender before importing everything in game. got anims for every state (including hopping over fences lol)
iāve been chatting with Alex & Paddlefruit on the side. theyāve been super insightful with the animation stuff especially
Wait you didn't test any of your animations beforehand ? š
Like in-game ?
not quite yet, lol š
Everything works fine in blender so far.
I was a bit overkill with my prep work overall (got 13 anims in total lol) xD
but yeah, iāve been doing my research on custom animals. if I run into any issues with getting things in-gameā I have a few points of reference to bug fix from
iāll be working on actually porting stuff in the next couple of hoursish
once that lines up, yāall can expect to see some more teasers and a #1162438206516645948 š
question for yall, if you wanted to make a map, is there any tools to like tile it somehow? using the vanilla sprites?
iād suggest checking out the mapping community 
they have a whole bunch of guides over there. You can also search for āDaddy Dirkieā on youtube. he has a tutorial playlist for mapping 101
im asking for someone else, but like damn this is helpful as hell, thank you frey for your input, i apperciate it
happy to help! I wish them good luck with their project. itās awesome to see folks interested in mapping! š
None around. One developer though...
thats it im calling the police
@tame mulch any chance your around? ^
(recommend you delete last hour when you ban @dense lagoon due to him spamming it 15 places on server)
lil teaser, yāall! š
a few of the anims are a tad bit janky (lol), but planning on fixing them later in the dev process
New wild animals will be awesome!
any suggestion on debugging a recipe script file for B41? all of the recipes for one of my files aren't loading. I've already made a test file with a single recipe that works fine
like are there any logs that might display some sort of error? or is it just quiet?
not sure how, but an empty break unicode character appeared at the start of the file. the other files i had did not have this character so unsure of how it appeared there
Vague screenshot with a lot going on in it
Fellow modders
I have this code made (reading chracter skills, and its level saved up in a .ini file)
then applying to the chracter again after revive
but Perks.perk works well with Vanilla skills
but if chracter has custom one, it will throw an error
wht will be the best solution for this?
<@&671452400221159444>
<@&671452400221159444>
maybe try something like this
yea i did that
did not work?
yeap
just tried and worked
ty
thought it wasn't working
but forgot to put FromString
that was simple fix. ty for ur help
This might be a dumb question but how would I get in contact with K15 I want a commissioned vehicle and am willing to pay well, does anyone know?
ummm maybe send him friend request?
I think you need to contact him through ko-fi but that does require you to be supporter so probably have to send him something, maybe with message?
Idea; sauce thst puts your survivor in agony
One of the hair mods I have installed has a 3 length tied hairstyle revert to the wrong untied hairstyle which also happens to be a 2 length. Is there a way I can edit the mod myself to just specify which hairstyle untying that ponytail should change it to?
oh right b41 to be clear
Which mod is it, you could contact the author?
Spongie's hair. Specifically, the kotone ponytail hairstyle changes to long (curly) despite there being an untied variant of the kotone hairstyle. If possible I'd like to just tweak it myself but I couldn't find anything related to untying on the wiki, at least in terms of the hair modding section.
By default it unties to vanila hairstyle from what i remember
So it's strange that it would cut your hair
Without modifying hairstyle.xml i don't think you can do anything and at this point i think is simply better to let original author know
actually now I'm unsure if long (curly) is 2 length I might've misread the xml file
@winter bolt In worst case scenario i'll take the blame 
but regardless I couldn't find a way to change my hair to that kotone untied style in game
oh yeah I did misread I was looking at the texture name not model. Idk what length long (curly) is.
If i remember correctly you keep your hairs lenght if you tie hairstyle into something, once its "cut" then yeah... you cut to that
So i make my hairstyles "tie" so you can always revert it
Even if they do look shorter
oh honestly nvm I did a little more digging and apparently spongie has a separate mod that lets me change it to the right hairstyle
when you pick a ponytail in character creation the game defaults you to long curly
Can someone help me? Please. Lol. I simply want to make a personal use mod to create some posters with my family pictures to place in my base and I have no idea where to start. Google makes it seem to be straight forward, but I think I need a bit more help than AI can deliver
i made a mod that makes making tile object posters easier its a little jank and needs updating but it works. theres also a different one called Support Goods that uses a placeable 3d item its simpler because you just need to place the pngs in a folder
Is there anyway to simplify making them lootable in game, so I don't have to use debug to get them?
can the tile object be picked up already?
if so you can add them to inventory as a movable
I'm not sure. I created the mod using AI instructions, but it says at the end how to enable the debug menu to spawn the item and I don't want to do that, I want it to spawn in the world like other items. So I'm not sure if the mod even took tbh.
This is literally my first ever attempt creating a mod
ai doesn't know enough about the zomboid api and often makes things up. if the code is even any good you need to add the items to the ProceduralDistributions table to have it spawn in the world
anyone knows if Safehouse
getId() returns persistent value?
How possible is it to ask ChatGPT to help create a mod if I have zero modding experience?
not very
the issue with chatgpt, claude, gemini, etc⦠all of those ais are trained on much different data than PZ.
Zomboid is a very unique coding environment which those AIs simply arenāt equipped to handle
as a result, the AI will make up stuff & hallucinate and give barely-usable output
in theory it is possible to train your own AI⦠but that in of itself is a whole can of worms
tldr: when you give the AI a prompt like āgenerate code for Project Zomboidā it will pull any code it gives you from everywhere else except the actual game
Then, what do you think of the code it generated for me?
https://chatgpt.com/share/68c77348-8e18-8013-a690-cdbb17184b54
Or maybe I can start from somewhere and do a trial and error
Don't. Instead, find a mod that does something REMOTELY similar to what you wanna do, then start changing it.
you will be 100x better off
That seems like pz code is actually in the training data
don't listen to them guys here, do it š
might be interesting
it sure is trying. it looks like pz code but is it really doing anything?
i finished my first mod! i added energy drinks with custom mesh/Textures!
I donāt think it works, but there for sure is pz code in the training data
Anyone know if there is way to increase range of sound from BaseCharacterSoundEmitter?
zed:getEmitter():playSound("examplesound")
think i answered my own question for anyone who ctrl fs a problem I hadn't defined the sounds in scripts so its all just wacky defaults šš»
Please disregard --
I tried with setCanPerform and setLuaTest, won't work
Edit: Ended up overriding the actual recipe txt so I would be able to add OnCanPerform
the item is written as wearables but the code is expecting the fan to be equipped on the players right hand
might also cause syntax error cuz the item isnt drainable
So, the easiest way would be using Lantern mod, replace the light part with temperature part?
interesting. My guess is since enough people have tried feeding gpt data (including what itās learned from prompts) - it actually does have some training data.
with this in mind though, itās giving disjointed code probably because there simply isnāt enough training for reference. itās likely working with tiny snippets of examples, but not the bigger picture.
For one, Iām skeptical GPT has the game files vectorized in its database
does have knowledge of javadocs too but still hallucenates enough that gotta take eerything with a grain of salt
Can be a great learning tool though I started out using chatgpt loads to write functions from scratch and overtime it becomes more effecient to check documentation and great forums like this when you run into road blocks
people kind of overestimate what ai does and how it works, yes it has a general awareness of PZ, but it still won't use it properly and will happily make things up as soon as you ask it something tricky
these days it can make something that looks convincing but unless it's very very simple, it won't actually work and without learning the skills yourself you won't be able to debug it (and at that point, why even use ai)
Can I add a custom clothing patch with custom parameters?
Or is there a way to increase protection for a specific body part on a specific piece of clothing as much as I want, like patches do?
idk if thats possible. you can change the clothes defense levels but modifying individual body part defense doesn't look like a thing on lua side, other than neck protection??? and applying patches is done in java by the looks of it. i didnt see if it checks for a patch already being there so maybe you can stack patches but i doubt it
Yes, I tried adding my own patch and changing the values of existing ones, but as far as I understand, the values are heavily hard-coded in:
Clothing$ClothingPatch.class
Clothing$ClothingPatchFabricType.class
Clothing.class
a work around i think might work would be adding custom clothing for each body part that isn't visible and has custom body attachments, then add these custom clothing when your custom patch is applied and set the defense levels
Hmm, sounds like an idea. I think itās worth a try, thanks.
can you pls tell me, how can I visually hide an item in the inventory and clothing on the player?
a clothing item without a model i think would hide the visuals. idk if you even need the item to be in the player inventory just instance it and apply it to the player, but youd need a custom attachment i think
And if the item isnāt in the playerās inventory, but just an instance, will it still be saved after reloading the game? I also tried setting the ClothingItem to a non-existent item or to empty, and in both cases errors pop up.
it probably wont be saved you can save that data yourself in moddata and apply it when the play rejoins. You need a clothing object instance to apply defense to. it is constructed with some string parameters, idk if they can be made up or have to exist
rename your Model_X folder to models_X
yes, also i suggest making the names lowercase, it is not case sensitive in windows but can cause issues for linux users
It's still the 32x32 textures sadly changed to lowercase m
did you restart the game? i dont think new folders load while in game
which it would be new to the game when renamed
Yeah I restarted and it's still the 32x32 textures
wait wait wait
"models_X" not "model_X" facepalm
lmao
i forgot, use the module in the model name
so MagicJellyBandage_Ground would be Base.MagicJellyBandage_Ground
in your item scripts
so would this be the correct setup? It was still 32
I can resend the now updated folder for you to see again if you want
your model script has no commas at the ends of lines
I think I added them correctly, it was 32
try lowercase model
alright I'm trying lowercase
YES
omg thank you
they're huge but I'll just scale them down
scripts are case sensitive in majority of cases
i havent touched scripts in a while and never did a lot of models so i was slowly remembering things
Welll I greatly appreciate it lol
Can you tell me if you know of a mod that adds such invisible to the player clothing?
You can do invisible clothing by doing 2d clothing with fully transparent texture
thanks
I want to make a mod that messes with the day and night temps but I've never touched PZ code, where can I get started with this?
ChatGpt
<@&671452400221159444>
Hello, stable version of our new essential mod...
so cool to use this kind of UI overlays system
https://steamcommunity.com/sharedfiles/filedetails/?id=3559529559
What's the function to set a player's weight? I can't seem to find it in the stats class and the "setWeight()" function I found elsewhere doesn't seem to do it.
local pl = getPlayer()
local nutri = pl:getNutrition()
nutri:setWeight(nutri:getWeight() + 3)
nutri:syncWeight()
ty
im trying to make b42 recipes but they just give me this option and i cant actually craft the recipe? i followed this documentation:
https://pzwiki.net/wiki/CraftRecipe
also for the record i cant actually open the "show recipes used in" dropdown
Share your recipe
craftRecipe boilCupNoodles
{
inputs
{
item 1 [ProjectGurashi.CupNoodles],
item 1 [*],
-fluid 1 [Water;TaintedWater],
}
outputs
{
item 1 ProjectGurashi.CupNoodles,
}
category = Cooking,
Tags = CanAlwaysBeResearched;RightClickOnly;AnySurfaceCraft,
Time = 200,
}
This game is really hurting for the implementation of render layer / render pass controls for Lua.
I'd mod this game to support it if adopted but that's unlikely.

UI would have such an insane boost of quality if one could add quest-like UI to the map where rendering comfortably with map tiles.
UI being locked to post-world renderpass is such a hard limiting factor.
It wouldn't be too hard to implement since the game uses a CPU-Thread render call instruction cache. It simply needs Lua events added to make possible so like a few lines of code and maybe some FBOTexture stores for shaders.
@bright fog sorry i forgot to ping
are there plugins to support Jetbrains Rider
you can use intellij which is jetbrains' java ide, it has a decent lua plugin, but it's still overall inferior to vscode
all my homies hate intellij
I'm just using both at the same time now lol. Reorganizing files with Rider but using the plugin from Vscode
Also am I able to add commands for the lua command line thing in the command console
bro casting spells ??
Is there a way to check what specific item/bullet is loaded in a gun mag ?
getAmmoType()``` checks the gun's AmmoType param.
And will return that value regardless of what ammo is loaded in the magazine
getAmmoType() on the magazine, not the gun
am I able to target a magazine loaded in the gun ?
and not just return the MagazineType = Base.9mmClip, param the gun has originally ?
probably not
to be straight up you might be really overestimating how guns work in this game
there isn't support for things like multiple ammo types, mods that do that use entirely original systems to do it
Yeah ik, I might have to fiddle with some stuff
Trying to think up a way to get different casing types functional.
Like steel/brass/aluminum/copper
I'm thinking there's a good chance I need to do some funky stuff involving applying mod data when refilling mags and stuff
definitely
there aren't 'bullets' in a gun/magazine, there's just an ammo count
the ammo type tells it which item to remove/add to fill/empty it, which is all that's needed when you only support one ammo type anyway
There is also the 'extra items' property, and while you can't store multiple items there, you could store the ammo type and it might make an icon of the current ammo type appear on mouseover?
(its used for evolved recipes)
And I think weapon mods?
extra items property ?
declaration: package: zombie.inventory, class: InventoryItem
I believe you store stuff like 'base.itemtype' in there
what's it do
Im 80% sure that it will automatically add the little icon of the extra item to the tooltip when you mouseover your mag
Like how gun mods can be seen on a weapon, and how ingredients can be see in an evolved recipe
Not that it changes how reloading or guns work, but it could give an indication whats loaded (assuming it works)
yo this could actually maybe help a lot though.
I need to check, but due to the nature of it, I think it might keep the order of items as well and not just sort them alphabetically or something
Which means I might be able to use getExtraItems to determine the current bullet type, which the casing ejection code should be able to check and update to the next casing :D
Im not sure if it will let you store duplicates of the same item.. Actually, I guess it does since the same evolved recipe can have multiple of the same ingredient.
it does, I'm currently checking to see if it saves the order they were added to the item or not
just note they arnt actual items: just strings
yeah ik
The value would be injected during the loading of the magazine itself, which would then be snatched and applied onto the gun itself
(And the game may do something horrible if you try to store anything except valid item typenames there lol)
So if you need extra data use moddata to store a table
And you might still wanna only hold '1' bullet type in the mag for anything over 6 rounds or so to prevent the UI from looking like a mess trying to render 30 bullet icons
Like, cool idea for tube mags for shotguns or rifles, bad idea for assult rifle mags.
idk how to do that š
You use getModData() on the item, and then you get this wonderful table that you can just edit and it saves it to the item
(Note: there is some update command you may have to use for MP compatability depending on if its server or client code doing the updating and I forget what it is since I don't mod for MP yet)
But basically you can just
local foo = magazineitem:getModData();
foo.MyImportantData = 10
no need on items
ah nice
foo.MyFancyData={x = 23, y = 42, moredata = {53, 53},} etc.
Just remember to init things (they will be null) before trying to read them. This idiom is commonly used:
foo.MyImportantData = foo.MyImportantData or 0;
foo.MyBigData = foo.MyBigData or {} -- Sets up a table for you if it doesn't exist yet.
Basically, this says "Assign it the value of itself!... or if it has no value, assign it this other value"
Is this data modified by each individual item? like will the moddata of one item share data with the same item type ?
Nope! its unique per-item instance
every player, car, inventory item (But not zombies so much) has persistent moddata that will save/load for you!
Just name your data something unique enough not to accidently trample someone elses š or TIS'es.
ie moddata.ammo = bad idea,
moddata.mycoolmod.ammo = awesome. moddata.mycoolmod_ammo = also awesome.
moddata.MCM_ammo = also awesome.
There is also 'global' mod data for data you don't want attached to anything in particular.
(Do note: you can only store POD data, ie tables, arrays, strings, numbers. You can't store functions in moddata, or fancy classes like inventory items)
how do I apply mod data to items š
just call item:getModData() to get its mod data
it's just a table, nothing weird, do normal lua stuff to it
yeah it displays them in order
YES, finally I can shoot tomatos at my foes. The will rue the day they made bad jokes in my general direction!
whats it like with 30 bullets in the tooltip? lol
Wonder that is there any channel for mod request?
Hello! Working on a sports card collecting mod, and have prepared a subset of card items with tags. I wish to call this specific set of tagged items during a recipe OnCreate function, but I can't seem to find a way to create the list in LUA by pulling items with the tag.
Is the only way to list out all the items for the table?
Or is there a way for the scriptItems:addAll(getScriptManager():getItemsTag("Tag")) to populate a table with item names?
i dont think you can do scripts using lua. but you can still achieve the same thing if you create the custom conext menu for it
Hello! I would like to join the modding community as a brand new modder working on her first mod. Is there a place/Discord for PZ modders?
Here and check pinned messages
iām looking into creating my own challenge, how would i go about that? by challenge i mean like cd/da or last stand where itās a custom scenario, would i use the project zomboid modding tool app or something else?
That's not really doable I believe, not directly at least
Been working on a luau transpiler for project zomboid. I am dying writing all the declared types 
(For those that donāt know luau is the equivalent of typescript is to JavaScript, luauās syntax is the same but supports type annotation)
Hahahahaha
My guy I was literally looking this way
Converting the code itself is easy š
Itās solving for all the updates require paths and weird syntax that is hRd
I wrote a few transpiled modding environments for PZ.
The main issue is having to translate a .luarc file into updated require paths
Luau uses luarc files to point to aliases
So instead of having to find every path you can say all games assets are contained within require(ā@game/fileā)
When I wrote a Typescript environment I had to post-render adjust the require paths and wrap re-imports in a custom PZ event to avoid broken requires.
My idea is Iāll likely regret all patterns so anything that starts with @ will instead be converted into its true file path
Ambient modules will probably cause headaches.
Probably, the hardest part will probably be defining all the classes project zomboid uses
As there is no documentation on .d.luau files
I had to learn via trial and error
Iād use dalbit but I really hate how it works
Iām likely gonna transpile it using lune
Check out Umbrella and Candle. It's all about what you're trying to do.
Candle more-specifically.
The issue is luau is very very very niche language
It was invented by Roblox and only has recently blown up for outside Roblox use
Iād argue itās better then regular lua just because of its type annotation system
as long as you know the format you're trying to write to, candle provides all the type data you need
