#mod_development

1 messages · Page 360 of 1

winter bolt
#

but sendclientcommand doesnt work on the tick that those events are called so you have to delay it by another tick 💀

small topaz
#

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)

winter bolt
#

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

silent zealot
#

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.

small topaz
#

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?

winter bolt
small topaz
winter bolt
#

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

small topaz
#

is item then the player? or the "clothing" item we equip to the player?

winter bolt
#

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

small topaz
#

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?

winter bolt
#

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

small topaz
#

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.

small topaz
#

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!

unkempt rapids
#

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

frozen venture
haughty bridge
#

I am working on a event/signal library and should I attatch PillAction to Item_Consumed

#

or should it contain its own event

bright fog
#

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

haughty bridge
#

I couldnt think of anything else

bright fog
#

Got to find something hehe

haughty bridge
unkempt rapids
haughty bridge
# bright fog Got to find something hehe
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

haughty bridge
#

there is a few other things

#

like using threading to prevent yielding

#

and being able to pause events

#

or destroy them entirely

bright fog
#

.Add is still possible ?

haughty bridge
#

and as I said extends some ISBaseTimedAction

#

oh yeah

bright fog
haughty bridge
#

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()
civic galleon
#

I cannot open my own mods change notes and have seen others report this. Something on Valve's end imo

silent zealot
#

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.

civic galleon
#

I feel that 100%, I've had to unlist my mod. Several people have reached out to help but ultimately I just need time.

silent zealot
#

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.

civic galleon
#

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

silent zealot
#

Too tired to sleep with friends? 😛

civic galleon
#

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

willow tulip
#

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)

bright fog
# haughty bridge and since you can also create signals as well it also means you can create inter...

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

bright fog
#

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

raven epoch
#

sim help

#

actually uhh

#

nvm

#

ok in set mod data

#

i give it a table?

bright fog
#

Mod data IS a table itself

raven epoch
#

ah

#

how do i set it tho

#

brain kinda dead sorry about that

#

just need to set a boolean for an object

bright fog
#

You don't set mod data

#

You just store stuff in it

small osprey
raven epoch
#

so i cannot set it per object?

bright fog
raven epoch
#

back to global tables it is

bright fog
#

You're talking before even reading

raven epoch
#

mb

#

this mod melted me brain a bit

bright fog
raven epoch
#

is a cansee check more costly or a distance check

#

or neglible diff

bright fog
#

Test it

small osprey
raven epoch
bright fog
#

@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

haughty bridge
#

With someone different syntax

raven epoch
bright fog
#

It's fairly new, not getting a lot of love for now but will get some more with plans to move it sphinx

bright fog
raven epoch
#

still cant get isoplayer to run

small osprey
#

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?

raven epoch
#

iswalkto seems to disable running

bright fog
#

It lists functions and classes

haughty bridge
bright fog
#

Tables etc

bright fog
haughty bridge
#

I doubt that part would be used at all

#

It’s mostly gonna be for easier events

bright fog
#

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

bright fog
#

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

raven epoch
#

despite all of this i cant get the isoplayer to run

#

at most it seems to run for a second before reverting to walking

silent zealot
#

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?

small osprey
# silent zealot How do items get tags? for example `base.blowtorch` has the BLOW_TORCH tag, an...

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.

silent zealot
#

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.

small osprey
#

Tags now require the ItemTag registry.

silent zealot
#

All the vanilla tags are in java.

#

actually that's probably a screenshot of the wrong thing, but you get the idea.

small osprey
#

Ah I get what you are saying. Well maybe there is a way to read them from the registry?

silent zealot
#

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

abstract summit
#

can someone make more traits mod for b42 mp

bright fog
abstract summit
#

if i could i would

bright fog
abstract summit
placid zealot
#

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

bright fog
#

The game allows you to automatically rescale textures in-game when using in UI elements

placid zealot
#

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?

frank elbow
trim yacht
#

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?

bright fog
tired glen
#

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

mellow frigate
trim yacht
grizzled fable
#

is anyone able to load mods on workshop? i get error 2

mellow frigate
placid zealot
#

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.

civic galleon
#

I bet on accidental ddos or similar whoopsie causing the "Too Many Requests"

icy night
#

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

thin swan
pulsar pecan
#

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

grizzled fable
#

what is this?

small topaz
# pulsar pecan Hello guys, I’m new in creating own mods especially in Pz. Is there any good tut...

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.

