#mod_development
1 messages · Page 282 of 1
Ah yeah. Different issue appears. It didn't auto update but now tells me I don't have it installed. I'll have to publish my own version.
i meant unlisted, not hidden
I did something similar when one of my favorite map mods disappeared, Stonehill Apartments
had to reupload it as unlisted so me and my brother could keep playing
Halp. I updated my mini-mod, signed up on Steam page to check how it works, but in the game in the mods menu it is not shown (there are generally only ~40 mods and there are already about 900 for b42 in Steam), I need to look for it in the search bar and only then I can see it and activate it. Is this the case with everyone?
Your mods are also not in the list after subscribing to Steam?
they are usually up right away, unless you have links in the description then it might take a little bit while the content verification checks that links are not malicious
Can take a long time if you put a private gitHub link...really trips the steam verification up
I think I might have found a bug
LOG : General f:0, t:1735267741127> Unable to load video texture C:\Games\Steam\steamapps\common\ProjectZomboid\media\videos\media\maps\FishermansCabin\FishingCabin.bik.
Seems the path for the demoVideo is hardcoded
title=Cabin Spawns: Fisherman's Cabin
lots=Muldraugh, KY
description=
description=
description=
zoomX=11063
zoomY=10637
zoomS=14.5
demoVideo=media/maps/FishermansCabin/FishingCabin.bik
No links or anything like that. In Steam it says checkout is finished + other users have already downloaded it. But I still don't see it in the game in the mods list, only if I use the search bar
I mean do you guys see your mods in this list after signing up in steam or do you have to use search too?
i see mine
I'm confused on what specifically you are asking
seems they uploaded a mod to the WS, subscribed to it, but cant see it in their mod list
only when searching for the mod in the mod manager it is visible
Basically the same situation. I published it, it's public because I wanted my server to see it and be able to distribute it to my friends, however getting this error:
Workshop: item state DownloadPending -> Fail ID=3392902228
Not extremely descriptive.
Somewhere I can find more output?
Fun Fact: the new aiming system means if you target a zombie near your vehicle it's possible to hit the vehicle and set tire condition to zero, but not actually destroy the tire.
Less Fun Fact: North Muldraugh to South Muldraugh on foot at night is scary
actually that is kinda fun... gotta create those memorable zomboid moments somehow, and an easy loot run where nothing goes wrong is not very memorable.
Sorry, I'm using a translator.I'll try again: I signed up for a mod in steam, then I opened the game and I don't see it in the mod list if I scroll down. I have to use the search bar to find my mod and then enable it. Like I said, as far as I remember - in b41 you just have to subscribe to steam for it (mod) to work in the game
you could try exiting steam completely and opening it again, or you could verify integrity of game files, it tends to download missing mods as well
yes, ty
I'll give it a shot for sanity. I can subscribe to the mod myself just fine but the server seems to have issue pulling it and loading it on server restart.
Does the mod work once you search for it and enable?
yes
And are there any non-english characters in the mod name... that sems to mess up the list of mods
hay so my map mod is crashing on game load up for b42.
no, all fine with that
map mods dont work on 42 yet
Spawn location mods are working (technially maps, but not really) and I have seen B42 map mods on steam but not tried them
this isnt the only one ether.
there is an unstable tool supposedly
All the ones I've seen updated have issues from what their author said
Hey everyone,
I'm trying to add an overlay to a door frame as part of a mod I'm developing. This is my first time modding PZ, so I’m not sure if I’m on the right track.
Here’s the situation:
-I have a custom image, wuw_test_overlay.png, located in media/textures.
-My mod adds a security clearance system to doors. Players’ clearance levels are tied to their ID cards, so without the right card, they can’t enter.
-After right-clicking a door to set its clearance level, I use the door’s square coordinates to find door frame objects (WallType=doorframe), and I’m attempting to add a sprite overlay (a card scanner) near the door handle.
What I’ve done so far:
The overlay is added with setOverlaySprite, and when inspecting the tile, I can see:
[MAIN] walls_interior_house_03_11
[OVERLAY] wuw_test_overlay
[ATTACHED] overlay_grime_wall_01_27
However, hovering over [OVERLAY] wuw_test_overlay shows no image. It seems the sprite isn’t rendering, even though the name is correctly assigned.
Does anyone know how many IsoGridSquares are in an IsoChunk?
Here’s the relevant code I’m running:
local function attachOverlayToObject(object, overlayObjectName)
if object then
object:setOverlaySprite(overlayObjectName, 1, 1, 1, 1);
object:transmitUpdatedSpriteToClients()
else
WUWUtilities.DebugLog("Object is nil. Cannot attach overlay.", 3)
end
end
local function addOverlay(player, args)
if not args or not args.x or not args.y or not args.z then
WUWUtilities.DebugLog("Missing or invalid arguments for AddOverlay().")
return
end
local sq = getCell():getGridSquare(args.x, args.y, args.z)
if not sq then
WUWUtilities.DebugLog("GridSquare is nil at coordinates: " ..
tostring(args.x) .. ", " .. tostring(args.y) .. ", " .. tostring(args.z), 3)
return
end
WUWUtilities.DebugLog("Searching for doorframe on GridSquare at: (" ..
tostring(args.x) .. ", " .. tostring(args.y) .. ", " .. tostring(args.z) .. ")")
for i = 0, sq:getObjects():size() - 1 do
local object = sq:getObjects():get(i)
if object then
local objectProps = object:getProperties()
local spriteProps = object:getSprite() and object:getSprite():getProperties()
-- Check Object Properties
if objectProps then
if objectProps:Is("WallType") and objectProps:Val("WallType") == "doorframe" then
WUWUtilities.DebugLog("Found door frame on object properties at: (" ..
tostring(args.x) .. ", " .. tostring(args.y) .. ", " .. tostring(args.z) .. ")")
attachOverlayToObject(object, "wuw_test_overlay")
return
end
end
end
end
WUWUtilities.DebugLog("No door frame found at coordinates: " ..
tostring(args.x) .. ", " .. tostring(args.y) .. ", " .. tostring(args.z), 1)
end
Can overlays like this work directly with a standalone .png in media/textures, or do I need to define it in a tile pack or some other registration system?
Is there something I’m missing in how I’m applying the overlay, or how PZ handles tile overlays?
Any help is greatly appreciated as I've been stuck for a while now.
it could also just be a plain port with just adjusting folders until stuff sorta works so no b42 features at all
They need to be a tile, I believe the tool is TileMapper in the PZ Modding Tools under your Tools section in steam
The tool is called "TileZed"
If I remember that is what I used to pack image information into a special type of compressed file, I forget the extension, a .pack or .pak file maybe?
Start there for new tiles ^ @restive lodge
OK thanks ill check this out
I need to learn the tiled tool. Seems so confusing to me
That page has a good breakdown of it, if I remember right one of the pains is making sure to use the right template and to be very good at keeping track of those layers 🙂
Lack of jurassic park merchandise in July 1993 has always been disturbing
Okay(no). I'm unsubscribed from game list and from steam but i still can see my mod in list, idk how this list updates works but rn all fine. Anyway, thank you all)
https://drive.google.com/drive/folders/1lRCkMqPJ27GfW0fKg8ZN9CLWYJcm5zGI Tile Templates that you DO want to use 🙂
Anyone have an issue publishing a mod and the server failing to download it from the workshop?
can you manually place it on your server?
I suppose I can try. Will it serve it to new players automatically?
under workshop/content/<workshopID> ?
I have no idea
I would like to know how many times the number of zombies is greater, in the insane option
it would be 3x, 4 or 7 compared to vanilla
hahahaha I definitely need to add a script to clear a radius around you for these spawns...
this is the remote cabin west of muldraugh
for cycling do you think i should tie runner or fitness to bike stuff? like i get fitness but could runner also be tied into? like speed?
I say fitness
hrm yeah if i tie in runner it would also be less intuitive
not all cyclists are good runners but most runners can be good cyclists personal opinion not backed by facts
lmao
no worries
i think you are right
i might book mark the idea if i ever need it for some reason
heaya fellows
i have a question about obejct contruction method in pj
local square = getCell():getGridSquare(x, y, z)
if not square then return nil end
local isoObject = IsoObject.new(square, spriteName, objectName, false)
square:AddTileObject(isoObject)
return isoObject
end```
```lua needs to be on its own line
local function newObject(x, y, z, spriteName, objectName)
local square = getCell():getGridSquare(x, y, z)
if not square then return nil end
local isoObject = IsoObject.new(square, spriteName, objectName, false)
square:AddTileObject(isoObject)
return isoObject
end```
thanks
anyways, this newobject function
i see they used like Generator.new() barbecue.ne()
etc
where is this class made in?
can I just do custom name .new() to create any type of obejcts?
all java public constructors are exposed as Class.new()
i see
you can see constructors on the javadocs but they'll be written there as new Class() because that's the java syntax
but where are those square, spritename, objectname parameters are handled in??
like (as a noob modder) .. i thought u need to inherite following functinons
from a parental document
so i thought to expect something like "IsoObject = ISObject(IsoObject) " to b declared somewhere
to make it work.. but i couldn't find it
maybe im asking really stupid question...
they're implemented in the java side of the game, they aren't lua code
yeah
then why don't i see things like
ISButton = ISPanel:derive("ISButton");
for things like
local function newBBQPropane(x, y, z)
local square = getCell():getGridSquare(x, y, z)
local object = IsoBarbecue.new(getCell(), square, getSprite("appliances_cooking_01_37"))
square:AddTileObject(object)
return object
end```
like.. IsoBarbecue = IsoObject:derive("IsoBarbecue")
it does'nt matter what name goes before ".new" ??
they just automatically considered as object?
IsoBarbecue is java so it's in a .class file, :derive() is for creating lua classes
when .new() function is called?
ah
then if I wanted to do like
local obejct = CustomNAME.new(cell,squre,getsprite)```
it will cause error?
yeah
is it currently possible to set Autolearn similar to Recipe_:addRequiredSkill(Perks.Cooking, RequiredLevel_)?
just realized u can just use lua local isoObject = IsoObject.new(square, spriteName, objectName, false)
Does modifying the Zomboid.ini require a restart?
Does anybody know how MainScreen.instance can be nil?
My code is simple:
if not MainScreen.instance.inGame then
But somehow it causes the error:
attempted index: inGame of non-table: null
the main screen isn't loaded until OnMainMenuEnter or OnGameStart
local function KeyUp(keynum)
if not MainScreen.instance.inGame then
return
end
I guess it's a mod incompatibility, but users can't catch the bad mod and STACK TRACE in log doesn't help too.
I ended up getting it to work 👍
hi, I've a question, before in the 41 the walls basic health were wrote in a lua file (i'm not able to code in lua, I just can play around a little) is it possible that now on the 42 are in a script?
i've found this
was curious so I looked into this. here's the bits from the parser that handle it:
else if (var5.equalsIgnoreCase("AutoLearn")) {
this.autoLearn = new ArrayList();
String[] var16 = var6.split(";");
for(int var19 = 0; var19 < var16.length; ++var19) {
String[] var21 = var16[var19].split(":");
PerkFactory.Perk var23 = PerkFactory.Perks.FromString(var21[0]);
if (var23 == PerkFactory.Perks.MAX) {
DebugLog.Recipe.warn("Unknown skill \"%s\" in recipe \"%s\"", var21[0], this.name);
} else {
int var25 = PZMath.tryParseInt(var21[1], 1);
RequiredSkill var27 = new RequiredSkill(var23, var25);
this.autoLearn.add(var27);
}
}
}
without a proper example, I have no idea why it's trying to split on a semicolon in Lua unless it's some sort of weird varargs implementation, so I got kinda lost there, but you can probably just recreate the functionality without all the parsing by doing this:
local reqSkill = RequiredSkill.new(Perks.Woodwork, 5)
myRecipe.autolearn:add(reqSkill)
as long as myRecipe is a CraftRecipe object
(edit: whoops, wrong java codeblock, but they're pmuch the same. fixed though)
hopefully that's at least enough of a hint to get you in the right direction, if that doesn't work.
local square = getCell():getGridSquare(3433,10904, 0)
if not square then return nil end
local texture = getTexture("media/textures/Build_Cross.png")
local isoObject = IsoObject.new(square,texture, "hello", false)
square:AddTileObject(isoObject)
return isoObject
end``` why would this cause error
what does the error say?
you're passing a texture as the second argument but it is expecting a string
ah,,
true
but "media/textures/Build_Cross.png" this wouldn't work
if i put it directly either right?
tried and confirmed it's not working
saying no implementation found
i guess it only takes tile name only...
yeah it takes a tile name
i thought it would work because i was reading the old Object Tutorial files
-- adding blue cube
local obj = IsoObject.new(cell, sq, Cubes.sprites.blue.sprite);```
so it would still work but i guess new versions are changed
texture:getName() doesn't work too? I'm curious.
it should work if second arg is for texture name. idk if it's not for texture
haven't tried but i can try
well, it's not producing any error
but doesn't spawn anything on the square
so i guess it' needs to be set as sprite
it needs to be the name of a tile, that constructor loads the object properties from that tile
i see
guess no simple, putting .png image file in a folder and make it work
do the trick...
has putting Tile files stay unchanged from build41?
yeah
gotcha
anyone know why my character doesnt scream the sound i want?
seems to throw out an error : attempted index: add of non-table: null
i did edit it to change it from .add to :add but that was a bit later once I realized it. if that isn't the issue then not sure, I'm a little rusty atm
that class is exposed and the list is public, so it should work, but you might need to see if you can find any similar patterns.
you can't access fields easily without mods
https://steamcommunity.com/sharedfiles/filedetails/?id=3378285185 my library lets you access them with that syntax
Okay, Big thanks for the help
weird. i guess I forgot about that. what allows syntax like this to work, from vanilla?
local list = ArrayList.new();
for index,item in ipairs(_items) do
list:add(item);
end
is it an issue of it being passed via copy or something like that? e.g. list is now just a lua table more or less that contains the modified object, so you'd have to reassign it like javaObj.fooList = list?
they just aren't exposed
there's some weird reflection api you can use to get fields instead but it's a nightmare
something like this```lua
local autolearn
local fields = getNumClassFields(myRecipe)
for i = 0, fields do
local field = getClassField(myRecipe, i)
if string.match(tostring(field), "some posix pattern idr") == "autolearn" then
autolearn = getClassFieldVal(myRecipe, i)
break
end
end
my library just lets you do myRecipe.autolearn like you would expect
and does some precaching and stuff to improve the performance a whole bunch over this monstrosity
the class being exposed doesn't expose all the public members? or is it a matter of like... well, I was going to say ArrayList not being exposed, but the snippet I just posted kinda proves that wrong I guess.
arraylist is exposed, it's just that the exposer just doesn't expose fields whatsoever
only public methods are exposed
ah okay, that makes sense. so even public fields are basically treated as encapsulated
that blows honestly but I guess I get it, just weird since that's like the whole point of field protection keywords
keep in mind that field access even through this is strictly read-only (but that's generally fine since we're usually just trying to reach objects anyway)
does that mean "read only" as in, the collection itself is immutable (no add) or the members are read-only? kinda specific to collections I guess but still
(or both, which would be the strictest, I suppose)
just that the field itself is read-only, you can't do myRecipe.autolearn = ArrayList.new()
but since the field here is an object, you can modify the object just fine
you just can't assign a new object in its place
ah okay, that makes sense, just no reassignment. thanks for explaining all that
what is a good workflow to work on mods ? Launch game, edit lua file, reload file from F11 menu, etc... ?
is there a way to remote debug the lua file from vscode for example ?
main menu reloads/f11 reloads when they work for you
unfortunately because of the way the game uses lua remote debugging will probably never be possible
but there is an improved debugger expected eventually
ok thanks. is there a way to import compiled lua modules too, or is that out of questoin
no way
ok
and I suppose nobody tried, for fun, to import some python interpreter into this ?
bytecode compiled for other lua implementations (pz uses a weird niche one that, as far as i can tell, literally nothing else notable has used) wouldn't be compatible and functions related to bytecode dumping/loading have been blocked off anyway
I would suggest making completely bug free code! /S (F11 reloading always took my ass forever)
jab has a jython mod but i'm not sure what state it's in right now, especially given b42
but wait, how do the core devs work then ? they launch a game and edit .lua files and hit reload ?
with only print statements for debugging ?
as far as we can tell, probably yeah
wtf
afaik the community tools are probably more advanced than what they use 😅
There's a good chance
I remember using them a year ago and they were still well put together then
using what ?
The map editor and such
ah ok
If I remember correctly the indie stone have 1 guy doing the tools for the game
I regretfully don't remember their name would have to look at the credits again
i was mostly referring to umbrella and the various bits of community documentation
What does the following mean?
attempted index: setVehicle of non-table: null
Many mods in Build 42 seem to cause an issue where vehicle dashboards don't load. The first mod I have encountered which caused this was More Traits, and the odd thing is it continued to happen even after disabling the mod and creating a new save. Currently, I am having this issue while attempting to port a Build 41 mod for my own use. I have found two files the larger error refers to: ISEnterVehicle.lua and ISVehicleDashboard.lua. The ISEnterVehicle.lua is being refered to at line 51, which reads triggerEvent("OnEnterVehicle", self.character) and the ISVehicleDashboard.lua is refered to at line 608, which reads getPlayerVehicleDashboard(character:getPlayerNum()):setVehicle(vehicle) and seems to be part of that "OnEnterVehicle" event that ISEnterVehicle.lua called for, as it is in the following:
function ISVehicleDashboard.onEnterVehicle(character)
local vehicle = character:getVehicle()
if instanceof(character, 'IsoPlayer') and character:isLocalPlayer() and vehicle:isDriver(character) then
getPlayerVehicleDashboard(character:getPlayerNum()):setVehicle(vehicle)
end
end
With this, it looks like, somehow, the mod is making the game unable to read the character.getVehicle(). The problematic line ends in "setVehicle(vehicle)" where, if I'm not mistaken, "(vehicle)" is a variable, which is defined in the second line of this function where the variable "vehicle" is set by caracter.getVehicle.
Now, I've gone through the files of this mod I'm porting, and I've not found any reference to any of these files or variables, so what gives? Is this just one of those really odd bugs in Build42 where the game just doesn't want to read this function correctly when ANY mods are installed?
You'll get that error if ANY mod has a recipe in the old format.
Hello I am running on a weird issue for several hours where I cannot run a function from an event. I only have a small script that print something in response of an event but nothing happens
`function onCreatePlayerData()
print('Hello World')
end
Events.OnCreatePlayer.Add(onCreatePlayerData);`
My script is loaded fine btw
If anyone was using CDDAReading on B41 and found it to not be working since the author updated it for B42, I've essentially forked the previous build (with suggestive help of folks here) and got it working on both SP and MP:
https://steamcommunity.com/sharedfiles/filedetails/?id=3392902228&tscn=1735277334
is there a getter method for getting if the player is bitten or scratched?
Where do you check that something happens?
And why are you sure that your script is loaded?
Is it possible to do unit tests on lua script M
getScratchTime() or getBiteTime() they are methods of bodypart so you will need to separate bodypart from bodyDamage(). You can do that by something like
local bodyDamage = player:getBodyDamage()
local bodyParts = bodyDamage:getBodyParts()
Then iterate through bodyParts to check stratch time
B42 update broke my steam workshop results haha
i see i assume scratch time and bite time is the remaining time a body part is scratched or bitten ?
Kinda, though it probably doesn't translate in an exact time. It's more a damage indicator and how far a player need to heal by. Like scratch with time 100 will take longer to heal than a 5
And heal rate changes depending on what you treat it with I'm pretty sure
okay so i see so 0 is no scratch and then anything else is the "severity"
I think it depends on how the damage was given. Pretty sure if a zombie bites you it hits you with like a bite time of 20
does anyone know how the map and structures are stored in memory? what data structures are used for the chunks/heightmap etc..
I think it stored under the lot files in /media/maps/Muldraugh, KY/map/ but the files are encrypted
okay, I don't need to know their contents, but I see that there are lot header, lotpack and bin files in there, what do these store? this website only talks about the lotheader files: https://pzwiki.net/wiki/File_formats
Hi everyone, hope you guys have had a good christmas!
ive been following a couple of guides for creating new tiles and mod making in the hopes of making a new place-able building and now B42 unstable has a nice new build menu im wondering if there are any resources on how add to my custom tiles to it?
for added context i have a tiledef and .pack file with the attributes i want from worldzed / tilezed but i dont know what the next steps would be as to add my new tiles as a building?
Hello! I run PZ on a mac & notice two things that I want to try to make a mod to resolve, and was wondering how I should go about it (if even possible). First, the game incorrectly scales the resolution when opening up, easily fixed by changing resolution but I want to fix this if possible. The next thing is that since PZ doesn't ask for permission to use my mic, it doesn't show up as one of the applications in the list of apps that have permission to use it, so I can't use my mic in-game (wanted to use radios with friend, found out I couldn't!)
Hello! although i don't know how to mod properly myself it might be worth submitting bug reports to The Indie Stone since these sound like more fundamental/core issues that may not be solvable with mods! (as far as i know) due to TIS only exposing things they wish to be modified by us end users
yeah, these seem to be bugs that should be reported to TIS
ah ok! Thank you both for your responses!
B42 Unstable has a bunch of issues with aiming. It's fun as is, but it also breaks your immersion frequently as you struggle to deal with the inability to target enemies.
I explain how to quickly gain experience, aim, and a number of issues you should avoid.
Reddit Post By developer to read:
https://www.reddit.com/r/projectzomboid/comments/1hj...
hello people i wanna make that the player can show the middle finger but the player model has one finger so the main question is how??
Modify the model
true
anyone have a good resource for recipes?
check the PZ recipes
honestly, the base game scripts are a great resource
OK ill look there
Show that finger 
You could maybe twist it 90 and tuck it into the palm?
Or see if you can use the thumb as the finger somehow could work possibly too
Anyone know how to programmatically add a dynamic light to the game?
I can't seem to load this mod for some reason. It's just a simple moodle replacer. any ideas?
it's not on the workshop; just a stupid meme for me and my friends
im just thinking change shape of it
You need the 42 folder, the structure is in pinned messages
that certainly helped but didn't seem to do the trick, mind if i DM you?
sure
greetings fellow modders
https://discordapp.com/channels/136501320340209664/1318920979581501502/1321068033304956928
Ah! That makes sense as to why it seems to happen so "randomly"! Unfortunately, I have no idea what the format is or how to change it. Darn. I was really hoping to be able to use this mod in my Build 42!
#musicmaniacpins b42 javadocs
Is there a way to reduce the scale of a 3d item via script?
Is it possible to write an in game note (like on a piece of paper) dynamically via code?
Like, add an item to an inventory that is a note with dynamically generated text in it?
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\models_X\vehicles
thanks
yes, in fact writing on notes is implemented in lua
it gave me this
Ok, dope. That opens quite a bit to me. Off chance, do you know if text is READABLE by code? Like, can players write a note and the code pick it up (I can parse it if I can get it lol)
yep!
From what i remember, some files need to be imported using Blender addons such as the better fbx export
let me search it
I think it cost money 😭
wait
I think I found something
I found a way
this might be interesting
PZ use's triangles or quads?
triangles
alr
alr
So uhm I'm a bit confused, can anyone tell me why this
local original_ISPetAnimal_perform = ISPetAnimal.perform
function ISPetAnimal:perform()
print("ETW Logger | ISPetAnimal:perform(): caught, petting animal with ID "..self.animal:getAnimalID())
original_ISPetAnimal_perform(self)
end
local original_ISPetAnimal_complete = ISPetAnimal.complete
function ISPetAnimal:complete()
print("ETW Logger | ISPetAnimal:complete(): caught, petting animal with ID "..self.animal:getAnimalID())
original_ISPetAnimal_complete(self)
end
gives 0 prints in console when petting?

