#mod_development

1 messages · Page 367 of 1

willow tulip
#

A totally sane number of sandbox options:

#

@queen oasis Might be able to add hooks for your mod too

#

yea, the 'mult general' is for all world containers

hot void
#

i legit wanna give up on the tattoo parlor rn

queen oasis
willow tulip
#

Java, it just rewrites getCapacity.

queen oasis
#

dang. I figured but I keep hoping there's a lua solution

willow tulip
#

Not without overwriting the transaction manager (for mp) since SOMEONE restricted all getCapacity calls to 100 looks at devs

queen oasis
#

that was my hiccup too

willow tulip
#

But then mine also breaks all other limits, like, floor limits, player limits, 50 capacity for backpack limits, 100 capatity for world containers, etc.

queen oasis
#

anyone wants this on their server isn't going to care about that

willow tulip
#

(all adjustable, by default those sandbox settings do nothing as shown)

willow tulip
#

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

queen oasis
#

isn't there a check on the server for how many 'items' are in a container?

willow tulip
queen oasis
#

nice. I didn't really look in to it, I think I saw someone else mention it somewhere

hot void
#

ayyyyyyyy it works Yippy

quiet fulcrum
#

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

quiet fulcrum
mellow frigate
#

How can I enter in TileGeometryState ?

willow tulip
frank elbow
#

I switched away from sandbox options entirely and rolled my own configuration for v2

willow tulip
#

facepalm

frank elbow
#

It was definitely too excessive for sandbox options, had to override the menu to make it usable

#

Way happier with my custom config

willow tulip
#

lol.

#

pic?

frank elbow
willow tulip
#

interesting

frank elbow
mellow frigate
frank elbow
#

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

mellow frigate
frank elbow
mellow frigate
#

Thanx

willow tulip
mellow frigate
#

is there a reliable way to get the tilesetname of an IsoSprite / IsoObject or should I pray and split the sprite getName ?

willow tulip
#

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

mellow frigate
#