GitHub

Guide to modding various aspects of Project Zomboid - FWolfe/Zomboid-Modding-Guide

GitHub

Guide to modding various aspects of Project Zomboid - FWolfe/Zomboid-Modding-Guide

pulsar pecan
bronze yoke
#

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)

bright fog
wet sandal
#

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

bronze yoke
#

did you read the migration guide? complete is only called on the server

wet sandal
#

I did not

wet sandal
#

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.

bronze yoke
#

yeah it doesn't, completely separate environment

placid zealot
#

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.

bronze yoke
#

common makes the most sense for assets

placid zealot
#

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.

bronze yoke
#

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

tulip valve
#
    if player:HasTrait(CharacterTrait.Desensitized) then
       player:getStats():reset(CharacterStat.STRESS)
    end
end
Events.OnTick.Add(NoStress.Tick)```

Why does this not work?
bronze yoke
#

hasTrait

bright fog
#

This should catch a lot of these projects with proper usage

tulip valve
#

No idea what that is

tulip valve
tulip valve
#

Im not seeing the difference lol

bright fog
#

Wdym ? You didn't install it yet did you ?

tulip valve
#

no

bright fog
#

Anytime a function is unknown it tells you

tulip valve
#

I see

bright fog
#

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

opaque hornet
#

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

bright fog
#

PZ is Linux compatible natively

#

Verify your mod has the project structure

#

Notably not a missing common folder drunk

opaque hornet
#

It is missing common, is that required?

bright fog
#

Yes

#

Common mistake

#

pun non intended

opaque hornet
#

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

bright fog
#

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

opaque hornet
#

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?

opaque hornet
bright fog
#

The versioning and common folders are mandatory

#

If you haven't yet, I suggest reading the Mod structure wiki page

opaque hornet
#

And TY!

tulip valve
#

Devs trolling lol

opaque hornet
#

litterally!

bright fog
bright fog
opaque hornet
#

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

bright fog
#

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

opaque hornet
#

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

bright fog
#

You can add a .gitkeep file in that folder I believe

#

Should do the trick

opaque hornet
#

Ok will do. I was just going to plonk some unused png or something 🙂

bright fog
#

Yea just use an empty text file at the very least with a very obvious name to understand that that file does nothing

opaque hornet
#

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?

#
opaque hornet
#

Thanks

haughty bridge
#

Just in that I am using them to prevent having to wait a long time on your event to run

bright fog
bronze yoke
#

@bright fog could you unpin the two pins in here about body locations? they're pre-registries and don't work anymore

bright fog
#

These ones I assume ?

bronze yoke
#

yeah

bright fog
#

Done

bronze yoke
#

thanks 👍

tired glen
#

does the wave defense gamemode work in mp? all the lua is in the client folder

shy mantle
#

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

bright fog
#

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

shy mantle
#

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.

bronze yoke
#

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

shy mantle
#

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

dawn lynx
#

Did I miss something? not sure why I can't upload, I've uploaded before...

bronze yoke
#

you can't upload Build41NoWeight in b42 because it doesn't have a mod.info in the build 42 location

bright fog
#

If I had to guess, it's that B41 mod the problem

bronze yoke
#

just put both versions in the same mod, they don't overlap

bright fog
#

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

bright fog
bronze yoke
#

it could actually cause a lot of issues since b41 will see it

bright fog
#

Indeed

bronze yoke
#

if they have the same mod id then you'll trigger the mod pack issue

bright fog
#

Both mix when they have the same IDs no ? So technically there wouldn't be any overrides no ?

bronze yoke
#

no only one is used

#

and it is not deterministic which one

bright fog
#

oof

bronze yoke
#

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

topaz tangle
#

need ideas for which of the new profession vehicles to do for my 89 econoline

placid zealot
#

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

bright fog
#

Just the location of the media folder changed for mods

placid zealot
#

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.

bronze yoke
#

only very specific things like that have changed

#

i don't think there's any documentation of that on the wiki

bright fog
#

Nah there isn't

#

The wiki doesn't cover B41 stuff

bright fog
#

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 😅

young trellis
#
{
    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?
bronze yoke
#

media/ui/traits/Trait_lactose.png

#

the icon cannot be specified in the script

pliant minnow
#

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 😄

young trellis
bronze yoke
#

nowhere, it has to be that exact filename

#

it's based on the name (but not namespace) of the CharacterTrait

willow tulip
#

@bronze yoke ❤️ that request idea.

#

Vanilla code is gonna be so much better at resource location then mods all trying to do it themselves

young trellis
shy mantle
#

What's the best way to test a mod in mp that my computer can handle lol

dawn lynx
dawn lynx
bronze yoke
#

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

dawn lynx
#

okay I'll give it a shot, ty

#

that worked - thank you!

sage kindle
#

does anyone know why my model is not showing up

sonic gazelle
#

might be something to do with the 9889 errors

bronze yoke
#

probably related to the 9889 errors

haughty bridge
#

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

bronze yoke
#

coroutines run when you directly run them and block the thread until they yield

#

there isn't really anything beyond that

haughty bridge
#

Hm

#

That is really unfortunate

#

Well thanks for telling me

#

I didn’t know their threads worked different

#

Well not threads but

bronze yoke
#

yeah, the point of coroutines is literally just the convenience of being able to yield and resume, they don't do anything else

haughty bridge
#

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?

bronze yoke
#

there's no concurrency whatsoever

haughty bridge
#

thats really lame

sage kindle
# sage kindle

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

soft jetty
#

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.

sage kindle
#

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

indigo hound
#

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

trim yacht
#

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);
raven epoch
#

is there an inbuilt way to get roads like vehicle stories

#

or do u ahve to do it manuıally

raven epoch
#

nooooo

#

ok

#

is there an inbuilt way to black out the scren

#

like fade in fade out

main pasture
raven epoch
#

how

main pasture
#

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

raven epoch
#

oh thank you

main pasture
#

Just make sure you don't fade out without fading back in, because you can't use UI for exiting while faded out

raven epoch
#

test

#

why cant i send vid

winter bolt
fast otter
#

How do i know what folder my .lua files should go into? Thinking abot the Lua/Client or the Lua/Server folder path.

raven epoch
#

me when i run into recursive requiring (mod is cooked)

raven epoch
#

how does one teleport a player far away

#

tried set position but doesnt seem to work

bright fog
#

I believe you need to set lastX or some shit like that too

#

I suggest checking out the RV interior mods

raven epoch
#

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

nimble badger
raven epoch
#

finally

bright fog
#

That's pretty cool

raven epoch
#

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

bright fog
#

Also you're still not using Umbrella ????

raven epoch
#

didnt see need for umbrella

raven epoch
#

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

bright fog
#

But you should define your cutscene handler in a different file

raven epoch
#

it is

bright fog
#

Not really

raven epoch
#

its that a NPC calls the

#

cutscene

#

but the cutscene

#

needs the npc module

#

to spawn the npcs

bright fog
#

I see the problem

raven epoch
#

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

bright fog
#

Imo you should have a main class that includes every systems

raven epoch
#

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

small osprey
# raven epoch or do u ahve to do it manuıally

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
#

ooh thank you

#

lemme check it up rn

bright fog
#

@raven epoch have you setup Umbrella ?

raven epoch
#

nope

#

it helps autocomplete?

bright fog
#

Yes, it helps with everything

#

It also helps finding problems before testing stuff

raven epoch
#

o ty

#

might install it

bright fog
#

With such a huge project it's not "might" it's "must"

raven epoch
#

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

small osprey
#

which mod are you working on? 🙂 is it published?

raven epoch
#

nope

bright fog
#

A NPC mod

raven epoch
#

just a mod adding npcs

#

mostly military

small osprey
#

"just" 😅

#

cool!

raven epoch
#

ty they kinda dumb rn tho

#

checking ur

#

scene editor rn

small osprey
#

Fair warning, it is not used by any published mod - so real world testing is, well, zero.

raven epoch
#

its fine

#

ooh

#

this reminds me of my

#

auto fortify function

#

(it was not good)

#

but this is good

dull moss
#

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

bright fog
#

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

bronze yoke
#

they aren't named the same things

bright fog
#

That too

dull moss
raven epoch
#

nope still recursive

#

fixed by using a different script to hold tables

#

😔

raven epoch
#

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

small osprey
raven epoch
#

oh property check

#

ok

placid zealot
#

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?

bronze yoke
#

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

bright fog
#

No one uses older B41 versions

willow tulip
#

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

raven epoch
#

huh thats interesting

willow tulip
#

B can even then add its own functions to the table A might have returned.

raven epoch
#

im pretty much running on roblox studio logic here so thats why

willow tulip
#

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

willow tulip
bronze yoke
#

the problem is you usually want to require during the initial run of the file

willow tulip
#

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.

bronze yoke
#

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

willow tulip
#

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)

raven epoch
#

what should ia dd

civic galleon
#

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

bright fog
#

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

civic galleon
#

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

civic galleon
#

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

bright fog
civic galleon
#

I must be 😅

bright fog
#

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 ?

bright fog
#

I'll look for the proper syncing for stats

civic galleon
#

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 set method, this is how it runs "server side"
#

is this correct?

bright fog
#

You shouldn't set anything client side, most of the logic should be done server side these days

civic galleon
#

ah ok so basically move what im doing to a function that will fire on the correct "clientCommand"?

bright fog
#

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

bronze yoke
#

no

#

i don't really know why there's three functions for syncing stats but i've used sendPlayerStat(player, stat) with success

bright fog
#

Wasn't there a list of every syncing functions somewhere ?

bronze yoke
#

the migration guide had a list of some syncing functions

#

but far from all

bright fog
#

Yea that's why I didn't find that function

civic galleon
bronze yoke
#

it'd be in the document describing inventory items

#

but again, i don't think these ones were even listed

civic galleon
#

Ahh ok that makes sense why I didn't look there

#

Hmmm.

wet sandal
#

Inventory Tetris is a garbage mod

#

Look at this GC!

#

GasGasGas.mp3

#

💀

bright fog
#

jeez

wet sandal
#

Mistakes clearly made

#

Not entirely sure where, but I'll find them

#

The FPS drop isn't normal

#

I already sorted that bit

civic galleon
#

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?

bright fog
#

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

civic galleon
#

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.

quasi kernel
#

If you're using host, to check server output you can check coop-console

quasi kernel
#

Ah.

civic galleon
#

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

haughty bridge
#

are you using AI ded

civic galleon
haughty bridge
#

Liar

#

The color is identical

#

Except backdrop

#

But PC looks like that color

civic galleon
#

lmfao

#

go look at this page

wet sandal
#

Can we not AI witch hunt?

haughty bridge
#

God damn it

#

I stand corrected

#

My bad gang

civic galleon
#

off syntax color theme jesus

haughty bridge
#

It looks a lot like AI

bronze yoke
haughty bridge
bronze yoke
#

if it's in the client folder, it is only loaded by the client

#

the server folder does not have any similar behaviour

haughty bridge
#

@civic galleon my bad gang 😭

The comments and style seemed like some chat gpt would write 😭

winter bolt
#

because its example code 💀

small osprey
# wet sandal

Uh! That diagnostic window is that inbuild in Zomboid?

wet sandal
#

I can't remember the last time I played zomboid without -debug drunk

small osprey
#

that works like a charm. What is LPS and UPS?

UI is the UI-framerate I guess?

bright fog
bright fog
bright fog
bright fog
#

The CLIENT SIDE thing is for actual client side
While the SERVER SIDE is for actual server side

haughty bridge
bright fog
#

And I'm not sure I've ever seen AI prompts have full caps comments like that

bright fog
#

Did you miss that ?

bronze yoke
#

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

knotty saffron
#

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 ´" ( ' ~´

bright fog
#

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

noble shell
#

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!

bright fog
#

The Java files from previous paths can technically still be loaded

#

@willow tulip probably knows better than me the details tho

noble shell
#

so classes in ROOT/zombie will still be loaded and overwrite the ones in projectzomboid.jar?

bright fog
#

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

noble shell
#

thank you!

willow tulip
#

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

bronze yoke
#

branch changes might be stricter

willow tulip
#

so it might be due to the fact that previous versions exist with those files, that it will now always be deleting them

bronze yoke
#

really? i don't get how that works

#

maybe because the main branch still has those files

willow tulip
#

IMO, this feels like a good move: Zomboid updates will automatically remove java mods to keep em from bricking the new version

willow tulip
bronze yoke
#

agree, just surprised it does that based on how steam usually behaves

noble shell
willow tulip
noble shell
#

I can potentially see it being annoying for users tho, but oh well spiffo

silent zealot
hasty oxide
wet sandal
#

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.

silent zealot
#

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

bronze yoke
#

CharacterTrait.register returns it

silent zealot
#

Ah, so you need to capture it to a global when you register it in you registries.lua file?

bronze yoke
#

yeah

silent zealot
#

Thanks, annoying but I can work with that.

#

player:SetOnFire() no longer works. 😭

willow tulip
silent zealot
#

hahaha

#

I think this is where I need to learn how to manage client/server stuff.

willow tulip
#

Yea likely.

silent zealot
#

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

compact pendant
#

Could someone who's dabbled in VHS modding get back to me? I got a couple questions

silent zealot
#

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.

silent zealot
#

But! I also made my first client -> server mod thingy with sendClientCommand and Events.OnClientCommand, so that's good.

wet sandal
#

I look forward to being on fire

calm depot
#

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

calm depot
#

thanks.

Am I imagining it or was the Java bytecode previously in folders rather than a JAR

civic galleon
civic galleon
bright fog
#

I see

bright fog
broken briar
#

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

near wind
#

Anybody working on maps? For the new updates

near wind
broken briar
#

and sound more realer

raven epoch
#

is the only way to move something manually setting position every tick?

raven epoch
#

ok i figured it out

#

kinda

knotty stone
raven epoch
#

LOL

#

what did u use to apply physic push

knotty stone
#

dont rly remember, sry. was messing around with tile coords, and it was a mess lol

raven epoch
#

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

main pasture
#

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

raven epoch
#

ye but problem is

#

cars have

#

physics

#

imagine collision

knotty stone
#

you going to build automatic driving cars or what? ^^

raven epoch
#

ye we going to get teslas in zomboid

#

jk its for npcs driving

main pasture
#

I see. Physics that way are unrealible, but still work sometimes

raven epoch
#

im going to see if i can fake input with isoplayer

knotty stone
#

i remember someone trying something months ago and it looked decent

mellow frigate
#

Did you get clues on how to analyse this ? I get the same thing when spawning modded vehicles with exotic containers in MP.

main pasture
#

Do any of the npc mods implement npcs driving cars?

knotty stone
#

week one does right?

raven epoch
#

week one does?

#

idk im asking

#

i never saw

main pasture
#

What are you using for your npcs btw?

raven epoch
#

military faction

#

did u see

#

gimme a sec

main pasture
#

I mean some framework or custom implementation of npcs?

raven epoch
#

oh

#

im just using isoplayer

#

so just zomboid modding

main pasture
#

Ok

raven epoch
#

no idea how it will go tho

#

isoplayer might goof up

#

since its meant for player

knotty stone
# raven epoch week one does?

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

▶ Play video
raven epoch
#

aa ur right

#

wonder how he did it

shy minnow
#

Can someone help me with the vehicle shadow texture ? Like the image in the mechanic menu, how I add it ?

neat walrus
#

are body locations exclusivity transitive?

tranquil kindle
#

What does that even mean?

neat walrus
#

location 1 is exclusive with location 2 and
location 2 is exclusive with location 3 therefore
location 1 is exclusive with location 3

bronze yoke
#

no

neat walrus
#

ty

grizzled fable
#

Does anyone have any information on how to define forageable items in version 42.13? ty

knotty stone
noble shell
#

So you might wanna use something else, if you dont need to control the character

wraith flame
#

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

pearl prism
#

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.

mellow frigate
pearl prism
#

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.

mellow frigate
#

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

pearl prism
pearl prism
mellow frigate
#

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 ?

pearl prism
#

Wait, I'll take a look through my files to see if I can find anything useful for you.

mellow frigate
pearl prism
#

Nice, so it was a error inconfiguration of the item after all.

mellow frigate
small iron
mellow frigate
# small iron can someone help?

help request + log without comment, I suppose you are looking for mod_support channel (if modded) or pz_techsupport (if vanilla).

noble gazelle
#

hi! where can i find the male and female playermodel textures for blender? i want to make some cloathing mods

knotty stone
# small iron can someone help?

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

silent zealot
#

I think that has links to the models and helpful templates/info

bronze yoke
#

@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

primal schooner
pastel wolf
#

tiiiime to figure out how the hell I can update my mod to 42.13

vivid zinc
#

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

bronze yoke
#

yes

vivid zinc
#

Sweet, ty!

silent zealot
#

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.

willow tulip
willow tulip
knotty stone
#

😂

silent zealot
vivid zinc
#

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

silent zealot
#

Some bugs will get fixed, some will exist forever.

vivid zinc
#

fair lol

vivid zinc
#

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?

silent zealot
#

Magazines no longer increase in weight when you put bullets in, so I guess I should remodel this for the 97 round magazine.

vivid zinc
#

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

civic galleon
#

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}, )

bright fog
willow tulip
#

People who keep installing carcontroller.java mods into the server. shrugs

vivid zinc
#

Thank you both!

civic galleon
bright fog
#

The online ID won't change during play

#

It'd be a bit catastrophic lol

civic galleon
#

Awesome and thank you!

silent zealot
sonic needle
#

just havent released mine xD

silent zealot
#

Sorry, I can't hear you over the really loud ringing noise in my ears from test firing this thing.

sonic needle
#

Anyone got a working B42.13 clothing using a custom bodylocation yet?

tranquil kindle
sonic needle
#

so yeah im stumped.

tranquil kindle
#

It kinda feels like an unnecessary addition in my (not much worth) opinion

#

The registries

sonic needle
#

100% yep. i can understand why? but nothing but maybe ammo or item keys work atm. from testing

frank elbow
#

Stuff not working/not being as moddable in unstable is fine by me, as long as it's fixed by stable

tranquil kindle
#

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.

sonic needle
#

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.

tranquil kindle
#

Don't register them as "Base"

sonic needle
#

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

tranquil kindle
#

Do you still have body location in shared>NPC?

#

It is also required

#

Bit different but still needed

sonic needle
#

you are joking

tranquil kindle
#

No

sonic needle
#

Ugh.

tranquil kindle
#

You need both

#

But now it's bit different so check it out

sonic needle
#

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.

vivid zinc
#

is it possible to remove ContextMenuConfig from a vanilla entity using lua? seems i can't just override the entity in script

vivid zinc
#

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

vivid zinc
bright fog
vivid zinc
#

i want that specific "Get Compost" option to be gone, yeah

bright fog
#

Then hook to that Lua function to stop the option from being added

vivid zinc
#

that function doesn't add it, i'll keep looking around tho, ty

bright fog
#

So you can find that option and remove it

vivid zinc
#

ah i see, will try that, thanks again! edit: worked 💪

vivid zinc
#

even better than straight up removing now, player hint for bug workaround 😄

unique harbor
#

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)

earnest mulch
#

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,
    }
shy minnow
#

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

knotty stone
# shy minnow Can someone help me with a car mod ? How I add custom parts to the car ? Like fo...
        {
            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,
            }
        }    
        }```
