#mod_development
1 messages · Page 360 of 1
Yeah... Maybe just sending commands from client on the appropriate events is pbbly easier (although it may provide some more cheating options). But for the sake of easy coding, I'll pbbly do this (and on game tick 2 or smth)
i did this and then the same for oncreateplayer
i did 3 ticks just to be safe but im assuming just 1 tick is fine
In the context of Zomboid modding, AI is extremely limited. You can use it for general lua questions (how do I remove all things in table A that are not in table B) or give it one function and ask it to explain... but for anything zomboid specific it will make things up that are far more work to fix than just doing them yourself.
Only thing I am currently worried about is that if we do a lot of inventory and clothing management on server, couldn't this lead to serious performance issues on the server?
i think its fine since the server does a lot of that already and its infrequent
when changing clothing as visuals only on server (as you do in your character creation mod), is it necessary to apply some sync command, like "player:getVisual():sync()" (pseudcode for now) ?
item:synchWithVisual()
the typo is the correct function name for some reason
if you're using bodyvisuals instead of clothing i think sendVisual(player) might work but im not sure
is item then the player? or the "clothing" item we equip to the player?
the clothing item
AddBloodAndDirtToItem is just doing setDirt and setBlood on the item's visual and this has been working for me
as long as you call onclothingupdated
oh yeah i had to add a sendservercommand when doing stuff like this on the server to tell the client to call onclothingupdated btw
im pretty sure theres a delay after sending a clientcommand to the server so i dont think calling it after sending the command will work so i have the server send its own command back so the client definitely runs onclothingupdated after the server has modified the items
its extremely scuffed
Thanks good to know. I also have some blood/dirt management on my items, so this helps a lot!
Do you also need to call item:synchWithVisual() when you equip such an item like a face texture to the player?
no thats just when changing the visual
if you set the texture of the item before you call sendadditemtocontainer it should sync since thats working for me
from what i remember for equipping items you need to do sendadditemtocontainer after adding to inv.
and then sendClothing after setting the worn item
unequipping the item i dont think needs a sync call but if any of your clothing items use a bodylocation that has multi item set to true then you'll run into a really annoying issue
Multi item does not apply to my situation.
Just wondering whether I really need any of the sync commands when equipping items cause I equip them but not put them to inventory. But I'll test a bit more.
Omg! I now have a first working version of my BodMod where I shifted all clothing and modData mangament to the server. Many thanks @winter bolt (and sorry for the ping again). Without you sharing your knowledge, it would have probably took me twice as long!
Hey folks, I tried multiple times on setting the visibility for a mod yet I always got error 15 when trying to make is public
And public is not even an option here
wondering anyone knows why? I've tested this mod and works fine in the game
Maybe just change it in the whorkshop file and update the mod
I am working on a event/signal library and should I attatch PillAction to Item_Consumed
or should it contain its own event
Camel snake case 
But to answer your question, idk, it depends what information that events output
I think making it its own event is worth it ? But does the game differentiate taking a pill or consuming food ? I believe yes no ?
So I'd probably separate it
I feel like this was a bad library icon
I couldnt think of anything else
Got to find something hehe
I mean I thought it was pretty straight to the point
thx for the guidance. I've updated in the workshop yet still getting error 15
Signals:GetEvent("OnGameBoot"):Connect(function()
print("STARTED")
end)
---@param item InventoryItem
---@param client IsoPlayer
Signals:GetEvent("Food_Consumed"):Connect(function(item, client)
end)
I mean hey if it works it works
connections can also be overwritten and since they run in a row it means you dont have 17 different mods all try to override 1 base ISBaseTimedAction to add a event to it
---@param Event string
---@return Signal | any
function module:GetEvent(Event)
if module.CachedEvents[Event] then
return module.CachedEvents[Event]
end
if Events[Event] then
module.CachedEvents[Event] = SignalBuilder.new()
Events[Event].Add(function(...)
module.CachedEvents[Event]:Execute(...)
end)
return module.CachedEvents[Event]
end
return nil
end
I am also storing events so that way it isnt creating like 30,000 events
I could of probably reduced indexing
infact I am gonna do that
Wait what does this do ?
just a simple mod that changes the syntax for events from
.Add
To :connect
there is a few other things
like using threading to prevent yielding
and being able to pause events
or destroy them entirely
.Add is still possible ?
Wdym pause them ?
You can use halt to pause a connection so on it trying to run all the connections this one wont
and since they run in their own thread you do not have to worry about having to wait on every connection to run before yours
you can technically use .add or override ISBaseTimedAction
this is just easier/faster for me
and since you can also create signals as well it also means you can create internal events for you mod so that way other people can hook into your mods events
for example one mod could do
local MyEvent = SignalBuilder.new()
Signals:AttatchSignal(MyEvent, "Test_Event")
Signals:GetEvent("OnGameBoot"):Connect(function()
print("STARTED")
MyEvent:Execute(true)
end)
---@param item InventoryItem
---@param client IsoPlayer
Signals:GetEvent("Item_Consumed"):Connect(function(item, client)
end):AttatchOperator("testmod:Item_Consumed")
and another could do
---@param test boolean
Signals:GetEvent("Test_Event"):Connect(function(test)
end)
Signals:GetEvent("Item_Consumed").Operators["testmod:Item_Consumed"]:Disconnect()
I cannot open my own mods change notes and have seen others report this. Something on Valve's end imo
I just logged a ticket with steam suport, so in a few weeks I'll tell you why they are not able to help.
It really annoying because I finally have time to sit down and work on mmy zomboid mods and I'm being blocked from seeing what is working/what isn't, can't leave any updates to set expectations for mods, etc etc.
I feel that 100%, I've had to unlist my mod. Several people have reached out to help but ultimately I just need time.
I unlisted a couple that aren't worth updating.
Some others I might delist but I'd like to check subscriber numbers first. Except steam is broken.
I was almost at 600k then mp dropped and people started unsubbing from everything
Tbf Sleep With Friends is borked now. I'm trying to learn sendClientCommand but of course it does not want to even make print commands fire. I'm hoping its just a "late night mistake" and was just too tired to see the issue last night
Too tired to sleep with friends? 😛
< why isn't my mod workingggg zzzzZZZzzzZZZ
I fell asleep at the computer last night I was so desperate to get this done before I do a week of crazy overtime at work
syncItemModData(player,item); is kinda weird when we could have item:syncItemModData() or something.
Also having issues using item:syncItemFields() when the item is inside a vehicle, and the data to be synced is fluids the item contains
(in my case, its a mixture of 2~ fluids, im not sure if that is important at all)
Or even better, some kinda universal 'verbage' for syncing. ie, it shouldn't be a mix of transmit or sync, pick a verb: transmit OR sync, and all commands that do that thing should follow it. ie 'transmitModData' instead of 'syncItemModData' transmit vs sync.
(I looked in the vanilla code and syncItemModData(player,item); is the only example I saw in the vanilla LUA)
Are you making a Java mod ?
I'm gonna be honest this is a bit confusing how this can be used by modders, bcs it looks like you basically add a layer on top of events. You're talking about "own thread" but that's literally impossible to do with just a Lua mod, that's not a thing, and if it did that wouldn't even work based on how PZ code handles most of the stuff (majority of stuff are on a single thread and run one after the other, at least for the layer modders can access with Lua)
Override ISBaseTimedAction also sounds like a terrible idea, unless that's unclear what you do here.
Changing the notation of event adding is also kind of problematic and really unecessary imo ? Nothing is stopping you from directly hooking to the default way of adding callbacks to events. At least I hope your code doesn't change any vanilla behavior of events or else that could nuke other mods out of nowhere the moment there's a problem
This would prove useful BUT there's a huge flaw in design here, because modders that need to hook to other modder's events will most likely depend on modders actually using that lib AND registering their events into a MyEvent/Signal system, but if you need to hook to the call of another mod you will most definitely not try to hook to a modder using that system
Also is the modder simply overriding the callback or hooking to it here ?
I think a proper doc or actual usage example in conditions to see what this could be used for
Mod data IS a table itself
ah
how do i set it tho
brain kinda dead sorry about that
just need to set a boolean for an object
Maybe that is more of a topic for #pzwiki_editing but wouldn't it be nice if https://pzwiki.net/wiki/Category:Current_Lua_events was organized by "runs in /client/server/SP"? Or some other .. "runs only when blablabla"
so i cannot set it per object?
Hmm, I can do something like that
back to global tables it is
Yes you can ? Read the wiki page
You're talking before even reading
Tbh the Lua event pages need a small clean up, I didn't bother with it because the LuaDocs did the job
Test it
Uhm the LuaDocs? 😅 . Sorry for the stupid question but where/what is that
I have 4 ways to find truths that I bump around between
- search pzwiki
- search https://demiurgequantified.github.io/ProjectZomboidJavaDocs/
- search game files
- check in console with debug and prints and stuff
I don't decompile the Java scources, but I know people find good stuff in there.
package index
@frank elbow Looking at the translation note, either we do that (screenshot), or we just directly update that page to not list previous versions, which I'm personally more for since the modding wiki should show the last version information
This way so it shows it's for 42.13.1 and then it's just the current encoding
It’s not like it overrides the base system mind you. It’s just a utility
With someone different syntax
The LuaDocs is mentioned in the main Lua event page
https://pzwiki.net/wiki/Lua_event
https://pzwiki.net/wiki/LuaDocs
looks so much like roblox studio
It's fairly new, not getting a lot of love for now but will get some more with plans to move it sphinx
The hooking to other mods events is a bit confusing
still cant get isoplayer to run
Cool! Is it fair to say that LuaDocs is a "subset" of the JavaDocs ?
It reduces to the the stuff that is exposed + adds more details and explanations?
Or there are also functions that come on top that are purely in lua PZ?
package index
iswalkto seems to disable running
Yes
It lists functions and classes
It’s kinda just either making custom events or if you want removing another mods event in place of yours
Tables etc
But removing another mods event require them to use your lib ?
Yes, that’s the only thing
I doubt that part would be used at all
It’s mostly gonna be for easier events
Yea that's likely, the problem being that if a mod uses the lib to give this ability to other mods it's probably a bad design
But how does it make it easier tho ?
For custom events for example there is Starlit which provides a framework to add new events
And to hook to events the vanilla way looks way easier to use than what you showed
despite all of this i cant get the isoplayer to run
at most it seems to run for a second before reverting to walking
How do items get tags? for example base.blowtorch has the BLOW_TORCH tag, and I know this because I can find item:hasTag(ItemTag.BLOW_TORCH) in the code... but I can't find "BLOW_TORCH" anywhere except in the checks. It's not in the item definition at all.
...wait, did they move this to $%#@^ing java code?
https://theindiestone.com/forums/index.php?/topic/88499-modding-migration-guide-4213/ mentions new registries.lua that has been discussed here also. I haven't touched it personally.
A guide for mod authors on how to update your mods to the new identifier and registry system introduced in version 42.13. Migration Guide.pdf testmod_registries.zip Project Zomboid_ API for Inventory Items.pdf
Yeah. It's in java. I guess that's one way to avoid the shitty parser killing the entire game when it tries to read item scripts.
Tags now require the ItemTag registry.
I've seen that, but it doesn't explain how the vanilla objects get tags or give a list all tags.
All the vanilla tags are in java.
actually that's probably a screenshot of the wrong thing, but you get the idea.
Ah I get what you are saying. Well maybe there is a way to read them from the registry?
some items get tags in their script... but not all. Also looks like case is different between java and item script files, which are all lower case.
This is feeling like a problem for tomorrow. 😛
can someone make more traits mod for b42 mp
Why don't you do it ?
because i dont know how to code
if i could i would
Then commission someone or learn
alr bro i dont want it anymore i just asked
Is there a tool provided by PZ for converting Moodle image files to each of the sizes the game expects, or must that be done manually (or via a script)?
What's your goal with that ?
The game allows you to automatically rescale textures in-game when using in UI elements
In B42, the structure for the Moodles folder is six individual folders (128, 96, 80, 64, 48, 32). I assumed downscales for each had to be done by the modder. Have I missed the correct way to do it?
I indicated my reasoning for not just updating it in the edit note. & that's the way I typically see and do it on Wikipedia lol, but sounds good as long as it gets the info across 👍
Hoping someone can help here. I have a standard flow/structure for my mods which works fine, but for some bizarre reason that I cannot figure out... this mod just won't load. I see 2 lines in the logs:
loading \phunfixes
mod "\phunfixes" overrides icon.png
Then it goes on to the other mods. Interestingly, the other mods have 2 override mentions (I assume one for 42.0.0 and one for common) but this one only overrides the one. Its also not picking up on the other overrides like sandbox-options, etc... Any ideas on where I have gone wrong?
Yea I didn't see the note bcs you had two edits
Is there a way to add more entries to the challenges list? I want to try messing with last stand accumulator to add more stuff u can buy
the logs are only for overrides, (meaning the file logged was chosen from the override folder instead of the common folder's version). other files of the 42.0.0 folder may be loaded without overriding common folder files.
Thanks for your answer. Though this sort of stands out as the behaviour is exactly like the 42.0.0 folder is not being loaded and only the common folder is. I can even stick media folders from the other mods into the 42.0.0 and nothing loads. Can't even find a single file in the debugger. What could lead to this folder not loading?
is anyone able to load mods on workshop? i get error 2
I had the same problem from ingame update. I never had the problem with https://pzwiki.net/wiki/Steam_Uploader. but now I have Steam "too many requests" when looking at workshop changes, though it is probably unrelated 😄
The "Too Many Requests" error seems to be occurring widespread on Steam. I was having trouble accessing both other people's mod discussion pages, and even my own mods' discussion tab and change log yesterday.
I bet on accidental ddos or similar whoopsie causing the "Too Many Requests"
any manual for this? XD
Hey, is there a pzwiki guide on all the various options you can make when writing sandbox options?
I'm looking for a way to make certain options become "hidden" when you select a certain option that overrides it. I saw it in vanilla sandbox options
There's stuff in the vanilla sandbox options that aren't available to mods unfortunately. But the sandbox menu is all Lua, so if you really want to you can wire up your own custom UI that shows when selecting your mod's options where you can do whatever you want
You can see the options available for mods here:
https://pzwiki.net/wiki/Sandbox_options
Hello guys,
I’m new in creating own mods especially in Pz. Is there any good tutorial or guidelines of how I can modify the game?
I have some coding background.
Most of the tutorials I found are mostly ppl who copy/paste stuff from others but don’t know how all the stuff actually works.
I’m mostly interested in creating some kind of events or systems that gives some quality of life and more atmosphere here and there.(like the crowbar in common sense).Not just copying and rename them.
Is there something like a overview of functions and methods or stuff like that.
Thanks for all advise
what is this?
A starting point is the modding section in the pz wiki: https://pzwiki.net/wiki/Modding
When it comes to modding by adding new lua code, there is also a modding guide by Fenris_Wolf which I found very helpful: https://github.com/FWolfe/Zomboid-Modding-Guide , especially the "The code" section: https://github.com/FWolfe/Zomboid-Modding-Guide/blob/master/api/README.md . Most important parts are where they explain the event system and how to properly "overwrite" vanilla code (which you actually shouldn't do but they explain the proper work-around). Problem is that this guide is quite outdated when it comes to modding B42. Multiplayer B42 is also not covered there. However, the basic principles for single player modding explained there are still valid. Only thing to note is that the game's lua code structure and various lua and java commands have changed quite a lot over time.
Thanks for that! I’ll work myself through that.
At least I get the basics of how all that works😅
sorry but i think you're misunderstanding what threading does in lua, threads aren't able to run concurrently
their only purpose is to allow you to write coroutines, they aren't 'real' multithreading
from how you've written this i think it's fair to say you're obviously coming from roblox, roblox is an extremely unique environment and does not really work how lua works (even before luau)
The Lua (language) wiki page too can be useful to learn the basics of it
Anyone know what's up with TimesActions in MP?
In the debugger it doesn't seem like TimeActions (specifically ISWearClothing) is completing on the client.
The results seem to complete alright. But I can't catch it calling complete
did you read the migration guide? complete is only called on the server
I did not
Thanks, you're the best @bronze yoke
So I'm guessing the server doesn't forward events to the client?
ISWearClothing calls the OnClothingUpdated event in perform, but this is before the new clothes are actually equipped, so not useful.
I work around this in SP by patching complete to call it again. But that seems like a no go in MP.
I guess I'm going back to per frame updates for now.
yeah it doesn't, completely separate environment
When writing Moodle mods (or any mods that merely replace image files) for B42, is it better to prefer storing the contents in 42, or in common? I'd assumed 42 originally, but certain related mods (such as Moodles In Lua) seem to recommend common.
common makes the most sense for assets
Wouldn't any change to the file structure break the mod, though? IIRC, even in early minor versions of B42, Moodles were structured differently (a single folder rather than sub-folders, and border files had different names). I don't think it's possible to go back to those versions (at least from Steam's Beta tab), only 42.12, but still.
yesss but then it doesn't make sense to put anything in common because anything can move
if you're concerned about that then you can use the version folders, i don't imagine a mod like that will get too large anyway, but the main purpose is that common can hold assets so that they aren't duplicated and bloat the file size when code changes have to be made
if player:HasTrait(CharacterTrait.Desensitized) then
player:getStats():reset(CharacterStat.STRESS)
end
end
Events.OnTick.Add(NoStress.Tick)```
Why does this not work?
hasTrait
Highly advise you use Umbrella
This should catch a lot of these projects with proper usage
No idea what that is
still gives error
Im not seeing the difference lol
Wdym ? You didn't install it yet did you ?
no
Anytime a function is unknown it tells you
I see
If you use proper Typings and indicate that player is an IsoPlayer it'll scream at you for using improper functions that don't exist
See the typing wiki page too
42.12 I slightly modified a mod and now I can't get it to show up in the mod list.
42.12 steam, linux, linux compatiblity. Mod is in ~/Zomboid/mods
mod files re in 42 folder
I've tried a bunch of stuff and have a bunch of other local mods that are loaded fine. IDK why this one isn't. I wanted to ask here if it's a known issue
PZ is Linux compatible natively
Verify your mod has the project structure
Notably not a missing common folder 
It is missing common, is that required?
oh ok, well sounds like an easy fix. The wierd thing is it was working before! It only stopped when I deleted it from workshop I think.
Thanks for tip, I'll look that up and add it tomorrow
common was always mandatory since B42
If you used a git repo clone, and the common folder was empty, it's not present in the repo
So when you clone, that folder isn't there
I do have one other question - I'm lead to belive you can specify version compatibility with the folder name, e.g 42 or 42.0 for all 42.x or 42.13 for that specific version>
There's also mod.info minRequiredVersion, that's a minimum.
Does PZ rely on the mod.info only, or primarily or what. There's 2 sources of truth that file and the folder name so if they are in conflict which wins. And can you use any folder name if you have correct mod.info files?
That's almost certainly what happened!
Nah PZ doesn't use the mod.info things to load your mod besides its ID and required mods
The versioning and common folders are mandatory
If you haven't yet, I suggest reading the Mod structure wiki page
OMG I just added the empty folder and it's working. I really hope they fix that soon, I tried so many BS fixes, that's really dumb
And TY!
Devs trolling lol
Yeah I wondered if it was accurate or outdated
litterally!
I don't know if they'll fix it 😅
You can see the version the wiki pages were last updated for
There's not even a damn error in console! I searched for the mod id and name in every file zomboid can see and there was nothing, it's pretty poor design
Currently, pages are accurate for the entire B42 builds for the most part
In some cases, if the info is inaccurate I add a small indicator of it on the wiki pages if I notice they need updating
Ok cool, good to know, that's nice
well I guess we can put a bit of the blame on git for not tracking folders too
Ok will do. I was just going to plonk some unused png or something 🙂
Yea just use an empty text file at the very least with a very obvious name to understand that that file does nothing
Sure thing. What a gottcha though. Should have asked sooner.
Can I make a suggestion somewhere to at least show a log entry when a mod is disqualified due to impropper structure like this? is there some feedback site or something?
I wanted to take a moment to express my appreciation for the countless hours of enjoyment I've had with Project Zomboid. The immersive gameplay and attention to detail truly create a unique experience. However, I believe there are a few areas that could benefit from some attention to help keep th...
Thanks
I know that, I never said it was for real multithreading.
Just in that I am using them to prevent having to wait a long time on your event to run

@bright fog could you unpin the two pins in here about body locations? they're pre-registries and don't work anymore
These ones I assume ?
yeah
Done
thanks 👍
does the wave defense gamemode work in mp? all the lua is in the client folder
How does split screen on a multiplayer server mess with sending client commands and mod data? Player 1 seems to work fine, but any players after that on the same client don't seem to work when trying to save mod data to those other split screen players (other commands work fine, it's just saving mod data for when the split screened player logs back in and whatever other purpose).
I forgot to test if it's even saving during OnClientCommand, but regardless of that I want to know more about it
Can you even play in splitscreen in MP ?
I guess yes lol
Splitscreen players are on the same client, so it's a bit of a bizarre thing to handle
Syncing with other players in the session is too much work to bother putting in. When it comes to commands, I guess you could make the original sender client also receive the command client side and update every local players
When it comes to the vanilla syncing commands, idk if they implement that
Probably not worth doing then since most people don't do split screen AND mp at the same time. It's not like it doesn't work if split screen is enabled on mp, it does, I just can't save if the player was on the vehicle on log out, it's no big deal.
commands should work fine with splitscreen
if you're using the player passed to OnClientCommand then make sure the right player is sending it
sendClientCommand with no player argument always sends it from player 1
Ooooh, that last part was it. I assumed it knew which of the players the client was sending, in hindsight I guess it makes sense if it just defaulted if not specified
Did I miss something? not sure why I can't upload, I've uploaded before...
you can't upload Build41NoWeight in b42 because it doesn't have a mod.info in the build 42 location
If I had to guess, it's that B41 mod the problem
just put both versions in the same mod, they don't overlap
Alternatively, you can upload with an external uploader to bypass the in-game uploader limitations
But yea you can mix both B41 and B42 folder structure
Also that mod.info file next to the 42 and common folder in your B42 folder is useless
it could actually cause a lot of issues since b41 will see it
Indeed
if they have the same mod id then you'll trigger the mod pack issue
Both mix when they have the same IDs no ? So technically there wouldn't be any overrides no ?
oof
more than one mod with the same id = server can't tell the client to use the right one = checksum mismatch
that's what the coming mod id changes in b42 are intended to fix
need ideas for which of the new profession vehicles to do for my 89 econoline
Are there wiki pages or repositories that've recorded the layout of the media folder (and/or similar folders) among the various versions of the game? I was hoping to not have to downgrade and upgrade again just for a sanity check (though I'll probably end up needing to soon anyway).
No but it's basically the same
Just the location of the media folder changed for mods
Ah, I know b41 mods use the mod root as their initial point and b42 use version numbers and common. Rather I meant the game files themselves. The locations and formats of certain things have changed rather starkly between versions. For example in B41, iirc, moodles used a .pack file contained in some folder that I can't remember, while in 42 they're in ui/Moodles where each subfolder contains regular .pngs.
only very specific things like that have changed
i don't think there's any documentation of that on the wiki
And we wanted to cover modding changes on the wiki but it proved to be an impossible task to maintain
Bcs not everything are written in the patch notes
And considering I am the only maintaining a lot of these things it wasn't viable 😅
{
CharacterTrait = lrrp:lactose,
UIName = UI_trait_lrrp_lactose,
UIDescription = UI_trait_lrrp_lactose_desc,
Icon = media/ui/traits/trait_lrrp_lactose.png,
Cost = -1,
} ```
So for my script I've checked for syntax errors etc however I cannot seem to figure out how to properly reflect my icon for my trait in the selection screen, can anybody tell me where the game is pulling the tell to fix that?
sorry to intrude, tried to make my first mod recently got the functionality working but couldn't get the sprite showing up PZ evan tried using another mod as a complete template just overriding the files it called up in the code is there any issues using fbx files for sprites or should i go for x files btw trying to add my Tungsten cube into the game thought it would be funny to smash zombie skulls with it 😄
Where can it be specified at now?
nowhere, it has to be that exact filename
it's based on the name (but not namespace) of the CharacterTrait
@bronze yoke ❤️ that request idea.
Vanilla code is gonna be so much better at resource location then mods all trying to do it themselves
Which file, the lua file or the script itself?
What's the best way to test a mod in mp that my computer can handle lol
I've removed that, and the ID's are separate - I released an update in January with both 41 and 42 mods and it worked, but things have changed since then
wdym put it in the same mod? like the same mod folder? would I just create a "41" folder and put the mod in there?
no 41 folder, just copy things in exactly as they are
build 42 only looks for files inside common + version folder, build 41 doesn't look inside these folders at all, so there is no issue from doing this
might be something to do with the 9889 errors
probably related to the 9889 errors
Well yeah lol
4 years of Roblox work lmao
I’m one of the more well known scripters on there
Definitely new to zomboid
Are you saying they changed how coroutines function
I’m used to the round robin system
Where each cycle it handles each thread including main
Not referring to the task scheduler which operated entirely different
coroutines run when you directly run them and block the thread until they yield
there isn't really anything beyond that
Hm
That is really unfortunate
Well thanks for telling me
I didn’t know their threads worked different
Well not threads but
yeah, the point of coroutines is literally just the convenience of being able to yield and resume, they don't do anything else
That really sucks
In luau lune and Roblox luau coroutines run concurrently
Well kinda
It’s not true concurrency
It’s more of a Que of actions to run
Does zomboid have access to some kinda asynchronous system?
or does everything just yield the main thread?
there's no concurrency whatsoever
thats really lame
I am using Tomb's Player Body Overhaul and this is what it is suppose to look like. But then I tried to make the character model just a little bit more thicker . So I tried to replace the original model with my newer model and just renaming it to female body.fbx did I need to go bind my new file with something else to make it show up in the game
Keep in mind if you change his masterpiece that your body may clip through clothing. And basetextures can look weird if you destroyed the uv.
risk I am willing to take because I was originally using the thicker pear shaped model but Tombs player body overall has better faces so I was trying to combine the 2
@iron salmon Can you connect me with any of the artists?) I want to know what the text should be here. I'm translating the spawn map.
:3
Trying to add an item to a dead zed client side but having an issue. The item appears, but cannot be removed from the body. Am assuming this is because the server doesn't know its there, but why not? Of course I can do server side (which works) but ideally need to do client side... for reasons.
local items = zed:getInventory():AddItems("Base.ThingAmAdding", 1)
sendAddItemsToContainer(zed:getInventory(), items);
is there an inbuilt way to get roads like vehicle stories
or do u ahve to do it manuıally
Yes
how
UIManager.FadeIn(0.5) where the float is time in seconds. I haven't tested this in a while, but it at least used to work like this
oh thank you
Just make sure you don't fade out without fading back in, because you can't use UI for exiting while faded out
it has to be done on the server or the item cant be interacted with
How do i know what folder my .lua files should go into? Thinking abot the Lua/Client or the Lua/Server folder path.
me when i run into recursive requiring (mod is cooked)
I believe you need to set lastX or some shit like that too
I suggest checking out the RV interior mods
gah
ok
i think im pretty sure
game auto unloads isoplayers when they are too far away
which is nice
alright it is weird
RV interiors does setX setY setZ and setLX and set LY ...
i did the same but when i teleport
it seems to try to load for a second before teleporting me back
alright fixed
u gotta add the LX and LY or it no work
You could do this by just replacing the Uv's and plopping them down on the new mesh that you need, Still no clue why you would want this g 😭
That's pretty cool
ty
though i dont like how i did the cutscene trigger
not good to check every tick but idk how else to do it without causing recursive requiring
Why do you not just trigger the function ?
Also you're still not using Umbrella ????
didnt see need for umbrella
because
function needs NPCMain to spawn npcs
but NPCMain also calls the encounter logic loop
so recursive loop
if i call it from when i set it which is inside encounter logic
But you should define your cutscene handler in a different file
it is
Not really
its that a NPC calls the
cutscene
but the cutscene
needs the npc module
to spawn the npcs
I see the problem
wish there was an event like
moddata changed or smth
aah ok i got an idea
im going to seperate encounter from npc main
that should work
ye ty
Imo you should have a main class that includes every systems
rn i got NPCMain
that requires npc types
to spawn them
then an encounter that was tied to NPCmain which i will seperate rn
the rest are utility
May wanna look at Champy's https://steamcommunity.com/sharedfiles/filedetails/?id=3569303590 or my https://steamcommunity.com/sharedfiles/filedetails/?id=3594105442 - for inspiration. Both for indoors for now and not updated to 42.13 😬 so no guarantees.
Open to colab for outdoor scene support for SceneBuilder and Multiplayer/42.13 help though 😅 . There is a github 🫰
@raven epoch have you setup Umbrella ?
With such a huge project it's not "might" it's "must"
ye true
i was losing my mind debugging that cutscene
i made it so that
when an npc encounters a player
they stop all their own ai
and make an "encounter "object
that handles ai
so i can coordinate multiple npcs
which mod are you working on? 🙂 is it published?
nope
A NPC mod
Fair warning, it is not used by any published mod - so real world testing is, well, zero.
its fine
ooh
this reminds me of my
auto fortify function
(it was not good)
but this is good
How does one hook onto OnCreate in .13?
I used to do it this way
local original_Recipe_OnCreate_RipClothing = Recipe.OnCreate.RipClothing;
---Overwriting Recipe.OnCreate.RipClothing() here to insert ETW logic catching player ripping clothing
---@param craftRecipeData
---@param character IsoPlayer
function Recipe.OnCreate.RipClothing(craftRecipeData, character)
if not isServer() then
local modData = ETWCommonFunctions.getETWModData(character)
if #modData.UniqueClothingRipped < SBvars.SewerUniqueClothesRipped and ETWCommonLogicChecks.SewerShouldExecute() then
local items = craftRecipeData:getAllConsumedItems();
local item = items:get(0)
modOptions = PZAPI.ModOptions:getOptions("ETWModOptions");
---@type DebugAndNotificationArgs
local DebugAndNotificationArgs = {detailedDebug = detailedDebug(), notification = notification(), delayedNotification = delayedNotification()};
---@cast item Clothing
if detailedDebug() then print("ETW Logger | Recipe.OnCreate.RipClothing() item: " .. item:getName()) end
ETWCombinedTraitChecks.addClothingToUniqueRippedClothingList(character, item, DebugAndNotificationArgs);
end
end
original_Recipe_OnCreate_RipClothing(craftRecipeData, character);
end
I looked into wiki page for crafting recipes but its not updated for .13
The vanilla OnCreate are Java sided now
I believe they are called from Lua side tho so you should probably be able to hook to it
Also the craftRecipe wiki page is still fairly accurate
they aren't named the same things
That too