lol, I messed up my code (again) and used string.gmatch on 'a'. ```lua
string.gmatch(a,"pattern")-- a is not defined.. locally

mellow frigate
willow tulip
#

apparently there is also 'zombie.input.Keys' global..

#

(though im not sure exactly how you use that)

bronze yoke
#

in your own code you should just reference the Keyboard constants

willow tulip
#

^ Would be best yea

frank elbow
mellow frigate
#

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 ?

frank elbow
#

Those refer to mouse buttons

#

Constants for those are in the Mouse class, for reference

dense yoke
#

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

mellow frigate
#

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}
bronze yoke
#

you can use that name, no idea

frank elbow
#

Just to clarify, assuming it's a valid identifier you can use whatever you want as a local variable name

frank elbow
#

I just use a web server + discord bot to manage mine

frank elbow
mellow frigate
#

thanx

dense yoke
frank elbow
dense yoke
fervent wraith
#

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:

  1. Is there any engine-safe way in B42 MP to remove items from a player inventory without a timed action?
  2. Has anyone successfully reused an existing timed action (sell / transfer / craft) for “virtual” removal?
  3. Is this a known B42 MP limitation expected to be fixed later?
  4. Are there internal APIs we may be missing that handle inventory removal + replication safely?
  5. 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

mellow frigate
# fervent wraith Hey all, Looking for info/help. We’re building a fairly large “living blackboar...

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.

fervent wraith
# mellow frigate But if you really initiate it client side (apparently with a sendClientCommand),...

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:

  1. 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?
  2. For the polling approach, are you tracking removal via the unique item ID until:
    item:getContainer() == nil
    or by scanning inventories for absence?
  3. If you’ve used a silent TimedAction, are you reusing an existing action (sell / transfer / drop) or a custom one?
  4. 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.

mellow frigate
#

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

fervent wraith
# mellow frigate 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

foggy finch
#

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

bright fog
#

Doing it on the server is the right way

#

TIS has made guides about timed actions for B42.13

fervent wraith
foggy finch
upper moat
#

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 🙁

upper moat
#

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

mellow frigate
#

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 ?

willow tulip
#

(pretty sure the limit remover mod would work too)

#

Do note: all of those require java install to work in MP

upper moat
#

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

willow tulip
upper moat
#

i thougt you also meant that when you was talking about setcapacity

willow tulip
#

without the java mod, nothing can exceed 100 capacity in MP

#

(Capacity limit can only be broken by LUA in SP)

upper moat
#

yeah i understand but the mod "Multiplayer Weight Limit Breaker" also lets you do this without java

willow tulip
#

Weird. Haven't seen that mod

upper moat
#

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

willow tulip
#

Nice

upper moat
#

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 😄

willow tulip
#

its got stuff like

#

oh wait its just using those functions to declare other functions

#

thasts uh, a choice

upper moat
#

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 😛

willow tulip
#

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

upper moat
#

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

willow tulip
#

interesting.

#

and it stores over 100?

#

(tested)

upper moat
#

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 😛

willow tulip
#

zombie folder

#

java folder is for dedicated servers

#

and may or may not contain a zombie folder

upper moat
#

yeah i meant the zombie folder but i said java cause its java related crap :p

willow tulip
#

yea lol I suspected

bright fog
willow tulip
wraith flame
bright fog
#

Looks like my raycasting lib

#

I mean it's not

#

But I did something similar

willow tulip
wraith flame
#

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

willow tulip
willow tulip
wraith flame
mellow frigate
bronze yoke
wraith flame
#

i have like maybe 300 lines of lua code on server

#

just a dumb pipe

bright fog
wraith flame
#

its actually not a model its jut a line render i used math on to split innto segments and appy the droop

mellow frigate
bright fog
wraith flame
#

its the brains for all the logic to avoid lua soup loool

willow tulip
wraith flame
#

and theres alot you can do if you decompile and look 😉

bright fog
upper moat
bright fog
willow tulip
#

But it can't see it actually reading capacity the normal way anywhere

wraith flame
#

i got fully functioning MP npcs as well

willow tulip
#

And reading capacity the normal way is hard limited to 100 as a return value if your not using reflection to get the value

upper moat
#

yeah i didnt test it i just looked at it and thougt it worked anyawy so one sec

bright fog
upper moat
willow tulip
#

I can't even find the word 'capacity' in the source lol

wraith flame
#

its done mostly in java that one but any time there is logic to run its always in run

#

rust*

bright fog
#

How do you link it to the game ? You modified the Java ?

wraith flame
#

i did some slick rickery

bright fog
#

File writting then file reading ?

wraith flame
#

nopeà

#

its real time bi-directional

dense yoke
# wraith flame

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)

wraith flame
willow tulip
bronze yoke
#

new? 😅

willow tulip
bright fog
#

Nop

dense yoke
willow tulip
#

Never noticed it before -_-

bright fog
#

Was just broken back then and required a patch I believe

willow tulip
#

lol

bronze yoke
#

it's old enough to be broken

dense yoke
#

im considering making a Docker image and all that

wraith flame
#

anyways il be releasing a lite RP framework when my server goes up

bronze yoke
#

sure but i told you the topic before i told you that 😅

willow tulip
#

Btw I think I figured out a relating factor in the 'can't hit zombies with guns' thing.

willow tulip
#

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

wraith flame
#

this is what i got done so far, ofcourse everything is properly replicated for MP

upper moat
#

this is with just those 2 mods

#

and no zombie folder

willow tulip
#

Interesting.

#

Does it work on non-crates?

upper moat
#

these 2 mods

flint whale
#

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?

willow tulip
#

Im'a still stick with my java solution just because im lazy and its instantly retroactive 😛

upper moat
willow tulip
upper moat
#

but for vehicals you coudl also use damn capacity for the cars from KI5

#

and that also works

flint whale
upper moat
#

but he deleted the mod, i did reup it in private settings

wraith flame
willow tulip
upper moat
#

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)

upper moat
#

amoung other code

upper moat
#

but just 4 lua files

willow tulip
upper moat
#

thats why i thougt you knew about all this and asked if you could help me 😄

willow tulip
#

(and HP and weight override)

upper moat
#

yeah but i dont have that added cause of the java stuff

willow tulip
#

Yea.

upper moat
#

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

willow tulip
#

Basically it looks like this mod ignores vanilla capacity entirely and uses its own 3rd party setting.

upper moat
#

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 😛

bronze yoke
upper moat
flint whale
bronze yoke
#

i mean that the vanilla context menu option that lets you rename things (just bags i think?) doesn't work at all

willow tulip
wraith flame
willow tulip
upper moat
willow tulip
upper moat
#

yeah i know your mod for sure, i just thougt it was the other one also 😛

upper moat
#

and i might take a look at your mod aswell and hope it doesnt break with the othe stuff 😛

dense yoke
#

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

willow tulip
wraith flame
#

need you one of these for easy player installs 🙂

dense yoke
#

This one requires a manual installation

willow tulip
dense yoke
#

or atleast, part of it needs to be manually installed

wraith flame
#

everything needs to be automatic that way stupid people can enjoy it too

upper moat
wraith flame
#

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

willow tulip
#

the screenshot is from 'Total Capacity Override', a beta mod part of moons mods pack

willow tulip
# upper moat dude 100k

Yes I felt silly. Realistic car physics will let you drive cars over 10,000KG weight though.

upper moat
#

back in B41 we had 15k on our storageomatic and lagged the hell out when it was loaded to 11k

willow tulip
#

yea I don't recommend actually storing that much lol

#

unless its also stupidily heavy items

upper moat
#

you dont say 😛

#

true that

willow tulip
#

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?

upper moat
#

btw i havent played yet as im making a server atm, but with animals, are there trailers that can handle more then 1 cow ?

willow tulip
#

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.

upper moat
#

but i get your point yes 😛

#

some ppl play on supercomupters @work 😉

willow tulip
#

there are mods that add more 'animal capacity' to horse trailers/etc

#

IIRC

upper moat
#

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 😛

willow tulip
#

B42.13 seems to have fixed it and will happily support a few 1000 items in a container

upper moat
#

yeah i waited till MP got released cause i dont play SP

#

im too cool for school 😛

#

also too old

willow tulip
#

Stuff on ground is laggier then in containers too

upper moat
#

but who cares 😛

willow tulip
#

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

upper moat
#

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 😄

willow tulip
#

and the fact everyones (at least hoarders like me) base becomes a crate stack is... ewww..

upper moat
#

unless you need a spefici table.machine to make it offcoruse

#

yeah so pray my mod works 😛

willow tulip
#

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

upper moat
#

it has 3k limit now with that java limiter as he has it capped on 3k

wraith flame
#

add pagination to your storage it will help alot

willow tulip
#

or rather, limit it to 3k

upper moat
#

btw that MLB mod also comes with cheat fast inventory transfersetting

#

😛

willow tulip
#

like.. if your gonna fix limits... fix them to be totally broken and let the player decide 😛 its a sandbox game

flint whale
#

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?

willow tulip
upper moat
willow tulip
#

I should prob add that to my capacity override mod lol

upper moat
#

😛

willow tulip
upper moat
#

yeah but you cant complile 1 java file right

willow tulip
#

yes you can.

wraith flame
#

ye its called a patch

upper moat
#

as it looks for the other files aswel ?

willow tulip
#

you compile it against the game, but the end result is you just have a 1 file patch to send to players

upper moat
#

yeah but i dont have java stuff anymore 🙁

#

and too lazy to install

willow tulip
#

.....

#

How does that change how java works? 😛

upper moat
#

dont have a compiler

wraith flame
#

some things need to be done in java for PZ. java executes before any lua does so sometimes there is no choice

willow tulip
#

.... the compiler comes with the java SDK thats 2 clicks to install.

upper moat
#

duuuuudeeeeeees im a n00b 🙁

willow tulip
#

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

upper moat
#

im old and lazy 😛

#

yeah that i know but how to edit all that shit... 🤷‍♂️

wraith flame
#

its the same shit just looks different

upper moat
#

well its a class file i need the java file right

#

in order to change it ?

wraith flame
#

you decompile the games jar

dense yoke
#

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

wraith flame
dense yoke
#

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

cyan locust
#

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?

wraith flame
#

oi satana

#

perkele

paper ibex
bright fog
flint whale
#

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

bright fog
flint whale
bright fog
#

Just why do you need to do that ?

#

If that's not something the client interacts with, then why do that ?

flint whale
#

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

bright fog
#

Bcs if you need to rename something, that's done client side

flint whale
#

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?

vast pier
#

how would I go about adding a small ingame delay to code

bright fog
#

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

flint whale
#

Currenlty the room name is free form input by the user

bright fog
#

By not renaming the item but instead using variants of the item, you make sure every clients have the proper name for the item

flint whale
#

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

wraith flame
hazy patio
fathom dust
#

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

fervent wraith
hexed arrow
#

Quick question does the OnTick not work properly? I can’t get it to print anything

bronze yoke
willow tulip
willow tulip
#

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

hexed arrow
#

Thanks Guys will look into it

hexed arrow
#

It worked when I restarted the game reloading lua didn’t work somehow

graceful grove
#

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

paper ibex
paper ibex
bright fog
fervent wraith
# paper ibex That's the idea behind ZUL. Centralized, leveled logging avoids a lot of pain la...

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

bright fog
#

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

paper ibex
bright fog
#

The community debug tools does it

#

It hooks to the print function and shows which mods call the prints

bright dawn
#

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

brittle spruce
#

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.

bright dawn
#

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

stuck tapir
#

Anyone know if it's possible to make a firearm not fill the area with light when fired?

trim yacht
#

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

burnt charm
#

hello guys! wanted to upload addon, but i have some problem

mellow frigate
#

Can someone recall me how we get current container distribution info ingame in debug ? = right click + open Loot Zed

tranquil kindle
#

Unless thats not what you ask...

mellow frigate
#

thanx 🙂

willow tulip
#

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)

paper ibex
crystal pollen
#

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.

graceful grove
#

I think theres a decent bath towel mod already

vast pier
#

how would I go about adding a small ingame delay to code?
Like shorter than a second delay

silent zealot
#

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);
quiet fulcrum
#

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

bronze yoke
#

commands start working at the end of the first tick

#

so something like the second ontick trigger is typically used

quiet fulcrum
bright fog
bright fog
#

I'll pin until then

torn igloo
#

hello modding guru, are there any new vehicle related api in b42?

gleaming inlet
fervent wraith
# gleaming inlet Hey I saw this the other day, id be keen to follow progress on the mod and how f...

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.

gleaming inlet
hexed arrow
#

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

tulip valve
# hexed arrow local function sayItemName(playerToSay, itemToDisplay) playerToSay:Say(tostring(...
    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

pearl fox
#

Hello,
someone can explain me why this is OK for B41

local nbmoodles = player:getMoodles():getNumMoodles()```
But not for B42 ?
bronze yoke
#