Does a more simple print work?
ie: print("test")
complexity of print doesn't shouldn't matter, it would either print or error out if it would be print related
but i'll try
is it possible to make more variants of the same weapon?
usually it indicates that function isn't even used
ye but if you look at ISPetAnimal it kinda runs that code when you pet an animal
True, just fastest thing to eliminate a potential issue and narrow down cause.
judging from this at least
function ISPetAnimal:start()
forceDropHeavyItems(self.character)
self:setOverrideHandModels(nil, nil)
self.character:setVariable("AnimalSizeX", 0.01);
local range = self.animal:getData():getMaxSize() - self.animal:getData():getMinSize()
local current = self.animal:getData():getSize() - self.animal:getData():getMinSize()
if current <= 0.001 then
current = 0.001;
end
self.character:setVariable("AnimalSizeY", current/range);
-- print("range", range, "current", current, "total", current/range)
self.animal:getBehavior():setBlockMovement(true);
self.character:setVariable("petanimal", true)
--print("set animal pet! ", self.animal:getAnimalType())
self.character:setVariable("animal", self.animal:getAnimalType())
if self.animal:hasGeneticDisorder("dwarf") and not self.animal:isBaby() then
self.character:setVariable("animal", self.animal:getBabyType())
end
self.animal:setVariable("idleAction", "petting")
sendEvent(self.character, "PetAnimal")
end```
if you check context menu code it creates the ISPetAnimal
if animal:canBePet() then
menu:addSlice(getText("ContextMenu_PetAnimal"), getTexture("media/ui/AnimalActions_Pet.png"), AnimalContextMenu.onPetAnimal, animal, playerObj);
end
where
AnimalContextMenu.onPetAnimal = function(animal, chr)
animal:getBehavior():setBlockMovement(true);
local vec = animal:getAttachmentWorldPos("head");
ISTimedActionQueue.add(ISWalkToTimedActionF:new(chr, vec));
ISTimedActionQueue.add(ISPetAnimal:new(chr, animal))
end
it creates timed action
I might be wrong on my syntax, but do you need to return the old code?
return original_ISPetAnimal_perform(self, ...)
Its just how I have seen it done in the past.
only if the original function returned something
sometimes yes sometimes no
ye, that
well i guess complete should return then but that doesnt explain how timed action skips my perform decoration
originalToggleClothingWasher(context, worldobjects, playerId, object)
-- Custom logic below
end```
I have a good idea for making a mod:
A mod that adds a new plumbing system, you can connect piping to a well and then hook the piping up to a electric pump that you have to find, kind of like generators but much more rare, then you con pipe the plumbing to sinks, baths, etc.
I shall make this as soon as I learn how to mod PZ
my syntax should be correct, as an example, here's decorating another timedaction with same one:
local original_ISChopTreeAction_perform = ISChopTreeAction.perform;
---Overwriting ISChopTreeAction:perform() here to insert ETW logic catching player cutting down trees
---@diagnostic disable-next-line: duplicate-set-field
function ISChopTreeAction:perform()
if ETWCommonLogicChecks.AxemanShouldExecute() then
--- stuff here
end
original_ISChopTreeAction_perform(self);
end```
question is why pet won't pet 
You have the require at the top?
No, nor should I be needing it, I believe? At least, I never have needed it and I decoreted a bunch of other fucntions
requiring a vanilla file never does anything
Hmm, I thought you had to if you were overwriting
it's basically a mass hallucination induced by the community copying vanilla files

So you saying I can make my file 1 line shorter 
all require does is:
- run the file if it hasn't run already
- return whatever the file returned
all vanilla files run before all mod files and none of them return anything so requiring them does nothing
local original_ISPetAnimal_perform = ISPetAnimal.perform
function ISPetAnimal:perform()
print("ETW Logger | ISPetAnimal:perform(): caught, petting animal with ID "..self.animal:getAnimalID())
original_ISPetAnimal_perform(self)
end
local original_ISPetAnimal_complete = ISPetAnimal.complete
function ISPetAnimal:complete()
print("ETW Logger | ISPetAnimal:complete(): caught, petting animal with ID "..self.animal:getAnimalID())
return original_ISPetAnimal_complete(self)
end
local original_ISPetAnimal_start = ISPetAnimal.start
function ISPetAnimal:start()
print("ETW Logger | ISPetAnimal:start(): caught, petting animal with ID "..self.animal:getAnimalID())
original_ISPetAnimal_start(self)
end
Im only catching start.
I think this sendEvent(self.character, "PetAnimal") at the end of start just delagates petting to server
but there is no server...
thats exactly why i am confused
how timed actions are going to work is a bit confusing right now but all the old functions are still running as usual
in b41 didnt we still have server console output even in sp?
or am i trippin
as a separate file
then idk, zomboid is trolling or sth. how can it start timed action but not run perform

also from what i can tell perform is client code
complete seems to be the server equivalent
well full petting with this catches only start

umm
and i kinda need to decorate the end of petting not the start cuz I wanna do stuff when player completes the petting
petting doesn't really look like a timed action to me
I thought it is? ISPetAnimal = ISBaseTimedAction:derive("ISPetAnimal");
hm
even indefinite timed actions show that looping one
that is true
maybe they did it as timed action so they can queue player walking?
idk
maybe you can just do that actually
oh, true, that explains no action bar
local original_ISPetAnimal_animEvent = ISPetAnimal.animEvent
function ISPetAnimal:animEvent(event, parameter)
print("ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID "..self.animal:getAnimalID())
if event == "pettingFinished" then
print("ETW Logger | ISPetAnimal:animEvent(pettingFinished): caught, petting animal with ID "..self.animal:getAnimalID())
end
original_ISPetAnimal_animEvent(self)
end```
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(pettingFinished): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(pettingFinished): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(pettingFinished): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(pettingFinished): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(pettingFinished): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(): caught, petting animal with ID 1325
ETW Logger | ISPetAnimal:animEvent(pettingFinished): caught, petting animal with ID 1325
holy moly 
I pet 1 cow
why can't perform just work like a normal timed action, it has to be some weirdass stuff
sigh
guess I'll have to decorate animation event instead of perform like a normal person
If anyone was using CDDAReading on B41 and found it to not be working since the author updated it for B42, I've essentially forked the previous build (with suggestive help of folks here) and got it working on both SP and MP:
https://steamcommunity.com/sharedfiles/filedetails/?id=3392902228&tscn=1735277334
Ok, I'm stumped. I'm working on creating a list of item names that will be used later, and stored in the modData of a container. However, even though the logic seems right to me, when I print the length of the tables at the end, I'm getting 0. Am I adding key value pairs to the tables incorrectly?
function TKE.ProcessDeadDropIntake(container, items)
local value = 0
local sold = {}
local rejected = {}
for i = items:size() - 1, 0, -1 do
local item = items:get(i)
local itemType = item:getType()
local itemName = item:getName()
if TKE.SyndicateFactionWants[itemType] ~= nil then
local val = TKE.SyndicateFactionWants[itemType]
value = value + val
if sold[itemName] ~= nil then
print(string.format("Sold: Increment %s", itemName))
sold[itemName] = sold[itemName] + 1
else
print(string.format("Sold: Add %s", itemName))
sold[itemName] = 1
end
else
if rejected[itemName] ~= nil then
print(string.format("Rejected: Increment %s", itemName))
rejected[itemName] = rejected[itemName] + 1
else
print(string.format("Rejected: Add %s", itemName))
rejected[itemName] = 1
end
end
container:getContainer():DoRemoveItem(item)
end
print(#sold)
print(#rejected)
container:getModData().DeadDropValue = value
container:getModData().Sold = sold
container:getModData().Rejected = rejected
container:transmitModData()
end
Console returns the following (I put 1 44 round, 5 dollars in the container, dollars are the only thing on the Want list.)
> Rejected: Add .44 Magnum Round
> Sold: Add Money
> Sold: Increment Money
> Sold: Increment Money
> Sold: Increment Money
> Sold: Increment Money
> 0
> 0
hey, have you by any chance figured out what itemcount means/does? I can't see any rhyme or reason for its use, but that might just be me being dumb
fyi if you put lua at the start of multiblock code you'll get pretty formatting :)
Nope, just copied it from the lighter refill recipe and it worked lol
Ty, I spaced it
haha alright. I'll try to figure it out, perhaps it's related to mode:destroy
Seems to be used on many of the refill-style recipes
isn't correct syntax to append to list in lua is table.insert(list, value)?
your direct asignment is incorrect if I'm not mistaken
it should be list[integer] = value
you have list[string], no?
# only counts consecutive integer keys starting from 1
it doesn't check the number of pairs because lua doesn't really have that concept
#t basically just counts t[1], t[2], t[3] etc until it hits nil
if you had to count the actual number of pairs you'd do a pairs() loop through the table and just increment
if I had to guess, maybe itemcount is supposed to be used in conjunction with drainable items, if you want that item to be used in its entirety instead of 1 use being subtracted
so item 1 [Base.BlowTorch] itemcount, means "use 1 entire blow torch item"
and item 1 [Base.BlowTorch], means "use 1 unit from the blow torch item"
Ah, that makes sense. Would explain why the recipe was only failing for empty torches, as that would be the only case where there is no unit of fuel to use.
I was attempting to create a key value pair like
sold = {
["Money"] = 5
}
rejected = {
["44Round"] = 1
}
I'll try that.
gonna make a mod that gives you money on every zombie kill :p
Can't you just check their wallets?
good question
Trick question; Yes you can.
That was it, I was printing the wrong thing lol.
Can anyone fathom a way to combine two Sprites/Tiles to make a Texture? For example, some moveables are multi place in which they have seperate parts for each square. I am using this texture for UI purposes.
I feel like I'm overthinking this, but I'm about to try to add in an item to the loot pools and I'm a little overwhelmed. Do I need to dive into the procedural distribution or just the distribution to get the places for a new item to spawn?
The best way to get started is to look at an existing example, and then to search for the different spawn locations you can use. There are some other considerations to make it work well. What are you looking to do? Where you plan to spawn affects how to approach it.
You know what would be dope now with the basement feature to have like mining and we can gather resources like this
It's essentially an MRE or a ration. I have the item working as intended and having it spawn in the world is the last step, at least until I tinker with it more.
Are you looking to have it spawn in various places like dead zombies as well as be found in containers?
I can give you an example file to get started with give me a moment.
Thanks so much. I was just starting with containers, but corpses could carry a small chance, that'd be cool.
Its all doable and the system is solid once you know about a few kinks in it.
Also, how different is the lua compared to 41? I ask because there are tons more examples for B41 but I don't want to shoot myself in the foot if those mods are too outdated
if it's not a system that's been directly updated it's probably still quite similar
for example distirbutions haven't changed whatsoever (aside from some being renamed)
Depends on the systems you are using, recipes changed a lot, I think lighting may have changed, plus all the new stuff, lots of things are exactly the same too. But with B42 there are little changes too like variables for example in distribution they changed instances of "Sidetable" to "SideTable" so you can get bit by some of those.
I've been referencing old docs for sound and nothing has changed I can find so far, for example.
yeah sound api's identical, that was one of the first things i looked at
Have you looked at any of the light stuff? From their examples it seems like there is a lot of new, but I haven't looked. I am curious if we can float a light around like a UFO yet 🤓
like light at XYZ would be so great 🙂
Drones in B42 imminent
then Ill add a coast to coast am radio station that
I think Art Bell started it around 1992
Computer shut off suddenly and hadn't saved in an hour 
what software were you working with? N++ and VScode should have it stored
I usually tell my students that this is opportunity to do your work better than you did before. 🤓
Yeah lol
don't worry, sooner or later you'll encounter an event so traumatic you obsessively press ctrl-s after every minor change for the rest of your life
--This will add an item to a generic zombie.
table.insert(SuburbsDistributions["all"]["inventorymale"].items, "YOURMOD.YOURITEM") --This is generic male
table.insert(SuburbsDistributions["all"]["inventorymale"].items, 100)--100 here is not percent chance, this translates to about %20-%40 chance depending on other circumstances. Verify in game with LootZed.
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, "YOURMOD.YOURITEM") --This is generic female
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, 100)
--This will add an item to a named zombie outfit, find these in the horde manager in debugger or by searching in existing distribution code etc.
table.insert(SuburbsDistributions["all"]["Outfit_PoliceState"].items, "YOURMOD.YOURITEM")
table.insert(SuburbsDistributions["all"]["Outfit_PoliceState"].items, 100)
--This will add an item to a named area - the rich peoples fridge
table.insert(ProceduralDistributions.list["FridgeRich"].items, "YOURMOD.YOURITEM");
table.insert(ProceduralDistributions.list["FridgeRich"].items, 100);
ItemPickerJava.Parse()
end
Events.OnInitGlobalModData.Add(AdjustSandbox) --this event is added to adjust sandbox AFTER your mod loads, if you have sandbox settings to adjust spawn rates this is required.```
You can put that in a .lua file located in media/lua/server/Items
I really should put these on my git like I do with my RW mods
if you're doing it in OnInitGlobalModData you need to call ItemPickerJava.Parse() at the end or your changes won't actually be applied
has any of you encountered issues with sounds? Like zombies breaking windows silently?
And one day the CTRL+S gets you too haha
Good catch I clipped it when making the example!
Thanks for this!
InventoryItemFactory.CreateItem is replaced by instanceItem() (global function)
This has to go after the other code I'm putting in?
Of course, if you goto media\lua\server\Items\Distributions.lua that will have all the outfits you can use to spawn on zombies as well as some places.
I added it to the example you are good. This is the "ItemPickerJava.Parse()" near the end of the example.
There it is as a file if that is a bit easier.
I noticed poking around that there is a ton of profession house spawns that are currently commented out
I got it from the other example in N++, just looking at it and wishing I knew more about it all to understand.
I think I noticed an issue with my example file, let me reprovide it.
There you go, use this latest example the function being called was not named correctly on the prior example I gave you.
I appreciate it!
What is the purpose of changing module Base to something else? Should I not do that if I'm using an already existing mesh?
Organization and compatibility. If you shove everything into Base you dont have that extra layer to keep your stuff unique. So if you add a RedCoat for example, and so does someone else you can have isues, if they are both Base.RedCoat.
You can import base if needed but you shouldn't need too. I think you can access Base items easy without the import for some reason, but I am not positive. You should be able to access the base mesh for your mod item without issue.
Okay, thanks! I think I'm understanding more.
No problem, this is the central place to ask too so you are in the right direction. 
gonna use this as well, see if I fix some broken distributions from other mods. I hate seeing errors
So if I change the module in my mod info will I need to put that "prefix." before any assets I add / anything else? As far as item stats, etc
only outside of your module
Technicallly anything you do outside of your module I think, but you can safely include prefixes all the time too if you want to umbrella it.
The leniency in the coding is both convenient and also something to get used to.
Part of my like the fact that if a B42 recipe is off by a bit, it kills the whole program, it is a damn good filter haha.
it's so refreshing to get script errors that actually tell you what you did wrong
most other script types don't even tell you you did anything wrong
Yeah it is nice when we get that solid feedback. Sometimes it is a void and all we get is faith as we jump haha.
How come when I had the model scaled up unreasonably huge it's visible when eating it, but when I scale it down to a realistic size, the item doesn't show up in hands while eating it? Do I have to do something special with the static model?
Hello, good afternoon everyone. I would like to start creating my first mod in pz, but I don't know anything about the LUA language. I know how to program in python, java and C++, but I have never worked with LUA. I understand that it is similar to javascript, so I would like to know if you can help me by guiding me on where I should start. The mod I want to build is not just a skin, I would like to start modifying traits and professions.
Hello, is there a mod that can replace the ost for multiplayer? I know true music but it only adds songs as cassetes to my knowledge. Thank you
Pretty sure most mods that replace the OST need to be manually installed
And you can't do much about it
So i have to ask my friends to manually download the mods too?
maybe just a developer having some fun with npc testing?
Must be lol. My only throughts. Was the case the last time I found a robot in a game where it didnt belong.
Yesterday, I found an unused pocket icon. Did this game ever use pockets as a containers?
it's something they've wanted to do for a bit
Doesnt seem like it would be too hard to implement
they posted a concept image of flattening all containers into one inventory and having stuff like clothing give you your basic inventory space
Interesting
Thank you so much for this. I was struggling until I saw this and finally got my mod to load properly in 42.
Anyone seen a guide on how to create sound events? Perhaps another mod that does this. Instead of assigning one sound with file, events seem to allow a variation of sounds for a given sound script. Would it require FMOD Studio?
it would, and there's no modding suport for it (replacing vanilla files with manual file replacement only)
What a shame. Bank files can be huge as well. I suppose there are always workarounds if someone were insistent on doing it.
By modifying bank files yourself
You can replace sounds
Idk about adding any tho
But yeah it would be great to be able to utilize FMOD
if we wanted to get serious about it we'd need lua api for it too
Yea
module WUW_ID_Me
{
item MOV_CardScanner
{
DisplayCategory = Electronics,
Type = Moveable,
Icon = wuw_id_cardscanner_icon,
Weight = 5.0,
DisplayName = ID Card Scanner,
WorldObjectSprite = location_community_school_01_32
}
}
Does anyone know why I cant place this item. I even tried using the wall clock sprite but nothing shows up when i try to place
Missing a comma maybe after -> WorldObjectSprite = location_community_school_01_32
no
No need for a comma there
I guess you're not importing base ?
i'd put a comma
not sure about the new script parser but in b41 basically every script type except items bugged out without closing commas
make a middle finger attachment
I need help with python. Trying to make a recipe updater.
only problem i'm having is that it throws double commas sometimes or comma after ingredients like [Base.Plank,],
Before I glue a prefix to doLiteratureMenu() and hack together something that works, is there a proper way to add a rightclick context menu option to a new item?
add a listener to OnFillInventoryObjectContextMenu
local original_doLiteratureMenu = ISInventoryPaneContextMenu.doLiteratureMenu
-- From media\lua\client\ISUI\ISInventoryPaneContextMenu.lua
function ISInventoryPaneContextMenu.doLiteratureMenu(context, items, player)
print("##### This is where my code would go, if I had any")
original_doLiteratureMenu(context, items, player)
end
will work, but there may be a much better way.
I also found errors on vanilla recipes. Strangely the game doesnt complain about them
craftRecipe MakeSawbladeCudgel
{
time = 600,
tags = AnySurfaceCraft,
category = Weaponry,
needTobeLearn = true,
SkillRequired = Woodwork:4,
timedAction = CraftWeapon2H,
xpAward = Woodwork:5,
AutoLearn = Woodwork:8;Axe:5,
MetaRecipe = MakeSawbladeWeapon,
inputs
{
item 1 tags[Hammer] mode:keep flags[MayDegradeLight],
item 1 tags[Saw] mode:keep flags[MayDegradeLight],
item 1 tags[Wrench]] mode:keep flags[MayDegradeLight], <=========== Double ]]
item 1 tags[DrillMetal] mode:keep flags[MayDegrade],
item 5 [Base.Nails],
item 1 [Base.CircularSawblade] flags[IsHeadPart],
item 1 [Base.LeatherStrips] mode:destroy,
item 1 [Base.NutsBolts],
item 1 [Base.LargeBranch] flags[Prop2;InheritCondition],
}
outputs
{
item 1 Base.Cudgel_Sawblade,
}
}
local doMyItemContextMenu = function(playerNum, context, items)
local primaryItem = items[1]
if not instanceof(primaryItem, "InventoryItem") then
primaryItem = primaryItem.items[1]
end
if primaryItem:getFullType() == "Module.MyItem" then
-- add to the context here
end
end
Events.OnFillInventoryObjectContextMenu.Add(doMyItemContextMenu)
thanks
There's no more oncanperform?
It's not here, it might not be there anymore.
https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md
you can technically replicate it in an ontest
What is LootZed? a command?
kinda, you enable it from the debug cheats list and then right click a container icon to open it for that container
ok cool, ty
-- Hook into ISMoveableSpriteProps placement validation
local originalCanPlaceMoveable = ISMoveableSpriteProps.canPlaceMoveable
--ignore warning, this is intentional
---@diagnostic disable-next-line: duplicate-set-field
ISMoveableSpriteProps.canPlaceMoveable = function(self, character, square, item)
if item:getFullType() == "WUW_ID_Me.MOV_CardScanner" then
for i = 0, square:getObjects():size() - 1 do
local object = square:getObjects():get(i)
local objectProps = object:getProperties()
-- Check Object Properties
if objectProps then
-- Rotate based on door frame direction
if objectProps:Is("DoorWallN") then
self:rotateMoveableViaCursor(character, square, "wuw_cardscanner_01_1")
return true
elseif objectProps:Is("DoorWallW") then
self:rotateMoveableViaCursor(character, square, "wuw_cardscanner_01_0")
return true
end
end
end
return false
end
return originalCanPlaceMoveable(self, character, square, item)
end
can anyone help me rotate my sprite rotateMoveableViaCursor and rotateMoveable didnt seem to work
@bronze yoke thank you for your help earlier, I got my in game notes working.
Hopefully a a simple question: how do I convert from playerNum to get a player object?
local doDIYContextMenu = function(playerNum, context, items)
I'm sure I've seen something really simple like Global.getplayer(x) or Player[x] but now I can't find any of those.
this might be it: local playerObj = getSpecificPlayer(playerNum)
that's right
Ok yall,
Anyone able to point me in a good direction (PZ code, or a mod, something like that)?
I'm looking for a way to display a png on screen similar to the way that the brochures and fliers work. I looked into the "how to add a flier" walk through, but I'm not sure thats what I need, I don't want to add the items into the randomly spawning lists, as the items are dropped off of special zeds or spawned into the world by player actions.
The eventual goal is right click > Context Option > Show Image
I've never worked with the UI before, but I'll learn.
Can confirm. Used that a couple times today.
Looking for Coders for a Project Zomboid Radio Mod
I’m working on a mod for Project Zomboid and need help with coding! The idea is an infinite government-run radio station, originally run by FEMA during the Knox Event. It broadcasts pre-recorded educational tapes by Dr. Evelyn Grant, a high-ranking FEMA official, teaching survivors essential skills like carpentry, metalworking, fishing, and more. Over time, the station is maintained by two immune scientists broadcasting from a bunker.
The station also features propaganda, bulletins, and survival content designed to help survivors rebuild civilization. I’ll handle all the writing; I just need coders to make it happen. Let me know if you’re interested!
I've got a few bits of answer, since I'm working on adding a context menu to something
local doDIYContextMenu = function(playerNum, context, items)
print("##### doDIYContextMenu()")
local primaryItem = items[1]
if not instanceof(primaryItem, "InventoryItem") then
primaryItem = primaryItem.items[1]
end
if primaryItem:hasTag("DIYSchematic") then
print("##### It's a DIY Scematic")
local playerObj = getSpecificPlayer(playerNum)
readOption = context:addOption(getText("ContextMenu_ReadDIY"), items, DIYonLiteratureItems, playerObj);
end
end
Events.OnFillInventoryObjectContextMenu.Add(doDIYContextMenu)
That will add a function to the context menu generator that will see if the item matches if primaryItem:hasTag("DIYSchematic") and if so, it will add a context menu entry that calls the function DIYonLiteratureItems()
Sent you a DM.
I've messed up passing playernumber vs. player object somewhere in my code, but at least my code is getting called.
Then you steal the code for displaying the fliers and change as needed.
I appreciate the share! I do already have the items making context menus. Its the "show the picture part" that I have no clue where to go 😄
player numbers are a frustrating concept to be honest
Ideally, you can make a new type of object and then your code says "if objecttype=NewThing (call the existing display flier code)
i have no idea why random parts of the code prefer them (and never specify that they do)
I miss strictly typed languages.
me too 😭
In those you know damn well what is an int and what is a ZomboidPlayer
But before doing that, check the existing procedural distribution tables - if they list each existing type of flier explicitly for the vanilla fliers then you can just make more fliers and add them where you want
where is usually client sided print statements located? in the output log console in game? or is there a log file? i heard it should be console.txt but i can't find it
both console.txt and the lua debug window
where should be console.txt be located? in the game installation folder?
%UserProfile%/Zomboid/
okay then it seems like my function won't fire correctly
Not me doing mod development but I LOVE the devcatt’s noodles mod the guys are so silly
local MULTIPLIER, STARTCHANCE
local function SetSandboxSettings()
MULTIPLIER = SandboxVars.Immunity.Multiplier
if MULTIPLIER == nil then
MULTIPLIER = 1.01
end
print("SandboxVars were initialised")
end
Events.OnGameStart.Add(SetSandboxSettings)
shouldn't it print that statement when i start a new Game or load into a existing one ?
it should yeah
Neither in log nor the console.txt is anything
is the file loading logged? there should be a line in console.txt for every single lua file loaded
it seems like it loads my mod but not the lua file
its b41 and my lua file is inside media -> lua
oh i suppose im missing the folder for which device, client, server or shared?
yeah, file cant just be in lua alone
yeah it worked now, thanks!
So I'm currently working on getting my new item to spawn on zeds, I go in and kill some, check LootZed and the item has a 60% chance to spawn on them but in the space for name it doesn't have the icon or the name like all other items... Where did I go wrong?
And for a 60% drop rate, there have been none dropping.
The item does show up in the itemlist and I can give it to myself, and it appears normal there with its icon.
Usually it will not have the icon in lootzed or in the item viewer but it should still work fine in player inventories. What do you mean the name is missing also, is it just completely blank?
Yes, where other items have their icon followed by their display names, my item has neither.
I tinkered a bit with the lua and tested more. Now some zeds opened up in Lootzed have the Name in the space for name (I'm okay if the icon doesn't show up there.)
It could have been the item being added to the table was not matched to the item so it was adding an item that did not exist, so then blank, but since it still added it, it still had the chance, but a chance for nothing.
I think you're right. I fixed a capitalization error and now they're starting to spawn. Although some zeds when opened up in lootzed still have that happening. I wonder if it's because they're not 'generic' zeds
Did you make sure it is correct on both male and female?
🤦♂️
ill try
im used to strongly typed languages so lua is a bit weird for me
how do i correctly process a parameter which came from a event? for example
OnPlayerGetDamage
i get the Character which is the IsoGameCharacter
but since my parameter of my function isn't defined its just "any" and so calling methods on it doesn't seem to work?
https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md
From there I see OnPlayerGetDamage passes 3 variables that is (character, damageType, damage), when you setup your function make sure to have all three parameters on there. Then you should be able to call functions from character.
No idea on that I do all my PZ work in Notepad++ and just use visual studio for searching the source. I don't use VSCode in this case so can't help you there.
in lua you can pull the event params out using "..." syntax and it should return a lua table with the java objects
`Events.OnSpawnVehicleEnd.Add(function(...)
print("vehicle spawn ended")
local vehicle = ...
print("Direct vehicle access: ", vehicle)
initializeDomeLightData(vehicle)
-- check mod data content
local modData = vehicle:getModData()
printTable(modData)
-- fetch parts and create the lights
local parts = {"DynamicImposter/DomeLightFront", "DynamicImposter/DomeLightLeft", "DynamicImposter/DomeLightRight"}
for _, partId in ipairs(parts) do
local part = vehicle:getPartById(partId)
if part then
Vehicles.Create.DIDomeLight(vehicle, part)
else
print("VehicleSpawnEnd-: no part found")
end
end
end)`
Odd thing: while testing I killed a zed who dropped my item, although upon checking Lootzed, there is no percentage for that particular zed to drop it. The item isn't even listed in lootzed for her. I'm unsure what to make of this one.
That zombie has an outfit and is not generic.
Correct
Hello, any advise on how i can solve this problem?
ReplaceOnUse = Base.WaterBottleEmpty, this is an item definition line, since WaterBottleEmpty dosen't exist anymore, how i can give the player an empty bottle after consuming this drink?
Do you have that outfitted zombie in your loot table?
Thing is though, I haven't added in the outfitted zeds in the table yet
So the male and female only apply to zombies that do not have an "outfit" which you can think of as a profession in most cases, if they have an outfit, they will spawn instead from that loot table. For example police are Police PoliceState (there are some others I forget them, a riot guy I think).
Yeah this one was OfficeWorkerSkirt
There is another layer to the generics also, I think you can use Generic01 through Generic05 as the outfit name as antoher way to spawn on Generics but the male female ones get you the most.
Yeah so unless you had given the outfit OfficeWorkerSkirt the item in loot table it wouldn't show up, keep in mind to do that isa different format to add them it is in that example file from before though.
I think it ends up being formatted as Outfit_OutfitName
Right, I'm confused because she did carry the item, I'm bewildered as to how.
It's not in LootZed for her either but somehow she died and has the item
Hmm that is odd. Trying to think of potential reasons for that... Could be that male and female apply to her somehow, but if loot zed showed it wasn't there and it was, that is odd. The only time I have seen that happen is if you are changing sandbox settings without a restart of the game, sometimes lootzed will reflect the old info not the new. That can also be the case if your ItemPicker call is in the wrong place and sandbox isn't updating.
If you are using anything from sandbox and you don't have the itempicker call it can cause that because it will keep using the original entries but lootzed will look at the new ones. Not sure how else could cause it, feel free to share your file if you like.
the lua?
yeah
hm how do I put code in here
You can just hit the + and upload the file it will bring it in as an expandable block
Looks like you don't have any sandbox calls in there, it shouldn't have an issue here I don't think. You may want to kill some more zeds and see if that repeats
you can use horde manager to spawn a bunch of the one you saw it on
it could be that you found a borked outfit, otherwise I am not sure.
Where is horde manager?
Do you have your game in debug mode?
I do
You should be able to do a right click, and then I think the menu is Debug > Zombies > Horde Manager from the context
it may be slightly off I am not lookin at it now, but its in there
You can spawn OfficeWorkerSkirt and see what you get from that one in LootZed, then also check another outfit that is named and see if any of your items show up.
Confirming that OfficeWorkerSkirt is dropping items not in her LootZed consistently
I'll try some more.
My guess is that outfit is funky. Interested to know what you find.
Maybe she isn't defined correctly and it is defaulting to the generic, does she spawn anything that is in her lootzed?
She was, it was all standard stuff in there and just had a ration on her.
Confirming that regular "Police" is also dropping em
4/10
Hmm I will have to take a peak at this, my understanding was that ["all"]["inventoryfemale/inventorymale"] would apply to zombies that are not outfitted only but it could be that "all" includes all outfits now. I will need to take a closer look, are you in B41 or B42?
b42
Okay it is possible they have changed something there, I am curious about it and will dig in later, but let me see I can give you lines to change.
I mean it's doing what I wanted it to, I just was going to dial it way down so the items are rare before release. Also still have to go through the procedural distribution but that's a task for after some sleep
In fact this saves me from finding every outfit name and putting those in lol
Yeah it could be good to have one that adds to everything, this is how you would do it if you only wanted to spawn on the five generic outfits, I believe that is how to call them but that is from memory.
Gonna tuck this away for reference... Thank you v much
I was considering making em more prevalent in service workers rather than generic zeds, which this will definitely help me do, but first priority is getting it ready to ship. I can tinker with those specifics when it's time to refine
Yeah, did another 10 zeds for kicks, Firemen this time. Looks like it's across the board.
Anyways, @spiral pike, console.txt is available in your Zomboid folder - which is typically under your User profile on WIndows at least.
thank you
k so the moment lua is reloaded with my mod it immediately shits itself and the screen turns black
i dont see any errors (?)
does anyone know what a food item requires in order to appear in EvolvedRecipe recipes in build 42?
any help?
q1
You don't have the "require('NPCs/MainCreationMethods')" which you need if your calling a traitfactory method
You need to put
require('NPCs/MainCreationMethods')
At the top of your code
If you have that it'll probably tell you what else is wrong with your code in the console log
errh okay so the screen is still black
It'll be something with your OnGameBoot function if it's not going to title screen
alright hold on
the ongameboot doesnt match
this should work
Outplayed - The ultimate capture app for gamers. While playing, it automatically captures your best moments and biggest plays. When the match is over, relive your best (and not so best) moments by watching them in the match timeline.
nope nuh uh it is still shitting itself
Your proflist has an indentation too many by the looks of it
is lua sensitive to that?
Not sure but I am lol
well it doesnt make sense either way because
if i completely remove the entirety of the occupationtest part
it works
i am befuddled
I am befuddled too, your trait gives you aiming and reloading and that's not even in the script 😂
i ripped the code from somewhere else
i kept it there because i wanna see if it go down
---@diagnostic disable: missing-parameter
require('NPCs/MainCreationMethods');
---Function creating trait with set parameters
---@param name string
---@param cost number
---@param isProfExclusive boolean
---@param isDisabled boolean
---@return Trait
local function createTrait(name, cost, isProfExclusive, isDisabled)
isProfExclusive = isProfExclusive or false;
isDisabled = isDisabled or false;
if getActivatedMods():contains("EvolvingTraitsWorldMarkDynamicTraits") then
return TraitFactory.addTrait(name, getText("UI_trait_" .. name) .. " (D)", cost, getText("UI_trait_" .. name .. "Desc"), isProfExclusive, isDisabled);
else
return TraitFactory.addTrait(name, getText("UI_trait_" .. name), cost, getText("UI_trait_" .. name .. "Desc"), isProfExclusive, isDisabled);
end
end
local function addTraits()
local activatedMods = getActivatedMods();
local newTraits = {};
if not activatedMods:contains("EvolvingTraitsWorldDisableLowProfile") then
local LowProfile = createTrait("LowProfile", 3);
LowProfile:addXPBoost(Perks.Sneak, 1);
table.insert(newTraits, LowProfile);
end
for i = 1, #newTraits do
local trait = newTraits[i];
BaseGameCharacterDetails.SetTraitDescription(trait);
end
TraitFactory.sortList();
end
Events.OnGameBoot.Add(addTraits);
here's a bit different code structure
but it'll work
you can unpack createTrait func into addTraits, I got it out cuz it was easier for me
it returns TraitFactory.addTrait(name, getText("UI_trait_" .. name), cost, getText("UI_trait_" .. name .. "Desc"), isProfExclusive, isDisabled);
Do you not need the require for maincreationmethods? Has my life been a lie?
so this
local LowProfile = createTrait("LowProfile", 3);
LowProfile:addXPBoost(Perks.Sneak, 1);
table.insert(newTraits, LowProfile);
is equal to this
local LowProfile = TraitFactory.addTrait("LowProfile", getText("UI_trait_LowProfile"), 3, getText("UI_trait_LowProfileDesc"), false, false);
LowProfile:addXPBoost(Perks.Sneak, 1);
table.insert(newTraits, LowProfile);
edited
not sure if its needed or not, pretty sure it isnt cuz that's what's albion said and she knows pz modding pretty much better than anyone
I might test it later on
errr
all i see is tv static looking at that
but thats basically adding new traits right?
i got that part working at least already
i have trouble with custom occupation
check SOTO code, i dont do occupations
How do you know if a file/module need to be imported before using ? Because I already used object from other files without importing them
Guys, do you know how to read lotpack & lotheader ? or even reading the map data ?
thank you for your insight
I'll defer that answer to someone smarter than me. Apparently it's not necessary so ignore that message
but i am already ripping code out of something that already exist
the uhh marineocc mod
if its from vanilla files im pretty sure you can ignore it as vanilla files are loaded before mods
Ok thanks 🙂
I am a bit confused with lua, is it a OOP langage ? I am not used to how they are created, it's like object with functions on them and mimic the "new" Java thingy 😄
lua is more of a scripting language
I am really enjoying playing with the code from SpecialLootSpawns.lua. Its just simple name changes and stuff, but its fun.
But here it can be used to have sort of Object Oriented files ?
Pitty that we can't use Java 😄
you can but then it will be manual installation mod
I find it similar to python with extra steps but I don't code in java
Yeah that's not user-friendly
Yeah it's very similar to python
honestly I havent seen anything yet where I thought "man I wish this was a class" 
I was close, I put a function inside a function, but wasn't a class
I mean you can pack functions in the file and then return content and use it in different parts of code
that's as close as you canget to classes in lua
unless im mistaken
sth like
local ETWCommonFunctions = {};
---Plays a sound if enabled in settings
---@param player IsoPlayer
function ETWCommonFunctions.traitSound(player)
if modOptions:getOption("EnableSoundNotifications"):getValue() then
player:playSoundLocal("ETWGainTrait");
end
end
---Returns ETW mod data with correct type (for IDE)
---@param player IsoPlayer|IsoGameCharacter
---@return EvolvingTraitsWorldModData
function ETWCommonFunctions.getETWModData(player)
return player:getModData().EvolvingTraitsWorld
end
---Function responsible for checking if specific trait should be gained/lost, returns true if yes and removes it from the table. Otherwise, returns false.
---@param name string
---@return boolean
function ETWCommonFunctions.checkDelayedTraits(name)
if not SBvars.DelayedTraitsSystem then return true end;
local player = getPlayer();
local modData = ETWCommonFunctions.getETWModData(player);
local traitTable = modData.DelayedTraits;
for index = 1, #traitTable do
local traitEntry = traitTable[index]
local traitName, gained = traitEntry[1], traitEntry[3]
if detailedDebug() then print("ETW Logger | Delayed Traits System: caught check on " .. traitName) end;
if traitName == name and gained then
if detailedDebug() then print("ETW Logger | Delayed Traits System: caught check on " .. traitName .. ": player qualifies for it; removing it from the table") end;
table.remove(traitTable, index);
return true;
end
end
return false;
end
return ETWCommonFunctions;

and then u just use it in other lua files
local ETWCommonFunctions = require "ETWCommonFunctions";
...
if SBvars.DelayedTraitsSystem and not ETWCommonFunctions.checkIfTraitIsInDelayedTraitsTable("ProneToIllness") then
...
Yeah it used commonly on IS lua files, and fuck, I know now what IS means 😄
I was like "what they are all caled ISButton, ISPanel" it's Indie Stone no ?
ModData is good for that as well, in certain circumstances
There is the functionality around TimedActions with :New and derive. Its class-like. Kinda like how LaCroix is "fruit flavored"
also kinda tru
I was thinking about making the mod loading the class in the game classpath on startup, I don't know if it would work, or possible
But derive is not a hand-created function that mimic the inheritance ?
International Spacestation no?
Sure, but I was just pointing out class-ish stuff in a classless system 😄
Hahah yeah
Anyone done anything with animals yet? Trying to make a pig explode rn but I need an onAnimalDeath event ideally lol

Well if anyone is interested, even when animals are attacked they are tagged as "Zombie" but they don't trigger onZombieDead event
Do you know guys how to reload lua files in game ?
Tired on leaving/entering game again and again
main menu - bottom right - reload lua
I mean, in game not in the menu screens 😄
or press f11 - search specific lua file - reload
yeh then try second one 🙂
crash mean your game has stopped work or something like CTD?
The debug screen appears saying there is an error on a specific line, but my lua script did not reload
seems that the game catched my 'F11' as teleport key
that's normal. but reloading not working is not normal.
so you changed something, saved your lua file, back to pz, hit f10, search your lua file and click "reload file"
but does nothing?
F10 or F11 ?
default should be f11 sorry i changed keybind to f10
i was confused myself 😛
Oh okay I understood ! So the debug mode appears and then I can see my files on the bottom right
Thanks !
And Thanks god that when you re-hit F11, the search text is still there and not have to re-write the file again 😄
Seems that I have more comfort now
step by step 🦾
yep just don't try reloading wrong lua code(missing end, missing {}, etc) or game will be broken.
in this case, you will be able to see error count when you reloaded wrong lua code, once you see error count it means there's a typo or something.
And do you know how I can trigger specific events without impacting the game ?
Like, I have a OnGameStart trigger Event, so I still need to quit the game 😦
Ok thanks for the info
you can write function name into finger print(bottom left)
but working or not working is depended on what does function do.
thats good to know! but sadly this doesn't fix the way that autocomplete / intellisense doesn't work with the event parameter on my end
Working on a first aid mod, all the new first aid files have a “syncBodyPart” function which calls a sequence of numbers as the parameter.
Does anyone know how I’d change these to other wound types? I checked the documentation and it wasn’t helpful
aaaand now debug mode wont launch
Validated files several times, issue persists
Are we able to make .java scripts for mods or just .lua?
You can make java mods but it requires manual installation
oh okay great thank you, ill stick with lua then
what would be the best way to get the information if the player is infected with the virus? is it on the BodyDamage/ BodyParts or on the Player itself?
i assume IsInfected() isn't for the zombie virus
player:getBodyDamage():IsInfected()
okay so IsInfected isn't referred to bacterial infection or such
theres a separate thing for wound infection i think
i'll test it, i just assumed the zombie infection to be more "centralized" on the Character itself and not the bodyparts
Does anyone know why my mod wont show up in the mod list, i have follow nasKo's thread for folder structures but it doesnt seem to be working?
Heres the folder structure:
and here is my mod info:
i shall give that a go now
still nothing sadly, i have it in the mods folder in my PZ directory should it be there or in the workshop folder?
There’s other stuff with new mods wanting an icon for the mod menu as well, not seeing that
Add an “icon=icon.png” line to your mod.info and add an icon.png image to your 42 folder
thank you ill give that a go
Has setGhostMode been depreciated?
@tawdry moss icon didnt work either, heres my new folder structure
Maybe in your mod.info, set “icon=poster.png”
If this works then I think I know whats going on, if not then I’m out of ideas
sadly this hasnt worked either! i did do a fresh install in the hopes that TIS has provided a new example mode to get me started converting my old mod but it doesnt look like they have
thank you for the help! ill download a working mod and see what the difference is!
Put everything in the 42 folder instead
Currently there seems to be a few weird things happening with the common folder not taking some files
Also you have
model -> model_X
It's supposed to just be model_X, that's it
Models are put in model_X
But overall it should work
However yeah the problem could be that some of these are not cognized in the common folder
I'm curious what's your full path however for these folders
okay so heres the new tree based on your suggestions:
Looks good
this is full path:
G:\SteamLibrary\steamapps\common\ProjectZomboid\mods\DirtysFuneralPyre\42
That should be good yes
Check the new wiki page about it if you want
Still being created but I've fully made the parts about the paths
Sadly its still not working but thank you for your suggestions, i will look over the wiki page youve made!
Can you send your mod.info please ?
Your icon is named "icon.png"
But here you reference it as "poster.png"
While I don't see why it wouldn't work anyway (it should be able to use the poster), try setting it as your icon.png
ah yes, pieandcheese was helping me earlier today, i can change that back
Nothing looks wrong beside that tho
changed back and still no luck, I'll start from scratch and make a new folder structure
Can you show what you see in the mod manager ?
Is it a white icon ?
Can you send your icon file ?
currently my mod doesnt show up atall,
https://projectzomboid.com/modding/ does not seem to have been updated to B42. Will that happen soon?
package index
heres my very inventive icon
Yes it will happen, I'm currently mostly alone working on the modding Wiki
https://pzwiki.net/wiki/Mod_creation
You can use this
This is up to date
thanks that seems to be about the file structure of how to make mods with new version. thats helpful but i was interested in reviewing the actual Java class and methods for the Animal husbandry. Its a lot easier to use that site then a java decompiler in my opinion
Still getting created at the bottom tho, but you'll find a bunch of explanations already
Give me a sec, we have that
package index
Unofficial java doc
Also be aware that the modding Wiki was basically useless and that I'm currently reworking it completely to actually be usable
So some pages will not be up-to-date
But a lot of stuff are getting updated
is there a way to add information to the original character info panel? creating a new children for ISCharacterInfoWindow?
okay @bright fog little update, i decided to put my mod in "G:\SteamLibrary\steamapps\workshop\content\108600\3389781770\mods" folder (this is where steam downloads workshop items) and it is showing in game, unsure on the behaviour behind this but could be something to do with my PZ installation being in a non standard drive? or some other wacky thing but its now being shown in the mod list
Thank you so much for your help and updating the wiki, going to need it now my real work is beginning!
Has anyone managed to get the cheat commands to work on client side without running debug? This seems to have changed from my testing.
Hello guys, I have the code above that removes insulation by crafting
And I'm trying to do the same to remove the combat debuff in this case (set it to 1)
but I've tried every way, every possible way, but it doesn't update within the game
What i'm doing wrong?
I once again made a mod that keeps the game from loading - where can I see the error log?
I assume that might give me some indicator as to what I messed up.
Found it. Zomboid/Logs/ duh.
is this where i can suggest mod ideas for mod creators?
Hello Again, does anyone have any resources on how i can access PZ lua classes within my mod project?
im using Rider with IntellJIdea and i want to be able inherit from and use various classes and their functions
It will most definitely be forgotten and ignored by 99.9999% of people here but you can probably just throw it here eh
Hey, currently the only way is by usinig VSCode
We have an addon called Umbrella
Adds autocompletion
ahh okay is that the pinned thread from chuckleberry?
well if anyone sees this: maybe a mod where you can catch and release fish cause i wanna fish but i dont wanna overfish the river near my house
i just like fishing for fun
This? @bright fog
Yes
Cool Idea!
Does anyone have intellisense for B42?
that maybe what Sir Doggy is talking about!
@cosmic ermine the third pin in the pinned threads on this channel
That's for 41.78...
ah my bad, new to this stuff
thats problematic for me too as i want to work with the new build menu
It's a message, not a thread tho
- Download VSCode
- Download Lua server package
- ctrl shift P
- Open addon manager
- Search Umbrella
- Activate Umbrella unstable
Welp it's not showing the Unstable here for some reason
But you should have the Unstable too
@bronze yoke any idea why Unstable is not showing here ?
up and running now, thank you kindly
if you're using umbrella, the best way is to put```lua
---@type Callback_OnPlayerGetDamage
thats really good to know thanks!
More than 1 year waiting for an update and the game's graphics API is still not optimized, this is sad
Uh ?
The game got optimized a fuck ton here
can we get a TV chatter update? maybe different chatter for different channels?
Question: what does media do? If common is used by all versions and 42 is used by version 42 then what does media do by itself?
get loaded by build 41
i try to display some custom values to the characterinfo window, but struggle with updating the variable
but it shouldn't say nil
i've overriden the creation of this ui element
function ISCharacterScreen:createChildren()
original_createChildren(self)
local y = self.height
local customLabel = ISLabel:new(250, y, 20, "Custom Info:", 1, 1, 1, 1, UIFont.Small, true)
self:addChild(customLabel)
y = y + 20
local infoLabel = ISLabel:new(250, y, 20, tostring(InfectionLevel) , 1, 1, 1, 1, UIFont.Small, true)
self:addChild(infoLabel)
end
and also the prerender to update the value
function ISCharacterScreen:prerender()
original_prerender(self)
updateInfectionLevel()
end
but i am also not sure if overriding these functions should be the way to go to implement custom ui elements into existing screens
Hey guys, i made a backpack mod a while ago, what would be required to update it so it works w b42?
Does the combo getNumActivePlayers() and getSpecificPlayer(playerIndex) allow me to select online players in multiplayer or just the splitscreen players?
just splitscreen players
That was quick, thanks!
@smoky vine this could be a start!
Is it possible to make settings for your mods now? Without mods like ModOptions?
for online players, from the server you can do```lua
local players = getOnlinePlayers()
for i = 0, players:size() - 1 do
local player = players:get(i)
-- do something to player
end
@full escarp Maybe check out killcount mod by tchernobill. killcount directly modifies that same window
thanks mate ^^
no worries hope it helps
awesome thats a good, i was already looking for a mod in the workshop that does the same, but hasn't found one thank you ❤️
Does anyone know of a mod that adds new things to the build menu that i can look at?
in client this will only get nearby players
i don't know the distance
may be 1 cell
b41 or b42?
B42 would be great but im struggling to find one
have no idea
ahaha, thank you anyway!
Try to take a look at the vanilla code. I think the formula for architecture should be similar to the synthesis of items
from looking at a mod using the new crafting menu it uses alot of tags in its recipe script so im guessing its similar but its a bit of a black box
good idea, i keep forgetting ive decompiled it
weirder than that, it'll get players who have ever been within your radius
when you're close enough to a player for the first time you start receiving updates about them and won't stop until you disconnect
The player's position obtained by this function is not accurate, especially when in the car
any guide on how to put a gif in my workshop item?
Is it possible to add options for my mod?
i haven't worked with it yet but b42 has native mod options, there should be a guide from dhert on them somewhere
he uploaded an example too https://steamcommunity.com/sharedfiles/filedetails/?id=3386860561
OK, thanks.
Hi how do you get the body location of a clothing?
Does anyone knows what these args for?
setBallisticsColor(int var0, float var1, float var2, float var3)
I thought rgba at the first, but int/ float/ float/ float seems not rgba
declaration: package: zombie.core.physics, class: Bullet
Is it fine to leave common empty?
what are my options for looking at the decompiled java code. do I have to decompile it myself or is there a resource somewhere for B42
beautiful java doesn't work out of the box with b42, i'd recommend just using vineflower
download a vineflower jar from here https://github.com/Vineflower/vineflower/releases, open cmd next to it and do java -jar vineflower-1.10.1.jar PATH/TO/ProjectZomboid/zombie
If only IntelliJ Idea wasn't so expensive
there's a free community edition
also, if youre studying you can get a free school license
the reason beautiful java wants you to use idea anyway is just because it comes with fernflower which is just a slightly worse version of vineflower
I suggest you decompile the game code
Link the wiki page
Wiki page on the subject. Up to date too
Forgive me for my stupidity, but I'm trying to make my own True Music Add-on. The instructions say this. It says "For example, add your mod Workshop ID to their names:" Does it have to be their workshop ID, or can it be something else? If it has to be their workshop ID, isn't the ID created when you upload a mod to the workshop? How would I get that if the mod isn't even ready to be uploaded?
they just need to be unique, workshop id is a good way of guaranteeing that
Oh, ok. Thankyou!
I got it using vineflower, thanks
It details all the steps of vineflower on the wiki
If you ever need to point someone to a guide, please point to it
After 1 year I expected at least DirectX 12 integration
I don't know anything on the subject but why would they need it ?
Are they even using any DirectX ?
nope
The only benefit of using Java in this OpenGL project is the cross-platform option. Even so, we don't have a version of Zomboid for Android and almost all users use Windows
the game has native linux and mac builds, this would not be possible with direct x
Another question about true music addons, if I name a file say, with Japanese characters, will it show up in-game that way, or will PZ have a brain fart and just replace it with something like □□□□□?
If they don't need it, why would they use it ?
Zomboid demands so much from my video card that it's more worthwhile to play anything else
I love this game, don't get me wrong
Maaan the game got hella optimized this build
But it is a resource black hole
cries in Ark: Survival Evolved
Just work with UTF8 encoding I believe
Ah damn ok. Thankyou
the vanilla english font might not be able to render them though, not sure
I'll probably just translate the song titles
Hmm true
if you mean in lua then getBodyLocation() from what i remember
Is B42 currently having rendering issues to any degree? I ask because I've received 2 bug reports related to Visible Generator Range having to do with rendering (when it literally just uses the basic highlighting system) and I want to confirm that it's not an issue with my mod.
Not unless there's new issues associated with the highlights in B42, but even then that doesn't necessarily explain the awkward issues I've been getting reports about.
what kind of rendering issues?
as all games do it has rendering issues to any degree
"big shadow box appear in place of generator" and "shadowy ground around world-generated doors"
hmm, i haven't seen anything like that
It just seems so.. odd?
Like, all I'm doing is messing with the highlight system from B41 which - to my knowledge - hasn't been thrown out or anything.
And I'm not aware of any performant alternatives.
I don't know if it's an issue with the highlight system that appeared with B42, if I'm just going crazy, or what.
Mods I place manually aren't showing up in the game, including the example mod. I fresh installed on both my drives and nothing's changing
Hey! Im sorry for asking twice (I believe there were some discussions above), but anyway, wanna be sure if I dont miss anything. Could I just clone the main b from the Umbrella rep, for the 42 unstable version? Seems like my vscode dont want to define this ver and show only 41.**stable, as well as I see only one release for the stable one as well.
Sorry, Im pretty new to this (was trying to recreating stuff from necro capsid half a day and found that there is another way to make things work with umbrella :D)
i'm not sure we've pushed anything into the umbrella repository since b42 dropped
you can use the library folder from here, this is where the addon manager gets it from https://github.com/demiurgeQuantified/UmbrellaAddon-Unstable
Tysm!
let me check i don't have anything local unpushed actually
hii
i have no experience modding, but i created a mod patch and it WORKED somehow after 12 hours of dying. Now i need to create a version of the base mod Shops for build 42 but i dont know what should i change
yep all good, that's the latest version already
there's actually a bunch of long standing issue fixes in there that haven't actually been pushed to the addon manager so you'll be (temporarily) using a better version than everyone else
Well I think I got this as good as I can get it until MP comes out
so please come here again after follow first step which I sent you. that step is 100% necessary. basically you have to create sub folders for b42.
and the link I sent is explaining how to create sub folders.
tats an honor 
and then if you encountered any errors or weird situation, you can ask them 😉
Folder structure
https://pzwiki.net/wiki/Folders_structure#Mod_folder_structure
Just did that, now I am trying to figure out what else must be changed. The mod introduces barely 2 new 2D items which are the coins and that’s all
Did you try to run the mod ?
My files aren't reloading? I've updated the code and files but the game is still loading the old version.
Is Workshop prioritized than mods?
It is... 
Ok, I have made a mod that allows you to do "Dead Drop" trades with offscreen NPC factions. With reputation, values, specific wants etc.
My question:
The code that give the player items when the Dead drop is complete. Does it matter if that is on /server or /client? Should code that adds items to worldObjects be on the server?
How do I add sandbox options for my mod?
That should have a lot of info on adding sandbox options
For build 42 not yet
I know I have to make a build 42 file but what am I supposed to put in there?
Refer to the wiki page I sent
It's the same thing, media folder etc
But you need to put things in versioning or common folders now
You have the comparison of both on that link
B41 and B42
is there a list of functions around the fluid containers yet? looking for a way to add fluids to a container. thank you
thank you very much, Albion. I appreciate you 🙂
Hey, I’m encountering a problem modding a TV channel. My TV channel works, and the text colors and skill changes, but for some reason all text is the Entry ID for each dialogue.
Does anyone know how to fix that?
Did you make a mistake with your code ?
I'm not familiar at all with modding these however
👌
Where can I find vanilla scripts?
D:\SteamLibrary\steamapps\common\ProjectZomboid\media\scripts
Should be something like that
Thanks.
Anyone have any luck finding where the animal items are?
You can pick them all up but I don't see any item for them in the scripts files
Those are probably like for furnitures
I believe there's some weird things with that
I wouldn't be able to point you in the right direction, but I believe for furnitures it's a system where it's not an item too or some shit like that
Anyone ever get anything like this to work?
https://pzwiki.net/wiki/Creating_dynamic_radio_channels
Or know of any mods that did?
Custom radios ? Definitely
Not me, but there's mods that add custom radio channels
Not the XML based ones, but the Dynamic ones.
However I do not know if that guide is up-to-date, I'm interested to know if it is bcs I'm reworking the modding wiki
Like the Emergency Broadcast that changes based on the weather etc.
Hmm
Maybe
Maybe:
- True Music Radio
- Braven's radio mod
Check these out if they use it, ik they do some radio stuff
That guide is pretty extensive, but something about the way the author explains it, just doesn't calculate in my brain.
Which don't involve the XML if I'm not mistaken
I'll go look! thanks for the direction. 😄
Haven't read the guide fully, but if you have suggestions
I can take them
why is this recipe screaming at me?
java.lang.Exception: unknown recipe param: Base.PropaneTank at InputScript.Load(InputScript.java:551).
craftRecipe RefillPropaneTank {
timedAction = Refill,
Time = 50,
OnTest = Recipe.OnTest.RefillPropaneTank,
OnCreate = Recipe.OnCreate.RefillPropaneTank,
Tags = Welding;Refill,
category = Welding,
inputs {
item 1 Base.PropaneTank mode:destroy flags[NotFull], /* Empty or partially used Propane Tank */
item 1 TW.HugePropaneTank flags[NotEmpty], /* Huge Propane Tank with remaining fuel */
},
outputs {
item 1 Base.PropaneTank, /* Refilled Propane Tank */
},
CanBeDoneFromFloor = true,
}
I'm quite new to modding and I'm trying to just add a few items/recipes to b42 and get familiar with the system, I'm struggling to make an edit to an existing base item (making Base.Flour drainable, as it just creates two distinct items), any help to fix this would be apprechiated!
CanBeDoneFromFloor isn't a thing from what I can find.
Remove that and change your tags to
Tags = Welding;Refill;InHandCraft,
or
Tags = Welding;Refill;AnySurfaceCraft,
testing again thanks
nah, still get the error
module TW
{
imports
{
Base,
}
craftRecipe WeldingPropaneTank {
timedAction = Welding,
Time = 50,
OnCreate = Recipe.OnCreate.WeldingPropaneTank,
Tags = Welding;InHandCraft,
category = Welding,
inputs {
item 1 Base.PropaneTank mode:destroy flags[NotFull],
item 1 TW.HugePropaneTank flags[NotEmpty],
},
outputs {
item 1 Base.PropaneTank,
},
}
}
this is the vanilla recipe for reference
craftRecipe RefillBlowTorch
{
timedAction = Welding,
Time = 50,
OnCreate = Recipe.OnCreate.RefillBlowTorch,
Tags = InHandCraft;Welding,
category = Metalworking,
inputs
{
item 1 [Base.BlowTorch] mode:destroy flags[NotFull],
item 1 [Base.PropaneTank] flags[NotEmpty],
}
outputs
{
item 1 Base.BlowTorch,
}
}
i see, commas
This is not a thing in B42 anymore?
if (var6.equals("CanBeDoneFromFloor")) {
this.setCanBeDoneFromFloor(var7.trim().equalsIgnoreCase("true"));
}
apparently
none of the vanilla recipes have it and its not here
https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/scripting/objects/Recipe.html
declaration: package: zombie.scripting.objects, class: Recipe
Recipe is deprecated, look at CraftRecipe
declaration: package: zombie.scripting.entity.components.crafting, class: CraftRecipe
yeah
How can I override the tooltips that show when hovering items in inventory and containers? Trying to add and remove parts of them
seems like this should work, it doesn't do anything, not even throwing an error... I can see the container and verify it's empty but it won't take the add... container:getFluidContainer():addFluid(Beer, 1)
can someone help me? i literally cannot get this mod to work. the text displayed in-game in the TV channel i modded in is the RD_ followed by the entry ID
Yeah, I just did a search through the /scripts/recipes folder and got 0 results.
container:getFluidContainer():addFluid("Beer", 1) I got it... it would only take it as a string...
The language file should be Tooltip_EN.txt
found in media/lua/shared/Translate/
I'm PRETTY SURE you can just overwrite base game lines and it will use the mod values.