compact warren
#

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

compact warren
#

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?

small osprey
compact warren
#

is there anyway to access that

shy minnow
#

Do I need to do the mask to get the light overlay working ?

compact warren
lusty kindle
#

I think it should be Contents

fathom forum
#

is it stable enough to make mods for it yet
or should i keep waiting

bright fog
worthy wharf
#

how to call a vanilla function?
for example smoke and it should auto handle:

  • Reduce stress
  • Play animation
  • check if lighter is available
silent zealot
#

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?

silent zealot
worthy wharf
#

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

silent zealot
worthy wharf
#

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 ?

silent zealot
#

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

silent zealot
# worthy wharf what type of multiplayer test do you want to do ?

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"

silent zealot
# bronze yoke hosted is enough

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.

worthy wharf
#

interesting, if u need help to setup the steamcmd i can help

icy night
#

Can we still spawn vehicle in debug in the last update?

#

the context menu option isnt there for me. Maybe they moved it

mellow frigate
vast pier
#

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
winter bolt
#

you also cant insert bodylocations manually anymore you have to use the getorcreatelocation stuff

scenic tusk
#

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

scenic tusk
#

nevermind i have found it

silent zealot
#

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.

silent zealot
scenic tusk
#

another question about recipes does anyone know where masonry recipes are stored