moodles api was reworked

pearl fox
tulip valve
#

Why are you not using
local player = getPlayer()

#

maybe getSpecificPlayer(0) dosnt work in B42 anymore

pearl fox
#

getSpecificPlayer(0), work for other parts in my mod.

#

what is the equivalent in B42 of player:getMoodles():getNumMoodles()

small topaz
#

When using sendClientCommand im MP, do you guys think it is necessary to add some kind dos-protection on server side?

bronze yoke
#

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

small topaz
#

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.

bronze yoke
#

that would be on PZ's netcode, there's nothing you can do to prevent it

analog mesa
#

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

small topaz
# analog mesa Anyone know when one of the Profession Frameworks will update? Wanting to make s...

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.

analog mesa
#

Any clue if theres something specific you need to do for mp?

small topaz
# analog mesa 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).

willow tulip
small topaz
# willow tulip Do note that most 'user' aspects like calories, etc are all driven server side n...

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.

willow tulip
#

Try to work on mod without internet. Can't launch coop server to test mod, sigh

vast pier
#

how would I go about adding something to the radial reload menu ?

unkempt dragon
#

Do I need a folder with the exact name of the game version I'm using in my mod, or is that not necessary?

bronze yoke
#

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

silent zealot
#

Attach a prefix or postfix to that which calls addslice