what is a good way to check
if something is loaded/exists?
lets say i got an variable set to an isoplayer and it moved far away and despawned
but variable still holds the reference
wat do then
Uhm 1. check if it is nil, 2 check if one of its properties is nil.
There's no point in supporting (or backporting) versions prior to Build 41 Stable (41.78.16), right? Is it even possible to make a mod work for two different minor version of Build 41, due to the lack of versioning folders?
if the changes necessary are only lua you can have lua checks for game version, but there is literally no point to doing that no
No one uses older B41 versions
thats not how require/etc is used...
So, first off, file A can declare some functions, and file B can declare some functions
file A can call B's functions, and B can call A's functions, even without either requiring either, so long as its done after the initial run of the file
require is only to make sure that A loads before B, and that you can pass whatever the 'return' value of A to B
huh thats interesting
B can even then add its own functions to the table A might have returned.
im pretty much running on roblox studio logic here so thats why
and then it could call functions in A, and A can call those functions so long as B declared them and set the values before trying to call them
So, imagine one GIANT horrible global namespace.
the problem is you usually want to require during the initial run of the file
And each file is 'run' once.. and only once, and then the output of each file is cached.
when you 'run' a file, your actually compiling functions and assigning them to values in the global namespace.
function foo() end actually declares the global 'foo' and assigns a function to that value.
you can delay requires if you really want to but this is horrible style and imo circular dependencies are bad design inherently regardless of whether it causes an error or not
And everything that runs afterwards can call foo() or even assign it a new value if they wish.
(this is how we do hooks in LUA)
Where can I find documentation about this so called sync'ing?
I am modifyhing player stats but they do not stick, I assume becuase of lack of said sync'ing
Check the pinned messages
Also the Networking wiki page can help but it's not updated to the new syncing methods available and only covers commands for now
None of the last 3 pinned posts answer my question
player:getStats():set(CharacterStat.FATIGUE, newFatigue ) Does not stick, even when coming from a .lua in /Server
I will check the Networking page, but your notes do not give encouragement
I understand communicating between server and client, but I dont understand what I am "syncing" where
Do I just run player:getStats():set(CharacterStat.FATIGUE, newFatigue) on both the server and client? Obviously I fetch the player differently on the server, but just make sure theyre set the same within a certain timelimit or else the game catches the desync???
It seems you're missunderstanding what the server folder is
I must be 😅
Also that function you mentioned set is not doing the syncing
It JUST sets the stats server OR client side based on where it's called from
Wait does it ?
so then:
- Set client side (what is happening now)
- Send command with args to be caught with Events.OnClientCommand.Add(handler)
- Use 'handler' to also run the
setmethod, this is how it runs "server side"
is this correct?
You shouldn't set anything client side, most of the logic should be done server side these days
ah ok so basically move what im doing to a function that will fire on the correct "clientCommand"?
The game should handle the stat sync, I'm looking for that information rn
@bronze yoke the stats of the character get automatically synced ?
It's a bit unclear from the timed action example they use in their guide
no
i don't really know why there's three functions for syncing stats but i've used sendPlayerStat(player, stat) with success
Wasn't there a list of every syncing functions somewhere ?
Yea that's why I didn't find that function
Where? Even searching for sync gives zero results in the Migration Guide pdf
it'd be in the document describing inventory items
but again, i don't think these ones were even listed
jeez
Mistakes clearly made
Not entirely sure where, but I'll find them
The FPS drop isn't normal
I already sorted that bit
So then, being that now I know /Server doesnt mean it runs on the server. How do I make something run on the server?
is it just by running a function through Events.OnClientCommand.Add(functionToHandleCommand)
the function functionToHandleCommand would technically then run serverside, yes?
Didn't I write something on the Networking page about that ?
Basically you have commands to check isClient() isServer() etc
These return both false if SP
So at the start of your file, you can check for these and return instantly if they aren't meant to run for one or the other
Ok so I believe I have tried this and am getting a strange issue, or am misunderstand further
I have print() as a lazy debug. When I do not filter out isClient() or isServer() The script runs, printing whatever into the server-console. The player's stats seem to change on my client, but then snap back to old stats.
When I turn on the filtering out clients, I no longer get the char stat updates on my client (expected) but also no longer have anything printing to console.
If you're using host, to check server output you can check coop-console
its a dedi
Ah.
I dont understand how if isClient() then return end is stopping both logs printing to the server AND the pseudo-updates on my client
So then, what makes the top code "run on the client" and the bottom code "run on the server"
it is not .lua file placement in /Client or /Server apparently
are you using AI 
no
Can we not AI witch hunt?
off syntax color theme jesus
It looks a lot like AI
the top code runs on both because the file runs on both
the lower code only runs on the server because that event is only triggered on the server
Yeah I unfortunately have to deal a lot with ai code
if it's in the client folder, it is only loaded by the client
the server folder does not have any similar behaviour
thank you
@civic galleon my bad gang 😭
The comments and style seemed like some chat gpt would write 😭
because its example code 💀
Uh! That diagnostic window is that inbuild in Zomboid?
Yes!
Its bound to K
You might need to launch the game with the -debug flag as well. Not certain.
I can't remember the last time I played zomboid without -debug 
that works like a charm. What is LPS and UPS?
UI is the UI-framerate I guess?
This isn't AI
I see the confusion but basically you have to consider the code being shown here are running either client or server side because you controlled where you trigger those
Curious what you think looks like AI in that snippet 😅
That's not what that code shows tho
The CLIENT SIDE thing is for actual client side
While the SERVER SIDE is for actual server side
AI tends to write like documentation
That doesn't make that specific thing AI tho, also AI will always have caps at the start of their comments
And I'm not sure I've ever seen AI prompts have full caps comments like that
Wait you got to be kidding me, I was right, I did write on that wiki page client and server only codes
https://pzwiki.net/wiki/Networking#Client/Server_only_code
Did you miss that ?
it is true that ai tends to write these kinds of comments, it's just the whole witch hunting over a tiny bit of code that was unnecessary
chat models like chatgpt have mostly only seen code in tutorials and stack overflow and stuff like that so its code comes out full of overly explanatory comments
i was making a item mod on b42.13.1 and managed to make item be listed on admin spawner, but i can't actually spawn the item, when i click to add item admin chat just show the additem command explanation, anyone had that issue?
also there are any characters that shouldn't be in the item names? some of my items have symbols like ´" ( ' ~´
I think that's fine as long as it doesn't break the definitions in files
Like " can possible cause issues since that technically closes the translation entry
Hello, with B42.13 now packaged all TIS's code and dependencies inside of 1 jar file, if I want to make a java-side patch for users, do I now need to include the entire jar file with the patch, or is there a better way to do it...? Thank you!
No
The Java files from previous paths can technically still be loaded
@willow tulip probably knows better than me the details tho
so classes in ROOT/zombie will still be loaded and overwrite the ones in projectzomboid.jar?
From what I understood yes
I believe there are also more sophisticated methods to load Java mods, or you can look into solutions like Leaf that haven't been put to general use in the modding community
I just tested and it seems like it is the case. That's awesome for installing and uninstalling java-side patches!
thank you!
Yep
Yep, now we can just tell users to delete the whole zombie dir
and there is no confusion over what files are what.
also note, steam seems to be deleting my java files there when I went from b42.13 to B42.13.1
Dunno if thats going to continue to happen or what
branch changes might be stricter
yea, But files not included in the vanilla games zombie dir where not deleted
so it might be due to the fact that previous versions exist with those files, that it will now always be deleting them
really? i don't get how that works
maybe because the main branch still has those files
IMO, this feels like a good move: Zomboid updates will automatically remove java mods to keep em from bricking the new version
Yea. We'll have to see what happens in future updates
agree, just surprised it does that based on how steam usually behaves
yeah it could be that they want to make sure there's no lingering classes from previous versions that still uses multiple jar files and zombie dir structure, so they put a rule to wipe it
Yea, would also keep mods from bricking the game when the basegame updates
I can potentially see it being annoying for users tho, but oh well 
Quicker than I expected, but just as useful.
Uhh hey guys, it's my first time making a mod. I made a patch for Visual Sounds for 42.13.
Let me know what I did wrong I guess lol
https://steamcommunity.com/sharedfiles/filedetails/?id=3628725609
How do I get reuploads of my mod removed?
I don't care if people mod my mods with patches and such, but full reuploads that don't require the OG, no.
In B42.13 you can register a new trait with CharacterTrait.register("nep:onfire") and then define it in a script file, see it in character creation. Easy.
But how are you supposed to tell if a character has that trait in your lua code? I need to update
if player:HasTrait("onfire") then
All the vanilla examples are useless because they use enum values:
playerObj:hasTrait(CharacterTrait.HANDY)
and I can't find any hasTrait() equivalent that takes a string as an input, or any way to get something that hasTrait is happy with... so I can't figure out how to tell if the player has the trait nep:onfire
CharacterTrait.register returns it
Ah, so you need to capture it to a global when you register it in you registries.lua file?
yeah
try player:HaltAndCatchFire() (Sorry, bad reference joke, ignore)
Yea likely.
Seems that you can't just set yourself on fire anymnore, you have to ask the server to set you on fire.
All those players waiting for useful mods to update and here I am working on Start Game On Fire. 😛
Could someone who's dabbled in VHS modding get back to me? I got a couple questions
Either I'm doing something wrong or players don't catch fire anymore (at least not with SetOnFire(). The server bits triggers correctly, it just... does nothing.
...I had god mode on from earlier testing.
But! I also made my first client -> server mod thingy with sendClientCommand and Events.OnClientCommand, so that's good.
I look forward to being on fire
So, now that MP is out, I'm looking to update my mods - does anyone have the cliff-notes of what significant changes have gone on in Lua - especially network code
Pinned messages
thanks.
Am I imagining it or was the Java bytecode previously in folders rather than a JAR
Yes
It doesn't change much
I was literally trying to confirm it when you responded to other aspects of my comments
Here I had noticed without any filtering, print pushes to server-console.txt on the server, but disappears when I filter clients out at the top. This is why I wanted further confirmation
I see
OKAY, i have a question
how i can change the audio for the sprinters?
bc im not a big fan of the audio for the sprinters..
i wish to replace the audio for the sprinters to tlou's runners
Anybody working on maps? For the new updates
I think I saw someone do that where they replaced it with cod zombie sprinters somewhere once
i see
been tryna figure out on how to replace those sounds with these
bc i feel like tlou's runners' sounds are more realistic
and sound more realer
is the only way to move something manually setting position every tick?
That reminds me of my zombie corpse pushing try, just shove them to the neighbors ! xD
https://streamable.com/2tnawf
dont rly remember, sry. was messing around with tile coords, and it was a mess lol
its fine ty anyway
i rlly hope there is an easier way cus i dont want to do addimpulse every tick just for a vehicle to go straight
I don't know if there's a better way for cars, but maybe check out how the helicopter mods set the vehicle position every tick. It works pretty smoothly
you going to build automatic driving cars or what? ^^
I see. Physics that way are unrealible, but still work sometimes
im going to see if i can fake input with isoplayer
i remember someone trying something months ago and it looked decent
Did you get clues on how to analyse this ? I get the same thing when spawning modded vehicles with exotic containers in MP.
Do any of the npc mods implement npcs driving cars?
week one does right?
What are you using for your npcs btw?
I mean some framework or custom implementation of npcs?
Ok
https://youtu.be/JPr6jeW-P2I?t=605
10minutes 10 seconds you see a taxi driving
Hey guys! Today, I’ll be looking at the extremely popular Project Zomboid mod called Week One. Taking place the week before the outbreak, you witness as everyone in Knox Country slowly succumbs to the virus. Could you survive this outbreak? Find out now!
Thanks for watching!
Link to mod:
https://steamcommunity.com/sharedfiles/filedetails/?i...
Can someone help me with the vehicle shadow texture ? Like the image in the mechanic menu, how I add it ?
are body locations exclusivity transitive?
What does that even mean?
location 1 is exclusive with location 2 and
location 2 is exclusive with location 3 therefore
location 1 is exclusive with location 3
no
ty
Does anyone have any information on how to define forageable items in version 42.13? ty
ProjectZomboid\media\lua\shared\Foraging\Categories isnt it all there?
I did my research on IsoPlayer and made a mod with it. B42 is currently limiting rendering IsoPlayer objects if it isn't in your control.
So you might wanna use something else, if you dont need to control the character
anyone running a dedicated setup on unstable with ubuntu? server live and it pings but hanging on steam auth, tried jsut about everything
used steamcmd anonymously to setup and have all the dependencies
For me, the problem was with the items (vehicle parts) that were configured incorrectly for the B42.13.
I believe it was causing some kind of cascading error.
It's also worth taking a look at your "VehicleDistributions" file, which controls the spawning of items in vehicle containers.
can you point me to the corrected mod if you uploaded it to the workshop ? and indicate me the corrected parts names ? 😄 please 🙂
I use a translator and my text ended up a bit confusing. I mean the item itself, which, when installed, becomes a part of the vehicle, for example a ‘Custom car seat’ item.
If you want, you can message me privately.
👆
Item definition (item visible in debug ItemList): ```
module ATA2
{
imports
{
Base
}
item ATA2ItemContainer
{
DisplayCategory = Tuning,
Weight = 1.0,
ItemType = base:normal,
Icon = media/ui/Container_Counter,
MaxCapacity = 35,
ConditionAffectsCapacity = false,
ConditionMax = 100,
MechanicsItem = TRUE,
}
}Item registry:lua
ATAItems = ATAItems or {}
ATAItems.ATA2ItemContainer = ItemType.register("ATA2:ATA2ItemContainer")
Part definition:
module Base
{
template vehicle ATA2InteractiveTrunk
{
/much stuff in there/
part ATA2InteractiveTrunkRoofRack
{
}
/much stuff in there/
part ATA2InteractiveTrunk*
{
area = TruckBed,
category = nodisplay,
itemType = ATA2.ATA2ItemContainer,
specificItem = false,
mechanicRequireKey = false,
container
{
conditionAffectsCapacity = true,
test = ATATuning2.ContainerAccess.Tuning,
}
table install
{
test = ATATuning2.InstallTest.Tuning,
complete = ATATuning2.InstallComplete.Tuning,
}
table uninstall
{
test = ATATuning2.UninstallTest.Tuning,
complete = ATATuning2.UninstallComplete.Tuning,
}
lua
{
create = ATATuning2.Create.Tuning,
init = ATATuning2.Init.Tuning,
}
}
}
}
Error log:LOG : General f:211723, t:1766437483430> ItemPickInfo -> cannot get ID for container: ATA2InteractiveTrunkRoofRack``` @pearl prism
Do you have the Lua file containing "VehicleDistributions"?
\42.13\media\lua\Server\Items
I believe the "VehicleType = " is also missing in your item. But that's just a guess.
that specific item is not referenced in the Lua file containing items distribution. (I.E. vehicle's Items distribution). do you want some Vehicle distribution too ?
Wait, I'll take a look through my files to see if I can find anything useful for you.
setting the VehicleType removed the log.
Nice, so it was a error inconfiguration of the item after all.
Probably. I'm not confident, because this is part of a template that is supposed to be applied to any vehicle. I'm not sure if I'm breaking some compatibility by setting that VehicleType parameter.
can someone help?
help request + log without comment, I suppose you are looking for mod_support channel (if modded) or pz_techsupport (if vanilla).
hi! where can i find the male and female playermodel textures for blender? i want to make some cloathing mods
you are using a mod that uses the new 42.13 item/recipe format and you are on 42.12.3 so it not working
Tag has no items: base:pliers. line: item 1 tags[base:pliers;base:visegrips] mode:keep and good night lol
Look in the pinned messages in #modeling
I think that has links to the models and helpful templates/info
@primal schooner you can work around the limitations of mutual exclusivity with lua like this
obviously this is still an oversight and you shouldn't have to do this so it doesn't take away from your request but i thought i'd make sure you knew anyway
thank you! Yes, i don't really like the idea of overwriting a bunch of entries, it is a nightmare in a long run
tiiiime to figure out how the hell I can update my mod to 42.13
Anyone know if it's fine to distribute modified Java class files along with a mod? I know the user would have to do manual steps to actually complete the installation, but I'm wondering if it's possible to distribute server fixes I'm working on for 42.13.1 along with various lua fixes
yes
Sweet, ty!
I've done it (better headlights Java mod pre 42.9), it's a hassle but you can do it. Would be a bit better in 42.13 now mod files aren't being mixed in with normal files.
Better Vehicle Physics is the biggest example I know of that does it, there are also mods that affect the view cone/rendering that replace java files.
Be aware you will probably need to redo your java mod with every single update of the game. And if it's multiplayer good luck getting all the players to do the right thing.
Yes, just be ready for a lot of user complaints. but ignore em. 😛 I get about 1/2 as many downloads on my java mod as the lua mod that highly recommends using it for full functionality (but not 100% required) so you might wanna split the two if you can.
cough not realistic car physics? Sadness. 😛
😂
hahahaha - to be fair I haven't played Zomboid as a player since before that mod came out.
super appreciate the advice! ❤️ hopefully these specific mods won't need to exist for more than one version, i'd be sad if we got another hotfix that didn't fix bugs that i had fixed haha
We will!
Some bugs will get fixed, some will exist forever.
fair lol
will the game just load class files from the zombie folder, overriding stuff in the jar? and users don't actually have to edit stuff in the jar manually?
Magazines no longer increase in weight when you put bullets in, so I guess I should remodel this for the 97 round magazine.
and if so would it just be steamapps\common\Project Zomboid Dedicated Server\zombie for server?
Better Vehicle Physics suggests that you can copy their zombie folder to Steam\steamapps\common\ProjectZomboid\zombie but theirs is only client and i can't find docs about this
edit: looks like it's actually steamapps\common\Project Zomboid Dedicated Server\java\zombie for server
On the Networking page I see the note The onlineID is not persistent so it cannot be used for identification of players or zombies after loading or unloading them. For zombies, see PersistentOutfitID.. Is this meaning that this ID is not good for long-term player tracking (such as across multiple logins)? I am looking to keep track of a players stats for a small amount of time (while they sleep), and it must be outside of calling the players stats repeatedly (I am replacing vanilla math in a brute force way). I was intending on doing this with a simple table {playerID = {fatigue = 0.11, endurance = 0.42}, playerID2 = {fatigue = 0.11, endurance = 0.42}, )
Yes
Yes, however I believe it was @bronze yoke that mentioned the online ID possibly being persistent ? So that note needs to be verified I think
@willow tulip
People who keep installing carcontroller.java mods into the server. shrugs
Yes.
Thank you both!
I appreciate the time you've taken in helping me these past few days. Just to clarify for my own sake: Do you mean IDs being persistent as "across multiple session from a specific login"? I only need to track for a few minutes, but I worry about a player's onlineID shifting while they are connected in that time.
Yes between sessions
The online ID won't change during play
It'd be a bit catastrophic lol
Awesome and thank you!
it's not persistent
https://steamcommunity.com/sharedfiles/filedetails/?id=3629518507 Finally finished this off. Figured it was a good time to do it while half the gun mods are not working.
just havent released mine xD
Sorry, I can't hear you over the really loud ringing noise in my ears from test firing this thing.
Anyone got a working B42.13 clothing using a custom bodylocation yet?
tinnitus never sleeps
Got a few, mostly outfits and my random clothing that adds a few(but this one got bug/error report so I need to check it out). Once I'm home I'll send you ones with a few of custom locations, because I don't remember which one worked the best for it if you set exclusive locations
i tried testing custom stuff, added registries etc, just crashes the game
so yeah im stumped.
It kinda feels like an unnecessary addition in my (not much worth) opinion
The registries
100% yep. i can understand why? but nothing but maybe ammo or item keys work atm. from testing
Stuff not working/not being as moddable in unstable is fine by me, as long as it's fixed by stable
They work, it's just that it feels like additional step on top of fileguid tables and guids itself that (according to Albion) aren't even used.
no dice so far. no matter what i used
local bodylocations = {
"HolsterDeltaTest",
"Tail"
}
ChimeraRegistries = {}
ChimeraRegistries.BodyLocations = {}
for i = 1, #bodylocations do
ChimeraRegistries.BodyLocations[i] = ItemBodyLocation.register("Base:" .. bodylocations[i])
end
item FR_Operator_HolsterDeltaTest
{
DisplayCategory = Accessory,
ItemType = base:clothing,
Weight = 0.2,
DisplayName = [Chimera] Delta [Molle] Holster [TEST],
Icon = FR_HOLSTER_MAIN,
AttachmentsProvided = HolsterMountDeltaL,
BodyLocation = Base:HolsterDeltaTest,
ClothingItem = Operator_Delta_Molle_Holster_L,
WorldStaticModel = HolsterSingle_Ground,
Tags = base:firearmloot,
Researchablerecipes = SewHolster;SewHolsterDouble,
}
Tried both Base, CHIMERA etc, nothing works. Full game resets after each save. etc
all versions of the ID changed with each test. so CHIMERA: in registeries.lua had the Module CHIMERA etc etc.
Don't register them as "Base"
i tried other versions alrady
local bodylocations = {
"HolsterDeltaTest",
"Tail"
}
ChimeraRegistries = {}
ChimeraRegistries.BodyLocations = {}
for i = 1, #bodylocations do
ChimeraRegistries.BodyLocations[i] = ItemBodyLocation.register("Chimera:" .. bodylocations[i])
end
local bodylocations = {
"HolsterDeltaTest",
"Tail"
}
ChimeraRegistries = {}
ChimeraRegistries.BodyLocations = {}
for i = 1, #bodylocations do
ChimeraRegistries.BodyLocations[i] = ItemBodyLocation.register("CHIMERA:" .. bodylocations[i])
end
both fail.
yes its matched everywhere when changed
Do you still have body location in shared>NPC?
It is also required
Bit different but still needed
you are joking
No
Ugh.
yeah lack of context on all the changes ( yes even with the stuff they gave. ) hasnt reflected the info very well
ah the registries thingy reflects to your addon.
yeah it works. such a complex change.
is it possible to remove ContextMenuConfig from a vanilla entity using lua? seems i can't just override the entity in script
What's that ?
the vanilla composter has some ContextMenuConfig like this:
module Base
{
entity Composter
{
component UiConfig
{
xuiSkin = default,
entityStyle = ES_Composter,
uiEnabled = false,
}
component ContextMenuConfig
{
contextEntry
{
menu = GetCompost,
customSubmenu = ContextMenuCode.CompostInteraction,
}
}
...
this just indiscriminately adds a "Get Compost" option to composters on the root of the context menu that doesn't work properly (does not get disabled when conditions aren't met, does not show the % of compost). there is already other code that adds a proper "Get Compost" option under the Farming menu, so I wanted to mod this one out if possible
It calls a Lua function no ?
yeah it calls a lua function but it seems like the context option already exists at that point
You want to delete the context menu ?
i want that specific "Get Compost" option to be gone, yeah
Then hook to that Lua function to stop the option from being added
that function doesn't add it, i'll keep looking around tho, ty
That function has access to the menu tho ?
So you can find that option and remove it
ah i see, will try that, thanks again! edit: worked 💪
even better than straight up removing now, player hint for bug workaround 😄
How can I debug a function like ISInventoryPage:dropItemsInContainer?
I have a nested container mod which currently doesn't seem to work correctly only in multiplayer.
When I move a item into a nested container I get a infinite action bar.
In this case I tried to move the box of nails into the green backpack.
(Server hosted via main menu)
Sounds good !
Hello again,
I'm having issues with my modded items that have “ReplaceOnCooked,” but only in Multiplayer.
For some reason, when I try to cook them, they break, and you can't do anything with them. Its name breaks and becomes Base.CheeseStart (Fresh, Uncooked), but when you close and restart the server again, the “ReplaceOnCooked” works.
Is “ReplaceOnCooked” broken in MP, or do I have an error in the script?
item CheeseStart
{
DisplayCategory = Food,
Weight = 1.5,
ItemType = base:food,
Icon = MilkStarter,
CookingSound = BoilingFood,
EatType = Pot,
PourType = Pot,
IsCookable = true,
MinutesToCook = 10,
MinutesToBurn = 100,
DaysFresh = 2,
DaysTotallyRotten = 4,
HungerChange = -20,
ThirstChange = -20,
UnhappyChange = 80,
Calories = 1100.0,
Carbohydrates = 25.0,
Lipids = 10.5,
Proteins = 24.0,
CustomEatSound = EatingSoup,
StaticModel = PotMilkTPP,
WorldStaticModel = PotMilkTPP,
Tags = HasMetal,
ReplaceOnUse = Base.Pot,
ReplaceOnCooked = Base.Sourmilk,
}
Can someone help me with a car mod ? How I add custom parts to the car ? Like for exemple, in the mechanic menu there a new part uninstalled called roofrack and I want to install it
{
mechanicArea = Back,
area = Roofrack, /*Create new area or use already existing */
category = bodywork,
ItemType = Base.MetalPipe, /* Item for the car part slot */
durability = 5,
container
{
capacity = 100,
conditionAffectsCapacity = false,
test = Vehicles.ContainerAccess.TruckBed,
}
table install
{
items
{
1
{
tags = Screwdriver,
count = 1,
keep = true,
equip = primary,
}
}
time = 100,
professions = ,
skills = ,
traits = ,
recipes = ,
test = Vehicles.InstallTest.Default,
door = EngineDoor,
}
table uninstall
{
items
{
1
{
tags = Screwdriver,
count = 1,
keep = true,
equip = primary,
}
}
time = 100,
test = Vehicles.UninstallTest.Default,
}
}
}```
I haven't tried modding PZ in a while, does anyone have any documentation/guides on the game api
last i checked i wasn't able to find much
im talking guides on changing the game's code, not making custom weapons,clothing and vehicles
the mod migration guide for b42 multiplayer seemed to imply they were going to create more documentation for it
package index
anyone knows what script makes it so when a piece of furniture is next to a window, entities (by that i mean players and zombies) pass through it?
I'd guess something engine-internal.
is there anyway to access that
Thanks I figured out, one more thing, how I do the mask and what is the utility of the mask, his main purpose ?
Do I need to do the mask to get the light overlay working ?
I think it should be Contents
is it stable enough to make mods for it yet
or should i keep waiting
Always has been stable enough to mod
how to call a vanilla function?
for example smoke and it should auto handle:
- Reduce stress
- Play animation
- check if lighter is available
What's the best way to setup multiplayer for testing/working on mods? If using the "host" button on the main menu and running a second client as the client good enough, or do I need to actually set up a dedicated server to test properly?
Do you mean "how do I add a smoke option to the context menu for a custom item"?
no, just how to trigger the context options. bcoz the Use() does not trigger animations etc
is there any difference between host and dedicated for multiplayer?
i will try this...
smoking is a timed action. From memory, it's the "eat" action but when done to a cigarette you smoke it instead.
but seems very complicated to run a timed action for something simple
just click the action that has all the code behind
what type of multiplayer test do you want to do ?
hahahhahaha. the code is in ISEatFoodAction
And probably some bits in java too, and animation conditionals
ISInventoryPaneContextMenu is where it decides what goes in the context menu and which timed action gets started
hosted is enough
Just basic functionality testing at first - do my mods work in multiplayer or not?
Then for the ones with issues I'll want to fix them and retest.
So everything from "code that folds the survival rifle when you put it on your back" to "changing the light properties of car headlights" to "modify creation function for porn magazines"
Thanks, I'll give that a go today or tomorrow... I figure I should get things working in single player first but I'm steadily getting through the mod list.
interesting, if u need help to setup the steamcmd i can help
Can we still spawn vehicle in debug in the last update?
the context menu option isnt there for me. Maybe they moved it
it is available in main > vehicle spawn in SP and both there and directly in vechicle spawn in MP
MOD: SaltyMaskjava.lang.RuntimeException: expected argument of type ItemBodyLocation, got String
What changed about body location while I was gone ?
local bodyLocation = BodyLocation.new(group, "SaltyMask")```
Worked a few months ago
you cant use a string anymore you have to make registry for the name
https://github.com/SirDoggyJvla/Archive.Project-Zomboid-Modding/blob/main/TIS guides/B42 unstable MP/Migration Guide.pdf
you also cant insert bodylocations manually anymore you have to use the getorcreatelocation stuff
does anyone know where the recipe for firing clay objects is found, i assumed it would be in the recipes_pottery but i was not able to find it in there, nor can i find the recipes to make clay bowls/plates and such
nevermind i have found it
I feel like I shouldn't need to use reflection to access private fields just to add a new body location in a specific order, but the only other way I can see to do it is to completely wipe out all body locations and then recreate them one-by-one with mine getting placed in the correct place.
What changed about body location while I was gone ?
Approximately everything.
another question about recipes does anyone know where masonry recipes are stored
ive found them theyre buried in the blacksmithing recipes
For reference, here is how I added new BodyLocations at a specific place (in this case so they show up on top of underwear but under pants)
This was needed because BodyLocationGroup:getAllLocations() now returns a Collections.unmodifiableList instead of an ArrayList you can manipulate.
you don't have to anymore
i haven't updated the javadocs but 42.13.1 added a method to do this
What is the trick?
hahahaha
I couldn't see anything obvious in the java
(I would have expected a new method to be in BodyLocationGroup.java since that's where getOrCreateLocation() lives)
i haven't even gotten around to decompiling this build so i'm just repeating what i've heard
i don't rebuild anything for hotfixes, they don't usually have any significant api changes
"Fixed the order of clothing layers for mod creators" is in the patch notes. Zero details beyond that though.
they added a function to move them
it works ive been using it in my mod
pretty basic question but do mods still need a seperate lua script to make recipes work, im watching a tutorial from about 3 years ago and the structure for items/recipes is completely different so i wasnt sure if thats still needed
im making my first mod that is literally just two recipes no new items
You don't need a lua script for every recipe, but you can add a lua script(s) to do more complicated things.
they've never *needed* lua for basic recipes but the more complex things you want to do the more likely you'll need some
the new recipe system covers a lot of the basic cases much better than the old one did
You definitely want to look at the vanilla recipes in 42.13, since every tutorial older than a week is outdated now.
okay, if i have one recipe that needs to be done in the kiln and another that can be done without do i need to separate the files or can i have both in one text file
yes ive been referencing most of what im doing from the vanilla recipes and just cross referencing things
also if you guys know is there a base tag for all hammers
There is tag base:hammer
yes thank you i also just discovered the tags page in the wiki which also helps a lot
what ied coloring are you using because im using notepad++ and it would be nice is have some things colorized
ide
It seems like every item gets a tag, but then some items (like "hammer") get used as a "this is a type of <item>" tag
VS Code.
it just colors it in a basic text file?
I highly recommend getting a proper IDE; having your LUA typos picked up as you make them saves so much hassle.
The umbrella addon adds Zomboid specific stuff.
yea i use visual studio when im in unity but figured for this notepad would suffice but thank you ill look into that
Also, keep a second VSCode open to the media folder and you local decompiled Zomboid... makes it very easy to search for things.
notepad++ will work, but VS Code + Umbrella will work better.
is the AnySurfaceCraft tag for recipes that need a surface to craft
im guessing so but just want to make sure
so ive structured everything correct based on the example on the wiki, i have the mod loaded and the setup inside of zomboid looks good, icons, posters, desc, etc. However inside the game none of my recipes are listed could anyone help me out, do i need to do something to get the recipes to be loaded into the game besides have them in my media folder
this is the file itself
this is the code
im going to try putting it into a scripts folder based off of examples im looking at but if thats not the problem someone let me know
whatever ive done has made the game not load/launch if i have the mod enabled
script files go in the scripts folder, not media
for some odd reason when i put the script in scripts the game crashes on startup
good point
so does it have something to do with the code in the script
or is there a place i can find crash logs
C:\Users\user\Zomboid\console.txt
thank you ill report back if i figure it out
the only two instances of my mod inside the logs dont seem to be related to errors
aha
just post the whole console file
it has appeared to me that naming my script the same as the base recipe script in the game is not the best idea
thats for sure
yea it doesnt like your fluid line
it think it should be under the container its supposed to pull the fluid from
in vanilla i think pizza is using some kind of universal approach
-fluid 0.5 categories[Water] mode:mixture,
}```
yea i put the fluid line under the items and the game loaded
thank you
mod seems to be working, im going to need to go back through the code to figure out what the item for the salt lick is called as it wasnt found in the script but ill figure it out
thank you brodie
i was wrong i did it right the salt lick just does not have an inventory icon but i have succesfully made my first mod
Hell yea
Hello lua experts, when I define lua lcl.io_base = __classmetatables[IsoObject.class].__index lcl.io_addToWorld = lcl.io_base.addToWorld if I use ```lua
lcl.io_addToWorld(doorObject)--doorObject is of type IsoDoor, child class of IsoObject
My understanding is that it should call the method on IsoObject
Is there a way to separate version 42 Unstable code and 42.13.1 code within the same mod?
currently 42 unstable is 42.13.1
yes, but I am a bit concerned when unstable diverges from 42.13.1
Core has getGameVersion but I don't believe it has a method to easily get the patch number (unless I'm misremembering). Either way, you could get the GameVersion and parse the string to determine that
My procedure is more or less: the first time I make a mod B42+, I put everything in common and set the require in mod.info to current version. then when a new version requires change (lets say B42.99), I create a '42.99' folder with all files that diverge from common.
I don't believe the version folders take the patch number into account, from when I skimmed that code. I may be wrong though, since I didn't check it thoroughly
Not sure exactly what the behavior would be for multiple matches without looking, but my understanding was that it just looks for major.minor (ignoring anything after that in the folder name) & the same for major
(I say that because they mentioned 42.13.1 specifically)
I have been reusing 42.0 for each update, but searching through workshop/content, it seems like other mods are doing 42.<minor_version>
might be worth trying out once unstable diverges
No need for that
Yes see the Mod structure wiki page on the versioning folder
For the patch version? Pretty sure the version folder doesn't care about that, but like I said this is from memory of skimming the code
I'll have to double check when I'm home
Versioning applies to all version types
Major minor hotfix
I'll check when I'm home, that's not what I saw 🤷🏽
It looked like it just ignored stuff after the major.minor
I believe that was a recent discussion around here and the conclusion was it does check hotfix too
Maybe I'm missremembering too
I'd point you to the exact relevant method if I could remember that, but unfortunately my memory isn't specific enough lol—if you wanted to check though I imagine it'd be as easy as seeing where the version dir field is set on ChooseGameInfo.Mod
While seated in the car, panning the camera causes the player to stand up inside the vehicle. Any idea what causes this?
If you're trying to determine whether this is an issue caused by a mod that you're not developing, you're looking for #mod_support
This is my own vehicle mod.
In that case, more context is necessary
What minor version was the structure for recipes and items changed?
Hi, I'm new to modding on PZ and I have a problem.
The game crashes on startup and in console.txt, it says that the cause is my recipes.txt. I would like to know what I did wrong.
recipes.txt:
module NLK {
imports{
Base
}
craftRecipe RollSativaJoint_Debug
{
timedAction = Making,
time = 60,
Tags = InHandCraft,
category = ZazaMod,
inputs
{
item 1 nlk.SativaBud_Debug,
item 1 tags[base:rollingpaper],
}
outputs
{
item 1 nlk.SativaJoint_Debug,
}
}
}
Is your module NLK or nlk?
I can't check rn anyway
I took the thumbs up on your message from Tchernobill as their saying you're correct, but I'll still check later anyhow for my own sanity
why so many lol
Oh I didn't realize it wasn't yours lol
Spaghetti
NLK i tried with nlk and NLK but the problem is the same
I literally don't know which to use, at first I was just using isSolid and setSolidFloor, but now I look at my options and...
Iirc recipes that aren't base modules currently do not work
It's been reported
Check the decompile of the game to know which does what
So i can not create my own recipes?
You can make recipes, just not under anything but Base if I'm understanding correctly.
Shouldn't really change much though
Oh okay, so i need to wait the patch for creating without Base
Because i wanted to create custom recipes with custom items that i've made
You can still do that, just not under a different module
You could just make the recipes under base until they fix it lol
Oh okay i just have to rename my module by Base and it will works if i understand
It only checks the major & minor versions (and might have a logic error?)
Summary of logic used to determine mods' version folders (see getModVersionFile & getGameVersionIntFromName in ZomboidFileSystem). I've combined the logic of two methods to get the point across more easily (and because I am lazy). For each directory in the base mod directory:
- Set
gameVersiontomajor * 1000 + minor, wheremajorandminorare as defined inGameVersion(e.g.,42.13.1→42 * 1000 + 13→42013). SetmodVersionIntto42000. - If the mod folder does not contain the
.character, try converting it to an integer directly, set to0on failure to parse (major). SetfolderVersiontomajor * 1000and skip to step6. - Match the folder name against the regex
([0-9]+)\.([0-9]+)(.*). - If there's a match, convert the first match group (
major) and the second match group (minor) to integers (the third match group is ignored). Ifmajoris >=42andminoris in[0, 999], setfolderVersiontomajor * 1000 + minor. - If there's no match, set
folderVersiontonull. - If
folderVersionis greater or equal tomodVersionIntand less than or equal togameVersion, setversionFolderto the mod folder and setmodVersionInttofolderVersion. If there's another subdirectory to check, return to step2for the next subdirectory. - Return
versionFolder.
I say "might have a logic error" because this uses edit: this is handled, my mistakenewDirectoryStream to iterate the directories; DirectoryStreams do not have a single defined iteration order, so if there are multiple matches—like 42.13 and 42.13.1—the selection seems like undefined behavior (i.e., it'd just be whatever the last match is). Of course, it'd be consistent, so probably not a huge problem, but nonetheless odd. I could see this causing issues down the line if the ordering is ASCII-based. I'd expect it to check every folder & use the best match
(cc @mellow frigate)
Interesting
I'll add that to the mod structure page
Oh wait, actually it'll be the last match—just noticed I misread where a return is
Same potential logic error anyhow, but the other way, they handle the logic error upon a closer read, so only insight is that patch version is ignored. Updated the explanation to reflect that
Getting somewhere.
Updated it
I thought about it some more & it seems a logic error that's slightly different than what I thought does exist, but that message is a contender for my most edited message
So, in brief: curious, given that logic, how it selects multiple matches (like 42.13 and 42.13.1) & my gut says ASCII ordering of whichever is seen last
Instant death if someone reads HottieZ
lol