#

ive found them theyre buried in the blacksmithing recipes

silent zealot
#

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.

silent zealot
#

lol

#

after all my effort making that work lol

bronze yoke
#

i haven't updated the javadocs but 42.13.1 added a method to do this

silent zealot
#

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)

bronze yoke
#

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

silent zealot
#

"Fixed the order of clothing layers for mod creators" is in the patch notes. Zero details beyond that though.

winter bolt
winter bolt
#

it works ive been using it in my mod

scenic tusk
#

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

silent zealot
#

You don't need a lua script for every recipe, but you can add a lua script(s) to do more complicated things.

bronze yoke
#

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

silent zealot
#

You definitely want to look at the vanilla recipes in 42.13, since every tutorial older than a week is outdated now.

scenic tusk
#

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

scenic tusk
#

also if you guys know is there a base tag for all hammers

silent zealot
#

There is tag base:hammer

scenic tusk
#

yes thank you i also just discovered the tags page in the wiki which also helps a lot

silent zealot
scenic tusk
#

what ied coloring are you using because im using notepad++ and it would be nice is have some things colorized

#

ide

silent zealot
#

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.

scenic tusk
#

it just colors it in a basic text file?

silent zealot
#

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.

scenic tusk
#

yea i use visual studio when im in unity but figured for this notepad would suffice but thank you ill look into that