normal moth
#

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

bright fog
normal moth
#

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.

bright fog
#

Items don't appear ?

#

Any errors ?

vast pier
#

You only have model definitions for the ground models

normal moth
#

I thought they were the same. I'll fix that.

#

Is there anything else I need to add?

vast pier
#

uh idk, that was just the first thing I noticed

normal moth
#

Ty!

vast pier
#

"WeaponSprite" is the model used when held as a weapon

normal moth
vast pier
#

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

normal moth
#

What's a model script definition?

vast pier
#
        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,
        }
    }```
normal moth
#

Ahh okay! I'll fix that.

vast pier
#

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

normal moth
#

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.

vast pier
#

yeah that's what I was saying

#

Does B42.13 still use X file models ?

normal moth
#

Idk!

#

Does the FBX file need textures?

azure crest
#

Hey so im tryna host my own b41 pz server can someone help me out im using a thing called Nitrado for server hosting

normal moth
azure crest
normal moth
#

I'm gonna try it.

torn igloo
#

Hello modding guru, is there a javadoc for b42?

silent zealot
#

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.

silent zealot
#

I've never had any success doing anything with .X files though.

buoyant violet
#

You need to properly import to blender or another program

#

and export to the appropiate format

buoyant violet
#

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

tranquil kindle
#

I mean the body locations. It's kinda annoying that new ones are on top, which results in some strange behaviour

upper moat
#

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

normal moth
unkempt dragon
#
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/?

frank elbow
#

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

unkempt dragon
frank elbow
#

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

unkempt dragon
#

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.

pulsar fern
#

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

unkempt dragon
# pulsar fern Hi everyone, after months of thinking I decided to finally get into modding this...

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

▶ Play video
pulsar fern
#

wow, many thanks bro!! I surely check this!!

normal moth
normal moth
#

Okay, so the model is way offset and doesn't have the rotation it should.

pulsar fern
worn cloak
#

Is there an option to send server message ( /servermsg "Server restarts in 3 minutes" ) from mod?

unkempt dragon
#

Congratulations to the Umbrella contributors, this intellisense is incredible.

bright fog
frank elbow
#

And some community documentation contributions—hopefully more in the future

willow tulip
#
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?

severe marsh
#

Hai im not a dev but im just gonna say

petthespiffo thanks to all you devs who are updating your mods for the new update (that kinda broke a ton) it means alot

tough oxide
#

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?

bright fog
#

If it's PZ related, then yes

#

Probably

tough oxide
#

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

bright fog
bright fog
tough oxide
#

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

buoyant violet
normal moth
unkempt dragon
#

When should I use the Base module or MyModuleName module in scripts?

bright fog
#

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

unkempt dragon
#

ty for tips

small topaz
#

does anyone know by heart what the maximal capacity of the player inventory was?

bronze yoke
#

isn't it 50

frank elbow
# tough oxide but what does `f:` mean?

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

small topaz
# bronze yoke isn't it 50

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

bronze yoke
#

i think that's a bug

tough oxide
#

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*

frank elbow
#

So it's mostly useful for comparison between 2 reference points

tough oxide
#

interesting - i made an assumption

tough oxide
#

that is annoyingly foreign - is this a measurement that is more important in things like game engines where there are faster loops/ticks?

frank elbow
#

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

tough oxide
#

i normally deal in slower (something like a 50ms wait between loops is more than fine)

#

got it - profiling and such

frank elbow
#

In the game's case it converts it to milliseconds anyway, iirc (some unit other than nanoseconds, at least)

tough oxide
#

regardless if i find a use out of the gate its still useful to name stuff properly

unkempt dragon
#

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.

silent zealot
#

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.

willow tulip
#

If you can possibly do it in LUA, do it... Because java mods will have like 1/4~1/2 the usage rate.

silent zealot
#

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.

willow tulip
#

there is 'leaf' that apparently lets you only alter the functions you care about, but I have no idea how it works -_-;

buoyant violet
#

my current issue with tracer effects, if I implement any I need to do manual installs aaah

worn cloak
#

Just created my first mod 🎉 😅

buoyant violet
#

Welcome

#

you will now never play the game, just mod

frank elbow
#

This is true

worn cloak
#

Yep, pretty much what I was doing the past two days drunk

buoyant violet
tranquil kindle
buoyant violet
unkempt dragon
unkempt dragon
buoyant violet
#

yeap

#

dawg did not waste time to check my code lol

unkempt dragon
#

rsrsrs

buoyant violet
#

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

unkempt dragon
buoyant violet
#

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

unkempt dragon
unkempt dragon
buoyant violet
#

if you have experience with code you will get it quickly

buoyant violet
#

in media/lua folder

tulip valve
buoyant violet
#

most of the logic for firearms is there too

unkempt dragon
unkempt dragon
tough oxide
#

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?

bronze yoke
#

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

tough oxide
#

got it

worn cloak
tough oxide
#

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

bronze yoke
tough oxide
#

this is their file

bronze yoke
#

imo the extends system is kind of bad/useless anyway

tough oxide
#

but the error is either mis-reporting or something is causing the file to be loaded all lowercase

bronze yoke
#

filesystem errors will usually be lowercase, the game usually treats paths as if they're all lowercase to support linux better

tough oxide
#

yeah, on the docker volume the files are there

bronze yoke
#

the linux problems are a new issue with 42.13

tough oxide
#

you can see the exception is reporting in all lowercase

bronze yoke
#

it could be that it really is inappropriately lowercasing it, but again the virtual filesystem just downcases everything so not necessarily

tough oxide
#

i gotta remember theres a whole other vm involved

#

the java vm

bronze yoke
#

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

tough oxide
#

not gonna lie - i half googled making the linux filesystem case insensistive

#

and was like.. nah.. im not doing any of that

bronze yoke
#

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 😅

tough oxide
#

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

full flame
#

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.

small topaz
tough oxide
#

im digging through the code now

willow tulip
tough oxide
#

im curious what changed thats causing these files not to be found

sour island
#

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

bronze yoke
tough oxide
#

That’s a solid point

#

I’ll see if I can dig up those parts and see if anything stands out

tough oxide
#

any quick-fixes for intellisense vs code and javax stuff?

#

do i need to get a different version of java?

unkempt dragon
#
---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.

frank elbow
#

That doesn't seem like it should be possible

tough oxide
#

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

frank elbow
#

That's a trigger for the OnHitZombie event

tough oxide
#

which might be near the event you are referring to

frank elbow
#

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

unkempt dragon
#

ty

frank elbow
#

I was referring to what eyeOhScream mentioned, my answer to what you were saying is "I don't understand how that's possible" 😅

unkempt dragon
#

I think I may have forgotten to load the code in my tests, which is why the previous event was showing up.

frank elbow
#

So you were potentially mixing up the two events?

unkempt dragon
#

sorry

frank elbow
#

I see, all good I was just trying to understand

tough oxide
#

lol

#

i just got to the SwipeStatePlayer

#

and found it

unkempt dragon
#

How can I obtain IsoGameCharacter?

#

maybe IsoPlayer?

tough oxide
#

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

unkempt dragon
#
java.lang.Object
zombie.entity.GameEntity
zombie.iso.IsoObject
zombie.iso.IsoMovingObject
zombie.characters.IsoGameCharacter
zombie.characters.IsoLivingCharacter
zombie.characters.IsoPlayer
unkempt dragon
tough oxide
#

can you still access the properties of IsoPlayer?

#

even if it hint IsoGameCharacter or do you have to attempt to cast it?

bronze yoke
#

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

tough oxide
#

solid advice

unkempt dragon
tough oxide
#

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

unkempt dragon
#

liskov principle

tough oxide
#

A learned one here

small topaz
#

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?

bronze yoke
#

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

small topaz
#

so just keeping it as plain code without conditions should work?

bronze yoke
#

yeah

bronze yoke
frank elbow
#

Someday we'll live in the utopia without casts of this to IsoPlayer in IsoGameCharacter

tough oxide
#

i mean - i do an okay amount of commericial development - i give game creators a lot of leniency

frank elbow
#

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)

tough oxide
#

yeah, in my world automated testing should be in the toolbelt

#

but in a world with multiple loops and constant changing state

willow tulip
#

Just unsafe shit that you know works because this is an array of nothing but IsoPlayers or you already filtered it somehow

willow tulip
#

Course, I work as a knifemaker, so its still 100x safer then my day to day work.

sour island
#

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

GitHub

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.

tough oxide
#

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

proven rover
#

wdym about the DMCA filing?

torn igloo
#

I can use syncItemModData to sync mod data on vehicle object on b42?

gleaming canopy
#

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?

sour island
# proven rover wdym about the DMCA filing?

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.

polar heath
#

question for you: which firearms expansion back do you prefer? (I Used VFE extensively, going with Gaels now)

polar heath
#

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

torn igloo
#

In b42, AddWorldInventoryItem accept a new argument called synchSpawn, what is that?

bronze yoke
#

whether to transmit the object to clients

#

you usually want it to be true

torn igloo
#

But there's already a transmit boolean argument so what is the difference between true and true,true?

bronze yoke
#

it does seem redundant

rigid anvil
#

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.

mellow frigate
tough oxide
#

can i call things like CharacterStat:ANGER from Lua?

mellow frigate
tough oxide
#

perfect

#

i just wanna get atm

tough oxide
#

awesome - first mod (fixing an older one) working locally

torn igloo
#

According to decompiled java, for AddWorldInventoryItem, transmit is related to animal while synchSpawn is related to item. Weird naming.

bronze yoke
#

when i looked it seemed like they both did the same thing

#

like they literally call the same methods

torn igloo
#

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.

mellow frigate
#

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 ?

bronze yoke
#

don't be in full screen

#

print screen sees what was there when you last tabbed in, not what's currently there

willow tulip
#

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

willow tulip
#

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"

frank elbow
#

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

tough oxide
#

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

bronze yoke
#

yes

#

keep in mind that if they are playing in splitscreen there coudl be up to 4 'current' players

tough oxide
#

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

tough oxide
#

has the community come together on a coding style and naming convention or is it just the wild west?

bronze yoke
#

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

tough oxide
#

lol - i would say one day, but...

#

i guess im gonna stick to snake_case until the mod loading is fixed

#

for file names

tough oxide
#

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

willow tulip
#

ie, if you hook a vanilla function.. your previous hook will still exist, and be running ontop of.. the new hook when you hotreload.

tough oxide
#

yeah, that makes sense

#

im happy with the current enable disable method - the mod is passive currently

shut robin
#

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.

tough oxide
#

that could be cool

#

especially on multiplayer servers if you wanted some sort of RP momento

rain shard
#

Is anyone an expert in TileZed? I'm having difficulties getting a 2nd sheet to appear for some reason.

willow tulip
#

Soon, Cooking 3.0!

small topaz
#

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?

tough oxide
#

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

small topaz
willow tulip
mellow frigate
#

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 ?

mellow frigate
#

I'll try aoqia ports

bright fog
#

Aoqia's port ? That's the ZomboidAssetConverter

#

It's the only one that works for animations

tough oxide
#

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

willow tulip
#

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

mellow frigate
tough oxide
#

from what i can see they used the tool that they developed and offered to the community, ZomboidAssetConverter

tough oxide
bright fog
#

I literally made a video about it dude

mellow frigate
bright fog
#

If that's the case then tell the god damn creator 💀

mellow frigate
#

If I knew what to tell, I would.

bright fog
#

Saying things don't work doesn't make things move forward, @grizzled fulcrum is still an active member of the community

mellow frigate
#

I told, I have not been able to use, I have not told it was broken

bright fog
#

To run it ?

tough oxide
#

the help works at least for me

bright fog
willow tulip
tough oxide
#

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

grizzled fulcrum
#

its possible something changed with the x files that I might need to account for but its unlikely

bright fog
grizzled fulcrum
#

@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

willow tulip
#

Now if only i could make it pretty...

tough oxide
#

The 20 of the 80-20 principal for people who don’t make UIs

willow tulip
#

Basically... I'll work on that later, make it functional for now

tough oxide
#

I saw you had some place holder text for the menu title

#

Looks like the format for multilingual

#

So well done

willow tulip
mellow frigate
#

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.

tough oxide
#

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

bronze yoke
#

from what i know it's just linux servers

tough oxide
#

yeah

#

the case sensitive file system

#

i still havent looked over the forums to make sure its reported

bronze yoke
#

or maybe just mods that use x_extends, we don't use that at all

tough oxide
#

let me do that now

#

really?

#

both of those conditions are true for me

bronze yoke
#

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

tough oxide
#

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

bronze yoke
#

pz's codebase is just a mess wrt to networking

tough oxide
#

in my mind - a "server" would be created for every new game

bronze yoke
#

it's still developed as singleplayer and then another studio makes it work in multiplayer

tough oxide
#

the idea of "public" should be the configuration

#

did not know that

#

that explains so much

bronze yoke
#

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

tough oxide
#

i wonder if theres a pattern that could help bring this together

tough oxide
#

so both could happen

willow tulip
#

Developement tends to go smoother when you make SP just a local server and then you only have to code for MP

tough oxide
#

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

grizzled fulcrum
willow tulip
#

Just the reduction in bug searchspace alone is worth it.

bronze yoke
#

minecraft bedrock managing to get server desync in singleplayer was pretty impressive though

grizzled fulcrum
#

FIX BEDROCK MOJANG

tough oxide
#

bedrock is the java version right?

bronze yoke
#

no, the c# version

tough oxide
#

oh

#

i dont mess with that one unless i have to

grizzled fulcrum
#

that somehow manages to run significantly worse now

small topaz
#

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

tough oxide
#

imagine

bronze yoke
#

it only seems to exist so that they can monetise it far more than the original version without backlash

grizzled fulcrum
tough oxide
#

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

bronze yoke
#

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
tough oxide
#

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

bronze yoke
#

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

tough oxide
#

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

bronze yoke
#

i personally just enjoy writing that kind of code so i always support splitscreen even though i know nearly nobody benefits from it

willow tulip
#

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

bronze yoke
#

PZ doesn't thankfully

tough oxide
#

How to age yourself

mellow frigate
# grizzled fulcrum does it mention anything when it fails or nothing? also, I cant tell if you're s...

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.

▶ Play video
mellow frigate
grizzled fulcrum
willow tulip
#

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

mellow frigate
tough oxide
#

May not be related but something about animation mods might be broken

grizzled fulcrum
#

it may be possible, im not sure since I dont do lots of animation stuff

mellow frigate
grizzled fulcrum
#

is it possible you have bad export settings in Blender?

tough oxide
#

lol - doesn’t do animation but wrote the tool for conversion - no sarcasm - that tracks

grizzled fulcrum
mellow frigate
#

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

grizzled fulcrum
#

idk mabye no one needs the animations?

mellow frigate
mellow frigate
tough oxide
#

As soon as I read the steps for uploading it’ll be there

#

Though I keep looking at things that should be refactored