#mod_development
1 messages · Page 367 of 1
@queen oasis Might be able to add hooks for your mod too
yea, the 'mult general' is for all world containers
i legit wanna give up on the tattoo parlor rn
I was curious if it's lua or java?
Java, it just rewrites getCapacity.
dang. I figured but I keep hoping there's a lua solution
Not without overwriting the transaction manager (for mp) since SOMEONE restricted all getCapacity calls to 100 looks at devs
that was my hiccup too
But then mine also breaks all other limits, like, floor limits, player limits, 50 capacity for backpack limits, 100 capatity for world containers, etc.
anyone wants this on their server isn't going to care about that
(all adjustable, by default those sandbox settings do nothing as shown)
Pretty much.
it 'breaks them' as in, its settings arnt restricted by them
(though player limit still has the 12~ whatever strength overweight limit, but if you crank the player capacity you can carry over 50)
50 is honestly an annoying amount to be limited to when there is so many 40 weight objects you gotta drop everything to pickup -_-
isn't there a check on the server for how many 'items' are in a container?
thats a server setting and defaults to unlimited
nice. I didn't really look in to it, I think I saw someone else mention it somewhere
ayyyyyyyy it works Yippy
anyone know what happened to Events.OnFillWorldObjectContextMenu in b42.13? I used to be able to get the player under the right click context menu from a global var called clickedPlayer but that no longer works
found it. If anyone else is looking for it now it's ISWorldObjectContextMenu.fetchVars.clickedPlayer
How can I enter in TileGeometryState ?
Sane? What does that mean? https://github.com/omarkmu/pz-omichat/blob/main/Contents/mods/OmiChat/media/sandbox-options.txt
.. Might I recommend you use another page or two? 😛
I switched away from sandbox options entirely and rolled my own configuration for v2
facepalm
It was definitely too excessive for sandbox options, had to override the menu to make it usable
Way happier with my custom config
interesting
Seems like Left Shift + F6 from the code in IngameState, although I could've sworn there was a debug function to just switch to it
I think that's to quit the mode, not to enter it.
IngameState.java
if (this.showTileGeometryEditor || GameKeyboard.isKeyPressed(66) && GameKeyboard.isKeyDown(42)) {
this.showTileGeometryEditor = false;
DebugLog.General.debugln("Activating TileGeometryState.");
this.redirectState = TileGeometryState.checkInstance();
return GameStateMachine.StateAction.Yield;
}
Worth noting that you have to be in debug
yeah, I got you on that. I tried and I jumped to high speed, no other change that I could see
Sorry, that's my bad—66 is not F6, it's F8
Thanx
is there a reliable way to get the tilesetname of an IsoSprite / IsoObject or should I pray and split the sprite getName ?
getTileName ?
returns stuff like 'Mahogany corner counter' and 'Chrome fridge'
I use it to detect if its furniture or not.
if (this.getParent() != null && this.getParent().getTileName() != null && this.getType() != null) = furniture.
though thats being called from the itemContainer class
hence the getParent()
lol, I messed up my code (again) and used string.gmatch on 'a'. ```lua
string.gmatch(a,"pattern")-- a is not defined.. locally
How can I know the keyNumber / keyboard key association ?
Just thought I'd share this with everyone. Comes in handy when working with the OnKeyPressed event:
apparently there is also 'zombie.input.Keys' global..
(though im not sure exactly how you use that)
in your own code you should just reference the Keyboard constants
^ Would be best yea
Seconding what albion said, but for the sake of reviewing Java it's just LWJGL codes. So, the forum post Black Moons listed, or any resource that lists those out
Thanx all. For understanding decompiled vanilla code, knowing the association it not an option.
few days ago, I had print of unexpected 10000 & 10001, any idea where those could come from ?
Those refer to mouse buttons
Constants for those are in the Mouse class, for reference
made me a little tool. think other people might want something like this?
I'm hoping that I'll be able to do all this in game soon
why is reverse colored in my UI in a lua file ? can I use reverse as a local variable name or will I create problems ?
myTable={reverse=true}
you can use that name, no idea
Just to clarify, assuming it's a valid identifier you can use whatever you want as a local variable name
I'm sure people would be interested—there have been quite a few tools like this (I think the UI of what you've shown here is my favorite so far)
I just use a web server + discord bot to manage mine
To answer the question about why it might be colored btw—some language server extensions, including EmmyLua in my experience, seem to be fairly aggressive about assigning semantic colors to built-ins. You can see this by trying to name something type & observing the function color. So I'd guess it could be getting confused due to string.reverse, although idr seeing that issue
thanx
Yeah, I should have looked some tools before setting off to make my own. Course, ya know... kinda easy these days. I'mma keep working at it, get a working windows version up (kinda hard to test given I'm running on all linux.. plus I'd have to get a server running on windows as well). Alas, add a bunch of features and whatnot as well, just see how comprehensive this can be.
I hope my response didn't come across as “oh, yet another server management tool”—it's always neat to see what people cook up for those. Hope the new features turn out well 🙏
Nah, you're good, thank you thank you ❤️
Hey all, Looking for info/help.
We’re building a fairly large “living blackboard” style marketplace + contracts mod and have hit what looks like a B42 multiplayer inventory desync issue. Hoping to sanity-check whether others have found a clean solution, or if this is just a known B42 limitation right now.
The mod we’re building:
- In-world chalkboard-style UI
- Player-to-player market (buy/sell)
- Notice board for messages and trade offers
- Job / contract system where players turn in items to earn credits & tokens
- No physical rewards from contracts (credits/tokens only)
- Server-authoritative, snapshot-based client rendering
The core problem:
In B42 multiplayer, removing items from a player’s inventory outside of a timed action often results in ghost items on the client.
Symptoms:
- Item is removed server-side
- Client still shows the item
- Attempting to drop/place it throws errors like:
attempted index: getActualWeight of non-table: null - Relog fixes it (full inventory resync)
What currently works (workaround):
For buying items from a market:
- We do NOT add items directly to inventory
- Items are spawned on the ground near the player
- This avoids ghost items completely
We would prefer to add items directly to inventory server-side, but this has proven unreliable in MP.
What does not work:
For contract turn-in (credits/tokens only, no physical rewards), we’ve tried:
- server-side Remove(item)
- removeItemOnServer
- forced container sync
- requestSync / transmitModData
- client-side pre-remove
- hybrid client/server removal
All of the above eventually result in ghost items.
Key observation:
Selling items works reliably because it uses a timed action.
Contract turn-in does not, and that seems to be the critical difference.
Current contract flow:
Client sends:
sendClientCommand("TheBlackBoard", "ContractsTurnInReq", { contractId = X })
Server:
- validates requirements
- removes items
- awards credits/tokens
Result:
- items listed for removal often become ghosted client-side
What we want (ideal):
- Clean removal of required items
- No drop-to-floor hacks
- No ghost items
- No relog required
- Currently I have a hotfix that allows players to still use item in inventory and keep it without having to relog to clear inventory ect but its not ideal.
Questions for other modders / devs:
- Is there any engine-safe way in B42 MP to remove items from a player inventory without a timed action?
- Has anyone successfully reused an existing timed action (sell / transfer / craft) for “virtual” removal?
- Is this a known B42 MP limitation expected to be fixed later?
- Are there internal APIs we may be missing that handle inventory removal + replication safely?
- Is the recommended pattern effectively:
“All inventory removal in MP must go through a timed action”?
Extra context:
- Item IDs are normalized and server-authoritative
- Client is render-only using server snapshots
- This isn’t a Lua logic issue; it appears to be replication/state related
- Every stable solution we’ve seen either:
- routes through selling
- or drops items to the floor
If anyone has a confirmed working pattern (or can confirm this is just a B42 limitation), that would help a lot. Happy to share snippets or test cases if useful.
Thanks
If you've done the removal server side and correctly called the according client-update function, I think you just need to refresh the inventory page once the removal is taken into account client side. Note that the time deletion is received cannot be predicted. So you need both a sendServerCommand with the unique id of the item being removed and then you check OnTick client side until the removal has been done automatically and then you refresh the inventory.
But if you really initiate it client side (apparently with a sendClientCommand), you could as well initiate it client side with a "silent" TimedAction.
Thanks, that makes sense and lines up with what we’re seeing.
We are already doing server-side removal only, and we’ve tried a few variations of client refresh / requestSync, but we’ve been refreshing too early. What you’re describing sounds like explicitly waiting for the deletion packet to be applied client-side before touching the inventory UI.
Your point about initiating it client-side with a “silent” TimedAction is interesting as well that would effectively keep everything inside an engine-approved path while still being visually instant.
A couple of clarifying questions if you don’t mind:
- Have you used either the OnTick confirmation pattern or a silent TimedAction approach in a released B42 MP mod, or is this more of an experimental workaround?
- For the polling approach, are you tracking removal via the unique item ID until:
item:getContainer() == nil
or by scanning inventories for absence? - If you’ve used a silent TimedAction, are you reusing an existing action (sell / transfer / drop) or a custom one?
- In either approach, do you ever see edge cases where the deletion never arrives client-side (lag / reconnect), and how do you fail-safe that?
We’ve found that touching inventory too early (even a forced refresh) can resurrect ghost references, which is why we’ve been leaning toward timed actions as the safest long-term path especially since this mod is a core framework with planned submods.
I never removed from server withotu a timed action.
1/ OnTick synchro after reception of onServerCommand, I've used a lot, B41 & B42 alike.
2/I never removed from server without a timed action. I 'ont remember doing that
3/ custom "silent" timed action.
4/ I've never noticed such edge case. I do not fail-safe. I just ensure my model does not depend on receiving an answer.
About the delay, I can tell that equipping an item (that was in player inventory) from the server side takes systematically around 1s to occure visually on the client (client & server on same computer, 0 ping)
and same delay for fforce-droping from server side
Thanks a lot for all the detailed replies, that was extremely helpful.
The clarification about always using TimedActions for inventory removal, the OnTick sync usage, and especially the note about the 1s visual delay even at 0 ping really explains the behavior we’ve been seeing. That confirms we were fighting engine timing rather than logic bugs.
We’ll fully commit to a custom silent TimedAction approach and keep the client render-only instead of forcing syncs. Appreciate you taking the time to share experience it saved us a lot of guesswork
I need to know, is there a way to know whenever a player has, either read a book or not(that would be for B41 and B42) since i kinda need to know if someone has read a book or not. (Whenever someone answers, please do a reply with ping. That would be appreciated, thanks.)
ISReadABook.lua
You need to sync actions after doing them on the server
Doing it on the server is the right way
TIS has made guides about timed actions for B42.13
thanks, I ended up making a custom TimedAction and was able to archive the outcome I wanted. Spent a week working it out, come here to ask got it fixed in 1h 🙂
thanks for that link, will be useful later.
That seems to help, but it was more for vanilla books that i was looking for them to be read.
Any chance you can help me out with that. I am trying to fix our mod (storage o matic 3000) but I think that goes into the lua folders and I don't know how to add it I tried looking at how other mods do it but with my knowledge that all looks like gibberish 🙁
what does your mod do?
It adds 4 storage machines with 4 different capacties.
now i have to say i downloaded the 42.132 java capactity remove mod and it does work with that but thats a hassle for other players to understand.
I think it should also work without that mod and with the mod multiplayer limit breaker as i do have other mods that use that one and also works but i cant make it work with the MLB mod 😛
i think you need to have some stuff in LUA (setacapacity stuff you was talking about) for it work with MLB mod and thats where i am stuck
I have a problem that when I enter specific modded vehicles (more precisely the three Trailers from AutoTsar Tailers B42), my character view is under the ground, wich is most of the time pitch black. I do not find the significant difference in the vehicle definition compared to others but I just noticed that during enter action, the Anim Monitor indicates something strange that may be related: variable 'bundervehicle' turns from false to true. This does not occure when entering other vehicles.
The character variable bundervehicle is associated to IsoGameCharacter.isUnderVehicleRadius(float radius) called with radius = 0.3
Anyone has a clue on what parameter in the vehicle configuration I should look at to avoid being considered undervehicle when entering them ?
With realistic car physics/total capacity override you should be able to set the capacity to anything just using the regular game files
(pretty sure the limit remover mod would work too)
Do note: all of those require java install to work in MP
yeah but than you also need to add LUA code right if you dont use the java stuff like realistic car physics ?
yeah exactly all use java but there is also a way without using java but that requieres some LUA code as well
No, you can't do it in LUA for multiplayer period.
i thougt you also meant that when you was talking about setcapacity
With the java mod, you can use the game files OR setcapacity on other objects to set their capacity to anyyythingg you want.
without the java mod, nothing can exceed 100 capacity in MP
(Capacity limit can only be broken by LUA in SP)
yeah i understand but the mod "Multiplayer Weight Limit Breaker" also lets you do this without java
Weird. Haven't seen that mod
the mod [B42][MP/SP]Building Craft uses that one and i can set storage boxes that the mod makes also to 1000+ and it works
also in MP
Nice
yeah its perfect for ppl who dont wanna do the java thingy as you know, not all ppl read what you need to do 😛
so i thougt you knew that mod also 😄
todays cook:
Never seen it before.. the code confuses the hell outta me tbh
its got stuff like
oh wait its just using those functions to declare other functions
thasts uh, a choice
yeah im no coder and understand very little but i tried to use the buildingcraft mod and rework it for my mod but that didnt work out 😛
Yea im not sure if this fixes the fact that getCapacity() won't ever return higher then 100, unless hes getting capacity by reflection instead.
yea im not seeing any evidence they deal with capacity at all
tbh i have no clue, but i did set the capacity to 1000 for the crate section from that building mod and it did work
gimme 5 min and ill test again
this was on 13.1 not 13.2 and i do play 13.2 now
also need to delete the java folder 😛
zombie folder
java folder is for dedicated servers
and may or may not contain a zombie folder
yeah i meant the zombie folder but i said java cause its java related crap :p
yea lol I suspected
What am I looking at ?
Dunno but let him cook, maybe we'll get zomboid bowling?
projectile based damage system, with wall pen
ok but how do we see zombies on the other side of walls to shoot them?
its overriding vanilla damage system
its for my RP project
i needed to override vanilla damage to avoid perma deaths. i made a tazer for police using actual projectile detection instead of hitscan like vanilla
and it worked so well i just decided to cut out vanilla damage completely
from what little I can tell, I think this mod reduces weight in the container, not increases capacity?
cop screams 'hey you' repeatly before tazering person doing nothing at all, seems accurate.
loool thats just normal. yell https://discord.com/channels/@me/774036860628369478/1463968296205418528
you compute everything server side ?
the man is holding a shotgun next to a bloody corpse!
i decoupled from the game tick i run everything in a rust backend OUTSIDE the game
i have like maybe 300 lines of lua code on server
just a dumb pipe
Oooh using a rope for the taser is interesting, what do you attack it to ?
this is in the sandbox setting
its actually not a model its jut a line render i used math on to split innto segments and appy the droop
Interesting 
and you feed your backend with the updated terrain and characters ?
Oh it's not the vanilla rope ? Ah yea vanilla ropes aren't curved
its the brains for all the logic to avoid lua soup loool
Hmm. shrugs
and theres alot you can do if you decompile and look 😉
I did make a raycasting lib that runs Lua side and runs well tbh
yeah one sec im going ingame now
We are aware of it don't worry lol
Basically the LUA mods work by faking stuff in the UI, and this one seems to... take over the transaction logic entirely
But it can't see it actually reading capacity the normal way anywhere
i got fully functioning MP npcs as well
And reading capacity the normal way is hard limited to 100 as a return value if your not using reflection to get the value
yeah i didnt test it i just looked at it and thougt it worked anyawy so one sec
Using your Rust thing too ?
yeah i didnt even think about that 😄
I can't even find the word 'capacity' in the source lol
its done mostly in java that one but any time there is logic to run its always in run
rust*
How do you link it to the game ? You modified the Java ?
i did some slick rickery
File writting then file reading ?
Does that have like... all the other functions? Like can I see what mods are installed, players connected, and run commands? (not saying it doesn't or anything, just wondering about the functionality of that mod and if I should continue developing this is another exist that already has these things)
its my personal dev env dont worry im not releasing that
Iv been wondering if one can abuse the new discord intergration feature to have PZ talk to custom discord bot?
new? 😅
Its not new?
Nop
ah gotcha. yeah mines actually personal too, though I'm putting it on the github and people can find it ;p
Never noticed it before -_-
Was just broken back then and required a patch I believe
lol
it's old enough to be broken
im considering making a Docker image and all that
anyways il be releasing a lite RP framework when my server goes up
"old enough to be broken" in zomboid could mean anything!
sure but i told you the topic before i told you that 😅
Btw I think I figured out a relating factor in the 'can't hit zombies with guns' thing.
yes it was a joke
when I can't hit zombies, I reload and CAN hit zombies again... for a couple bullets...
I'll bet that TIS isn't reloading the correct magazine into the gun on server side -_-
and its loading mags with low bullet count
so it thinks your bullets arnt bloody existing -_-
(I believe its only happened to me after I started having multiple partially consumed mags)
Why is it TIS seems to have such problem with crafting/etc actually acting on the item the client says to use -_-;
this is what i got done so far, ofcourse everything is properly replicated for MP
this is with just those 2 mods
and no zombie folder
these 2 mods
Hi all, my mod need to rename an item, which is done like so:
item:setName("xxxxx)
item:setCustomName(true)
This renames the item which is in the Player's inventory. But when moving the item across containers or relogging, the name is reset. Does anyone know if this is by design, or if there is the right way of renaming items?
Im'a still stick with my java solution just because im lazy and its instantly retroactive 😛
Currently Compatible Capacity Expansion Mods:
- Expand Furniture Capacity https://steamcommunity.com/sharedfiles/filedetails/?id=3573441967
- Building Craft https://steamcommunity.com/sharedfiles/filedetails/?id=3459887404
3.Vehicle Container Expansion https://steamcommunity.com/sharedfiles/filedetails/?id=3623536023 - Backpack Pocket Patch https://steamcommunity.com/sharedfiles/filedetails/?id=3651104219
this is stated in this discription
are you doing it client or server side?
Ah k, neat.
but for vehicals you coudl also use damn capacity for the cars from KI5
and that also works
I do that client side, I was just thinking that I propably need to do this server side as well. Is that what I missed?
but he deleted the mod, i did reup it in private settings
server authority issue the server has to set the name and notify the clients
Generally best to do changes server side, then use sync commands to transfer it to client side
so in the code he had stuff like
-- Oshkosh M1082/M1095 (TruckBed per variant)
DAMN_CapacityData.registerVehiclePart("Base.TrailerM1082", "TruckBed", 380)
DAMN_CapacityData.registerVehiclePart("Base.TrailerM1095", "TruckBed", 490)
-- W900 (TruckBed per variant)
DAMN_CapacityData.registerVehiclePart("Base.SemiTrailerLowBed", "TruckBed", 1080)
DAMN_CapacityData.registerVehiclePart("Base.SemiTrailerVan", "TruckBed", 1080)
ah.
amoung other code
got it, will try that. thanks
but just 4 lua files
Neat. Realistic car physics has its own trunk override now too.
thats why i thougt you knew about all this and asked if you could help me 😄
(and HP and weight override)
yeah but i dont have that added cause of the java stuff
Yea.
now if i just play with my friend its ok, but if i want to open it for other ppl it can be a hassle right
Basically it looks like this mod ignores vanilla capacity entirely and uses its own 3rd party setting.
tbh i have no clue, i was just happy it worked without the java overide stuff
but that leaves my mod still broken so i thougt i just ask for help 😄
cause i cant fix it cause i have no clue what im looking at 😛
FWIW vanilla item renaming doesn't even work currently
yeah i think i used this mod back in B41, cause i do like/want it
Would it work if the item is from my own mod?
i mean that the vanilla context menu option that lets you rename things (just bags i think?) doesn't work at all
Your thinking of a different mod 😛 it was never ported to B41
I left a suggestion on the mod authors page to use reflection (that'd make more mods work automatically)
ow i thougt car physics was also on B41 🙈
"better car physics" is, Realistic Car physics is the mod I made 😛
yeah i know your mod for sure, i just thougt it was the other one also 😛
if that would work that be awesome, thnx for your time and help 🙂
and i might take a look at your mod aswell and hope it doesnt break with the othe stuff 😛
oh nice, I literally just added that mod to my dedicated server a couple hrs ago
put a little message to others on how to install it, hopefully its not too complicated for the kids who may or may not be on the server ;p
Good news is as long as the beta features are turned off, not having it installed just means vanilla physics
need you one of these for easy player installs 🙂
This one requires a manual installation
Yea iv considered it at some point.
or atleast, part of it needs to be manually installed
everything needs to be automatic that way stupid people can enjoy it too
whats your max container cap ? or do you only touch trunks?
im aiming for 75-100 online players per server with multiple hives
for clarification, im not running any zombies its strictly RP server
and map is restricted size
that mod only touches trunks, but 100,000 or so 😛
the screenshot is from 'Total Capacity Override', a beta mod part of moons mods pack
dude 100k
Yes I felt silly. Realistic car physics will let you drive cars over 10,000KG weight though.
back in B41 we had 15k on our storageomatic and lagged the hell out when it was loaded to 11k
yea I don't recommend actually storing that much lol
unless its also stupidily heavy items
its just, you COULD if you wanted to, scale it that high 😛
becasuse I thought... whats the point of breaking limits if im just going to have slightly less sane limits?
btw i havent played yet as im making a server atm, but with animals, are there trailers that can handle more then 1 cow ?
No, truely insane limits that nobody in their right mind would ever need more then because the game would have already crashed is the way.
well 100 vs 5k is already huge 😄
but i get your point yes 😛
some ppl play on supercomupters @work 😉
I don't recall being able to move more then 1 cow at a time IIRC -_- but my memory is fuzzy.
there are mods that add more 'animal capacity' to horse trailers/etc
IIRC
also maybe it is less laggy in B42 cause i also had lag when opening cheat menu items
and now i dont lagg at all
i so love this one
cause all those big fish and animal carcases weight a lot 😛
B42.12 had some REALLY bad lags with item counts
B42.13 seems to have fixed it and will happily support a few 1000 items in a container
yeah i waited till MP got released cause i dont play SP
im too cool for school 😛
also too old
Stuff on ground is laggier then in containers too
but who cares 😛
IMO excessive container capacity is for organization though, so you can actually put all of X into one container instead of spread across 15 stacked boxes unable to ever find what you need again -_-
yeah but that why my mod needs to work, its like the AE2 from miecraft, we always dumped everything in the computer and craft from there 😄
and the fact everyones (at least hoarders like me) base becomes a crate stack is... ewww..
unless you need a spefici table.machine to make it offcoruse
yeah so pray my mod works 😛
yea I don't plan to have everything in one container 😛 but I do plan to have all 25 shotguns iv found on cop zombies in one container yaknow?!?
it has 3k limit now with that java limiter as he has it capped on 3k
add pagination to your storage it will help alot
yeaaaaaaa I don't get why people would just increase it to 3k lol
or rather, limit it to 3k
like.. if your gonna fix limits... fix them to be totally broken and let the player decide 😛 its a sandbox game
Hi channel, I use ScriptManager.instance:getItem(xxx):getDisplayName() to get an item name from its template. This works fine Client Side, but server side, this is returning the Item's type name. Anyone know why or how to tget an item name from its template on the server side?
Yea thats a lot easier to fix in LUA afaik
yeah and i dont think you can just edit 1 class file cause its compiled right
I should prob add that to my capacity override mod lol
😛
you override it
its java you actually can just edit 1 class
yeah but you cant complile 1 java file right
yes you can.
ye its called a patch
as it looks for the other files aswel ?
you compile it against the game, but the end result is you just have a 1 file patch to send to players
dont have a compiler
some things need to be done in java for PZ. java executes before any lua does so sometimes there is no choice
.... the compiler comes with the java SDK thats 2 clicks to install.
duuuuudeeeeeees im a n00b 🙁
and you only need it to create java mods.. not to use them
Installing java mods in zomboid = Copy folder from mod to PZ folder.. done
its the same shit just looks different
you decompile the games jar
Just tried some "project zomboid" server tools I found.. regarding server installation, they don't do it like I did which was set it up as a systemd service smh. Perhaps I'll work on automating the funcationality of installing a server and creating a system d service under a different username for my own mod
you should make it work headless as well incase someone is hosting on a vps
mhmhmh
good idea
my current mod doesnt do any installation stuff, just basic server management, updating mods, sending commands, viewing logs and users. something to look into
Anyone here who doesn't speak english as their native language? Have you ever tried PZ's localization in your language and how was it?
Hey everyone, just a reminder that print() is a major performance(1) antipattern in Project Zomboid mods, particularly at scale.
Removing prints entirely in release builds is strongly recommended.
For those needing logging, ZUL Framework(2) is an opt-in alternative.
Happy Logging!
(1) https://pzwiki.net/wiki/Mod_optimization#Prints_are_the_devil
(2) https://steamcommunity.com/sharedfiles/filedetails/?id=3653948326 | https://github.com/escapepz/ZUL
Just to clarify, even a logging API has performance impact with overheads, tho it's definitely not as significant as prints
Hi channel, I use ScriptManager.instance:getItem(xxx):getDisplayName() to get an item name from its template. This works fine Client Side, but server side, this is returning the Item's type name. Anyone know why or how to tget an item name from its template on the server side?
Nevermind I think the server doesn't have the translation tables. thats why
Why would you use that server side ?
I wanted to prefix the the item name with some text. And If I do this on CLient side it wont persist on the server.
Why ?
Just why do you need to do that ?
If that's not something the client interacts with, then why do that ?
What do you mean by client doesnt interact with? To rename the item and prefix with some string, I need to know what was the original name. thats all
I dont really udnerstand your question
What is your mod doing here ?
Bcs if you need to rename something, that's done client side
That makes sense and thats what i was donig, but when I transfer the item to another inventory or relog the name resets.
My mod creates a recipe to write down the contents of a room on paper. So I have an option to specify the room name, and I want to prefix the original name with the room name
So originally its something like "Inventory Sheet of Paper" and after it would be "Kitchen Inventory Sheet of Paper"
I could not find an Event on the Client side to rename the item when its transferred between containers. And someone on this channel told me I need to do this Server side so its persisted.
So I gave up on renaming and will show the room name as tooltip
@bright fog Makes sense?
how would I go about adding a small ingame delay to code
I think the best way of doing that is by making item variants that replace the original one
The reason for that is that you are currently not considering translations for your mod
So basically if the client is english or spanish or whatever, with your current system they'll impose their language to everyone else
Currenlty the room name is free form input by the user
By not renaming the item but instead using variants of the item, you make sure every clients have the proper name for the item
I could have a list of common rooms, and do what you said
I feel, letting the user input the name is way more flexible. I dont know what types of rooms each player will have
The room name is subjective, and wont be translated
tell me what you're trying to achieve exactly. like "im trying to do ______ because i want ______ outcome"
can anyone point me to where body slot locations are listed? as in, how to reference them from lua. the wiki page listing slots doesn't seem to have them in the same format
I was thinking adding a logging system to my mod, lucky I saw this.
Quick question does the OnTick not work properly? I can’t get it to print anything
it definitely works, your problem is something else
Make sure your code didn't crash on compile (check for the word 'trace' in your console.txt)
Im still amazed somehow TIS managed to make a slower logging system then.. just about any random modders implimentation of one
Admitly, TIS has to handle crashes.. but I feel like that could have been handled so much better by just having 'flush log' at the end of any callstacks, and maybe have 'flush log' at end of every print only when in debug mode or something -_-
Thanks Guys will look into it
It worked when I restarted the game reloading lua didn’t work somehow
having fun learning the basics of modding
baby steps
wheres the composter lua stuff?
trying to figure out how it generates worms
I'd like the campfire to generate ash, but I guess I'd have to make ash an item not just a tile
hrmm
what fun
That's the idea behind ZUL. Centralized, leveled logging avoids a lot of pain later.
Logging always looks cheap - until it isnt.
I'm more of the pov that logging should just straight up not be present in mods, only for unexpected code behavior and edge cases which can be handled with asserts most of the time
That makes sense, thanks for the clarification.
We definitely want logging in the mod, but we’re moving away from print() entirely. The goal is to have controlled, centralized logging that we can rely on for debugging without hurting performance.
We’re currently weighing up whether to roll a very small internal logger (since our needs are fairly specific), or to integrate something like ZUL to avoid reinventing the wheel.
Either way, the intent is:
- no print() spam
- event-based logging only
- and something that’s safe for MP and scale
Appreciate the insight
Like I wrote in that guide on the wiki: no one gives a single shit about your logging but yourself, even modders don't care about it
We only care about problems, maybe overwrites and that's about it
And for these prints are usually enough or even better you can use the game logging system with DebugLog
In fact you should because prints are broken rn
Agreed. I manage a semi-heavily modded server with 150+ mods, and some mods print random numbers to the console with no context. It's impossible to trace their source, and they're clearly not vanilla.
Actually you can trace their source
The community debug tools does it
It hooks to the print function and shows which mods call the prints
Good Day guys, I'm trying to make my mod's sfx volume configurable and it seems like its either loud or none, Upon sleuthing I found this page that states that this part is actually disabled on b41 and not sure if its still the case in the recent version. Can someone actually confirm is this is the case and if is, what are your tips on how to granually set its volume. I already made the slider but currently, its either loud(not zero) or 0. Thanks in advance, This has been plaguing me for days lols
https://theindiestone.com/forums/index.php?/topic/40085-soundmanager-inability-to-control-the-volume/
https://projectzomboid.com/modding/zombie/SoundManager.html#<init>()
I ran into the problem of not being able to change the sound volume, which happened with SoundManager in 41.54? This is how everything worked before... getSoundManager():PlaySound(sound_song,false,0) getSoundManager():PlaySound(sound_song,false,1) getSoundManager():setMusicVolume(0); gameSound:se...
declaration: package: zombie, class: SoundManager
Has anyone managed to figure out how to get IsoAnimals to attack or be aggressive without relying on the Aggression Gene, since it seems to refuse to reset unless the entire save is reloaded? I'm trying to create an animal that that attacks zombies rather than just fleeing.
If the gene is janky enough, my hunch is to just fake the attack mechanic by making it check for nearby zeds, grabs their id then throw some dice if it hits or not to simulate fighting lol
Anyone know if it's possible to make a firearm not fill the area with light when fired?
I am having a problem using dressInNamedOutfit or dressInPersistentOutfit in MP. If I do something like
zed:dressInPersistentOutfit("HazardSuit")
zed:resetModelNextFrame()
zed:resetModel()
On the client, it works fine. however when I kill the zed, I stick items in its inventory (on the server) which works fine, but it also causes the zed to revert its clothing. Any help is appreciated
hello guys! wanted to upload addon, but i have some problem
Can someone recall me how we get current container distribution info ingame in debug ? = right click + open Loot Zed
Pretty much. Some containers can have multiple distributions, so keep that in mind. In B41 you need to enable lootzed in debug menu, but 42 has it on by default
Unless thats not what you ask...
thanx 🙂
Yea, also note what distribution is picked has some complex logic behind it.
theres like, a min/max count for each distribution, I think it means 'per room'
So there is often a few rare distributions that are limited to like 1 max -_- and then some junk distributions that have 99 max
hence why there is only ever 1 cabinate in gas stations with anything good (smokes/matches/etc)
echo --- reset IP ---
netsh int ip reset
echo.
echo --- reset Winsock ---
netsh winsock reset
echo.
echo --- flush DNS Cache ---
ipconfig /flushdns
work for me on Windows, no need to reset the pc, btw need run as admin, you can search google how to
I have a new mod item, BathTowel reskin(different color), what is the best way of adding the menu to dry yourself using it, since it doesn't seem to be granted via ItemType or ItemTag. It is setup currently like the regular BathTowel.
I think theres a decent bath towel mod already
how would I go about adding a small ingame delay to code?
Like shorter than a second delay
Are you adding a new color to the existing Base.BathTowel item or makingg an entirely new item?
Or just changing the color for all existing towels.
If you've replaced the texture or added more textures to an existing item you should not need to do anything else. (but WARNING: if you add an extra texture option to an item, then your mod is removed, the texture index will be out of bounds and this will cause an entire chunk of the world to reset (assuming they didn't fix that bug) )
if you added a new item, you will need to add your own context menu entry. The existing check is hardcoded to two specific items only instead of using a tag:
if (testItem:getType() == "DishCloth" or testItem:getType() == "BathTowel") and playerObj:getStats():get(CharacterStat.WETNESS) > 0 then
tests.canBeDry = true;
end
then if your towel is found (and your towel is dry) you can call the existing timed action which doesn;t seem to care what you dry yourself with provided it is drainable:
context:addOption(getText("ContextMenu_Dry_myself"), items, ISInventoryPaneContextMenu.onDryMyself, player);
anyone know what's the earliest event I can use sendClientCommand? It's not working at OnGameStart or OnConnected. It doesn't even work on the first OnPlayerUpdate
or alternatively, is there a trigger for the server where I can see when a client joins? Would love some sort of OnPlayerConnected(player) event
commands start working at the end of the first tick
so something like the second ontick trigger is typically used
not ideal but thanks it's good to know that, at least I can work with it
Lua timers
Probably something to add on the wiki
hello modding guru, are there any new vehicle related api in b42?
The game ?
Hey I saw this the other day, id be keen to follow progress on the mod and how far you are from release.
I saw a sneak peak of it somewhere and already I can see its going to be fun.
Also what is the blackboard, other than like a market, contract mod?
Hey not sure if this is the right channel for your question but..
Appreciate the interest, glad the sneak peek caught your eye 🙂
At the moment all testing is being done privately and we’re keeping public info pretty limited on purpose. The mod is still in heavy development, and we’re focusing on getting the foundations right before opening things up or talking release timelines. So there’s no public testing or ETA just yet, but progress is definitely ongoing. But Id say within the next month or two.
As for what The Black Board actually is, it’s more than just a market or contract mod.
At its core, it’s a living, in-world community hub. A physical blackboard where players trade with each other, post messages, take on jobs and contracts, earn money and progression currency, and interact with larger systems like server-wide contracts and factions. The goal isn’t just functionality, but atmosphere, making it feel like something that belongs in the world rather than a detached menu.
We’re trying to build a system that tells a story, a story made by players and shared with the community. The Black Board is meant to feel lived-in: trade scratched onto the board, notes erased, rewritten, overwritten again. Things appear, expire, and disappear as the world and its players change.
We’re building something here that goes well beyond what most Project Zomboid mods attempt. There isn’t really anything on the Workshop that does what The Black Board is aiming to do, combining a player-driven economy, contracts, progression, and social interaction into one cohesive, world-based system. That’s also why we’re being careful with development rather than rushing things out.
When we’re closer to being ready for wider testing, we’ll share more. For now it’s mostly "behind the scenes" design, iteration, and multiplayer stress-testing to make sure it all holds together properly.
Thanks again for the interest, it’s genuinely motivating to hear people are excited about it already.
oh sorry did not know where to ask about it, but yea im keen to see this finished. thanks for that info will be looking forward to it.
local function sayItemName(playerToSay, itemToDisplay)
playerToSay:Say(tostring(itemToDisplay:getDisplayName()))
end
local function onKeyPressed(key)
local player = getPlayer()
if not player then return end
if key == Keyboard.KEY_K then
player:Say("K pressed")
local container = player:getInventory()
local items = container:getItems()
if items == nil or items:size() == 0 then return end
for i = items:size() - 1, 0, -1 do
local item = items:get(i)
sayItemName(player, item)
container:Remove(item)
end
end
end
Events.OnKeyPressed.Add(onKeyPressed) can anyone tell my why it crashes on " if items == nil or items:size() == 0 then return end" sorry first time lua
local player = getPlayer()
if not player then return end
if key == Keyboard.KEY_K then
player:Say("K pressed")
local container = player:getInventory()
if not container then return end
local items = container:getItems()
if not items or items:isEmpty() then return end
for i = items:size() - 1, 0, -1 do
local item = items:get(i)
sayItemName(player, item)
container:Remove(item)
end
end
end```
try this
Hello,
someone can explain me why this is OK for B41
local nbmoodles = player:getMoodles():getNumMoodles()```
But not for B42 ?
moodles api was reworked
Ok, and how to access it ?
Why are you not using
local player = getPlayer()
maybe getSpecificPlayer(0) dosnt work in B42 anymore
because after I want to put getSpecificPlayer(0) in for loop for server needs.
getSpecificPlayer(0), work for other parts in my mod.
what is the equivalent in B42 of player:getMoodles():getNumMoodles()
When using sendClientCommand im MP, do you guys think it is necessary to add some kind dos-protection on server side?
it makes sense to validate commands to prevent cheating, but keep in mind that vanilla commands do not do much in this regard so they'd just DOS those instead
Yeah... it is super natural to validate stuff and if done with some care, it can probably eliminate all gameplay cheats not intended by a mod.
But what I was thinking of is that the client may use smth like this:
sendClientCommand((player, "someMod", "someDefinedCommandFromTheMod", args)
end```
Haven't tried how this would behave in an actual MP game but just in theory... wouldn't this break a server?
But I'll definitely try such a construction in my current mod when I have the time (or sending it via a for-loop a million of times).
Curious how the server behaves.
you can't stop that
that would be on PZ's netcode, there's nothing you can do to prevent it
Anyone know when one of the Profession Frameworks will update? Wanting to make some custom occupations but I wasn't able to find any mentions of removing vanilla professions
My current workaround is to remove vanilla professions is to exclude them from the list of selectable professions in the occupation menu. Here is one way of doing this:
function CharacterCreationProfession:populateProfessionList(list, ...)
vanilla_populateProfessionList(self, list, ...) --execute vanilla code
list:clear() -- clear the list of selectable professions
local excludedProfessions = {}
excludedProfessions[CharacterProfession.BURGER_FLIPPER] = true
local profList = CharacterProfessionDefinition.getProfessions() -- restore profession list
for i = 0, profList:size() - 1 do
local profession = profList:get(i)
if not excludedProfessions[profession:getType()] then -- omit excluded professions
list:addItem(profession:getUIName(), profession, profession:getDescription())
end
end
local unemployed = CharacterProfession.UNEMPLOYED
list:sort(function(a,b) -- sort the list as in vanilla
if a.item:getType() == unemployed then
return true
end
if b.item:getType() == unemployed then
return false
end
return not string.sort(a.text, b.text)
end)
end```
only thing is that our mods might then not be compatible with each other since we both fully delete the list and then restore...
in the long run and with regard to mod compatibility, it might be better to first back up the list and when re-storing the professions, do it from the back upped list. (note for me: do this in the next update).
but as a quick and dirty solution, the above will also work.
Any clue if theres something specific you need to do for mp?
not sure. my mod is currently single player only (although I plan to update it for mp). however, from what I see, the vanilla code I modified above is fully client side, so it may work in mp out of the box. the only thing you need to take care of is the new system for defining professions which has been introduced in 42.13 (this applies to sp and mp).
Do note that most 'user' aspects like calories, etc are all driven server side now
Yeah, but not the profession selection screen we are talking about. It is located in the client's OptionScreens folder and mainly consists of code for controlling UI. Still possible that there is some server-client communication which I just haven't noticed (in fact, there should be at least some server-side checks cause otherwise, people could cheat overpowered builds). But from what I saw, there is nothing in the code we discussed above.
Try to work on mod without internet. Can't launch coop server to test mod, sigh
how would I go about adding something to the radial reload menu ?
Do I need a folder with the exact name of the game version I'm using in my mod, or is that not necessary?
no, the highest version folder that does not exceed the current version will be used
so if i have a 42 and 42.13 folder, all versions from 42.0 to 42.12 use 42, and all versions from 42.13 onwards use the 42.13 folder
I think it's media/lua/client/ISUI/ISFirearmRadialMenu.lua
Attach a prefix or postfix to that which calls addslice
ty
Did something get changed with textures for B43.13??
I have my mod for Ancient Weapons and the models don't have textures.
I have the .X files in the Model_X/weapons folder.
And then I have the .fbx files in Model_X/WorldItems
Why do you use both fbx and x ?
Idk, it's just how the thing was set up from B41??
I really don'y know what I'm doing at all.
I'm trying to get it to load up in the mod menu, and I added the ItemType = base:weapon to them.
And the new catagories = base:smallblade
I've got thousands of people who use this mod, and I can't seem to get it up and running for B42.13, and I looked at all the documentation.
The base mod runs on B42 though, and that one's still up on the workshop.
I'll do all the legwork, I just need a tip to move in the right direction.
I also noticed that the vanilla model definitions added a new "attachment world" and "attachment bip01_prop2" for some vanilla weapons as well.
Sadly I can't give you much tips without more info on what the problem is on your side 😅
Items don't appear ?
Any errors ?
You only have model definitions for the ground models
So there's a difference between ground sprites and world items??
I thought they were the same. I'll fix that.
Is there anything else I need to add?
uh idk, that was just the first thing I noticed
Ty!
"WeaponSprite" is the model used when held as a weapon
I can reference them both back to the same .X file?
you might be able to use the same model for both without issue, but the problem is the itemscript is calling for a non existent model script definition
What's a model script definition?
mesh = weapons/1handed/BattleAxe_stal,
texture = weapons/1handed/BattleAxe_stal,
scale = 0.01,
attachment world
{
offset = 0.00 0.00 0.00,
rotate = 0.00 0.00 0.00,
}
attachment Bip01_Prop2
{
offset = 0.00 0.12 0.00,
rotate = 0.00 0.00 0.00,
}
}```
Ahh okay! I'll fix that.
I think there's more than just that though, I'm a bit tired
It seems like the model just,, isn't loading ?
It's not spitting out the error anymore since I added a new model definition
but the model itself seems to be empty
strange
Okay, I added the model and renamed it all to _ground
and it's got an attack animation in game too
and the attacks work now
But I think it might not have a texture?
okay, I got into a fight and the weapons are working.
But there are no visuals.
It's just a blank space.
Hey so im tryna host my own b41 pz server can someone help me out im using a thing called Nitrado for server hosting
Sorry mate! Never used it myself.
Ur good man i haven't done this in years tryna figure it out
Can I rename a .fbx file without messing anything up??
I'm gonna try it.
Hello modding guru, is there a javadoc for b42?
package index
That's for 42.13.0, AFAIK the only change that matters for 42.13.1 is the additional of a way to move a new BodyLocation to a specific place in the array of BodyLocations.
Yes because updating existing .X models to .FBX has not been done, so a lot of game assets are still in .X
I've never had any success doing anything with .X files though.
no
You need to properly import to blender or another program
and export to the appropiate format
it does, but its just better to use fbx
less size, and more programs support them
the wiki already has link to programs that you can put in blender for importing X into Blender
there is also a CLI for mass transforming X to GLTF
I used that to make animations from X to FBX later
How?
I mean the body locations. It's kinda annoying that new ones are on top, which results in some strange behaviour
So I am getting this error and no idea what i did wrong with uploading the mod but it does kick the mod out of the steam id line in the ini file but it does remain on the Mods line...
[MLOS] Mod \Storage0Matic3000 not found. Subscribe to the missing mod or save changes to the server configuration (missing mods will be removed from the mod list).
Okay, so switching to .fbx now makes the weapons show up, but they are in weird locations.
Like the model is displaced from the correct xyz coords.
Zomboid/
└── Workshop/
└── MyExampleMod/
├── Contents/
│ └── mods/
│ ├── MyMod1/
│ │ └── ...
│ └── MyMod2/
│ └── ...
├── workshop.txt
└── preview.png
Will each of my standalone mods be in a folder in Workshop/ or in Workshop/Contents/mods/?
Workshop/
Mods are defined in subfolders of a workshop item with the appropriate file structure & mod.info. Workshop items are defined in Workshop & contain the content specified in Contents/mods
ty
What are multiple subfolders of mods used for within a single mod in Workshop?
Multiple mods within a workshop item
Workshop items don't have to be 1:1 with mods, you'll see this a lot with mods that have different options that aren't doable via sandbox options
ty
I've already taken a look at the project structure, now I'm going to study the Kahlua API so I can make my first mods, thanks for the help.
Hi everyone, after months of thinking I decided to finally get into modding this game, I have experience in modding some games like Unturned or Running with Rifles. The thing is after some research I didn't find a recent weapon tutorial focused properly on B42 or firearms. If some of you could share some guide or tutorial I would be more than grateful, to help me in the long way to make something as big as Britas firearms mod. 
I recommend that you start by studying folder structure, file formats, and mod structure first. There are some very good recent videos about this and a lot of information on the wiki.
https://pzwiki.net/wiki/Mod_structure#Build_42
https://pzwiki.net/wiki/Lua_(API)
https://www.youtube.com/watch?v=FGbyLGLmxes&list=PL91PT-Vd7Vhp_eBA8pE4hCXPcrxHWgr_E
This guide explains how the Lua is able to communicate with the Java, how to use this behavior for your mods, and how to set up a basic Lua mod structure. It will also teach you how to use the JavaDocs, LuaDocs, how to search the game files and decompiled code to find what you're looking for, and also searching Lua events to implement specific b...
wow, many thanks bro!! I surely check this!!
I'd look at Rain's firearms mod too!
Okay, so the model is way offset and doesn't have the rotation it should.
many thanks bro!!
Is there an option to send server message ( /servermsg "Server restarts in 3 minutes" ) from mod?
Congratulations to the Umbrella contributors, this intellisense is incredible.
You need to thank @bronze yoke, I believe @frank elbow too and possibly Jab ?
And some community documentation contributions—hopefully more in the future
public InventoryItem addItem(InventoryItem baseItem, InventoryItem usedItem, IsoGameCharacter chr) {
int cookingLvl = chr.getPerkLevel(PerkFactory.Perks.Cooking);```
k looks fine to me so far...
if (baseItem instanceof HandWeapon) {
item.setConditionFrom(baseItem);
item.getModData().rawset("condition:" + baseItem.getType(), (double)baseItem.getCondition() / baseItem.getConditionMax());
}
... wait, why is there.. handweapon code in evolved recipes?!?
also interesting: private void checkUniqueRecipe(InventoryItem baseItem) {
seems to provide some list of unique recipes (ingredient lists) to be used in an evolved recipe
that provide extra hunger/boredom/happyness bonuses
Seems to 'exist' as a feature, but isn't used in vanilla?
public void Load(String name, String[] strArray) {
for (int i = 0; i < strArray.length; i++) {
if (!strArray[i].trim().isEmpty() && strArray[i].contains(":")) {
String[] split = strArray[i].split(":");
String key = split[0].trim();
String value = split[1].trim();
if (key.equals("BaseRecipeItem")) {
this.setBaseRecipe(value);
} else if (key.equals("Item")) {
this.items.add(value);
} else if (key.equals("Hunger")) {
this.setHungerBonus(Integer.parseInt(value));
} else if (key.equals("Hapiness")) {
this.setHapinessBonus(Integer.parseInt(value));
} else if (key.equals("Boredom")) {
this.setBoredomBonus(Integer.parseInt(value));
}
}
}
}```
BaseRecipeItem doesn't show up in the .txt files?
Hai im not a dev but im just gonna say
thanks to all you devs who are updating your mods for the new update (that kinda broke a ton) it means alot
i'm not sure my questions would fit here, but i'm working on some companion tools (mostly for myself, but looking to OpenSource) for docker containers
is this a good place to ask basic questions?
ill add an example question
so i'm looking to start parsing some console output LOG : General f:56871, t:1769631036106, st:318,653,146> ERROR: IsoThumpable not found on square 5720,5725,0
i figured out t: is milliseconds since Unix Epoch and st: i assume is server ticks since creation (not current running)
but what does f: mean?
i noticed it jump by 50 when i was having a recurring mod error that was locked in the main game tick loop
and is there a place i can see what the "standard" output format is expected to be for the console log?
i know there will be outliers
im just trying to parse the 80% for now then work on the outliers and exception logs after
i promise not to ask full programming questions - i was just looking for some source code where everything outputs to the console or basic guidance
What's your goal with parsing the console file?
Nah, I'd probably check the Java for that
two parts - one just to do it myself and learn something - secondly i want to group everything together into logical groups so i can see the things that matter quickly
is the console output a standard Java console output?
i havent worked with Java much and currently working with C#
I’m looking though modding steps now to see what info I can glean
You need to adjust them tho
Adjust them how?
When should I use the Base module or MyModuleName module in scripts?
Basically all the time besides when there are technical limitations
You should always prioritize a custom module
There is (or was, no confirmation it's still present in 42.13.2) a bug where CraftRecipes don't work properly in MP if in a custom module
ty for tips
does anyone know by heart what the maximal capacity of the player inventory was?
isn't it 50
Frame number, as defined by the number of times the IsoWorld update method has been called. This can be answered by looking at DebugLog.java, so if you're looking more into this I'd recommend decompiling
Information on how to do that is on the wiki, you'll probably want to use ZomboidDecompiler
I just made a console output and it says 50!
what is weird: when I play multiplayer as a host, even when not in debug mode, I can still load more than 50
i think that's a bug
appreciate the heads up and i dont mind getting my hands dirty
so theres a game tick and a world tick
whatever - let me dig in and answer my own questions
interesting - st seems from the "start of time" (for the server) and f frame number is per boot
thinking "out loud" it might be a good number to look at when random server issues arise - like the server was up for like 15 hours and gracefully handled some exceptions but then suddenly when people slept the server didnt fast-forward time
might be time to dust off that jetbrains license*
This won't affect what you said that much, but regardless: from what I saw earlier, the value of the “server time” part of the output is derived from System.nanoTime, which is actually measured from an arbitrary point, not necessarily time since the start
So it's mostly useful for comparison between 2 reference points
interesting - i made an assumption
that is annoyingly foreign - is this a measurement that is more important in things like game engines where there are faster loops/ticks?
It's essentially just a timer with very high resolution, pretty sure it's intended primarily for benchmarks/duration measurements. That's at least the main place I've seen it used, anyway
i normally deal in slower (something like a 50ms wait between loops is more than fine)
got it - profiling and such
In the game's case it converts it to milliseconds anyway, iirc (some unit other than nanoseconds, at least)
regardless if i find a use out of the gate its still useful to name stuff properly
Is it possible to add new properties to existing classes?
For example, I would like to add a new property to the entity that represents radiation levels and then create systems to manage it.
Extending java classes needs a java mod. Think very carefully before doing that, it's a pain for you and for all your users.
Using lua I wouldn't desribe what you do with an elegant term like "adding properties"... it's more like "here's a soup full of stuff, you can throw more stuff in there"
I expect you can do what you want with lua, but if you can describe the systems you'll be adding in more detail this channel can probably give you advice on where you need to get started.
If you can possibly do it in LUA, do it... Because java mods will have like 1/4~1/2 the usage rate.
And you will have to constantly update them, and if you're adding anything via java that is meant to be persistent you'll probably have everything break every update when people start up the game without the java bits installed and either break your mod or break their entire save. And everyone will blame you no matter how clearly you explain how to avoid issues.
Depends what classes you alter.. ones with Save() and Load() functions are... difficult.
there is 'leaf' that apparently lets you only alter the functions you care about, but I have no idea how it works -_-;
Manual installs are all the rage lel
my current issue with tracer effects, if I implement any I need to do manual installs aaah
Just created my first mod 🎉 😅
This is true
Yep, pretty much what I was doing the past two days 
Hey I have like 50 guns on me hahaha
What programs did you use to make the casings? Animation and sprites.
each casing is one map object on ground?
rsrsrs
I left instructions on how to hook a weapon pack into the mod
or you can look over at the param tables in server
but I will be reworking stuff in the mod
I just have all changes local right now
I'm learning how to make mods, so I like to see how they've been made, and yours looks very well done from what I've seen.
A crafting system for ammunition was my first idea, but I see you're already doing that.
Dont recommend you looking at that one
I release a crafting ammunition for those casings yeah, its still WIP but you can look a bit into how I did one that one
start better by looking at vanilla files
but HB is not a simple mod specially for learning
even if the outcome of the mod is rather simple, visible casings haha
I have experience programming, but not with games.
I did a comparison with the Lua API and learned a few things, like sending commands to the server; I find that quite interesting.
Did you analyze the game's code by decompiling the Java?
if you have experience with code you will get it quickly
you can do that, and also check the main lua files from the game
in media/lua folder
Looks great! What does it do? Maybe add that sound from south park to play
most of the logic for firearms is there too
I did this to view the Zedscripts settings.
thanks for the tip
I was noticing some errors on a mod not finding files on Linux cause it’s filesystem is case sensitive - is it best practice to make the files lowercase?
it's best practice until they fix it in a couple weeks and then it's probably bad practice
also there are some files can't be lowercase (e.g. all animation nodes need to be in AnimSets), these things simply don't work on linux servers right now
got it
I have a friend in our party that constantly dies and we always ask him "Did you die again?" So this will show us a notification every time he dies. 😂The "Kenny" placeholder is configurable in the sandbox settings
i thought there was something that was beyond the modders control concerning extending objects
<animNode x_extends="ChainsawDefault.xml"> is causing an error that looks like its looking for the all lowercase version
at least that's my assumption
you can only extend a file from your own mod, it uses real paths
this is their file
imo the extends system is kind of bad/useless anyway
but the error is either mis-reporting or something is causing the file to be loaded all lowercase
filesystem errors will usually be lowercase, the game usually treats paths as if they're all lowercase to support linux better
yeah, on the docker volume the files are there
the linux problems are a new issue with 42.13
it could be that it really is inappropriately lowercasing it, but again the virtual filesystem just downcases everything so not necessarily
basically windows modders mess up casing so often that they had to make the game itself case insensitive for 90% of mods to actually work on linux
not gonna lie - i half googled making the linux filesystem case insensistive
and was like.. nah.. im not doing any of that
it's just a temporary issue with that system, if it's been reported properly i'd expect it to be fixed by the next patch
i say 'if' because it wouldn't be the first time a major issue we never hear the end of has not actually been reported to tis 😅
ill make a note to look over the forums and do my best to report it
if its not - an actual modder would likely do a better job
Hey, why isn't the mod that adds default cars with new textures, consisting of scripts and textures, working on the server? I can't find the reason.
better ask in the mod support channel or directly on mod's steam workshop page
has this been the case for a long time?
im digging through the code now
and
Yes windows modders have been messing up case for a long time.
im curious what changed thats causing these files not to be found
The previous filesystem handled it for Linux -- my guess is when versioning was added that fix was lost with it
I wouldn't be surprised if they had this issue a really long time ago too and needed a solution
it is a b42.13 change, build 41 handled linux fairly well
That’s a solid point
I’ll see if I can dig up those parts and see if anything stands out
any quick-fixes for intellisense vs code and javax stuff?
do i need to get a different version of java?
---OnWeaponSwing: Triggered when a player begins swinging a weapon.
---<br><br>attacker - The character attacking.<br>weapon - The weapon being attacked with.<br>
Events.OnWeaponSwing = {
---@param callback Callback_OnWeaponSwing
Add = function(callback) end,
---@param callback Callback_OnWeaponSwing
Remove = function(callback) end,
}
This is the "documentation" within Umbrella.
According to my tests, the attacker is actually the one that was attacked, not the one that attacked.
Did I do something wrong, or is it really reversed?
I tried displaying the attacker's name, and it's nil, and the ID is indeed the ID of the zombie I attacked.
this is my code
Events.OnWeaponSwing.Add(function(attacker, weapon)
print(attacker:getID()); -- Ouput: Zombie ID
end)
Events.OnWeaponSwing.Add(function(attacker, weapon)
attacker:Kill(getPlayer())
end)
This code killed the zombie instantly.
It seems that the same event behaves differently when it's on the client or the server.
On the server, it seems to return the ID of the attacker.
That doesn't seem like it should be possible
yeah, i was deep diving the source
and trying to see what i could find
i did find LuaEventManager.triggerEvent("OnHitZombie", this, wielder, bodyPart, weapon);
That's a trigger for the OnHitZombie event
which might be near the event you are referring to
The only one for OnWeaponSwing is in SwipeStatePlayer and it's called with a variable that was explicitly casted to IsoPlayer
So I'm not sure how or why that would be the zombie
I was referring to what eyeOhScream mentioned, my answer to what you were saying is "I don't understand how that's possible" 😅
I think I may have forgotten to load the code in my tests, which is why the previous event was showing up.
So you were potentially mixing up the two events?
I see, all good I was just trying to understand
I’m not a modder - just deep diving an error
I’d imagine there’s some god object you can get it from
Everything I’m seeing derives from zombie
But I don’t know
I’m sure there’s some lua context I haven’t seen yet
Hate when that happens
java.lang.Object
zombie.entity.GameEntity
zombie.iso.IsoObject
zombie.iso.IsoMovingObject
zombie.characters.IsoGameCharacter
zombie.characters.IsoLivingCharacter
zombie.characters.IsoPlayer
IsoPlayer inherits from IsoGameCharacter, so I can use it.
That's Java inheritance.
can you still access the properties of IsoPlayer?
even if it hint IsoGameCharacter or do you have to attempt to cast it?
lua does not have a concept of classes, so you can try to do anything, but if you don't confirm it's an isoplayer first you'll be in for pain when it isn't
solid advice
if they are public yes
yeah, my concern was what albion addressed
checking its type before assuming those properties exist
i was trying to see how many classes extend IsoGameCharacter but my IDE crawling
yeah, so IsoZombie also extends it, so be careful
liskov principle
A learned one here
In multiplayer, when having some top level code in my shared folder manipulating item definitions like
item:DoParam(), is it necessary to add a condition like if not isClient()? Or will this properly work out of the box?
no, you need both to make the changes
if you don't their scripts won't match and you will either see weird bugs or the anticheat will just kick you
so just keeping it as plain code without conditions should work?
yeah
not well followed by pz 🤫
Someday we'll live in the utopia without casts of this to IsoPlayer in IsoGameCharacter
i mean - i do an okay amount of commericial development - i give game creators a lot of leniency
Yeah, the priority is certainly just getting a working game made—I think anyone who's done enough pz modding or looked at enough pz code just has thoughts on its code quality
Not a knock on the devs, just observations on where things are at (and how frustrating it can be sometimes)
yeah, in my world automated testing should be in the toolbelt
but in a world with multiple loops and constant changing state
I love cursed casts TBH.
Just unsafe shit that you know works because this is an array of nothing but IsoPlayers or you already filtered it somehow
Course, I work as a knifemaker, so its still 100x safer then my day to day work.
Hello all, for those not frequenting the unofficial modding discord -- I've been working on a tool to check for reuploads of mods.
https://github.com/Chuckleberry-Finn/PZ-reupload-check/
It uses page to page scraping of keyword search results (this is to avoid rate limiting and to cast the widest net) of modIDs. (Which also cause(d) issues when multiple mods use the same ID.)
It also has a management system for tracked mods, as well as DMCA filing.
The final cherry feature is a file hash scan (which requires you to have a copy of DepotDownloader) which will cross match to your tracked mods. 🙂
Contribute to Chuckleberry-Finn/PZ-reupload-check development by creating an account on GitHub.
As for the DMCA process I plan to include some helpful tips to asuage concerns over privacy -- but I used a dedicated email for this process and have a PO box.
this is really cool
i have an idea that might include this in the ecosystem
if i decide to make a mod it will be around passive stats and debugging values for mod dev
this is so dope, huge kudos
wdym about the DMCA filing?
I can use syncItemModData to sync mod data on vehicle object on b42?
Hello, since this new .2 version completely broke the whitelist system of servers. I’m trying to create a server side mode that will just have a file with all the usernames that should be whitelisted. Everyone else will be kicked once they login if they’re not in that list.
What’s the code to kick someone from the server?
You can file a DMCA claim against people that reupload your work.
But the process is tedious, and it's easy to forget who/when. So the management column for DMCA tracks when, and you can mark ones you've filed against. Also, the "copy DMCA message" is a template message that includes all the "contained mods" mods. So you can just copy and paste into the form.
Disclaimer that you should still verify the files manually if there's any doubt. The file hashes are directly from steam but still.
question for you: which firearms expansion back do you prefer? (I Used VFE extensively, going with Gaels now)
Also: massive thanks to all the modders in here who do amazing work, gives this game even more replayability which I thought was pretty awesome to begin with
In b42, AddWorldInventoryItem accept a new argument called synchSpawn, what is that?
But there's already a transmit boolean argument so what is the difference between true and true,true?
it does seem redundant
Hi guys… first time posting here.
I honestly don’t know who to ask or how to approach it myself.
For context: my only modding experience comes from basic modding and scripting in DayZ.
Is there any simple way to make all food related items frozen from the start of the playthrough?
Like making it an extra option in sandbox settings?
I love the winter setting (cyrogenic winter, realistic temp) but this is kind of missing in my opinion.
There would been a mod for build 41, but i honestly don’t wanna go back now.
Any ideas?
If there is anyone that could help me with that, please lmk.
In vanilla, frozen state depends on the container the items are in and depends on the fact items are frozen-able (afaik fresh food). It is not related to external temperature in vanilla.
can i call things like CharacterStat:ANGER from Lua?
playerObj:getStats():set(CharacterStat.ANGER, value)--set is only valid server side in MP. get is valid everywhere
awesome - first mod (fixing an older one) working locally
According to decompiled java, for AddWorldInventoryItem, transmit is related to animal while synchSpawn is related to item. Weird naming.
when i looked it seemed like they both did the same thing
like they literally call the same methods
On closer look, it seems like if the item is an animalItem then it will utilize synchSpawn so maybe it meant to spawn animal? Shrug, I don't know how animal works atm.
If it is normal item, then transmit will just transmit and synchSpawn is not used.
When I use print screen in game (windows), and then paste in paint, I don't get the screen I just print, but the one I print before as if there was an "additionnal buffer". Anyone knows what's happening and what I could do to change that behavior ?
don't be in full screen
print screen sees what was there when you last tabbed in, not what's currently there
Frozen on spawn is handled in java, AFAIK
You'd basically just need to go over all freshly spawned containers (there is a 'room first visible' or something event?) and edit the food age you'd want and set to frozen
Weird part is only very few games do this and im pretty sure its something TIS is doing (or not doing)
OpenGL is such a pain, it will allow you to do so many 'illegal' things.... that then break on other peoples video cards -_-;
Or suddenly render at 10fps instead of >100fps
just because you got a window creation flag wrong and someone elses PC refuses to hardware accelerate it
DirectX is so much better about just beating the developer over the head with a baseball bat when he screws up.
"oh you made a tiny mistake in texture format? hope you enjoy this EXCEPTION"
Not an answer to the question asked, but the game also has its own screenshot functionality for which there's a dedicated hotkey
Between that & Steam's screenshot functionality there are options
im looking over a mod and is getSpecificPlayer(0) function used in the client folder reliable to get the actual player running the game? im just thinking about multiplayer and i want make sure its targeting the correct current player
yes
keep in mind that if they are playing in splitscreen there coudl be up to 4 'current' players
gotcha
that'll be interesting to test
the mod im working with adds a UI element
which sounds tricky in splitscreen
oh nice - there's functions for that getPlayerScreenLeft() as an example
has the community come together on a coding style and naming convention or is it just the wild west?
absolutely not
most individuals don't even have consistent style
the most popular style you'll see is vaguely imitating the base game's style but even this is not usually done consistently
lol - i would say one day, but...
i guess im gonna stick to snake_case until the mod loading is fixed
for file names
any tips for sort of hot-reloading a mod? (knowing certain mods shouldnt be hot reloaded)
this is just a basic UI element
and ive already enabled the debug mode
Side effects don't get undone
ie, if you hook a vanilla function.. your previous hook will still exist, and be running ontop of.. the new hook when you hotreload.
yeah, that makes sense
im happy with the current enable disable method - the mod is passive currently
This mod idea is wild probably....but what if when I take bullet from my body It stays in my infentory or at least you can see and hear it fall on the ground.
that could be cool
especially on multiplayer servers if you wanted some sort of RP momento
Is anyone an expert in TileZed? I'm having difficulties getting a 2nd sheet to appear for some reason.
When adding a trait to the player via
player:getCharacterTraits():addTrait(myTrat)
in multiplayer on server, is there anything special I have to do? Like using a special sync command?
I can’t answer but when I was digging through the lua files I saw how they did it so it might be worth looking
I wanna say I was looking at client/ISUI/playerstats/
In the actual game files
I’m on my phone so I can’t look right now
thanks! I'll have a look
can we use a vanilla animation but removing or forcing Translation_Data & Dummy01 bones offsets ? If not, can someone make the port from .x to .fbx of 4 vanilla animations ?
does not work. Edit: I have not been able to use successfuly ZomboidAssetConverter
I'll try aoqia ports
Aoqia's port ? That's the ZomboidAssetConverter
It's the only one that works for animations
i havent tried that tool yet - which file(s)* are you^ looking to convert?
i wanted to try it without knowing anything and see if i hit issues
Still workshoping it but other then being ulgy atm Im liking it codewise 😛
Im basically going to ignore 'hunger' and the evolved recipe 'hunger per item', and instead your just going to get to.. add entire 'items' (or portions there of, if you perfer) to a meal
And will show preview of current items cals/hunger/etc and after you add the ingredient
I do not know what tool aoqia used but their export are usable. here is their post: #908614746071248916 message
from what i can see they used the tool that they developed and offered to the community, ZomboidAssetConverter
That's ZomboidAssetConverter 😭
as a personal preference - make things like the preview optional
I literally made a video about it dude
I saw that dude, I have not been able to use the result
How so ?
If that's the case then tell the god damn creator 💀
If I knew what to tell, I would.
Saying things don't work doesn't make things move forward, @grizzled fulcrum is still an active member of the community
I told, I have not been able to use, I have not told it was broken
To use ?
To run it ?
the help works at least for me
This guide goes in detail on using the ZomboidAssetConverter tool to import DirectX files from Project Zomboid into modern 3D modeling softwares such as Blender.
Relevant Wiki pages:
https://pzwiki.net/wiki/Game_files#Accessing_the_game_files
https://pzwiki.net/wiki/File_formats#Modeling_and_animation formats
https://pzwiki.net/wiki/ZomboidAsse...
Sure. I was also thinking of tying how accurate is to cooking skill (or having nutritionalist trait)]
sounds like a good time - godspeed maim/sir
i think when i was rapidly running through files i might have seen some of that code
so some of the work might already be done
or likely is - im on day 2 of looking through all of this
if its not working lmk im still fixing stuff
its possible something changed with the x files that I might need to account for but its unlikely
I guess it does just Tcherno didn't even manzge to run it bruh
@mellow frigate what issues did you have with it?
do know it doesn't have a GUI, its a very simple terminal application
following sim's video is basically 1:1 how to use it
i probably also need to release new binaries because assimp updated a fair bit since the last binaries I posted, and I can also set up a workflow so theres builds for every platform
The 20 of the 80-20 principal for people who don’t make UIs
Basically... I'll work on that later, make it functional for now
I saw you had some place holder text for the menu title
Looks like the format for multilingual
So well done
yea iv been trying to use translation tags in mods I release
It took me time to find back what blocked me at the time (10 days ago): I tried to apply the converter to dance animations from the following mod and the way those animations are implemented seems different from vanilla ones for the Transfer_Data bone. https://steamcommunity.com/sharedfiles/filedetails/?id=2648779556
After that, I switch to other animations and for Vanilla Asleep & Awake, I am reusing your last export and it works for my use. Edit: no, I fail again at export time.
I do not pretend there is a need to change the converter.
i almost installed that mod, but it looked like AnimSets mods got lightly broken in the new release
something something case sensitive issues?
not sure where the problem is
from what i know it's just linux servers
yeah
the case sensitive file system
i still havent looked over the forums to make sure its reported
or maybe just mods that use x_extends, we don't use that at all
nevermind actually we do, i guess it's only servers then
from what i know linux servers have been having a lot of trouble with mods for all of 42.13
windows servers and linux singleplayer weirdly both seem to work fine
im kinda picky-choosey so i havent had any real issues
let me figure out the format so i can report it if it hasnt been
from my digging over the last few days
there still seems to be overlap between client/server code that could be brought together
pz's codebase is just a mess wrt to networking
in my mind - a "server" would be created for every new game
it's still developed as singleplayer and then another studio makes it work in multiplayer
the idea of "public" should be the configuration
did not know that
that explains so much
you see this kind of mess with games that were originally singleplayer and made multiplayer later, but pz is even worse since it's *still* being made singleplayer
i wonder if theres a pattern that could help bring this together
so both could happen
Developement tends to go smoother when you make SP just a local server and then you only have to code for MP
i cant pretend to know - i do more "corporate coding"
so its damned easy
i made my first long running loop in years like 2 weeks ago to account for race conditions
^ yes integrated server is the best solution
Just the reduction in bug searchspace alone is worth it.
minecraft bedrock managing to get server desync in singleplayer was pretty impressive though
FIX BEDROCK MOJANG
bedrock is the java version right?
no, the c# version
that somehow manages to run significantly worse now
Currently trying to change an item's dirtyness on server side using
local item = player:getWornItem(bodyLocation) item:setDirtyness(ZombRand(30)) syncItemFields(player, item) item:synchWithVisual() syncVisuals(player)
As quite often the case for those sync commands, it doesn't work for me...
imagine
better yet, throw it out 😭
it only seems to exist so that they can monetise it far more than the original version without backlash
does it mention anything when it fails or nothing? also, I cant tell if you're saying there's an issue with the converter, animation that you are converting, or the importing of it into the game
btw it is not meant to be a 1:1 conversion that you can just take into the game, because assimp has some issues sometimes, so you should look at it and make sure it's correct before using it and whatnot
thats actually a question i have. here they only mention player but isnt where that comes from super important?
i saw at least 5 methods to grab a player
then albion mentioned split screen and broke my brain how to make this (my own personal project) work in split-screen
actually 6 - 4 for split and getPlayer() and getSpecificPlayer()
usually it's:
- don't use a global player getter, just use the player that gets passed in by most things (this is better code anyway)
- if you're grabbing players for some kind of action (e.g. doing something to them every tick), loop and do
getSpecificPlayer(i) for i = 0, getNumActivePlayers() - 1 (be sure to nil check these as there can be a gap - if it's triggered by some kind of keyboard event, just use
getSpecificPlayer(0), player 0 is always the keyboard if there is one
is there a term for the player currently running code right now?
aka the "local" player to the code
the mod im rewriting used getSpecificPlayer(0) in the client context
which you said would break on split screen
and that makes sense
sorry, ive been picking your brain all day albion - thanks a ton for the help though
since there's up to 4 players on one client because of splitscreen, there isn't a global 'current player'
there is usually a way to get the current player, though it's often specific to the context, but there is also another school of thought, which i don't subscribe to but is quite prevalent:
nobody plays splitscreen anyway, so why bother supporting it
Do you have to “Dom” dive and find each player?
I’m just guessing but something like iterating through windows to find each player
That’s “pragmatic” but…
I hate ignoring a subset
I’ve been the subset so often
Using x language on y OS - enjoy
i personally just enjoy writing that kind of code so i always support splitscreen even though i know nearly nobody benefits from it
yea, often you'll get a player context from whatever action your responding to anyway.
Good point about the keyboard too btw.
although, scarily enough, computers do support multiple keyboards and iv seen 1 game that actually supported multiple keyboard/mouse splitscreen: serious sams
PZ doesn't thankfully
How to age yourself
I do not know if the failure comes from my actions or from the converter. here is a video that may show obvious errors on my part: https://www.youtube.com/watch?v=UvkM60rpU7M
I tried first the paddlefruit export conf but the animation was not available in the animation viewer.
I do not know if the problem comes from my (lack of) actions in blender or from the imported files.
I had a similar behavior when using the ZomboidAssetConverter.
Although the fixed .x from the converter work in PZ.
What is assimp ? What do you mean by verify ? The only things I see I can do are playing the imported & modified animation in blender (which is OK) and playing the exported animation in PZ (which is NOK).
assimp is the asset importer used by Project Zomboid and many other things. It is also what the converter uses under the hood
Yay, my code can now make the evolved item properly, now just need to add the ingredient/spice part.. and determin what that will even do in my cooking system
If you export Bob_Awake.fbx rebuilt from your gltf+bin and replace vanilla .x, then start the game, is the Bob_Awake animation valid in the animation viewer ?
May not be related but something about animation mods might be broken
yeah its not meant to be a direct replacement as I said because assimp has too many issues for X animation stuff
it may be possible, im not sure since I dont do lots of animation stuff
so this may be a tool for using PZ animations in other context, not a tool for porting PZ animations to fbx for PZ.
is it possible you have bad export settings in Blender?
lol - doesn’t do animation but wrote the tool for conversion - no sarcasm - that tracks
the main reason I made it was so people could see and copy the values for the animations, in theory it should be possible to get it to work with the game, but im not an animator so how easy it is
I am a blender noob, so yeah totally.
On the other end, I have seen noone pretending to have reused it for exporting back to PZ and considering the amount of animators around, I find it strange
idk mabye no one needs the animations?
Once you mod, you play less. Once you make tools for modders, you make less mods .. some people go far meta that way 😄
yep, maybe I'm the first.
I admin, but hit an error and started deep diving and then fixed a mod that the wife loved
As soon as I read the steps for uploading it’ll be there
Though I keep looking at things that should be refactored