#mod_development
1 messages · Page 339 of 1
so i suggest those who are planning on uploading the mod today
to wait till the problem is fixed.
it's fine on single play but only problematic for dedicated serverss
I need a bit of help, im trying to make a cheat class for personal use, but the SOTO compatibility I added isn't working, cause it's not adding the traits I want it to add. any chance someone could take a look and let me know what could be going wrong? this is for B42 if it makes a difference at all here.
require ("MainCreationMethods")
RRProfessions = {}
function RRProfessions.DoProfessions()
-- REPUBLIC RANGER
local reprangerocc = ProfessionFactory.addProfession("reprangerocc", "Republic Ranger", "icon_reprangerocc", 10);
reprangerocc:addFreeTrait("NightOwl");
reprangerocc:addFreeTrait("Burglar");
reprangerocc:addFreeTrait("Desensitized");
reprangerocc:addFreeTrait("Marksman");
reprangerocc:addFreeTrait("Handy2");
reprangerocc:addFreeTrait("Axeman");
if getActivatedMods():contains("SimpleOverhaulTraitsAndOccupations") then
reprangerocc:addFreeTrait("AdvancedForaging");
reprangerocc:addFreeTrait("BreakinTechnique");
reprangerocc:addFreeTrait("HeavyAxeMyBeloved");
reprangerocc:addFreeTrait("UsedToCorpses");
reprangerocc:addFreeTrait("DemoStrongGrip");
reprangerocc:addFreeTrait("GasManagement");
reprangerocc:addFreeTrait("BladeTools");
reprangerocc:addFreeTrait("MinersEndurance");
reprangerocc:addFreeTrait("ImprovisedCleaning");
reprangerocc:addFreeTrait("PriestSpirit");
reprangerocc:addFreeTrait("EnjoytheRide");
reprangerocc:addFreeTrait("CommDriver");
end
end
Events.OnGameBoot.Add(RRProfessions.DoProfessions);
also the LUA file, incase it makes it easier to read
anyone know why if i change the weapon sprite of a firearm it no longer shoots?
how difficult would it be to implement, in lua, a conditional that checks if the character has a specific name?
local forename = survivorDesc:getForename()
local surname = survivorDesc:getSurname()
if forename == "name" and surname == "surname" then```
Checking for other mods in B42 is a tiny bit different
I tested it in b42. I used b41 documentation, so they should work the same
getActivatedMods():contains("\SimpleOverhaulTraitsAndOccupations") if I'm not mistaken, I'll check again
Sorry double slash
getActivatedMods():contains("\\SimpleOverhaulTraitsAndOccupations")
For B42
I don't quite understand, can you please explain in more detail?
I'm working on a simple mod (this is my first experience with modding), so i add a challenge to start on brandenburg prison, give the player certain clothes and weapons, so far is working, my question is if there is any way to change the sandbox settings, particularly I want to change the months after the apocalypse option
Thanks for the heads up!
{
itemType = Base.DaciaHood,
table install
{
recipes = Classic Mechanics,
}
table uninstall
{
recipes = Classic Mechanics,
}
model Default
{
file = PapucbodyBase_hood,
offset = 0.0000 0.0000 0.0000,
rotate = 90.0000 0.0000 0.0000,
}
anim Close
{
anim = JDR_HUMVEE_HOOD,
reverse = TRUE,
rate = 1.0,
}
anim Open
{
anim = JDR_HUMVEE_HOOD,
rate = 1.0,
}
anim Closed
{
anim = JDR_HUMVEE_HOOD,
animate = FALSE,
}
anim Opened
{
anim = JDR_HUMVEE_HOOD,
reverse = TRUE,
animate = FALSE,
}
}```
Is this the right way to assign custom animations of parts when I'm not using the standard ArmatureAction way?
Also, here is the def
{
mesh = vehicles/papuc|Js_Standard_Humvee_Hood,
shader = vehicle,
static = FALSE,
invertX = FALSE,
scale = 1,
boneweight = JDR_HUMVEE_HOOD 1.0,
}```
yeah, but it's not mine, I'm helping a fellow modder who makes clothes to make his first car and his animation system is different
I always used the standard armatureaction, he is using custom names for each part
I do use that single guide about making animated vehicle parts and if you do follow it, it works correctly
But yeah.. i do make custom names too
Man,I'm lost with custom names
Sadly in my case is usually trial and error untill i figre it out
As im only starting on animated vehicles. That would be my 3rd
I asked him for the obj file so I'm gonna make it my way
hey guys could anyone help me with this?
it doesnt matter which animation i use, the weapon sprite is the issue
Uh no
Check the modding Discord, people are working on this currently and found fixes
The model doesn't matter, you sure those two items are using the same script tho to properly compare ?
same script how?
i no longer have the scripts but this is for the knife
the only difference is two lines
WeaponSprite = Knife, SwingAnim = Handgun,
the working one was sprite handgun and swing anim stab
@bright fog
Actually yea what you sent is the reason, I just remembered a bit how it worked
Tho I'm fairly certain the animation is not what actually defines it to be a gun
But here that might be your issue yea
so do u have an idea on how to fix the fact that the knife model cant be used to shoot?
im thinking maybe using the handgun sprite on code but show the knife model in game
i found PrimaryAnimMask in the wiki
maybe something like that
The issue is not the model tho
Sadly I don't have your script or can't check it fully
Check the firearm guide, might explain some bits regarding that
But the model has nothing to do with the shooting
could u send it please?
i can send it if u want its only 2 scripts
I can't check it rn
Later maybe
is there a function for (visually) updating an inventory after adding an item to it via script? i'm using AddWorldInventoryItem() and it doesn't show the item in the ui until i shift+scroll
Sort of, and in fact you SHOULD run it or that can cause duplication glitches
Give me a sec to make sure what it is exactly, you need to trigger an event
triggerEvent("OnContainerUpdate")
okay, thanks
Go to media>Scripts>models.txt or something like that. You're looking for one that has Knife model script you're intrested in. Find it and Copy it into your mod but change it's id to something diffrent, Once you have that use this guide, go to "adding your attachments" and it will show you how to add muzzle attachment to it
sorry cant help you rn
my pc kept crashing
i think i got my os disk corrupted
Got it, thank you
ope yeah that worked out, thanks for the help ^^
hey if anyone does Java modding, im in the *testing phase for a modloader and friends™. here's some details:
- it's a fork of FabricMC/fabric toolchain but instead for Project Zomboid, since fabric is pretty hardcoded for minecraft. once leaf is installed into the game folder, clients and servers (servers are still a WIP, work for the most part but some features are missing) can download leaf mods through the workshop and when their game is restarted, the mods will be loaded.
- most people writing lua shouldn't be concerned about this yet, because it's only intended for java modding. Think things like engine changes, NPC mods, etc. This is not a lua library. it will be relevant in the future though, as you could for example add some java functionality for npcs, and then allow customisation and modifying further through lua (kind of like an api)
More information is pinned in the discussion thread in the modding discord (https://discord.com/channels/908422782554107904/1379702489250529280) if anyone is curious, or go to the example mod (https://github.com/aoqia194/leaf-example-mod) and do some fun stuff idk
* testing phase only because it's not on the verge of breaking 😂 its decently stable right now
I don't usually like to "sell it"/advertise but im pretty sure like 99% of people who do java modding for this game have no idea what I was doing for the past 1.2 years 😂
I gave up after 2 minutes of trying to get leaf working at 3am, I'll have a proper go of it.
I downloaded installer-1.1.0 from the leaf-installer repo, ran it, and added Zomboid64.exe -debug -pzexeconfig leaf-1.2.0-42.10.0-unstable.30053.json to the zomboid shotcut. When I run that it creates leafloader.txt with one line:
[12:15:30] [INFO] [LeafLoader/GameProvider]: Loading Project Zomboid 42.10.0-unstable.30053 with Leaf Loader 1.2.0
and that's it - Project Zomboid doesn't start up at all.
I'm not sure that's the correct way of installing it though
hey folks! anyone have any experience with adding new weather events to pz? perchance a guide or a good mod to learn from?
I've got some note son triggering existing weather, but not on adding new stuff - you'd have to figure out if what you want is easy to do via lua or if it's all in the Java code.
What sort of weather do you plan to add?
there is some explicit support for modded weather stages (literally a weather stage named 'modded') but i've never seen a mod that uses it or much indication of how it's supposed to work
Can i request a mod?
I need a mod that makes empty caned food store water and can also be boiled by fire
If the water bottle holds about 10 water units the empty canned food should hold 4-5 water units
Pinned messages, unofficial modding Discord to commission
Wait that's literally already a thing tho
Hey Sir Doggy Jvla, you around by chance?
Yea ?
I've had a couple people ask about integrating your infected skins from the last of us infected into my tlou bandits integration, but there's some sort of conflict between your mod and bandits, to my understanding that stops me from just making it traditionally. Any chance I can get your permission to pack the infected clothing items into my bandit integration? w/ credits, ofc.
First off, why do you need to get infected clothing/skins into a Bandits addon ?
I was told tlou infected wasn't compatible with bandits, but I see your forge changelogs which say it should be, so disregard this.
The reports are right, for the B41 version especially
The B42 version, the compatibility should have been improved
ah
But I still don't get what's the point of bringing the infected clothing into a Bandits addon 😅
It was something a few people were asking for. having the infected use bandits ai
yeah, I couldn't tell you anything beyond what was asked lol
Imo there's no point to it however, my TLOU mods are fully open source for the most part currently
but considering you seem to be working on compatibility of some sort, I'm going to let you handle that
I'm not working on my TLOU mods anymore
My TLOU mods are open source, and locked in open source (meaning if you use any assets, you need to leave those at the very least open source and public)
Only requirements is to give credit for any assets used
Does the problem with workhop downloads and updates still persist?
There's a few fix that were found
Also no point asking in every channels
Some channels get more traffic than others at different times of the day. Figured I might get an answer faster
Is it an official fix or is it more like a workaround?
It just sounds rude and like you're impatient, people here are willing to help freely but there's no point asking for too much, it's just rude
Not official, but not a workaround either
It's a Steam issue, not a game issue
That wasn't my intention. Sorry
Steam made changes to their API
Fix to servers not updating or downloading mods properly
The issue is caused by the steamclient being outdated.
The fix is simple: replace it with an updated version.
For Linux:
Delete the old steamclient.so.
Copy the new steamclient.so into both:
/serverfiles/
/linux64/
For Windows:
Delete the old steamclient.dll, steamclient64.dll, tier0_s.dll, tier0_s64.dll, vstdlib_s.dll, and vstdlib_s64.dll.
Copy the new ones into:
\serverfiles\
Where do you get the updated files?
Just download and run SteamCMD once (it auto-updates).
Then grab the files from the SteamCMD folder:
Linux: steamcmd/linux64/steamclient.so
Windows: steamcmd/steamclient.dll - steamcmd/steamclient64.dll - steamcmd/tier0_s.dll - steamcmd/tier0_s64.dll - steamcmd/vstdlib_s.dll - steamcmd/vstdlib_s64.dll
Copy and paste them into the correct folders, and that’s it—problem solved.
@granite valve can you confirm this is the last working version of the fix ?
yep!
Can I get a cool role 
Uh, that's not up to me lmao
Add these to the pin too, because some people don't know how to do steamCMD
👌
These are pre-compiled SteamCMD binaries by me, applicable for windows or linux
Fix to servers not updating or downloading mods properly
-# Provided by @granite valve
The issue is caused by the steamclient being outdated. The fix is simple: replace it with an updated version.
Linux
Delete the old steamclient.so.
Copy the new steamclient.so into both:
/serverfiles/
/linux64/
Windows
Delete the old steamclient.dll, steamclient64.dll, tier0_s.dll, tier0_s64.dll, vstdlib_s.dll, and vstdlib_s64.dll.
Copy the new ones into:
\serverfiles\
Where do you get the updated files?
The files are uploaded alongside this message, simply download the ones needed for your server OS. Alternatively, you can download them manually by using SteamCMD. Then grabbing the files from the SteamCMD folder:
- Linux:
steamcmd/
└── linux64/
└── steamclient.so
- Windows:
steamcmd/
├── steamclient.dll
├── steamclient64.dll
├── tier0_s.dll
├── tier0_s64.dll
├── vstdlib_s.dll
└── vstdlib_s64.dll
Copy and paste them into the correct folders and your problem should be solved.
There ya go!
I'll rewrite that message a bit too
I didn't mean to be rude. I always post a questions in both channels if they are on the topic of the channel
Wait. Cat?
LMAO
Hey dude!
#modeling was definitely not the topic, even this channel isn't the topic it would be more #mod_support or #1019767076094758924
The message will most likely get unpinned one day lol
When TiS sends the patch update, but for now, I feel like a beacon for the B41 Servers

You can also write in it that I'm available to be DM'd regarding this for help
Especially Dawn of the Dead. God I wish I could have two different versions of the game on PC one Build 41 and one Build 42 so I could play multi again while developing mods on build 42
Actually I highly doubt they do it since it probably involves updating B41 ?
Sadly like mentioned in the modding Discord, TIS seems to be silent about the issue for now
I did get a message from NasKo thanking me for helping, so they are aware of it from what I can tell
Just be patient

Anyway, thank you both for the answers
Looks like my car mod's release will be delayed until this whole thing blows over
☹️
Nah don't even delay it lmao
Just full send it
Nice !
That's good to know
Majority of servers are now aware of the fix, and my reddit post has gotten a lot of traction
That's good
Ok I reformated your original message a bit
Good soup, thank you for formatting! My head is too deep in coding shits
I should really learn lua... but ehhh...
Check the wiki, it can help you getting started
Thank you!
Where can you link it to me please?
No in the base game that's already a thing ?
You can already fill empty tins
No its not
Which game version ?
Well maybe it was not a can

I'm certain
Or I used a mod
Ok so lets assume its not really a thing how much time or how hard is it to make such a mod?
I mod fallout 4 using xedit and ck
So to mod PZ what should i do?
Im asking because really i want this so bad
You should be able to easily do it yourself
Ok great but i don't know where to start
Check the pinned messages to learn how to mod, your mod will either involve scripts or a simple patch from Lua
If i want to ask about a detail that i don't understand should can i dm you?
No you ask here or in the modding Discord
Im not in the moding discord
click the clan tag Jvla has too, either way
There's a modding discord?
Read the wiki page regarding modding
It's not Discord public so it doesn't show the server if you're not in it I believe
oh sadge
@cyan flame have you developed a sheep mod yet?
Guide to uploading mods with SteamCMD
Allows bypassing the in-game uploader limitations for workshop previews.
https://pzwiki.net/wiki/SteamCMD
@sour island this is linked in the wiki page "Uploading mods"
Should I have not pinned it? I thought you may forgot. 😅
Nop you shouldn't pin it, I never pin singular informations like that because it makes it messy, I would have added it to the main pinned message with all the various links
This is just to send news about major changes to the modding wiki that might interest modders
It is done. Thank you everyone for helping me out with the lua coding and stuff!
https://steamcommunity.com/sharedfiles/filedetails/?id=3525537028
I've placed a mod I am creating in the appropriate location for single player games, but it is not showing up in-game. I believe the file structure and all files are correct, but does anyone have any ideas?
- Where do you place your mod? Exact path
- b41/b42?
- C:\users\my_login\Zomboid\mods
- b42
apologies but i got totally sidetracked so here i am hours later--in the process of making a trailer for another mod, using the weather debug tools to set scenes really made it apparent to me the kind of interesting atmosphere you can build with certain arrangements of those settings, so i wanted to introduce slightly more variably color-graded storms and also a rare wildfire smog event
Ash has done some fancy recolorings
And look into the "flare" function
It gives a colored tint to the light outside/different tint inside
possibly in an area, I'm not sure on that
(Assuming B42)
declaration: package: zombie.iso.weather, class: WorldFlares
Next question - do you have mod.info set up correctly? And does your mod folder structure starts from 42/* ?
Check pinned messages
Mod structure wiki page
Me? 🙂
they're asking those to someone else
Wait sorry, thought you were asking a question mb
oh, as part of a mod? what's it called?
Aha, that's the problem, I didn't use the Build 42 structure. TYSM
Yea realized it
Nope, I'm trying to help @open sierra to find out what's happening with his mod
I'm not sure... @sonic needle those nice recolored Zomboid screenshots you posted a while back, how did you do those?
that may well have been using the debug tools, it's super easy to change the weather in all sorts of ways with the debug tools in game
There were much more extreme reshades
which
you can do pretty extreme ones with the tools in game, you could essentially color the whole screen flat red if you really wanted if i recall
?
One I recall was all desaturated but reds, opthers had very interesting color shifts
from the game.
oh these are cool! i assume these are just edited photos though, not in game weather, yeah
no tools.
well that can't be right
under what conditions could the first screenshot have occurred in game otherwise lol
I may be mistaken, but you can recreate admin tool's weather colors via code approx. easily
Red Lamp, Kicks off Light. Reshade Preset to Crank it to Pro Grade Color scheme
ok so it's not in game because you reshaded it lol
Reshade is ingame, but with an external tool modifiying the game.
i would consider reshade a tool but whatever we're into pedantry at this point
for what pz is, its nowhere near capable in b42 of modern lighting
i am very curious to know more, though i imagine a hurdle exists in getting the weather into the rotation
So it can produce effects that you can't get from screenshot manipulation, since it it working on the rendering instead of an iamge of colored pixels with no context
I'll check this for you a bit later
thank you very much! :3
From B42 Plumbing Fix by ightja
local function lightja_createtropicalstormtest()
if isClient() then
getClimateManager():transmitStopWeather();
else
getClimateManager():stopWeatherAndThunder()
end
local clim = getWorld():getClimateManager();
if clim then
clim:triggerCustomWeatherStage(8,48);
end
end
8:24 PM]Glytch3r:
to start rain
lua local mgr = getClimateManager() mgr:transmitServerStartRain(0.1); mgr:transmitGenerateWeather(0.1, 1)
to stop
lua local mgr = getClimateManager() if isClient() then mgr:transmitServerStopWeather() mgr:transmitStopWeather() else mgr:stopWeatherAndThunder() end
from my notes on weather
Lots of stuff to try: https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/iso/weather/ClimateManager.html
declaration: package: zombie.iso.weather, class: ClimateManager
tuning it correct, reshade's Lovely at what it does
You could take it further hooking into and setting values in the screen shader.
=)
SAI GREY 300 BLACKOUT SBR
Pixel Perfection Conversion
So, I'm back, @rancid tendon
I did some research on climate manager and colors/desaturation:
- Ye, it's possible to change colors via code, without admin enabled
- It's a bit tricky, not as easy as I thought before
Everything you need to do is:
local color = ClimateColorInfo.new(1, 0, 0, 1)
local climateManager = getWorld():getClimateManager() -- due to climateManager is a singleton instance getClimateManager() should be the full alias for this, but I'm a bit tired rn to check, mem addresses at tostring() should be identical if so
climateManager:getClimateColor(0):setFinalValue(color) -- to change color 0 is a GLOBAL_LIGHT id, check out ClimateManager javadocs for full const list
climateManager:setDesaturation(1) -- full desaturation, syntax sugar over climateManager:getClimateFloat(0):setFinalValue(1), both works the same
But here's a few tricky parts
- It was surprising for me, but PZ colors are floats for some reasons. So red is not 255, it's 255 / 255, 1 in that case. Same for other colors and alpha
- You may not change the final value, but Modded and Override one's, but at this point you'll face built-in interpolation issues, but PROBABLY it will give more natural output. Override priority is Modded < Override < Final. Admin values are top priority over all of that but seems to be working only if you have an admin access level (not sure)
- I've noticed that colors are client-only feature and haven't found any transmit functionality to send colors from the server to clients. Flat climateManager call won't give any results on events such as OnClimateTick. Seems like those are for transmitting weather changes only. But there's a good side out of it - you doesn't have to deal with transmitting at all, it's not needed in this context
Actually I feel like that makes sense
That colors are floats
- For some reasons (I'll do additional research later) it doesn't work on oneshot events like OnCreatePlayer, even if there're client-sided. Screenshot made with OnPlayerUpdate handler engaged. Not sure if it's the most efficient way to implement gfx-related features, but it is what it is
That's it. There's a huge chance that my conclusions have some mistakes, it's a result of a short research. Maybe guys with more experience with climateManager will add something here, if needed. Hope I've helped you at least
Well... meh. I've never met float-valued colors in any other frameworks before. Probably it makes some sense but for me it just looks wierd
floats are generally used at the actual rendering level
Ah, and the most important thing I should add - I've tested it on b41. There's a possibility that b42 code will be a bit different
Not sure
Like albion said, at the rendering level it uses floats
Which then the rendering system does the job of using the full color render of your screen or some shit like that ?
I'm not complaining about floats, it just may look weird for someone unfamiliar with that sort of syntax
I'm not talking about rendering systems, if it's ok - fine, it's ok then
But the whole color system WILL use rendering in some form or shape
That's why I'm not too shocked about it
Bcs you're feeding those colors to the rendering system of the climate system at the end of the day
You can do so much with shaders when using uniforms
It's all about competence in certain theme 🙂
You're not limited to what TIS provides for most shader input
Uniforms?
GLSL terminology for variable input for shader programs.
Ah. At this point I should mention that I'm not experienced enough in gamedev/rendering stuff, so I may miss some understanding of terminology like that
Yea dw about it, Jab getting technical 😭
It's a fun topic and study.
True, but at the same time heavily time-consuming
I'm about to get lost in it again
Gonna resume writing a html renderer using shaders with a framework.
Needed scalable rules and strict OOP personally.
So yeah, what era is this again?
is it possible to make a condition like depression cause wounds to appear on the body?
got an idea and i dont want to start having a crack at it if it isnt possible
more traits has done a self harm trait like that
oh right fair enough
was playing Obenseuer the other day and my dude wouldnt stop trying to kill himself lol
gave me the idea
iiiii still could use some assisstance in setting up a loot table, I never quite got it to work
local itemList = {
"PowerNodes.OrangeExtensionCord",
"PowerNodes.YellowExtensionCord",
"PowerNodes.GreenExtensionCord",
"PowerNodes.RedExtensionCord",
"PowerNodes.BlueExtensionCord",
}
local locations = {
"DrugShackTools",
"CrateTools",
"EngineerTools",
"FactoryLockers",
"GarageTools",
"GigamartTools",
"JanitorTools",
"MechanicShelfTools",
"MetalShopTools",
"ToolStoreMisc",
"ToolStoreTools",
}
local insert = table.insert
local list = ProceduralDistributions.list
local function addItems(dist,loot)
for i = 1, #loot do
insert(dist,loot[i])
end
end
for _,i in pairs(itemList)do
for _,x in pairs(locations)do
addItems(list[x].items,{i,2.0,}) --adds all chances as 2%
end
end
here is an example from a mod of mine
this is really simple since they all have the same roll chances but that can be changed per item
yeah thats completely different than what i had, that's using for loops and stuff huh
if you want to change the roll chance i'd just do it like this instead
local itemList = {
{"PowerNodes.OrangeExtensionCord",15},
}
for _,i in pairs(itemList)do
for _,x in pairs(locations)do
addItems(list[x].items,{i[1],i[2],})
end
end
i'm just trying to even get my stuff to spawn at all but I think i'm using the wrong naming convention...
show your code
yup, sec
require "Items/ProceduralDistributions"
table.insert(SuburbsDistributions["all"]["fridge"].items, "ProFishingRods.ProFishingRod")
table.insert(SuburbsDistributions["all"]["fridge"].items, 4444)
i just gave it a wack ass high number to even get it to show up
but
should I maybe be calling it Base.ProFishingRod?
yes since its in the Base module
i wouldn't set it at an extremely high level either
no thats kinda unnessecary thhat was just what i was doing before i realized lootzed would show all possible spawns
thats made thing snot show for me
click errors to see the actual error
I have angered the coffee liquour gods... kahlua is mad at me
Is this an issue with how im setting up my distribution table?
unity
blender
RGBA: 0-255
normalized: 0-1
there is no such table SuburbsDistributions["all"]["fridge"].items
i think the like
distribution table maker tool thing i used might be like, busted and old or something
would
table.insert(ProceduralDistributions.list["FridgeGeneric"].items, "Base.ProFishingRod")
Be more kosher? maybe i was using the old, wrong format or something
ayyy! no stack trace this time
so yeah i was using a weird wrong format or something
Ayyy there we go! perfect
i'll set up the table now, thanks a bunch!
usually that means the closing bracket is the unexpected symbol
no, semicolons are optional in lua and don't actually do anything at all, most people don't use them
oh! So then I'm not quite getting what's wrong here
require "Items/ProceduralDistributions"
table.insert(ProceduralDistributions.list["ArmyHangarTools"].items, "Base.ProFishingRod")
table.insert(ProceduralDistributions.list["ArmyHangarTools"].items, 1)
table.insert(ProceduralDistributions.list["ArmySurplusMisc"].items, "Base.ProFishingRod")
table.insert(ProceduralDistributions.list["ArmySurplusMisc"].items, )
table.insert(ProceduralDistributions.list["ArmySurplusTools"].items, "Base.ProFishingRod")
table.insert(ProceduralDistributions.list["ArmySurplusTools"].items, )
table.insert(ProceduralDistributions.list["BedroomDresser"].items, "Base.ProFishingRod")
table.insert(ProceduralDistributions.list["BedroomDresser"].items, 0.03)
table.insert(ProceduralDistributions.list["CrateCamping"].items, "Base.ProFishingRod")
table.insert(ProceduralDistributions.list["CrateCamping"].items, 2)
i'd post the whole thing but thats how the section i've got so far is set up and that's basically how it all goes
but i teleported over to the bait and tackle and despite
table.insert(ProceduralDistributions.list["FishingStoreGear"].items, 3)```
you're not inserting anything at some parts
line 8
table.insert(ProceduralDistributions.list["ArmySurplusMisc"].items, ) its probably breaking there and so doesnt insert all the other stuff
oh! weird
nvm same issue
I now know how to read this error message so yay, one less thing for me to pester you all about
im pretty sure thats the equivalent of just inserting nil
in any case, I dont even think thats valid syntax???
it's not, that's why it errors
I would like to take this opportunity to express my hatred for tables of multiple data types in sequence where they could have just made a table of tables, or defined a proper object to used. {"base.item", 1.0,"base.item2", 0.5,"base.item3", 2.0} -> {{item="base.item", chance=1.0},{item="base.item2", chance=0.5},{item="base.item3", chance=2.0}}
When you're already 5 layers deep in nested tables why avoid going one layer further?
it's just legacy reasons, as it typically is
item picker used to be lua so every marginal speed increase counted
now it's java and the lua tables aren't even used as is so their format can be whatever it wants to be and it wouldn't really affect anything
in fact, your idea is closer to the way java ends up representing them, since there's no real overhead to it there 😅
I know there are points where java does the sequence thing too
Like when shooting a shotgun, there is a 36 element array to hold pellet information which is why it crashes when you fire too many letts because it writes past the end of the array.
Since each pellet needs four numbers.
hey guys im trying to make a firearm that has no visible muzzle but i need a muzzle attachment so it fires, do you guys know which script calls the muzzle textures so i can replace it with a trasparent png?
this ruins all muzzle flash textures for the entire game FYI. not a good way to go about it
how to replace the player's walking animation during the game? For example, by pressing a button to switch the player's walking animation to the zombie's walking animation?
Like Ash said, this is one of those things that is buried in the Java and we can't control it via scripts/lua. And any method of hiding the muzzle flash like offseting it off the screen will also break the bullets appearing.
Animation Sets can have overrides based on things like a specific item being held or a variable passed via lua, so you could try duplicating the zombie animation set .xmls and making them conditional
Try with one first, because there are a lot of separate animations, and you'll have to figure out the way conditions work/how to pass appropriate values to the animation system
If you can think of a mod that has conditional overrides you can look at that. In vanilla I know of reloading double barrelshotguns/override for sawnoff to change the visual prop, and holding an umbrella overrides your arm.
The Kickscooter/skateborad/bicycle mods would be good to look at too, since they work by holding a "weapon" and changing the animations
thanks
Good luck! Are you on B41 or B42?
If B42, be aware of a bug that requires your animsets to be duplicated and in both the B42 folder AND the B41 folder.
b42, thanks
@bright fog @silent zealot
please tell me, I'm trying to simply change the walking animation, but the character freezes in place and doesn't move, why is that?
<?xml version="1.0" encoding="utf-8"?>
<animNode>
<m_Name>defaultWalk</m_Name>
<m_AnimName>Zombie_Walk</m_AnimName>
<m_BlendTime>defaultWalkBlendTime</m_BlendTime>
<m_SpeedScale>defaultWalkSpeedScale</m_SpeedScale>
<m_Scalar>WalkInjury</m_Scalar>
<m_Scalar2>WalkSpeed</m_Scalar2>
...
Sorry, I don't enough about the animation system to do more than point you in the general direction of solutions. Unless you want to swap weapon models during an animation, which is the very very specific thing I spent time working on.
What are those scalars ?
these are the default scalars, i just changed the animation speed and blend time:
Vanilla walk xml:
<?xml version="1.0" encoding="utf-8"?>
<animNode>
<m_Name>defaultWalk</m_Name>
<m_AnimName>Bob_Walk</m_AnimName>
<m_BlendTime>0.20</m_BlendTime>
<m_SpeedScale>1.04</m_SpeedScale>
<m_Scalar>WalkInjury</m_Scalar>
<m_Scalar2>WalkSpeed</m_Scalar2>
I want to make the player walk like a zombie, but the player freezes in place
You didn't send the whole file tho
Wait
You modified the vanilla file ?
Don't do that
Bcs that's not your goal ?
You want to have both animations ?
Also there's a few mods that add the ability to the player to walk like a zombie
I just tested it but the player gets stuck in place when trying to move forward
Can you please tell me the name of this mod?
Act undead I believe
thanks
I actually did this when writing EHE (1-2 months into modding) cause I wasn't aware of how dumb it looked, and thought iterating over loops by 2 was cool. 😎
for i=1, #table, 2 do 
I'm sure we all have lots of code we look back on and say "what the heck was I doing!"
I should probably change it...
For some uses I wanted optional values, so I don't even go by 2... I check if the entry is a string and if the next 2 are numbers 😅
Wtf
for i=1, #table, do
if type(table[i]) == "string then
---do thing
if type(table[i+1]) == number then
---do additional thing
end
if type(table[i+2]) == number then
---do additional thing
end
end
oof
I was cooking
What about...for (int i=0;i+=2<table.getSize();true) {...}
Anyway these are all terrible ideas
Jesus that's cursed as shit
Forgot to include the fact I was checking if the second 2 values were numbers
I won't bother to include that I verified they exist
I assumed that's how it was supposed to be done 😅
See: Distributions
Questions AI is qualified to answer! Hey ChatGPT, what's the most conusing way to interate through a lua table?
local X = { "a", "b", "c" }
local function z(y)
local M = { __index = function(_, p) return rawget(y, p) end }
setmetatable(y, M)
local Q = {}; for k in pairs(y) do Q[#Q+1] = k end
local J = 0
local function W() J = J + 1; return Q[J] end
while (function() return true end)() do
local K = W(); if not K then break end
for _ = 0, 0 do
(function(V) print((function(H) return H end)(V)) end)(y[K])
end
end
end
z(X)
At least 1.
Next level obfuscation
Wait you can give a function to the while ?
So obfuscated even the CPU will struggle to read it
default variables for the player speed.
It's a function call of an anonymous function
you can give any expression that evaluates to a boolean
I think it can be any type, coerced into a boolean
ah yeah, what i meant was 'any expression the result of which can be evaluated to a boolean' but that wasn't really clear
which come to think of it is literally every expression so i guess it's a meaningless qualifier 😅
I told chatGPT that was my first code ever written and to tell me what it thinks, it comforted me and said it was really 'creative' and impressive for a first code, but that I should consider not doing that.
Animal trapping and food spoilage tooltip additions coming soon, to a B42 installation near you!
But for real, though, anyone know how I can achieve automatic line breaks in inventory item Tooltips?
I have an annoying bug (see last image), and I'm not sure how to resolve it.
in B42 they added linewrapping (I faintly recall) prior to that you had to write your own
The challenge is that item tooltips are usually done in Java, so this is a weird hybrid approach where I need some way of doing it in Lua.
TextManager:WrapText
Will check it out, gimme a sec.
To clarify, they added this, sorry.
If that doesn't work I use this for Skill Recovery Journal - I don't remember why I don't use the textManager one...
local function wrapWarningMessages(warningMessage, fontType, maxWidth)
local warningWidth = getTextManager():MeasureStringX(fontType, warningMessage)
if warningWidth > maxWidth then
local words = warningMessage:gmatch("%S+")
local rebuilt, currentLine = "", ""
for word in words do
local currentLineWidth = getTextManager():MeasureStringX(fontType, currentLine)
local wordWidth = getTextManager():MeasureStringX(fontType, word)
local inBetween = ((wordWidth+currentLineWidth > maxWidth) and "\n") or (currentLineWidth>0 and " ") or ""
currentLine = currentLine..inBetween..word
rebuilt = rebuilt..inBetween..word
if inBetween == "\n" then currentLine = word end
end
warningMessage = rebuilt
end
return warningMessage
end
I should have left a comment...
MeasureStringX used to be the B41 strategy I saw a lot of folks using, and then they just re-sized the tooltip width.
This might also let me put all the catchables in a single line, similar to the zone tooltip 🤔
I mean... ok but that looks ugly 🗿 (to make the tooltip massive)
Oh yeah, making it super wide is ugg 😄
I'm sure what I wrote isn't the most efficient - idk
Lmao, I haven't stolen code from Skill Recovery Journal since B42's release, so I don't even have it subscribed..
i'm not entirely sure how you're adding to the tooltip, but the way starlit does it just works
i never had to add any code to handle things like this
For wrapping text?
the tooltip handles it automatically, i think it just extends it to fit
Yeah, I think he's rendering over the tooltip and dropping it's height down-- if you add it to the tooltip it will extend to fit, but it's also ugly for it to be so wide.
This isn't that much space though
Depends how long these sentences can get I suppose
I'm rendering over the tooltip so I can get perfect match with regards to padding etc.
It works on all font sizes and UI scales I've tested so far, just need to fix line breaks.
And you've tried to just add it to the tooltip's text directly too?
Probably 
Haven't touched the code for a bit, so I could've done all sorts of things back when I started this.
I am adding directly to the text for the zone tooltip, but I don't recall a way to do that for inventory items, there was always some blocker with Java code iirc.
They may have tweaked it but I think you can just apply a tooltip to the item itself?
That didn't give a very nice visual result iirc.
Or maybe overwrote some of the default stuff?
In it's item script - or dynamically
Yeah if there's vanilla stuff there, you may have to modify the dynamic addition
Probably nuked the fishing line?
Okay, the text manager approach works, but I gotta check how many lines it outputs 😄
starlit provides an API for adding to tooltips since this is such a common point of difficulty https://demiurgequantified.github.io/StarlitLibrary/modules/InventoryUI.html
If you're using my snippet - you can measure the Y of the string (even with line breaks)
Looking at screenshots for Item Use Tooltips which uses Starlit, additions are too far left. https://steamcommunity.com/sharedfiles/filedetails/?id=3400914593
i don't think that happens anymore iirc
I'll probably just count the number of newlines, tbh 😄
Are you measuring the font height already?
Yeah, I have all the height info I need here:
local unmodified_height = nil;
local line_spacing = self.tooltip:getLineSpacing();
local original_setHeight = self.setHeight;
self.setHeight = function(self, height, ...)
unmodified_height = height;
return original_setHeight(self, height + #lines * line_spacing, ...);
end
But I normally arrange my data on a per-line basis, so when a single line breaks over, I need to adjust.
If you do: getTextManager():MeasureStringY(fontType, currentLine) it will return the height of the string, including linebreaks
But honestly, check out starlib 😅
We need to start using these libraries more often
I'll make it work on my own, then check the lib to see if it has any issues 😄
This is all working now, assuming my new way of measuring height works.
Yeee, I got it working.
Also missed opportunity to name Starlit Library as Starlib 
This is gucci.
-- because we no longer call the original function, this may affect mod compatibility
-- there isn't really any way to avoid that though
This comment in Starlit Library (and many other mods doing similar things when making custom tooltips) is why I went with a custom approach.
a big benefit to the library is that mods that use it are compatible, where multiple mods doing the same thing couldn't be
I wrote my approach while running code from a few other tooltip mods originally, exactly so I didn't break cross-mod compatibility and other approaches.
So it works fine with Starlit, for example.
(Starlit looks perfect in the tooltip by the way, sorry for being antagonistic and vague with what might've been why I didn't select it earlier when I wrote the start of this mod)
no it's cool, there were actually a lot of visual issues in early versions of that module like the one you pointed out
fwiw the theoretical mod incompatibility here is incredibly niche but i left that comment so that i don't forget and get confused in the tiny chance that it actually happens
And I wasn't compatible with Eris' Food Expiry mod, which is why I added my own spin on it, so I don't really have a perfect solution either.
Might just swap to Starlit tbh, Chuck is right. We should use libraries more often, if I have an issue, I should forward a fix.
Think Starlit needs linebreak support 
oh, it doesn't extend the vanilla parts of the tooltip? i thought i'd fixed that
you can see the vanilla parts of the tooltip are still right-aligned as if the new line wasn't there though
not that that's really undesirable here but it's undesirable in some more reasonable cases and i thought it'd got it to stop doing that
maybe it just doesn't care about labels
that would be fine
Oh, I think we're talking about different things
Wrapping the line is more desirable though imo
i agree, not sure if i want to make it mandatory though (and any optional api i could add would be the same as just calling WrapText)
but when it's key-values like vanilla tooltips mostly are, there isn't really an option whether or not to wrap so width needs to match
Yeah, that makes sense. But if he's adding tooltips dynamically already - he can just call wrap text then? I think it manipulates the string-- and if it doesn't that's probably why I still use mine...
Do you know how firing off code in the console works? I have very little experience doing that as I usually write in feature or events for this but I need to spitball code faster
what do you want to know about it exactly?
Oh it is working, I just didn't have anything returning to compare 😅
The output is also hard to parse as it includes the inputted lua
yeah it's a little annoying 😅
the only unintuitive thing to keep in mind about it is that unlike most interactive interpreters, everything you input is considered a new chunk (equivalent to a file) so locals only exist for that one entry
but obviously there's not nearly as much risk to using globals
Yeah, I'm just trying out differnt ideas for something
The console is still java based or is it UXI now?
it's still java based
and the text input is still broken for long texts
XUI is only used for printed media and some newer debug menus
so making a lua interpreter wouldn't be feasible
i'm genuinely not sure what the intended behaviour is there
There's two variables/fields given for max length and they're used in two different places - Only one is used to limit the maximum, and it's not exposed.
the character limit seems intentional but there's no obvious reason for it and copy-pasting longer text gets past it and works fine
Yeah that's the other issue too
you can just load and run a string, so if you wanted to make your own
Thats true.. I don't really need to display it
I also wanted to revisit Aiteron's file reloader to setup successive or chained reloads to better handle modulized code
it's weird, the game seems to have some code specifically to make reloading modules work properly, but it... doesn't
I've gotten into the habbit of doing it manually
and they don't even use modules so i can't imagine why they even thought to try
it's fairly annoying 😅
anything related to context menus usually breaks anyway
but you have to almost work backwards from execution - which kind of helps understand the code better
But yeah, I have an idea to make the reloader have a drag and drop to form routines(?) I guess I can call them
Calculations in Lua
i do. cant be done this wasy. zomboid blends multiple animations to acheive the "Gate" walk you know
and what should be done in this case?
Hi! Haven't been doing models for zomboid for a while. Any tips why those models may have those "holes"? My first thoughts was that it may be wrong facing, but in blender everything is ok, all textures are facing outside. Textures are also full Opaque, max alpha. I was doing those in 41 build, and they were working just fine, so my guess is it is something that changed in 42.
B42 only renders Tris and Quads, So any face with more than 4 vertices will not render.
Oh, so i have manually separate them on tris and quads. Thanks for help!
You can select all faces in edit mode and "triangulate" them
Easiest way
Thought in some rare cases it might change shading, so then i'd reset all vectors in normals
I was doing some stuff to remember how to model/texture for updating Savotta Backpacks to build 42. Thanks a lot for the help again!
What could be making only some specific .lua files not load by a mod
Is there a script amount limit or something?
there's nothing like that
the files could be in the wrong folder or not using the .lua extension
other than that it should always try to load every lua file in a mod
That's what I thought. It was fixed when I deleted the emojis I had though 
looks good
I'm sitting here staring at the java docs for RoomDefs asking myself
"Why are these things 4D"
It took me 20m to realize the W stands for width
what does this mean 
Welcome to poor programming naming conventions hour.
I see Umbrella is not installed on your screenshot.
=)
I have it installed, it literally disables itself every time I close the program. I thought it was activated this whole time
Ctrl + Shift + P > Lua: Open Addon Manager > Umbrella (Unstable)
I didn't realize visual studio would give me info errors without having any point of reference towards what's wrong. no wonder
yeah, just reactivated it. is my vsc messed up or do I have to manually tell it to stay enabled after exiting?
Mine sets it as enabled via .vscode settings folder.
Oh, didn't realize it was per project
Anyway thank you. Now that I know it's not just broken, I hate it ever so slightly less lol
is there any way to figure out why my mod shows a red x on the mod menu? I can't figure out what is wrong
yeah that was actually the vanilla behaviour, and therefore my intended behaviour too 😅
the bug specifically is how b42 renders models, basically the Triangle or quad option corrects the UV enough to repair some form of
inconsistency, that b41 had no issue with, But b42 hates
Has anyone messed around with building on z 1 while being on z 0?
Having this annoying bug when I build a roof on a room but it doesn't hide the roof when entering. (vid 1)
If I build the roof while on the same z level as I'm building on, then it works fine and sometimes fixes other roofs that were glitched. (vid 2)
If I reload the save it works, and sometimes (like 30%) if I build stairs to go up one z level, and then go back down it will fix a glitched roof, but most often it doesn't and only reloading or rebuilding it will fix it.
I tried:
- Setting the z 1 squares as seen after creating them
- Setting
"ConnectedToStairstrue" = truein the squares mod data cell:ConnectNewSquare(sq, true);sq:RecalcAllWithNeighbours(true);
Looks to me like you're probably using the wrong method for that
There's an addon for the Build Menu mod in B41 to build roof from the floor below
Check it out maybe
Ah nice, I'll take a look thanks
I tried to make it as similar to vanilla build as possible:
local above = base:getSquareAbove() or cell:createNewGridSquare(x, y, z+1, true)
local newCeiling = ISBuildIsoEntity:new(pzPlayer, objectInfo, 1, containers, BuildLogic.new(pzPlayer, nil, nil))
getCell():setDrag(newCeiling, 0)
newCeiling.player = 0
newCeiling.Type = "fishingNet"
newCeiling.maxTime = 1
newCeiling:tryBuild(above:getX(), above:getY(), above:getZ())
Figured that would minimize issues, but nope lol
map buildings are VERY different from tiles built by the player.
If you are using the later, you'll need to be in a room for the ceiling to be hidden.
You can check the room integrity with the dedicated debug menu. (dev > IsoRegions)
build Roof mod will not help you for this, but Architect mod will as it looks a lot like what you are doing.
it looks like you are trying to use java (map) buildings from within the game. afaik the game is not supporting that and IsoBuilding instances made by the player ingame are not saved/reloaded correctly. GG for successfuly (up to having it mostly workingbefore reload) using them though. It must have been a pain in the axe to reuse correctly the roomdef and other specific stuff.
how does the new, ignoreZombieDensity = true/false, work? Does it just increase the rolls rolled for loot to spawn?
loot spawn chances are usually modified by the spawnrate of zombies in that area, you can use that to disable that
How hard would it be to make a mod that adds a single webbing attachment to Chest rig and tarp Chest rig
It's easy when you know what/how to do it
Sadly there is not a single guide about adding attachment slots to clothing
At least not any i know of.
I do know how to make it, but my first 3 mods with it were trial and error kind of thing
@hybrid edge
I basically just made a copy of the wooden floor script, but using the "ceilings_01_0" sprite instead, but I don't actually check for rooms, I just use specific sprite names to check for walls that connect to form boxes (the mod is for disassembling/reassembling those big military field tents), so no need for a lot of complexity.
Then I grab all the squares inside the box, create new squares on the z level above them, and then just use the same build function that DoTileBuilding uses to place the roof (which is technically a floor), which is what's used in the vanilla build menu in b42 as far as I can tell, so it should just behave like building directly from the menu.
So it's not really sophisticated at all haha, just annoying that it almost works 😭
which file dictates animal spawns?
Do you have any material you can point me in the direction of? I literally have 0 exp
Honestly? I'd check how other mods do it. You might find some luck looking and Noir's Sling as it does what you looking for
I might do guide about it, but not anytime soon as i'm stretched thing across multiple projects
<@&671452400221159444>
hey do you guys have any idea how to make an ammo-less firearm? meaning that it can shoot without bullets?
trying to do something very specific, anyone happen to know how to get this to um... work ?
or where i should look for reference
you can see a list of methods for the weapon class on this website https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/inventory/types/HandWeapon.html
in this case you're probably looking for setSpentRoundCount
Good evening. Is there any way to obtain and find out what information is stored in the database, in the binary field? I've seen that items, skills, and character status are stored there, but I'd like to know if I can obtain all the information and, more specifically, if it can be modified from Lua and re-stored/updated.
it cannot be accessed from lua
Thank you.
Is it known if they'll continue adding hooks?
Sometimes I feel like I need a little more freedom to achieve certain results.
Will we continue working in Java? Should I suggest using another language someday?
Switching languages probably won't be easy, especially if all developers are familiar with the current language. However, due to player limitations—I've seen that it's currently 32 in 41.78.16 (I don't know if the limit will increase in 42)—and also given the high performance of the servers, especially memory requirements, I was curious to know if there was an attempt at some point to migrate to another language.
i wouldn't expect them to ever do something like that
limited parts of the game are already written in c++ for better performance though
In World of Warcraft, C++, Lua, and SQL are used. Lua can be done on the client, but also on the server. And with the same resources, I can have 500 to 1,000 players, but I couldn't do it here. In fact, I have a scheduled task to reboot the machine twice a day to free up resources.
I hope they add MySQL, so I can have some tables, and be able to add certain information to them.
Is it possible to "suggest" modifications to event invocations? For example, the OnExitVehicle event fires after the player exits the vehicle. So, if we want to access the vehicle, we no longer have that information. We would only need to modify the location where it is invoked, moving it one or two lines higher (before the player exits).
Can these types of changes be discussed and asked to be taken into account or do we have to overwrite the files/methods?
you can try in this thread https://discord.com/channels/136501320340209664/1318920979581501502
could someone please help me with this? im trying to make it so if you have "ThrownHuntingKnife" equiped then the bullet context menu doesnt show up
I keep getting an error that crashes my game when I start it with my mod.
It's supposed to be a simple mod that allows the creation of nails from scrap.
send the scripts maybe i can helpp
Got it posted above.
let me see if i can help
im not to bright but maybe i find something
Is there a list of fluid color options that aren't already used by fluids in-game?
I looked at the "Make Clay" mod and used it as a template. And it was working before, but then when I made my copy and then made my own mod on top of it it failed.
Thank you! And no worries. I understand.
can you think of any recipes that use scrap metal? you can look at those aswell for reference
Could someone tell me how to put a container in a building and have it have specific loot with 100% spawn rate and the specific amount of each one?
Yeah, lemme find one.
in another recipe when using sheet metal is says item 1 [Base.SmallSheetMetal],
in yours it says
item 1 tags[Base.SmallSheetMetal
chat gpt says it shouldnt have the tags line before the sheet metal
could be that
I have the building and everything created, but if I add a container with a new property, I don't see it. Is there a way to add an existing container but still specify the above question?
ooooh, yeah!
Lemme try that!
alrighty
use
table.insert(ProceduralDistributions["lists"]
In a lua script.
I saw it somewhere in a mod like more guns and smokes.
I copied that method and was able to use it to add random stuff. I think you just need to define the correct location.
hey guys, i need help
I'm having a crash problem with my game, where it shows the following error in the console
LOG : General f:0, t:1752712714428> ERROR: IntegerConfigOption.setValue() "MaximumRatIndex" 100 is greater than max=50
LOG : General f:0, t:1752712714432> ERROR: IntegerConfigOption.setValue() "MaximumRatIndex" 100 is greater than max=50
Any idea which mod messes with something related to rats in the game?
you could hook in to the perform function, or new, isValid, etc and do whatever you want before the event fires
im trying to also add some "knife holsters" to be able to carry multiple knives but my code aint working. the holsters get added but the knives only can be attached to belt slots
if i type attachment type knife;handgun, i cant attach it to either belt nor holster
anybody see the issue?
You can look through all your mods until you find one where the English translation file has a variable named Rat Index or something.
THANK YOU ILY!!! BOOKMARKED
Also check the wiki page for Lua API if you haven't yet
So I know I can do this to get an item by name, where k is the item name
ScriptManager.instance:getItem(k)
Does anyone happen to know a similar for craftingRecipes? to be able to get by name?
Yeah, you can do SpriteConfigManager.getObjectInfoFromSprite("your_sprite_name_here"):getRecipe():getCraftRecipe()
There might be an easier way but this is what I use
Oh wait, this is for building stuff using just the sprite name
you have the right idea.. but I don't think I need to go through sprite config to get a recipe.. I think there has to be a more direct way
For crafting you should just need to do ScriptManager.instance:getCraftRecipe("name of recipe")
ah but you're trying to get the craft recipe from the resulted item?
that is what I thought too.. but that gives nil
Hmm
no.. just get recipe by name
I guess first I should ask if you're on b41 or b42?
42
I am building an api for modders.. to make it easier to edit base game things without all the overloading.. I have it working for items.. if I can find a reliable way to get craftRecipe by name I should be able to the same thing for craft recipes too
This is working for me: local craftRecipe = ScriptManager.instance:getCraftRecipe("WeaveCloth")
It gives the correct result when I test
Wdym an api to do that ?
Overloading ?
You don't need any of that, the game already provides the tools for modders to modify existing scripts without a complete rewrite
Also you can retrieve craftRecipe in B42
You can find the functions in the Java docs
my new question.. link?
You don't know about the JavaDocs ...?
Wait how did you manage to make anything in your API ? 😭
say I want to change the craft time of a recipe or the display category of an item.. I have to create a .txt and overload that item or recipe with the new value.
No you don't
You don't need to do that
reading the soource code 🤷
reading mods on the workshop.. same as any other game really.. didn't expect docs lol
declaration: package: zombie.scripting, class: ScriptManager
The methods used for script modifications are most likely not used at all by the game since it's just tools for modderd
declaration: package: zombie.scripting, class: ScriptManager
yea, this is basically what I have done for items
Did you raw decompile the source code ?
so to change the display name I just need to
ModderAPI.Items.updateProperty("Item", "DisplayCategory", "New Cateogry")
just the source lua.. didn't decompile the java.. that would have been last resort.. but thanks to you, I haz link now, thank you.
That sounds cumbersome
its one line? do you have a better suggestion?
Just it's a function inside a table Items inside a module and the first arg is "Item" for a fct specifically for Items
I would simplify the whole thing
no, first param is item name
Aaah the first string is the item id nvm
Item ID you mean ?
yes
the one used to declare the item.. not what you see ingame
I am learning lua.. so yea, my structure is probably weird.. I appreciate the feedback
my goal was to build out as such
ModderAPI.Items.updateProperty()
ModderAPI.Items.appendCategory()
ModderAPI.Items.appendTag()
ModderAPI.CraftRecipe.updateProperty()```
I am thinking in an oo structure and that probably doesn't fit lua
this way.. after you have built out your stack of mods, say you want to to change on little detail or two about some of them.. this will allow you to also update things added by other mods too
I have the first 3 working and tested.. I was trying to start doing recipes next.. this has been a huge help!
fwiw not sure why you couldn't find examples of mods already doing this, using the script manager to modify items is extremely common already
if you don't know what you are looking for, you could be staring at it and not know.
there was actually already a library mod to do this that we had to yell at everyone to stop using because of its poor implementation 😅
it printed every 'tweak' it made, but prints are insanely expensive in pz so this significantly impacted startup time
a server host i knew removed the print locally and found it improved start up times by around 9 seconds
yes, I think I found that.. but that is not what I am doing
I am gathering all 'tweaks' together.. then loop through the tweaks, call each item and applying them
the to append functions take into consideration that category and tag are semicolon delimited lists.. so instead of treating the list as a single string.. it allows you to add a new to the end of said string
so that appending won't overload other mods also trying to add a tag
Why not generalize the function so it's basically an implementation of DoParam easier to read ?
I think thats basically what I have done
So I hav this itemcontainer, how do I get the item object of this itemcontainer?
getItems
object = ScriptManager:getItem("id of container")
container:getContainingItem()
Im getting into modding however i know some lua since before. I was just wondering if theres any good documentation on (custom) Ui. I checked the github doc but i dont believe its added there yet (might be wrong)
What github doc ?
That's the best UI guide you can find rn
One by FWolf. Thought that was the good one….
Haha might have been completely off
Also check the wiki, tho rn the wiki doesn't cover UI stuff for now
fenris's guide is pretty good but a little old
Yea
Alright thank you
Most stuff you can find in his guide can be found on the wiki now
In an updated format with updated informations
Hey, i was wondering how to make a texture mod for a leather jacket? im following this guide and it confuses me alot.
trying to just make a little mod for me and friends, using the base biker leather jacket
There's a more recent guide
hell yeah! thank you!
haha i cant figure it out. everytime i boot up PZ and then enable the mod the main menu goes away and doesnt come back
Lol looks like someone else had the same issue with the roof not becoming transparent in this mod https://steamcommunity.com/sharedfiles/filedetails/?id=3524273533
Their solution is to "teleport the player away and then back to force a chunk update" 😄
Pretty smart, but I wonder if it's possible to force a chunk update any other way
if you solve this please let me know, i have a persistent similar issue with one of my mods
i've investigated it enough to the point of giving up so someone else finding the solution is my only hope 😅
Haha well shit, that doesn't give me a lot of hope 😂 But I'll poke around and try some shit
if you don't already, you should call square:invalidateRenderChunkLevel(FBORenderChunk.DIRTY_OBJECT_ADD) on the square you add the object to
my issue is not exactly the same so it's likely that things i've already tried might work for you
Ah nice thanks, I'll make sure to give that a try
Сan anyone explain how zomboid's "ticks" work? I've seen some people say it's a fixed rate based off real time, some people say it's each frame, and some people say it's fixed rate based off ingame time so now I just don't even know what to think.
it's every frame
there are some very specific systems that have their own tickrates but 'tick' in general is synonymous with frame
gotcha, thanks!
what system, then, do moodle use to keep their change at a consistent pace? is it based off ingame time or maybe some deltatime variable done each frame?
it's deltatime yeah
yeah, the GameTime class has about a billion 'multipliers' which are deltas in slightly different formats
alright, i'll look into that
way back i wrote down what they actually meant here https://github.com/demiurgeQuantified/PZModdingGuides/blob/main/guides/GameTime.md
great, thanks!
This is a question for those with experience in PZ modding.
Let’s say I wanted to make my own road texture. In simple step by step terms, how would I:
- Find the road texture/textures (where is it located?).
- After editing the texture, how would I upload it as a workshop mod?
So, how would I find the texture -> upload new replacement texture as a mod on steam workshop?
This should be as simple as it gets, right?
- You need to modify an existing tile #mapping
- Check pinned messages and the Mod structure wiki page
Hey everyone!
I’ve created a custom vehicle mod for Build 42 — a drivable Ford F150 Raptor SVT. The model works fine in-game, but for some reason, the textures are not loading — the truck appears only as a black shadow, or invisible in the editor. No errors are thrown during the script load, but the console gives me this:
ERROR: model texture "vehicles/Vehicles_FordF150.png" wasn't found
However, the texture does exist at this path:
FordF150/42/media/textures/vehicles/Vehicles_FordF150.png
Here’s a portion of my mod setup:
name=Ford F150 Raptor SVT
id=FordF150
description=Adds a drivable Ford F150 Raptor (Build 42)
poster=poster.png
version=1.0
(FordF150\42\media\scripts\vehicles\f150raptor.txt)
Script (f150raptor.txt):
module Base
{
model FordF150Base
{
mesh = vehicles/Vehicles_FordF150_body,
shader = vehicle,
invertX = FALSE,
scale = 1,
}
model FordF150frontwheelleft
{
mesh = vehicles/Vehicles_FordF150_wheel,
texture = vehicles/Vehicles_FordF150.png,
shader = vehiclewheel,
}
...
}
You put the texture in skins not in model of your vehicle
You didn't show that part, or my phone is playing tricks on me
and how do i add texture to model?
to make everything work in game
is it possible to check which seat of a vehicle the player is on through lua?
Maybe this? (b42) https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/vehicles/BaseVehicle.html#getSeat(zombie.characters.IsoGameCharacter)
declaration: package: zombie.vehicles, class: BaseVehicle
Can you show your whole vehicle txt file?
Maybe test without file extensions in the texture paths?
So either your texture has a typo, or the fact that some of your paths start with small letter "vehicle" and some with capital letter, or what Tunes said.
Yeah maybe check the paths because I think the models should load even if the textures can't be found (the shadow is defined separately so it doesn't correlate with the model)
I've sat on deciding to rewrite / revise / upgrade Kahlua for nearly four years. I feel like this might be my next project.
If I do I'd upgrade the version of Lua to 5.4 and probably support Luau type syntax.
The main thing holding me back was not knowing if TheIndieStone would adopt forks and fixes to their 3rd party libraries.
Honestly if the upgrades are good enough, I'd imagine they would. Worst case people could patch the game.
Thought I'd post this here in-case anyone finds interest in such a project.
@grizzled fulcrum
Thought I'd tag ya because it would be possibly relevant to your Java adventures.
Where can I find a guide for making item in build 42?
I'm trying to port an abandoned mod from B40 to B42.
I hope this sound less stupid then it does to me right now but i wanted to ask if anyone has any idea where the crop trample is being handled if a car/trailer drives over it, specifically how i can prevent it, is it a separate thing to zombie trampling or are both the "same". I've gotten a little frustrated since it is the only thing preventing me from finalizing my tractor ^
found the respective .class, decompiled, set nocropkill to true and recompiled now cars wont kill my crops 
remove the file extention :3
keep me posted if you do decide it's worth it
Greetings!
Is there anyone who tried to create a custom generator mod or similar? I've got some questions, or maybe ideas, and I'd like to find someone to share thoughts and collaborate about it?
Hi, I've been playing for years and I always have the same problem in multiplayer: hoarding players who stop playing and lose valuable items in their inventories. That's why I would like to make a mod to COPY VHS tapes.
- Create the audio and video cable item so it can be found or crafted.
- 2 TVs that can play VHS tapes.
- Add a high-speed tape sound.
- Set a crafting time.
- Click on the source VHS tape and have the recipe select a destination VHS tape from the inventory, similar to the materials list when you turn on an old-fashioned stove.
I do know how to solve those points. My problem is that I've never understood what the item ID of a VHS tape is. Can anyone help me with this?
- Obtain the source VHS tape ID.
- Duplicate it without the game crashing or triggering an anti-cheat due to duplicating the item
How tough is it to create new animation sets for zombies/players? I haven't done animations in years, but I'd like to play around with zombie AnimSets and try to attempt a mod that makes them sprint more like the Infected from 28 Days Later.
The question you got to ask you is, do you need to redo every zombie animations ?
it's no harder than the basic difficulty of creating animations
If yes, that can take a while but it's definitely doable
you probably won't need to touch the animsets at all so there isn't much you'd need to change on the game side
Most animations would probably have to be altered, as well as speeds.
The Infected are pretty twitchy and sporadic even when idle, except maybe when resting (Church Bois).
Plus, the idea of making noise and the Infected just snapping in my general direction would instill such fear in me.
Definitely curious if multiple animation speeds are possible to mimic that some Infected are faster or slower than others.
Would basically be like my TLOU Infected but 28 YL version
Yes that's doable
this is pretty much what the game does yeah
Yea there's already variations but the game switches between the various variations
So you can't use the default system for that
Unless you want an infected to constantly switch speed
Yeeeeee
The Clickers give me that 28DL tick with their movements. That plus me watching 28 Years Later recently.
Good point.
Sadly I'm not an animator so didn't manage to fully implement every infected animations
Tho it's still doable, but maybe not with the system Albion was thinking about
Still great with what's there, either way.
But you can redefine the animsets to use a variable for speed that then can be set
That way you can set how fast individual infected are when loading in the world
Only person I know that did that was Glytcher, and maybe Slayer too
This should have sandbox options to set the speed of the goose using that system
And you could easily use it
theres are 100% the zombie sounds? nothing hidden away elsewhere?
Where did you get those ?
D:\steam\steamapps\common\ProjectZomboid\media\sound
just making sure since i wanna replace the male sounds and the way its set up in the script .txt makes the file format look different
These are not the sounds used by zombies
flip!
The zombie sounds are located inside bank files
And to replace zombie sounds, you have to replace the entire bank files, which you mean you have to unpack the bank file, modify the sounds, then repack the whole thing again and upload literally every single sounds of the game and your sounds that are in the bank file
tragic
only options now are disabling the groans which makes it dead silent or just deal with the generic zombie groans 
It seems there are only 2 items for VHS: VHS_Home and VHS_retail. You can get the type and create a new item using that. My guess would be they use MediaData for the info (there might be more to the functionality). They can be get/set with getMediaData() and setRecordedMediaData(MediaData mediaData) for inventoryItems. You might also need to copy the name to the new item
Anyone know why it’s doing this? (I’m on Linux, with a steam deck)
Not sure if it causes issues, but you don't need the "texture" in "model FordF150Base"
If only there was a mod that allowed a matching knob and key set into a box.... If only I knew anything about this process.. I could finally lock my front door.
You mean a craft to associate a key and knob ?
Yes, that sounds very accurate!
I don't think it'd be too hard actually
You could do two crafts, one to have a key fit a door knob, and another one to have a door knob fit a key
I wouldn't even begin to understand the process
I suppose B41 ?
https://pzwiki.net/wiki/Recipe_(scripts)
\
He meant to remove this
model FordF150Base
{
mesh = vehicles/Vehicles_FordF150_body,
texture = vehicles/Vehicles_FordF150.png, ---right here.
shader = vehicle,
invertX = FALSE,
scale = 1,
}
Also does it still give you error?
Previously you had not even checkered texture, now you do
playerObj:remove("SmirkStuff.Hat_Name")
whats the correct method for deleting a worn item in b42, under this context?
also
local playerObj = getSpecificPlayer(playerIndex)
i was testing and the output of getGameTime():getMultiplier() doesn't seem to change based on day length at all?
i tested b41 and b42 and both always returned exactly 48/fps (0.8 at 60fps) with no scaling based on day length
the only one i tested that seemed to scale at all was getGameWorldSecondsSinceLastUpdate()
that seems correct yes, not sure how i got those results
i checked some places i remembered getMultiplier being used and they have additional explicit handling for day length
from a quick read of the code it also looks like getTimeDelta should be 1/s, not 1/m
thanks for pointing that out, sorry if it wasted much of your time 😅
Now you need to repair it . Since you lack masks for damage ect.
<@&671452400221159444>
Isn't it always the same freaking images ?
Like, they use media links, so couldn't that be used to possibly detect them ?
Do they use the same media links everytime ?
I’d imagine they have like 3 or 4 different ones they rotate
Tho if they use the same media links, possibly an automatic deletion of those links being posted could be done?
In theory, though I wouldn’t be shocked if the links themselves are some sort of IP grabber or something
Automod unfortunately can't scan attachments, or even the metadata of the attachments. Other bots can, but Discord's own built-in bots can't, and currently it's not worth the effort to build our own
No that's not how that works
Idk how the image linking stuff works won’t lie
Those are not external links
Those are Discord media links
If you post an image, then right click it and copy the link, you can share that same media elsewhere
Ah I thought they were external embeds
And it's not like you're reposting the image
That's annoying
So the message content doesn't show the Discord media link ?
Bcs technically you don't need to check the attachment itself, only the message that links those images possibly
Shame seeing how many people get got by those scam DMs and have their accounts stolen
There is no text to the message, it's basically an empty string with attachment objects, and automod can't look at those attachment objects, and we can't filter out empty strings
In this case it's not a Discord account steal tho, however they do use stolen Discord account
I see
I imagine most of these accounts are stolen via those scam dms
Yea there's plenty of other scams to get your Discord account stolen
That account that just posted had been here since 2022, but only had 4 posts
I find that kinda interesting
Usually it's poorly secured accounts
I got a friend who got hacked back to back multiple times, his Discord account and Steam account
Bcs that idiot didn't activate the 2fa
Like he got his Steam account hacked twice in a week I believe lol
This, friends, is why you don’t click sus links
Or just activate your fucking 2fa lmao
So inactive accounts getting hacked, not being used a lot, I'm not too surprised, since it's very likely those aren't properly secured
I do that for steam but I refuse to give anything else my phone number
There's other methods, like Google Authentificator
I do use that
Just a general statement though
yea
For a split second when I loaded back in, the “you need to verify with a phone number” text was there, and I was scared, lol
LOG : General f:2628, t:1752941522266> ERROR: model texture "vehicles/Vehicles_FordF150" wasn't found
Jesus default notepad ? 😭
Good morning everyone! does anyone know by chance which bin save file the time/weather/temp is stored at?
I've yet to hear about tools to modify world data stored in bin files for now
not for modifying. but to extract that info and use it for a discord bot
Ah you miss typed "chance" to "change" so I thought that's what you meant 😂
Uh well idk sadly
oh shoot! my bad! I've been awake for officially more than 24 hrs now haha
💀
its agiht. I'll try to check each one lol
I have black mask as a placeholder as im still working on it. HOWEVER if you spawn vehicle without mask file, Damage and blood texture assigned IT WILL break texture displayed UNTILL you fix car with debugmode/mechanic's
ALSO you can notice i dont have my "model Vodnik " having any "texture" as it is applied with "skins" in vehicle script itself
i recreated the texture file and got this. My texture is 1200x627 pixels
ok
this works
BTW you should have the left and right sides separated in the texture. You can't have the sides working independently with removed parts, damage and blood if they aren't separate in the mask
@queen oasis lol #1318920979581501502 message
It wouldn't be so bad, but the "game freeze" bug still happens sometimes when dragging a zombie. The only way to fix the freeze is to restart the game. So people using my "Auto Move Corpses" mod have all kinds of zombie pals hanging around.
oof
in my solo game, I built a fenced in pen to shuffle them in to
You can't kill them too ?
You can only push them around or lead them with noise. No interactions at all.
I haven't checked if it's present without ragdolls active tho
I doubt that's the reason
I mean I already see the reason why this happens tbf
Bcs the corpses are revived into zombies to be animated entities that can be interacted with, and they are set as reanimated players to keep the data of the corpse most likely (such as items)
And they are probably set useless or some shit like that, or have a bugged stated that isn't reset upon reloading the save
But your character and zombie animation state are reloaded, thus they "disassemble"
they're grappled
grappled entites can't do anything and their animations are controlled by the grappler
I see
it loses the grappled state but keeps the "reanimated" state. I've tried goofing with the animation states with no success.
I don't think albion is refering to an animation state here tho
declaration: package: zombie.characters, class: IsoZombie
Try setting that on the zombie perhaps
There's really nothing I can do once the game freezes. It's been confirmed by several people it's not my mod causing the freeze, it just takes longer without it because you're not dragging dozens of corpses one after the other. I guess I could check if any useless zombies are standing around after a game start, but that would certainly cause issues with other mods.
I'm finally playing with craft recipes and I have this thing that if I make a recipe to craft log bundles with less rope, the vanilla craft recipes for making log stacks disappear - and I don't know why. My recipe works fine but I can't unbundle them even though the result is a Base.LogStacks4
module AutoLoggingRecipes {
craftRecipe MakeFourLogStackLessRope
{
timedAction = Making,
Time = 60,
OnCreate = Recipe.OnCreate.CreateLogStack,
Tags = InHandCraft;CanBeDoneFromFloor,
category = Carpentry,
inputs
{
item 4 [Base.Log],
item 1 tags[Rope],
}
outputs
{
item 1 Base.LogStacks4,
}
}
}
fun fact: if you overwrite the vanilla recipes, they won't show up
it must be nap time
so Steam API still not updated?
Not sure what you mean
If you mean the server download issues, it's now the game devs to update their game
And also server providers to update their shit
the issue has always been on the game end
I mean, it was due to SteamCMD randomly updating anyway
it's not valve's fault the game uses a version three years old 😅
if you want to keep improving your software you have to break compatibility someday
I mean, I agree of course
yep, are inconveniences that arise.
Just maybe making an announcement to the game devs telling them "ok in 30 days we update this shit"
Or at least I haven't heard about a Valve announcement updating their SteamCMD
IDK, I just find it curious that its been a few days.
and persists.
Yea well that's what happens when the devs end up having to fix this out of nowhere lol
Also that's if they even properly keep track of their game versions and didn't completely lost previous version files that makes it impossible to properly make a new B41 version 
we know they use version control 😅
Yea I would have been surprised but you never know 💀
But yea Idk, it's true that this shouldn't be too much of a hassle to fix ? I doubt they changed majorly how any of it works anyway Steam side
What’s the default directory on Linux, for uploading mods to the workshop?
It's the cache folder
Find where you need to manually install mods
And that should be enough
But you can do like me and define a custom cache folder too
Game launch params:
-cachedir="<folder path>"
I don’t have a Zomboid folder in my cache folder.
The only PZ folders I can find are under primary > steamapps > common > Project Zomboid
Don't use that last one, that's the game files
That's why I set a custom cache folder
Bcs I couldn't find it too
Just do that already seriously, save you the hassle --'
Just you'll have lost your configs, that's the only downside
Okay, I ‘ll try doing what you did.👍
So, I just launch the game and have it create files at the specified directory?
Follow the Mod structure wiki page then
When launching the game, it creates all the default cache files
Which includes /Workshop
Animation structure
-# https://pzwiki.net/wiki/Animation#Animation_structure
- https://pzwiki.net/wiki/AnimSet
- https://pzwiki.net/wiki/AnimState
- https://pzwiki.net/wiki/AnimNodes
- https://pzwiki.net/wiki/ActionGroup
- https://pzwiki.net/wiki/ActionState
- https://pzwiki.net/wiki/Transition_file
New script type documented: Mannequins
AnimZed
-# Unreleased tool by TIS
https://pzwiki.net/wiki/AnimZed
It worked. Thank you, very much. 100 LIKES
My last and final issue that I need to resolve.
Any idea how I can fix this error, when attempting to open tileZed?
Didn't someone literally give you a solution the other day ... ?
You sent the exact same screenshot
You got an answer from Alree
In #mapping
AND the unofficial mapping Discord
This is correct. However, while they provided an explanation - I still don’t now how to fix it myself. Perhaps I’m a bit “slow”, but if someone would just hold my hand for just a moment - I’ll finally be free, and ready to continue with the fun things I’d like to do with modding.
In simple terms: I have to move “what” where?
This issue is not caused by TileZed itself, but rather by how the Steam Deck's operating system handles file systems.
the error:
Invalid cross-device link
means that the application is trying to rename or move a file between two different mounted file systems, something that Linux doesn’t allow using a simple rename() system call.
on the Steam Deck (SteamOS), this often happens because:
- The temporary files are written to /tmp (which is a tmpfs in RAM),
- While the target file is located in your home directory (e.g., /home/deck), or on a microSD card formatted in exFAT or another file system.
Since these are mounted as separate devices, a direct rename across them fails.
So yes, official linux builds works on Linux, just put all files on same partitions
BTW, you're posting on #1322524023992619039 for problem with B41 tools
Alree's message
While the target file is located in your home directory (e.g., /home/deck), or on a microSD card formatted in exFAT or another file system.
Find your file
Use tools to find where your file is located
What file, in particular?
If you're new to Linux, a simple search and you'll there's plenty of tools to search for files, directly with a simple command paste
The one in your error ...
I moved that one. I’ll try again.