silent zealot
#

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.

scenic tusk
#

is the AnySurfaceCraft tag for recipes that need a surface to craft

#

im guessing so but just want to make sure

scenic tusk
#

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

knotty stone
#

script files go in the scripts folder, not media

scenic tusk
#

for some odd reason when i put the script in scripts the game crashes on startup

knotty stone
#

thats good

#

then you know its loading it 😉

scenic tusk
#

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

knotty stone
#

C:\Users\user\Zomboid\console.txt

scenic tusk
#

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

knotty stone
#

just post the whole console file

scenic tusk
#

it has appeared to me that naming my script the same as the base recipe script in the game is not the best idea

knotty stone
#

thats for sure

scenic tusk
#

oh spoke to soon its still crashing

#

ill post the console file one moment

knotty stone
#

yea it doesnt like your fluid line

scenic tusk
#

is it because its at the top of is it a spelling error

#

what line does it read it in

knotty stone
#

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,
        }```
scenic tusk
#

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

scenic tusk
#

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

silent zealot
#

A mod that lets you lick salt?

#

With lemon and tequila?

bright fog
#

Hell yea

mellow frigate
#

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

frank elbow
noble shell
#

Is there a way to separate version 42 Unstable code and 42.13.1 code within the same mod?

mellow frigate
noble shell
#

yes, but I am a bit concerned when unstable diverges from 42.13.1

frank elbow
#

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

mellow frigate
frank elbow
#

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)

noble shell
#

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

frank elbow
# bright fog No need for that

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

bright fog
#

Major minor hotfix

frank elbow
#

I'll check when I'm home, that's not what I saw 🤷🏽

#

It looked like it just ignored stuff after the major.minor

bright fog
#

Maybe I'm missremembering too

frank elbow
#

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

magic nexus
#

While seated in the car, panning the camera causes the player to stand up inside the vehicle. Any idea what causes this?

frank elbow
magic nexus
#

This is my own vehicle mod.

frank elbow
#

In that case, more context is necessary

magic nexus
scenic tusk
#

What minor version was the structure for recipes and items changed?

dark salmon
#

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,      
        }
    }
}
fleet bridge
#

Is your module NLK or nlk?

frank elbow
shy mantle
#

drunk why so many lol

bright fog
bright fog
dark salmon
shy mantle
#

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

fleet bridge
#

It's been reported

bright fog
dark salmon
quasi kernel
#

Shouldn't really change much though

dark salmon
#

Because i wanted to create custom recipes with custom items that i've made

quasi kernel
#

You can still do that, just not under a different module

#

You could just make the recipes under base until they fix it lol

dark salmon
#

Oh okay i just have to rename my module by Base and it will works if i understand

frank elbow
#

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:

  1. Set gameVersion to major * 1000 + minor, where major and minor are as defined in GameVersion (e.g., 42.13.142 * 1000 + 1342013). Set modVersionInt to 42000.
  2. If the mod folder does not contain the . character, try converting it to an integer directly, set to 0 on failure to parse (major). Set folderVersion to major * 1000 and skip to step 6.
  3. Match the folder name against the regex ([0-9]+)\.([0-9]+)(.*).
  4. 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). If major is >= 42 and minor is in [0, 999], set folderVersion to major * 1000 + minor.
  5. If there's no match, set folderVersion to null.
  6. If folderVersion is greater or equal to modVersionInt and less than or equal togameVersion, set versionFolder to the mod folder and set modVersionInt to folderVersion. If there's another subdirectory to check, return to step 2 for the next subdirectory.
  7. Return versionFolder.

I say "might have a logic error" because this uses newDirectoryStream 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 edit: this is handled, my mistake

#

(cc @mellow frigate)

bright fog
#

Interesting

bright fog
#

I'll add that to the mod structure page

frank elbow
#

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

sour wave
frank elbow
#

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

raven epoch
#

bored

#

add what to mod

frank elbow
#

Instant death if someone reads HottieZ

raven epoch
#

lol