#mod_development

1 messages Β· Page 369 of 1

tough oxide
#

oh damn - they really updated kahlua

tough oxide
#

oh.. interesting

bronze yoke
#

you won't really be able to do anything with that for pz

#

if you have some code that is 100% pure lua then you can test it with a regular lua interpreter but that's pretty much the limit

tough oxide
#

booo

willow tulip
#

Just learn to use print()

#

.. and to remove it before you release your mod

bronze yoke
#

just use the in-game debugger πŸ˜…

small topaz
#

When in mp on client-side, what is a safe way to check whether items with item type "MyModule.MyItem" exists? (so like check whether "Base.Pants" exists)

paper ibex
#

kahlua calling java method, not translated to java

willow tulip
#

or release 2nd version of mod πŸ˜›

#

or sandbox option for more debug output

paper ibex
# willow tulip debug on host with yourself (generally works)

This works, but only partially; it depends on your development environment (Windows, Unix), player simulation, etc., so it requires more work on your end and might cause overload.

My local setup:

  1. Nonsteam env, -debug, game load mods from ZomboidClient1/mods/ folder . both server and client run with cli (ingame Host mode is like run server via UI but not effience startup time)
  2. Steam env, -debug, game load mods from ZomboidClient2/Workshop/ . this is before publish the Workshop
  3. Steam env, game load mods from Steam/Workshop/ . this is after publish the Workshop . also need control the -cachedir
paper ibex
willow tulip
#

2/3, from what I can tell, if you don't give it a 'steam workshop id' to the server settings, it will use your local mod. (or fail to load the mod if you don't have a local version)

willow tulip
paper ibex
willow tulip
paper ibex
willow tulip
#

yea I honestly don't even know the full load-order I just try to desubscribe to my mod when I don't wanna use the official version lol

willow tulip
#

I THINK your own version in workshop folder comes first? though im 99% sure if your playing on a server with it added to the steam workshop list, it asks you to subscribe and use that one.

paper ibex
willow tulip
#

but iv also got checksum off so dunno

paper ibex
#

checksum off because admin role bypass checksum, or server turn it off

willow tulip
#

I turn it off cause I heard it doesn't work in B42.13.x properly yet

#

and im sooooo tired of having checksum errors with my OWN SERVER looking at you B41

#

It SHOULD be impossible to have a checksum error... when you click 'host'.. and are the host...

#

But zomboid somehow manages it.

paper ibex
#

ah yes, when you use host mode, you are not login with admin acc

willow tulip
#

But that is still better then barotrauma, that as the host, you can lag worst then playing counterstrike via dialup from russia.

paper ibex
willow tulip
#

bonus points: if you download from server the mod instead of subscribe in barotrauma.. your download goes at < 3kbit/s

willow tulip
#

I used to in B41 because host was... worse for some reason

#

but damned if that cache dir wasn't the worst thing ever in B41

#

just... use... the steam workshop folder seriously developers -_-;

#

No other game copies the entire workshop folder for the server -_-

#

(or if they do, they do a lot better job at keeping it synced)

paper ibex
#

haha. no idea

paper ibex
willow tulip
#

yea,, iv just been using host but then I assumed my friend would stop playing in a couple days and id abandon the save before I cared enough to make a dedicated server setup.

#

got to day 15 ingame before that happened so.. yay?

willow tulip
#

Coding jumpscare:

frank elbow
# willow tulip

β€œWhat if we made LISP, but bad” is my immediate opinion of this (if you wrote it, apologies, but why is this in a python file)

merry osprey
#

anyone know of a mod that lets radios be plugged in rather than burn through batteries?

I saw there's a couple but not updated.

merry osprey
tough oxide
#

good shout

#

if im downloading lua for my system just to run parts of my lua that's vanilla (not dependent on game files) - should i worry about the "patch" version? or just any 5.1 is fine?

tough oxide
#

or should i even care and just get something installed so i can quickly run stuff locally?

frank elbow
tough oxide
#

yeah, thats what i settled with 5.1.5 - i dont see myself using lua much outside of this

#

worse case i install multiple versions and change my launch.json as needed

#

i got it running - i just wanted to experiment with some of the language features to see what kind of nuttiness i could get up to

frank elbow
#

I've done some unit testing of game code by mocking it to hell and back & I've found that Lua 5.2 is actually easier to mock because it doesn't have some limitations that 5.1 has which Kahlua does not

#

But if it's just for the sake of using Lua then 5.1 is perfectly fine

tough oxide
#

interesting - i considered doing that myself

#

but it seems like a very deep rabbit hole

frank elbow
#

It is πŸ˜… planning on generating mocks from the same data used from umbrella at some point, but for now it's all manual and not that great

tough oxide
#

probably not bad if you start small - like with what im using

#

im currently hellbent on making it more OOP-like in a way that i like

#

seems like there are language features that can get you close

frank elbow
frank elbow
tough oxide
#

yeah, ive been looking through the base classes and i dont really need them for some of what im trying to do, so i was trying to setup on my own

#

for some flexible slightly more than just "value" objects

#

yeah, i need to get my head full wrapped around the metatables so being able to quickly run code and see the precendence will help

willow tulip
#

also, I don't use notepad++

merry osprey
#

you didnt post that?

merry osprey
#

love it

small topaz
#

Is there an event which is only called when player loads a game with an existing character but NOT when player enters a game with a new character? OnLoad and OnGameStart do not work since they are both called when player enters game with a new character.

willow tulip
# merry osprey

Yes, but its a screenshot from someone elses discord that I screamed in terror the entire time they scrolled the file

merry osprey
#

ooh ok haha

tough oxide
#

Triggered every time a local player loads into the world.

#

then there's OnNewGame - Triggered whenever a local player character is created for the first time. which is obviously not it

#

but might be helpful?

#

also, they all specify local so..

small topaz
#

I really need to distinguish the situation when they start with a new character or when they continue a game with an existing character.

#

OnNewGame is only called when they start with a new character (in an existing world or a new world). So that's good. But I am missing a reliable way to check whether they continue with an existing character, so when they load a save with an old character.

#

I already tried to just add a local variable NEW_CHARACTER and set it true whenever the OnNewGame event is triggered. Problem is, that I am not sure how reliable this is. So I use smth like this:

local function onNewGame(player)
  NEW_CHARACTER = true
end
Events.OnNewGame(onNewGame)

local function onLoad(player)
  if not NEW_CHARACTER then
    -- do something
  end
end
Events.OnLoad.Add(onLoad)```

This seems to work but I do not understand why it works when I enable the mod in the main menu cause in this case, the mod is permanently enable and I don't understand why it still resets the `NEW_CHARACTER` to false whenever I load a game. (In fact it is good that it does because it works but I don't understand why and so I don't consider this reliable...)
frank elbow
#

But, essentially, the logic would be:

  • check for mod data flag
  • if present, it's a new character
  • if not present, it's the first character in the world; set the flag
#

The reason the above is reset is that Lua is reloaded, so it won't remember the value of that variable (it certainly wouldn't between sessions either way, it'd be a nightmare if it did πŸ˜„)

small topaz
#

So it reloads the lua code every time I load a game, no matter whether my mod is already enabled via the main menu?

frank elbow
#

Yes, Lua is reloaded when exiting to the main menu and when loading or creating a save (and when changing mods, and probably in some other circumstances I'm forgetting)

small topaz
#

Great! Then the above should be a reliable way! Btw I only use this in the client folder, so in my situation, just using the local variable instead of modData should be sufficient for making the flag.

elder tiger
#

Helloo, I want to ask something on OnPostUIDraw to render my icons, but they always show up on top of the World Map. I've tried these checks but they still return false or don't work during the map view:

ISWorldMap.instance:isVisible()
getCore():isWorldMapVisible()
ISWorldMapSymbols.instance:getIsVisible()

Since OnPostUIDraw is the top-most layer, is there a reliable way to detect if the map is active so I can return my render function?

dusky quiver
#

maybe you can override/hook ISWorldMap.ToggleWorldMap to track

#

...media/lua/client/ISUI/Maps/ISWorldMap.lua

elder tiger
severe kite
#

I'm trying to make "wear on lower back" mod but i can't get the "wear on lower back" option in context menu working. Anyone wanna help me work on it ?

tranquil kindle
paper ibex
severe kite
tranquil kindle
#

What do you got so far?

severe kite
#

it loads, i've fixed all errors (when loading to save and when right clicking on item) i think it registers lowerback slot but im not sure

#

also it says on every duffelbag that my mod overwrite it so it's good

#

i just can't get "wear on lower back" option to show in context menu and idk if it will render on back

tranquil kindle
severe kite
#

i've tried to do rest through lua. should i send it ?

tranquil kindle
#

Just send whole item script for Whole dufflebag

#

Not like Whole file, but whole script of single bag

#

Post them in code block so its easier to read

severe kite
#

well since they are vanilla duffelbags not custom ones i've only applied lowerbackduffel and i had registered position etc in luas, dont know how to explain it so i'll send all

#

gimme sec

tranquil kindle
#

I don't think it will work like that

#

Adding option to wear something on different body location with context menu (vanila one, like watches for example) require from you to have Existing item for that purpose.

#

So if you have default vanila bag, copy it, but change item script name to diffrent one so its unique, change body location to Lower Back (if you made that one to begin with with lua and newly introduced registeries)

#

But i belive Now Dufflebags can be worn along backpacks? Didnt they just change it in B42?

severe kite
#

this one is in shared
LowerBack_Shared.lua
`local hasRegistered = false

local function registerLowerBack()
if hasRegistered then return end
if not AttachedLocationDefinitions then return end
if AttachedLocationDefinitions.LowerBack then
hasRegistered = true
return
end

AttachedLocationDefinitions.LowerBack = {
    type = "Clothing",
    name = "Lower Back",
    attachment = "LowerBack",
    bone = "Bip01 Pelvis",
    offset = { x = 0.0, y = -0.22, z = 0.10 },
    rotate = { x = 0, y = 0, z = 0 },
}

if AttachedLocationDefinitions.RegisterAttachmentDefinition then
    AttachedLocationDefinitions.RegisterAttachmentDefinition(
        AttachedLocationDefinitions.LowerBack
    )
end

hasRegistered = true
print("[LowerBackDuffels] LowerBack slot registered")

end

Events.OnGameStart.Add(registerLowerBack)
`

#

this 2 are in client

tranquil kindle
#

I mean... if you're doing it with Lua... i can't help you

#

I'm working on models/animations only and vanila scripts with some Lua in small quantities, but i suck at it (at lua)

severe kite
# severe kite this 2 are in client

LowerBackContextMenu.lua
`if not Events or not Events.OnFillInventoryObjectContextMenu then return end

Events.OnFillInventoryObjectContextMenu.Add(function(playerIndex, context, items)
if not context or type(context.addOption) ~= "function" then return end
if not items then return end

local safeItems = {}
if type(items) == "table" then
    if #items > 0 then
        safeItems = items
    else
        safeItems = { items }
    end
else
    safeItems = { items }
end

local player = getSpecificPlayer(playerIndex)
if not player then return end

for , entry in ipairs(safeItems) do
    local item = entry

    if type(entry) == "table" and entry.items and #entry.items > 0 then
        item = entry.items[1]
    end

    if item and type(item.HasTag) == "function" then
        if item:HasTag("LowerBackDuffel") then
            if type(context.addOption) == "function" then
                context:addOption(
                    "Wear on Lower Back",
                    item,
                    function(it)
                        if player and it and type(player.setWornItem) == "function" then
                            player:setWornItem("LowerBack", it)
                        end
                    end
                )
            end
        end
    end
end

end)

tranquil kindle
#

I'm honestly unsure why would you do it with lua

severe kite
#

LowerBack_AttachedLocation.lua
`local function registerClientLowerBack()
if not AttachedLocationDefinitions then return end
if AttachedLocationDefinitions.LowerBack then return end

AttachedLocationDefinitions.LowerBack = {
    type = "Clothing",
    name = "Lower Back",
    attachment = "LowerBack",
    bone = "Bip01 Pelvis",
    offset = { x = 0.0, y = -0.22, z = 0.10 },
    rotate = { x = 0, y = 0, z = 0 },
}

if AttachedLocationDefinitions.RegisterAttachmentDefinition then
    AttachedLocationDefinitions.RegisterAttachmentDefinition(
        AttachedLocationDefinitions.LowerBack
    )
end

print("[LowerBackDuffels] Client: LowerBack slot registered")

end

Events.OnGameStart.Add(registerClientLowerBack)
`

severe kite
tranquil kindle
#

Create new item? I belive you can add ClothingExtraOption etc. with Lua doParam, so just do that, and as ClothingExtraOption make it your custom bag which uses diffrent bodylocation?

severe kite
#

then what about vanilla ones ? do i need to disable their spawn and replace them with this new created ones ?

tranquil kindle
#

You can link vanila ones with yours

#

Like, you make only one Item with LowerBack body location, then
doParam something like this

ClothingExtraSubmenu = BanilaBag,
ClothingItemExtra = Base.YourCustomBagwithdiffrentbodylocation,
ClothingItemExtraOption = LowerBack,
``
severe kite
small topaz
# paper ibex player object have it own mod data u know

Yes, but not using modData can in some cases makes things simpler, especially if you are modding for multiplayer and have a lot of other modData things going when game starts. Second thing is that in my situation, the data in question do not need to be save-game-persistent.

paper ibex
small topaz
#

they do not sync automatically afaik

paper ibex
small topaz
#

and yes, in my case I need them client-only and not save-game-persistent. So is there is no need to not just use local variables

paper ibex
#

have u tried the correct Events for that?

#

Events.OnCreatePlayer.Add(yourFunction) ?

small topaz
#

Yes. I tried a lot of events. Basic question was how I could properly distinguish the events "player enters a game with a new character" and "player loads a game with an existing character" but this has been solved by now.

tough oxide
#

anyone toy around with the getFileWriter and (de)serialization?

#

looks like most people just use it for basic ini files

bronze yoke
#

JSON is pretty popular too

tough oxide
#

nice - looks like there might be a pure implementation too

#

need to file that one away if i ever wanna do a web^ api

paper ibex
bronze yoke
#

not sure what you mean, it's not standard library but it's just text i/o, it's easily something you can do in pure lua

tough oxide
#

yeah, i just stumbled across a pure implementation lib

#

it hasnt been touched in awhile, but i cant imagine it needs much work

#

and can probably meet most needs and what it misses can be implemented

paper ibex
#

So I need to do a workaround. I am going to check whether any Lua5.1 JSON module exists on the internet.

#

Last time I checked, rxi/json had no luck with kahlua pz

paper ibex
bronze yoke
#

some others i've tried don't work in kahlua

tough oxide
#

Nice

#

One I can use and easily credit

#

I was trying to figure how I would credit a GitHub source

#

β€œnot our code lol”

#

Nevermind - it’s a copy-paste but fair enough

#

400* lines for json support is a win

#

i hate that you have to have nitro to bookmark messages

mellow frigate
#

is there a way to influence the probability of vehicle key appearance in modded vehicle containers ?

tough oxide
#

am i reading this right? : implies self whereas . you have to pass self - so in baseobjectwhatever:derive self.__index = self asserts that __index is reset to nothing?

#

im asking because i want to take over __index and do my own magic

#

and i want it to be "extendable"

bronze yoke
#

it's better to think of it in the terms of what it actually does in the lua language:```lua
local foo = {}

-- creates a function with an implicit self argument
function foo:bar() end

-- creates a function with an explicit self argument
-- this does exactly the same thing as the above!
function foo.bar(self) end

-- calls foo.bar with foo as the first argument
foo:bar()
-- calls foo.bar with foo as the first argument (exactly the same as above)
foo.bar(foo)

tough oxide
#

you're a superstar! however i was more interested in the self.__index = self

#

what im gathering is that it basically disables the magic method call for getters and just references the table itself for properties

#

so any time you call sometable.property it doesnt really bother with the magic and just looks for the property on the table

#

whereas i really wanna embrace the magic

#

no worries - im slowly getting it on my own and can now quickly f5 my way into success or failure

bronze yoke
#

they do it in constructors as well

#

that basically prepares the class to be used as a metatable

#

but there's no reason to do it every time an object is constructed or a class is derived, they could just do it once when they create the table

blissful seal
#

I'm kinda crazy, oh and first chat btw, but i got bored and started making a machinima engine for lols

#

it...sort of works, this would be an example of the "scene" code:

            -- === PHASE 2: Activate cart pack (auto-equips cart prop) ===
            { at = 4.0,  type = "anim_pack",  actor = "pusher", pack = "saucedcarts_cart" },
            { at = 4.0,  type = "subtitle",   text = "Cart pack activated β€” cart idle pose", duration = 2.5 },

            -- === PHASE 3: Walk with cart animation ===
            { at = 7.0,  type = "subtitle",   text = "Walking with cart animation", duration = 3.0 },
            { at = 7.0,  type = "walk",       actor = "pusher", toX = startX, toY = startY + 6 },

            -- === PHASE 4: Emote overrides pack β€” cart auto-hides ===
            { at = 11.0, type = "face",       actor = "pusher", dir = "S" },
            { at = 11.5, type = "subtitle",   text = "Emote plays β€” cart auto-hidden", duration = 3.0 },
            { at = 11.5, type = "emote",      actor = "pusher", emote = "wavehi" },
tough oxide
#

also thats pretty sick

#

btw couldn't

function ISBaseObject:new()
    local o = {}
    setmetatable(o, self)
    self.__index = self
    return o
end

be minimized to

function ISBaseObject:new()
    return setmetatable({}, self}
end
#

sorry, im on my own journey but i love the idea of being able to create scenes

blissful seal
tough oxide
blissful seal
#

probably all good then

tough oxide
#

i can only assume setmetatable didnt return when they first started

blissful seal
#

sometimes its better to be explicit, scripting languages get to be a handful cuz of all the tricks and shortcuts

tough oxide
#

yeah, im hoping to have enough steam to create something that people get excited about as much as disgusted by

blissful seal
#

top tier goal setting ❀️

tough oxide
#

i come from the wild west of what the hell is a type languages and have been spoiled by typing

#

so im using this as a break from type safety to do something different

blissful seal
#

oh this is the dark side, we do terrible things

#

πŸ™‚

tough oxide
#

yeah, im hoping to do a little of both and the lofty goal is to add a bit of type safety

#

with little effort

#

(from the dev using it)

#

and hopefully some idea of a fluent interface

blissful seal
#

Lua LSP + the umbrella type stubs help for sure

tough oxide
#

yeah, i gotta look more into that

#

i should probably just look at that and see how i can help

#

but i wanna take my own journey of failures so i can be more useful

blissful seal
#

that is the way

tough oxide
#

Also another reason albion is a superstar

blissful seal
#

facts

bronze yoke
#

instead of doing it once when creating the metatable, they do it every time they're about to use the metatable instead

willow tulip
#

Im still confused on the whole derive and setmetatable thing -_-;

#

Like I get the 'metatable' is somehow related to how you actually access an object... but beyond that.. shrugs

#

also, so cursed when your functions get called with the wrong 'self' object.

bronze yoke
willow tulip
#

We cannot add tables, we cannot compare tables, and we cannot call a table not with that attitude you can't.

frank elbow
#

Not without metatables, you can't

willow tulip
#

so it lets you override add and ==, but...
setmetatable(a, b)
if I call a:foo() does that actually call b.foo(a) ?

#

(becoming b:foo call with a as the 'self' instance?)

frank elbow
#

Assuming a does not have a member foo and b is a table without an __index field (passing a table without __index treats that table as __index iirc not bothering to check, but this wouldn't really make sense anyhow so choosing to take albion's word for it) yeah

#

Assuming the parenthesized bit is me misremembering, it'd also require that b.__index is set to b (or is a function that returns the expected foo)

willow tulip
#

So an object can override its metatable by having its own instance of the variable/function?

bronze yoke
#

i don't think that's true no

frank elbow
#

It's not an override necessarily

#

The behavior of __index is that it's what is checked when an index isn't found

#

So it's the other direction, in reality (i.e., not a overriding b, it's b acting as a fallback)

willow tulip
#

that brings me to my next question

#

is there some universal function called(?) when you try to access a.doesntexist() ? or a.doesntexist = ?

frank elbow
#

That would be __index, if it's a function

#

I believe the PIL pages albion linked explain all this

willow tulip
willow tulip
frank elbow
#

Yes, click the arrow in the bottom right

willow tulip
#

Oh ok, I thought it was just that one page -_-;

bronze yoke
#

metamethods are usually functions but __index is a special case where it can be a table which is indexed instead, because that's what nearly everyone would use it for anyway

willow tulip
#

@bronze yoke Does starlit use __index as a function to create (and cache I assume) reflection on demand, or does it just pre-create all field reflections on startup?

#

starlit is actually what made me first assume something like that had to exist in LUA

bronze yoke
#

it uses __index yeah, specifically the first time that class is indexed it uses that instance to grab all the fields

frank elbow
#

The "Lua not LUA" enforcers are knocking on your door once again

bronze yoke
#

i can't do it at startup because you need an instance to get fields and not all classes necessarily have a public/pure constructor

frank elbow
#

Makes sense considering you have to loop anyway to identify the fields

willow tulip
#

More devs need to realize they can at least do that level of reflection though.

frank elbow
#

I'll take what I can get, it works well enough

willow tulip
#

overwrites the whole transaction logic and timed events and everything

#

I told em they need to use reflection to grab capacity without the getCapacity() function clamping the result but they didn't believe me when I said it can be used in release mode πŸ™

frank elbow
#

I hope that isn't ultimately necessary for something that ought to be moddable πŸ˜… I assume the changes were in the spirit of anti-cheat, but seems odd to have a hard cap for that purpose

willow tulip
#

then it would have worked with any mod, transparently if they did -_-

willow tulip
#

every object, trunk, backpack, etc has its own limit already

#

literally nothing in the game uses 'the default maximum limit' because im pretty sure the 'default' is either 0 or crash.

#

Furniture shouldn't be limited to 100, cars shouldn't be limited to 1000 (even if the developers can't figure out how to prevent them from sinking into the ground at >1400KG, modders can)

small topaz
#

Is there anyone else who has constant trouble with the game's workshop uploader? I think it started for me with the update to 42.13. Always getting "failed to update workshop item, result=2".

willow tulip
#

"The "failed to update workshop item, result=2" error in Project Zomboid
usually indicates a Steam Workshop synchronization failure or corrupted mod files. Common fixes include unsubscribing and resubscribing to the mod, deleting the appworkshop_108600.acf file, or ensuring the poster image for your own mod is under 1MB"

#

says ai overview bullshit, so take that with a grain of salt, but do check the poster image size

paper ibex
willow tulip
#

(infact checking the thumbnail for your mod is under 1MB is likely the only valid advice there)

bronze yoke
#

unfortunately result=2 is the generic error

#

it's most commonly caused by random steam issues but if you've been getting it that long it's something else

paper ibex
#

reset Winsock
and
flush DNS Cache

save me, without the need of restart the computer everytime upload workshop

tough oxide
#

and its my goal

frank elbow
#

I'm unsure what you mean

#

My message was to indicate that it's not that a overrides b, it's that b provides a fallback for a

tough oxide
#

i need to do more testing, but it seems like __index is called on get regardless

frank elbow
#

I see. No, that's not the case

tough oxide
#

let me check

#

no, you're right

#

but you can override the set and then by proxy override the get

#

i think...

frank elbow
#

Yeah, there is __newindex

#

This wouldn't stop someone from using rawset, though (but presumably they know what they're doing if they do that)

tough oxide
#

yeah, im all over both of those methods atm

#

for sure, but im not looking to stop people from doing what they want

#

for my purposes - if you are using rawset then do something else or tell me what you intend to do and lets make it better

#

also - im not sure what im trying to do yet and speaking in hypotheticals

tough oxide
#

whats a good "this property is meant to be private" naming scheme?

#

just a single _ and lowercase?

#

i feel like even c# uses that scheme

#

private readonly string _youcantseeme = "private value"

bronze yoke
#

the most common convention in lua is a leading _, everything else is pretty divisive

tough oxide
#

does it come with a ruler extension that slaps their hand if they try to set it?

vast pier
#

Is there a list of all the weapon params that can be affected by weapon attachments ?
Like what all stats can weapon attachments change without lua interference

elder tiger
#

I’m trying to detect if the Crafting Menu is open in my mod using this code:

if ISCraftingUI.instance and ISCraftingUI.instance:getIsVisible() then
    return true
end

But it doesn’t seem to work reliably. Is there a better way to check if the crafting menu is open?

tough oxide
#

not sure if this is the right UI but you might be able monkey-patch your way into ISHandcraftWindow

#

might be the wrong UI

#

\ISUI\Crafting

tough oxide
#

ill keep looking

#

could be ISBuildWindow via ISUI/Building

#

the adults might be sleeping

willow tulip
#
return ISCraftingUI.instance and ISCraftingUI.instance:getIsVisible()

seems cleaner.

pastel ginkgo
#

Hey chat. I have a bit of an odd mod request. I'm unsure if this is the channel for it, but..
I have found a way to fix multiplayer desync issues. It's a bit of an awkward process, and I believe a simple mod to automate this would help a ton.
Basically, a little icon on the screen a player can press, or a keybind.
They get teleported to a set coordinate corner of the map, somewhere unused, then immediately back to the point where they pressed the button.

I have found that teleporting away and back fixes actions from not completing, trunks from being inaccessible, tiles not registering completely, invincible zombies, and it would be extremely convenient if someone with modding knowledge attempted this.

#

There would be the inconvenience that once you're teleported back the area around the player is blacked out until they turn around but honestly it's better than relogging and/or giving players observer access so they can fix it themselves

#

I would even commision this, it sounds so useful

torn igloo
#

Hello modding guru, I am trying to update a mod to b42 but I cannot figure out how to make -debug happy with this craftRecipe for MP. I can load the said craftRecipe just fine on SP.

This is the craftRecipe

module Base {
    craftRecipe CraftMysteriousVehicleClaimOrb
    {
        timedAction = Making,
        time = 60,
        category = Miscellaneous,
        Tags = InHandCraft,
        inputs
        {
            item 1 tags[base:hammer] mode:keep flags[Prop1;MayDegradeVeryLight],
            item 1 tags[base:write] mode:keep flags[Prop2;MayDegradeVeryLight],
            item 1 [Base.MetalPipe],
            item 5 [Base.Screws],
            item 5 [Base.Thread],
            item 25 [Base.RippedSheets],
        }
        outputs
        {
            item 1 AVCS.ClaimOrb,
        }
    }
}

This is the error on client-side, WorldDictionary: Cannot debug print entity: AVCS.ClaimOrb. Again, no such error when running on SP.

Thankyou in advance

mellow frigate
torn igloo
# mellow frigate show us your AVCS.ClaimOrb definition and registry

Just this

module AVCS {
    item ClaimOrb
    {
        DisplayCategory = AVCS,
        Weight  = 0.1,
        ItemType    = base:normal,
        Icon = AVCSClaimOrb,
        StaticModel = AVCSClaimOrb,
        WorldStaticModel = AVCSClaimOrb,
    }
    model ClaimOrb
    {
        mesh = WorldItems/Button,
        texture = Item_AVCSClaimOrb,
        scale = 0.1,
    }
}
mellow frigate
torn igloo
mellow frigate
#

local myModdedItem = ItemType.register("AVCS:ClaimOrb")--make it not local if you have to use it in your lua afterwards. Edit: I was wrong about that.

torn igloo
#

I am so confused now. Is the ItemType.register not referring toItemType = base:normal? But something completely different?

mellow frigate
#

AVS.ClaimOrb is an Item type, who's meta-type is base:normal.

torn igloo
silver delta
#

Are there any modding teams currently working on small, survivor-focused story mods aimed at immersion?

I’m especially interested in projects centered on park rangers, survivalists, and first responders (police, fire department, military, etc.). By that I mean environmental storytelling: notes, locations that tell a coherent story, visual clues, and possibly limited NPCs.

The goal would be grounded realism, with progression that feels rewarding through contextual loot and in-game advice that actually teaches survival mechanics, not just flavor text.

If such projects exist (or are planned), I’d love to hear about them. If not, maybe there's be people interested?

tough oxide
#

@blissful seal is working on creating scenes which might be up your alley

blissful seal
#

I hesitate to call it a project yet tho, but maybe one day -- my hands are currently full with my other 2 mods so this is just a POC for now

#

I'm coding this almost entirely agentically (vibed) -- I was looking to see in this channel if anyone else partakes in the forbidden fruit of agentic coding but I dont think so -- I'm sort of an AI evangelist at least for code, and I came up with a workflow that lets me write PZ mods super effectively

#

I wrote an MCP server that indexed the Javadoc, item script files, and lua code from the PZ gamefiles, as well as decompiling the Java source and making that accessible as well. This makes my agent basically an expert at decoding issues in the PZ runtime while making mods...

#

Basically its a workflow for agentic coding in a specialized domain (PZ) and it's extremely badass (to me)

#

(pls dont throw tomatoes at me)

blissful seal
#

i deserve that

golden helm
#

Hello, I am currently making my first mod for project zomboid I have been running into a few issues and have tried to solve them but I couldnt solve them. The mod im working on is a clothing mod with 2d textures I am making this on build 41. The issues are : icons for them wont load and the textures wont aswell ingame I will send a few screenshots. If anyone can tell me my issues I would be really grateful.

bronze yoke
normal moth
#

Hello! I have a custom .fbx model, but it's not being properly rotated when used in game?

It does show up, but when I use the attachment position with rotation and offset like I see in the vanilla generated items tables, it doesn't seem to apply rotation on the model?

Also, what does the Bip01_Prop1 and Bip01_Prop2 slots do?

normal moth
#

I've tried making the shovel back all 0.00 and the effect stays the same as when it's -90 and 180 rotation.

blissful seal
#

I wrote code for this in my Cart mod cuz it was such a nightmare guessing the offsets

#

It just basically lets you modify an attachments, offset, rotation and scale live in game

#

u can use it for this if u download my mod then run SaucedCartsDebug.attachmentTweaker()

#

or you can just have the code for it tbh (its not perfect but it helps)

paper ibex
# blissful seal Basically its a workflow for agentic coding in a specialized domain (PZ) and it'...

If it works, it works. People are laughing at vibe coders not just because they cannot code, but maybe because of untested code that is generated and shipped immediately. Before AI agentic tools became popular, people still used Google and Stack Overflow snippets-yes, me too. I am a self-taught coder πŸ™‚ and I was surprised that, in the old days, some products actually had support code reviews. (by LLM)

Be aware that some people here are kind of anti-vibe coder (or against using AI-generated code), just like how we complained about the B42 first demo loading scenes.

blissful seal
#

I see, thanks for the perspective. I will keep my zeal to myself, but if folks are ever interested I'd be happy to collaborate on agentic workflows or share tips etc.. I did go to college for CS and have worked professionally as a backend dev but yea I'm all about the agents at this point

bronze yoke
#

most of us are not really against ai as much as we're against lazy people who can't be bothered to learn anything a) throwing their non-functional garbage up onto the workshop or b) expecting this chat to debug and fix it for them

frank elbow
#

I don't use AI myself and don't intend to, but people can do what they want regardless of whether I'm a fan

blissful seal
#

I mean that is totally understandable I'm sure there has been a large influx of garbage as a result of AI democratizing the playing a field a bit.

#

I'm not here to change anyones minds, just here to talk PZ mods πŸ™‚ -- trust me I won't lose any sleep over it lol

paper ibex
#

this is kind of

learn from 0 , optimize to 1

and

learn from 0 optimize from mistake

??

#

because me also want to optimize my code, but not have enough info haha

blissful seal
#

I actually learned alot about internal PZ systems building mods in this way

#

i aint no mega expert, and still internalizing information to be fair but, I can just ask questions about the source code, AI is real good at Java.

frank elbow
#

What you described is certainly very different than the people feeding very specific questions about the game's codebase into ChatGPT (or just trying to generate code that way) and expecting it to work

#

I can't fault people for ignorance, but what drove me mad when that started becoming an issue months ago was when people didn't disclose that

blissful seal
#

Ooooh yeah, I can definitely understand and empahtize with that..

#

I just like building systems, and I thought to myself, how could I build a workflow that enabled me to actually build quality PZ mods

#

I just love the game, but am limited on time these days

paper ibex
#

trade off, we are mad because of reading noise content from un-trained chatgpt response, right?

bronze yoke
#

there's also quite a prominent issue with ai being used for blatant plaigarism

#

and i'm not talking about stuff as vague as 'ai is trained on copyrighted materials so it's technically all plaigarism', i mean people are taking other people's mods and telling chatgpt to make it look different so they can say they made it

blissful seal
#

Lmfao thats wild

#

Okay ppl who just go to chatgpt aren't really using AI

paper ibex
#

hmmm, true, you cannot claim an ai generated content

but not mean your brain and time to making it is worthless

blissful seal
#

at least not to me, thats just a magic trick, u need to do context engineering for it to be helpful in any specialized domain

#

which is why i wrote a bunch of code to parse lua files, item distribution tables, and the javadoc

#

Now an agent has relevant context to resolve an issue, and it requires that you have some higher level intent and ability to design a coherent system for you to actually be successful

#

I think if one of you, very extremely talented modders used AI in a similar fashion you would be unstoppable

paper ibex
#

very hard to me to explain rn, so we know the reason and maybe stop before it become off topic

bronze yoke
#

i had an incident a few months ago where someone blatantly copy-pasted the entire source code of a mod i had been working on -- shortly after we called them out for it, it suddenly updated with an entirely different codebase

#

i have learned that next time i should the DMCA should be the first contact πŸ˜…

blissful seal
#

Whats the point of reuploading a mod lol but ya strike fast with that

bronze yoke
blissful seal
#

ooooh okay that is extremely shady

#

damn i thought we were just doing it for the love of the game πŸ˜‚ wtf is workshop clout gonna get u

frank elbow
#

Some people will do anything to get people to give them accoladesβ€”anything other than putting in any effort whatsoever

blissful seal
#

wow the audacity...

frank elbow
blissful seal
#

i really do hate that too, muy unfortunate.

bronze yoke
#

we couldn't, we basically have no claim now, but our mod is finally about to release now and they didn't get a fraction of the attention we're getting πŸ˜„

blissful seal
#

uk what AI is pissing me off, the AI thumbnails 🀣

frank elbow
#

I remember back when all we had to worry about spamming the workshop was True Music add-ons that could've been unlisted

#

Now, a sea of AI thumbnails tired

blissful seal
#

I barely click on those mods

frank elbow
#

It's a shame because I imagine a subset of those are perfectly fine mods, but yeah when I see that I'm far less likely to click as well

#

Which is a bias I'm entirely aware of and okay with

blissful seal
#

Hey, that's just bad advertising

#

but i do understand the temptation, allow me to simply describe my image, and maybe provide an example and poof

analog mesa
#

Aren't a lot of those just commission mods?

blissful seal
#

Is that the case? That wouldn't surprise me

blissful seal
#

Your discord reqs are closed but add me πŸ™‚

willow tulip
#

Hope they enjoy trying to fix all those bugs in their 'different codebase'

bronze yoke
#

well let's not talk about it too much, i think it gets a little unpleasant

willow tulip
#

(especially when it changes every other version of PZ)

frank elbow
#

They described their workflow above, it's not exactly typical compared to what we're used to seeing here

#

Based on what was described I'd presume it performs better, but I'm basing that on the description alone since I haven't checked out the mod

blissful seal
#

Haha I'm explainign the same things to eScape in a dm rn but

#

At a high level i did a bunch of context engineering so agents could be good at PZ modding

bronze yoke
#

i've seen ai mods that it is extremely hard to argue were even tested by the author once, because they don't function whatsoever and the code is in such a state that it could never have possibly functioned for anyone ever

blissful seal
#

understanding tha tthe difference between any of us and these models is context, i engineered teh crap out of it so the models could be effective.

bronze yoke
#

so as long as your mod works i believe you probably put some effort into it

blissful seal
#

I mean i would actually love for one of you to critique my mods I'd learn alot

#

But yeah it still takes effort, but more from an orchestration standpoint less raw toil

frank elbow
#

And have your AI learn from the code review? I think not (this is a joke, it'd just be for lack of time)

willow tulip
#

And a rabbit gives 3000...

bronze yoke
#

hey the code works, the numbers are just fucked up πŸ˜…

willow tulip
bronze yoke
#

i've seen stuff like mods that use modules but the require paths use the wrong separator and path so they can never succeed

frank elbow
#

I wonder if this is what happens when Person A is responsible for cows and Person B is responsible for rabbits

blissful seal
#

The discourse around AI is all about hallucinations and lack of appropriate context, but humans ahve the exact same failigns

willow tulip
blissful seal
#

There is certainly the siren song of just believing everythign that comes out of the models is correct

#

the wonderful thing about computers is we get immediate feedback

analog mesa
#

Is there a quicker way to reload my mod other then alt f4ing and relaunching?

#

This is getting annoying now that I have to get all the way into a solo

willow tulip
analog mesa
#

Oh lua updates in main menu?

willow tulip
#

if its LUA with 0 side effects, you can reload it ingame with the F11 menu or the LUA hot reload function

#

(Note: your code very likely has side effects and the F11 reload won't work)

frank elbow
#

I HAVE to mention the β€œLua not LUA” at this point

analog mesa
#

Trying to get a locket to show up in the OnNewGame event

willow tulip
analog mesa
#

So either way I gotta start from menu

paper ibex
willow tulip
#

There is also a 'Reset Lua' button on the main menu.

analog mesa
#

You can use a string as a key can't you? I can't figure out why this refuses to index

bronze yoke
#

the error says the table is nil, not that the key is invalid

#

there are no invalid indices in lua (arguably except nil, which behaves weird but doesn't throw an error or anything)

analog mesa
#

It prints the table itself as table 0x1398301873 though

bronze yoke
#

wait that's not even where the error is

#

you're getting nil because they're different keys, that's normal

#

your key is a string and you're indexing with a CharacterProfession

paper ibex
#

i bet its time to add more print() to trace, lol

analog mesa
paper ibex
#

well, what is your goal at all

analog mesa
bronze yoke
#

i don't know but i just wouldn't use the string, it's kind of going against the point of registries

#

the only thing you should really use the strings for is (de)serialisation

analog mesa
bronze yoke
#

you can use the characterprofession object as the key instead

paper ibex
analog mesa
bronze yoke
#

you'll need to enclose the key with [] but yeah that's what i was going for

analog mesa
#

Hell yeah that worked, thanks.

analog mesa
#

Like good lord man do you have to print every change

paper ibex
bronze yoke
analog mesa
#

I just wrapped mine in a big fat if statement with a quick toggle

analog mesa
paper ibex
bronze yoke
#

in build 42 all event callbacks added by a file should be removed when that file is reloaded

paper ibex
#

and have no limit of registered event like nodejs

blissful seal
#

I've gaslighted myself several times just calling reload

#

someone make a mod to improve the reload experience πŸ˜‚

analog mesa
blissful seal
#

I actually like building those kinds of tools, anything to make me even lazier

analog mesa
#

Could even do quick edits to item xml in a session, reload xml, back out to sub editor, and go back in and it'd be the new xml

analog mesa
paper ibex
blissful seal
#

^ Me yelling at Claude

#

We treat programming like a Trade skill like plumbing, where skill is built through hands on experience -- cuz that was the way we had to do it. Like any other trade, Plumbing, Caprentry, but as a result we're forced to be like Biological Databases imo something we aren't ever going to be the best at. I get it too cuz, I put my own blood sweat and tears into becoming an employable programmer lol

#

I just really enjoy designing systems (and writing code) through AI, I get to focus on the former, rather than the latter, but couldnt do it successfully without my foundation

analog mesa
#

Most my interactions with AI are getting pissed off that it auto rerouted my search for "Project Zomboid animal stress" to their useless ai mode and it auto completing boilerplate shit for me at work

blissful seal
#

I stopped writing documetns at work at all

#

every would be document is a summary of a conversation or the synthesis of sevearl other docs

#

But yeah, I would advise decompiling PZ source and running an agent on your desktop, then force it to tell you how the PZ animal code works πŸ˜‚

analog mesa
#

Writing the documents is usually how I end up knowing anything about our wider codebase at all. Otherwise they shove my adhd ass into a meeting with no briefing on why I should care about it at 5am and expect me to retain information

blissful seal
#

that is a good way to retain information for sure, but I'm so AI-pilled that im just as happy asking an ai about the document im supposed to be reading 🀷 egregious i know

#

but imo work is work, i do my job and leave 🀣

sour island
#

Your analogy means people using AI are suspectible to becoming "Ikea" coders which is pretty accurate.

blissful seal
#

we had that before AI yknow?

stuck tapir
#

Any ideas on why a custom item seems to ignore the 'weight' parameter in its definition and just always defaults to 1?

analog mesa
#

Last time I had something like that I was printing the keys/values in a for loop and didn't realize they are separate objects then the actual table key/values, so could be anything

analog mesa
#

Finally

#

Is table.unpack not a thing in this version of Lua?

frank elbow
analog mesa
#

Oh so just unpack(table)?

frank elbow
#

Yeah, rule of thumb is that Kahlua is closest to Lua 5.1 (not exactly equivalent, but closest standard version to compare with)

#

So if you were to read the online Programming in Lua, for example, that'd be the one to read

willow tulip
blissful seal
#

to some extent i definitely agree

#

but I think of like, lets say reading a 15 page document at work, like a reading tax

willow tulip
#

And when a computer can tell you what to think... a computer owned by the richest people on the planet... well... Its not gonna go well for all the non-richest not-owning the computer that tells everyone what to think people.

blissful seal
#

I respect that perspective for sure

willow tulip
blissful seal
#

In mine as well πŸ™‚

willow tulip
#

.. even without an index.

#

Hell, iv done microcontroller and FPGA programming...

#

where you just get an unindexed 100~900 page datasheet

blissful seal
#

You know exactly what its like to be super high detail and whatnot

#

but I would say someone of your skillset could be really extremely effective still doing all the kinds of FPGA programming you want, but as more of a designer/orchestrator

#

I just like to think of it like: I have an assistant who can do whatever I tell it to do, I just need to give proper instruction

willow tulip
blissful seal
#

Exactly!

willow tulip
#

Programmers just seem completely against using anything they didn't code when it comes to frameworks πŸ˜›

blissful seal
#

But its like, are you ever gonna go learn Assembly (im probably asking the wrong guy πŸ˜‚)

#

but you get the example, like we doint toil away writing machine code anymore

willow tulip
blissful seal
#

yeah i figured 🀣

#

u said FPGA i knew u were serious

willow tulip
#

Yea I got someone to pay me to learn FPGA's to hack some 1990's car ECU in realtime

blissful seal
#

damn thats rad

#

I love that

willow tulip
#

yep. Don't think anything ever really came of the project, but I complete my end, the hardware

blissful seal
#

it's just simply my belief that someone like you, with an AI agent on your side, the sky is the limit actually

willow tulip
#

Had realtime emulation of the overly complex EPROM bus

#

it was the weirdest bus thing.

blissful seal
#

damnnnn

willow tulip
#

it had a 8bit bus.. No seperate address lines

blissful seal
#

thats really crazy 😭

willow tulip
#

16bit addressing, with automatic increment if you kept reading over and over

#

and in circuit programming of the EPROM

#

and I do mean EPROM, I had to buy a UV eraser and defeat the interlock and just... stick it over the ECU in a box

#

(Since the eprom was often soldered in lol)

#

Nobody knew the proper algo to program that EPROM so I had to find that out too.

blissful seal
#

oh my god ur truly hardcore, and i respect the hell out of it

willow tulip
#

Fried like 3 outta the 10 ECU's my boss bought me in the process.

#

(all bought at like scrap prices)

#

Turns out there was 2 very distinct chips, and the only info available on them only worked to program one of them

blissful seal
#

so u basically reverse engineered it

willow tulip
#

so I had to just FAFO how to program the other one

#

and then figure out an algo that still worked on the 1st one -_-

blissful seal
#

dead that's what its all about tho

willow tulip
#

yep.

blissful seal
#

i love all that stuff man

willow tulip
#

But it also takes an incredible body of baseline info to figure that out

blissful seal
#

That massive mountain of context us humans are so good at building and retaining

willow tulip
#

though iv never seen an (E)EPROM with combined address lines since, other then the serial ones

blissful seal
#

dang u got stories huh Black Moons, u seem like you've seen some stuff πŸ™‚

wintry galleon
#

Helloo. I'm having issues with a custom tileset I'm working on and was wondering if anyone had any advice. I got the example mod to show up in my modlist, and I believe I set up the mod info file the right way, but it's not showing up in the tilepicker for some reason.

#

Build 41 btw

robust locust
#

does anyone know if it's possible/how to register tags if another mod isn't enabled?

analog mesa
#

I hate lua I hate lua I hate lua
3 fucking hours and I cant figure out why this for loop is just being skipped

copper breach
#

Hello, I don't know much about modding on PZ but I would like to create a mod that allows you to read a magazine or anything else that would allow you to obtain traits (I know there are already a few mods on the workshop) but they're quite limited I'd like to do it with all traits if possible I'd like to know how I could do this If anyone could help me or just explain how to do it, that would be great Thank you for taking the time to read this

analog mesa
#

C:\Program Files (x86)\Steam\steamapps\workshop\content\108600 This folder is your workshop folder, if you grab the steam id from the mod and search it you'll get the exact mod files

analog mesa
paper ibex
#

or return one of?

analog mesa
#

shuffle?

paper ibex
#

what is your goal of that function

analog mesa
#

Oh, its supposed to roll each item based on the key as the chance you get it on start and produce a table I can merge with the occupation one.
I finally just got it to do something at least by getting rid of the i in ipairs, no clue why that did anything

#

Yeah that fixed everything

#

Until putting the chance back in breaks it again for another 3 hours

paper ibex
#

just about typo
ipairs can only used with array like
use pairs for table

#
for key, v in pairs(my_table) do 
        print(key, v)
#

haha you hate lua but pz use Lua

analog mesa
#

Ah, thought the main difference was that ipairs went sequentially down from the first while pairs just shot random spots in the table till it got them all

normal moth
analog mesa
blissful seal
bronze yoke
normal moth
blissful seal
#

I just ensured I had deleted the mod out ouf Zomboid/mods and Zomboid/Workshop as well as in the steamapps/workshop/content folder if its an uploaded/subscribed mod -- then replaced my Definitely updated mod back in to the mods folder lol

tough oxide
#

albion beat me to the loop optimization

#

ive been working on some frankenstein "class" in lua trying to figure out what i can get away with - so far i managed somewhat "magic" computed properties

#

and intercepting all property gets/sets (for later use)

#

which is kinda the easy part once you understand the metatables and such

#

but it feels like it goes wrong quick with "inheritance"

wintry galleon
willow tulip
#

opps saw someone already mentioned that

willow tulip
#

But yea, if your using table.insert() you can use ipairs (or table[1] = etc), but if its not a continious array pairs is the way to go (although pairs/ipairs is also slow, but whatever)

#

its actually faster to use a regular for loop instead of ipairs -_-

analog mesa
#

There a way I can set whats returned from instancedItem() to have multiple or am I gonna have to repeat it to add like 10 arrows

willow tulip
#

(also why you shouldn't just casually have 1000's of bullets hanging around, put them into boxes/cartons..)

light swan
#

Howdy yall. I've noticed level up sound mods ive downloaded for the most recent b42 build don't seem to work anymore. Is there anyway i can fix that myself?

bronze yoke
#

level up sounds are bugged, wait for a patch

light swan
#

Ah good to know! Thankyou!

#

I'm curious now is there a bug tracker anywhere i can follow?

light swan
#

Thanks!

tough oxide
#

anyone find the offending code for the AnimSets?

#

thats what i searching for last week....

willow tulip
willow tulip
#

Well.. that... sorta works :p

#

... Hu.. well.. thats a problem

slim swan
willow tulip
#

?

tough oxide
#

that looks like someone else's* problem

#

just walk away

willow tulip
#

the fire is walking away for me

slim swan
#

The vanilla cooking use the evolved recipes to add ingredients ,but its not so good,so I wondering did u have some better way

willow tulip
#

Im ignoring the evolved recipe hunger amount and letting you set it yourself, including up to multiple ingredients worth.. then redoing happyness/etc

#

there we go, now supports rivers and puddles for cooking

slim swan
#

I also made a cooking panel mod before, where I used advanced recipes. I never managed to correctly calculate the hunger value deducted each time an ingredient is added, and there always seems to be a bug here.

willow tulip
#

along with getbasehunger that is used to track when you eat 1/4 of an ingredient etc, but also scaled (incorrectly?) when you make evolved recipes

#

So yes there are many bugs πŸ˜›

#

Also cooking skill reduces how much 'hunger' you use of an ingredient in a mysterious way that makes no sense to me -_-

#

ingredients being 'cooked' also gives them like 30% more hunger change or something

#

you basically need to read the entire stupid addingredient code, and the food.java gethungerchange/gethungchange to understand whats going on -_-

#

while ideally dumping all the values of a few foods while eating them/adding them to recipes -_-

#

And im pretty sure TIS screwed up their use of basehunger in that it should NOT be touched by adding an ingredient to a recipe

#

hence the name 'basehunger'

tough oxide
#

im just scoffing at the fact that gethungchange exists

slim swan
#

What's more, sometimes when an ingredient only has a hunger value of 1, it seems you can add it multiple times before it's completely consumed. I checked the Java code and the calculation here doesn't seem that complicated, yet the results are mysterious

tough oxide
#

thats some bubble gum on a leak stuff and im all for it

tough oxide
#

whats the idea behind the kitchen zone?

#

you get access to all items in the zone within reason?

slim swan
#

This is the mod I made before. I never managed to fix the issue with the ingredient deduction values, otherwise, I could have done more with cooking

tough oxide
#

aah gotcha

#

well black moon is knee deep in that fun it seems

#

that icon pack is sick

#

i might grab the mod just see how you did ui elements

#

ive been pretty annoyed with what im dealing with so im looking to see how others do it - though im not sure theres a ton of wiggle room atm

willow tulip
#

because I HATE LEFTOVERS

#

and I hate clicking like, 20 times just to make a decent meal outta eggs -_-

tough oxide
#

i work with click counters...

tough oxide
#

lol

willow tulip
#

it also shows you how few calories you actually own -_-;

tough oxide
#

you should, down the road, setup some sort of template where people could make namable meals from ingredients

willow tulip
#

yea iv considered being able to save/load recipes

tough oxide
#

actually thats better

#

instead of being part of the mod - allow people to create and save

#

and for MP - you could maybe create a "skill book" or whatever that people could make to share recipes

#

the min/maxing recipes could go nutty for a popular server

#

like "Craft Recipe" that requires paper, pen, and some sort of skill gate depending on the recipe efficacy

tough oxide
#

might be worth inspecting \steamapps\common\ProjectZomboid\media\scripts\generated\items\weaponpart.txt or weapon.txt in the same folder

willow tulip
#

@slim swan but yea, I plan to just rewrite the happyness/etc bonuses from scratch since I now allow more then 2 'instances' of an item added.. and just being number of ingredient based was kinda meh, Im gonna make it more based on cooking skill instead.

tough oxide
#

and maybe ingredient qualilty

willow tulip
#

not sure how to really specify ingredient 'quality' other then fresh/stale

#

but yea. evolved recipes 'freshening' stale ingredients is kinda weird

#

Im kinda tempted to even add a little clicking minigame so you have something to do while cooking

#

since you'll now be adding much more ingredients at once and not needing to click 20 times otherwise..

#

Like I want to make the act of cooking easy, so that I can make it hard in other ways.

tough oxide
#

Could start with a basic β€œcutting” mini game with a simple rhythm game

#

Imagine missing a beat and having* a chance of being cut

willow tulip
#

Your cooking skill would widen the good bars, and you'd be free to select a 'speed'...

#

so you can make it easy (but slow) or fast (but dangerious)

shy mantle
#

It's gonna be like one of the song rhythm games, might as well go all in and add music drunk

willow tulip
willow tulip
shy mantle
#

I think I heard a third, CHOP, in there, followed by a screech.

willow tulip
#

these things

shy mantle
#

Me personally, more ingredients = harder song IF you were doing it that way

willow tulip
#

im not adding music lol.

shy mantle
#

YEAH yeah....

#

buuuuuuuuuuuuuuut

#

lol

upbeat turtle
#

fun lil cooking minigames would go a long way for breaking the repetition lol

willow tulip
#

I feel like with the 'speed' being adjustable, you can sorta set it to whatever your skill level is.. Or set it extra slow if your like "I need to make a really awesome meal"

upbeat turtle
#

ooh, one neat idea could be making different minigames for specific recipes cathappy

upbeat turtle
willow tulip
#

apparently, if you have a low enough cooking skill you actualy lose happyness buff with too many ingredients in vanilla

#
if extraItems ~= nil and extraItems:size() - 2 > cookingLvl then
  changer = changer + extraItems:size() - 2 - cookingLvl * 3;
end
baseItem:setUnhappyChange(baseItem:getUnhappyChangeUnmodified() - (5 - changer * 5));
#

Or something like that? Its hard to decypher lol

#

since unhappyness is bad and negative values are happyness

#

My other thoughs is I need to revive the boredom model of beefcake that made you bored of foods you ate too often

#

like, did anyone know this was a thing?

#
local nutritionBoost = cookingLvl / 15.0 + 1.0;
#

applied to calories, protein, carbo, lipids

#

Also considering.. Why not allow fluids to be added to recipes? -_-

#

At the very least to like soup/stew

torn igloo
#

Hello modding gurus, did anyone figured out the cause for "File doesn't exist on the client" for MP client on b42 on some mods? My mod also has this issue, tried changing CLRF to LF, doesn't help. I wonder if it is not happy with multiple sub mod thingy.

willow tulip
#

So what should be the actual limit for food then?

#

like the 4~6 ingredient limit means a lot less when you can add up to 100 hunger of each ingredient..

#

do I limit it to like, 50 hunger per 'ingredient max' or something?

#

Ohh cursed idea: Im gonna allow you to make evolved recipes outta liquids by pre-filling the pot with whatever liquid

#

and then it will just not detect water but any liquid

#

Gasoline soup? Go ahead.

#

Coffee and vodka soup? also acceptable.

quick gull
#

ammonia and bleach soup please!

willow tulip
#

I mean calorie wise, making a soup outta soda kinda makes sense! its horrible, but so is everything else about PZ cooking.

fervent wraith
#

Quick B42 MP architecture question for other modders.

I’m building a large server-authoritative system (The BlackBoard) that uses snapshots as the source of truth instead of client state.

Current structure:

  • Server builds and pushes snapshots.
  • Client stores snapshot.
  • UI renders from snapshot.

Question is about live UI updates:
Would you recommend:

A) Event-driven UI refresh when a new snapshot arrives
(UI listens for snapshot update and rebuilds)

or

B) Polling / periodic refresh from UI side

or something else entirely?

Context:
– PvE server
– Multiple players viewing the same live board (notices, contracts, etc)
– B42 MP timing rules already enforced (TimedActions for inventory etc)
– Avoiding client-side state logic as much as possible

Trying to follow best practice rather than invent something messy.

Curious what other B42 MP mods are doing now.

regal canopy
#

Hi, I've dipped my toe into creating a couple of really simple mods for my linux PZ server on b42 however I have a weird issue

When I load up the server I can see that my mods aren't being loaded

WARN : Mod f:0, t:1770384514222, st:10,252,060,502> ZomboidFileSystem.loadModAndRequired> required mod "wetwetwet" not found
WARN : Mod f:0, t:1770384514223, st:10,252,060,502> ZomboidFileSystem.loadModAndRequired> required mod "moffwatch" not found

However on the server viewer it is showing the mods as installed

So I'm really just confused atm and don't know if they are working or not.

They are in my ~/Zomboid/mods folder

/Zomboid/mods/
total 16K
drwxrwxr-x  4 ubuntu ubuntu 4.0K Feb  3 18:15 .
drwxr-xr-x 19 ubuntu ubuntu 4.0K Feb  5 16:52 ..
drwxrwxr-x  3 ubuntu ubuntu 4.0K Feb  6 13:25 moffwatch
drwxrwxr-x  3 ubuntu ubuntu 4.0K Feb  6 13:25 wetwetwet

Edit: these are just really simple server side mods that just add a bit of AI behaviour

tough oxide
regal canopy
# tough oxide its more than likely your file structure for your mod
ubuntu@valhalla:~/Zomboid$ ls -alh mods/moffwatch/
media/      mod.info    poster.png
ubuntu@valhalla:~/Zomboid$ ls -alh mods/moffwatch/media/lua/server/
total 12K
drwxrwxr-x 2 ubuntu ubuntu 4.0K Feb  6 13:09 .
drwxrwxr-x 3 ubuntu ubuntu 4.0K Feb  3 18:15 ..
-rw-rw-r-- 1 ubuntu ubuntu 1.7K Feb  6 13:09 moffwatch.lua

This is what copilot suggested as the location for the mod

merry osprey
#

Anyone know of a linux friendly script or a mod that allows a server to check for mod updates, save, and restart automatically? I would love to get the server to a self sufficient state.

tough oxide
#

dont place it directly on the server - im pretty fresh, but ive been working from this %userprofile%\Zomboid\Workshop\MyCustomMods\Contents\mods\SomeStats where MyCustomMods is where I open my IDE and also contains a workshop.txt and a preview.png and SomeStats has the 42 and common folders (i think common is required)

#

this allows for me to work on the mod and usually just quit to main menu and load back in to see the changes (there have been times i needed to a full quit to desktop specifically in -debug where the lua errors don't clear between simple main menu restarts - also mods might do things that require a completely fresh instance)

#

i then upload the mod to workshop and leave it unlisted until im ready for release - this allows my server to find the mod and load it from the workshop

#

and keeps people from downloading the mod when it might be in a broken state - technically they could find it if they know the workshop id

#

worth noting that you need to modify the ZombiodServer.ini and add the workshop id AND add the mod id prefixed with a \

tough oxide
regal canopy
#

I'm playing about with a server only mod, the workshop isn't involved

tough oxide
#

i may not be the best to ask, but i'll surely give it a try

#

with the same principal above - instead of %userprofile% find the zomboid\Workshop folder within the user running the server

#

though im curious if the server will send the mod out to the clients - even if its server only im not sure how it acts

sour island
small topaz
willow tulip
# sour island

I also wonder what would happen if I sent the entire food tracking data of everything someone has eaten...

#

(admitly, just a typename and weight for foods... prob should make some system that clears out any foods with small enough weights)

regal canopy
#

Has anyone built a server side only mod that can assist with my weird mixed messages?

bronze yoke
#

pz doesn't let you do that, server and client must have matching mods

wraith flame
#

best way to sync is outside the game πŸ™‚

fervent wraith
# small topaz In case you send those "snapshots" to the client via sendServerCommands, it is q...

We’re currently rebuilding our mod (The BlackBoard) for B42 and ran into something with live UI updates.

Current V2 architecture (intended design):
Server-authoritative state.
Server builds snapshots and sends them via sendServerCommand.
Client receives snapshot -> UI should rebuild only when snapshot arrives.

That part works in general β€” players see new notices after closing/reopening the UI β€” but while the UI is already open it doesn’t live-refresh.

How V1 worked (and why we’re confused):
In V1 we didn’t use a structured snapshot system.

We pushed data using ModData / transmitModData, and the UI was effectively reacting to ModData updates. It wasn’t super clean architecturally, but it DID live-update for everyone instantly.

So:
V1 = messy but live-sync worked.
V2 = clean snapshot architecture, but UI doesn’t refresh while open.

Question:
Is the intended B42 pattern basically:

sendServerCommand -> client NetHandler receives -> directly trigger UI refresh from that handler?

Or is there a better pattern for β€œUI currently open” to subscribe to incoming snapshot messages?

Right now it feels like either:

  1. snapshot arrives but UI isn’t listening, or
  2. UI instance isn’t hooked into the event correctly.
willow tulip
#

public Map<String, ItemRecipe> getItemsList() is this technically returning a LUA table?

#

(having problems figuring out how to iterate over the keys..)

bronze yoke
#

no

willow tulip
#

replacing the java of
iterator<String> it = this.itemsList.keySet().iterator();
with

            local keyset = recipe:getItemsList():keySet();
            local it = keyset:iterator();

but it crashes with attempted index: iterator of non-table

bronze yoke
#

to start with it'd be a Lua table, but

#

i don't think the return type of keySet is exposed

#

you can use transformIntoKahluaTable to convert hashmaps into tables

#

this isn't typed as a hashmap but it probably is anyway

#

it's a safe bet that most Maps are really HashMaps

willow tulip
#

thanks, got a little further.

#

private void checkItemCanBeUse( ... you stupid private function.... grrr.... another function I have to translate into lua

#

But then I guess it was only a matter of time until I had to change this function too

#

} else if (itemFood.isRotten() && cookingLvl < 7) { ok = false; }
just... no, no rotten food usage thank you very much.

tepid skiff
#

Adding the finishing touches to my Heavy Attacks mod. Different animations depending on the weapon. Guaranteed to be a critical hit, but forces you to stand still and consumes a lot of stamina.

blissful seal
#

ahahah that was absolutely amazingly badass

tepid skiff
patent lichen
#

any modders for hire available?

#

or anyone willing to collab on a small project?

tranquil kindle
#

You should give small idea of what you'd like to have made, or you could post request in pz modding discord

#

The community one*

patent lichen
#

I've got the base work done but Im not a pro so Im running into issues, its just a simple exchange money found in game for server shop "zPoints"

#

the new b42 crafting system is a little different so working out recipes and callbacks etc

#

was hoping I could either pay someone or have someone willing to collab to validate what I've got

paper ibex
#

zPoints is your custom mod system ?

#

I've finished the shop project before.

patent lichen
#

nice and thanks for the resource reference!

paper ibex
humble imp
#

Does anyone know how to extend the information presented to the player when they hover over an item? I found the function InventoryItem.DoTooltipEmbedded() - but it's in Java. Is it possible to extend it?

paper ibex
#

iirc you need to hook the item tooltip

humble imp
#

Would you know what class / lua file that would be in?

tough oxide
#

sidenote - ive spent the last couple of days creating an object that respects inheritance - anyone interested? if so im happy to setup my more anonymous github and share

#

this is^ all for lua if its not implied

#

i need to git init anyway because ive been wildwesting it and making huge sweeping changes and hoping for the best

#

it even calls __init automatically on :new from the parent to current child (including any inheritance along the way)

#

its basically a proxy

#

or exactly..

paper ibex
tough oxide
#

oh god.. i need to git init asap - im seeing how cool __call can be

#

are there any lua functions i should consider when thinking about kahlua?

#

ive been running all this code on 5.1.5 vanilla lua but havent actually tested it with kahlua

paper ibex
#

so test it, give basic example?

tough oxide
#

my next goal is this

local SomeObject = SuperCoolClass:derive("SomeObject")
local myInstance = SomeObject("Values to :new")
print(myInstance:interestingMethod("value"))
tough oxide
#

I’ll try to get it out tonight

paper ibex
#

Should it be: Triggered BEFORE the distribution tables have been merged. ?
Because of the name OnPreDistributionMerge , but OnPostDistributionMerge also explain the same after the distribution
Which is weird

---
---@alias Callback_OnPreDistributionMerge function

---OnPreDistributionMerge: Triggered after the distribution tables have been merged.
---<br><br>
Events.OnPreDistributionMerge = {
    ---@param callback Callback_OnPreDistributionMerge
    Add = function(callback) end,
    ---@param callback Callback_OnPreDistributionMerge
    Remove = function(callback) end,
}
tough oxide
#

Id love some real world uses to show its issues

frank elbow
#

The first example that comes to mind is next

#

There are other examples but that's the one that's top-of-mind. Unsure what would be relevant to what you've done since really setmetatable is the main thing you need for a β€œclass” system

tough oxide
#

Yeah I’ve avoided any outside deps so far but I do plan to implement toJson at some point

#

So you get it for free

#

β€œFree”

frank elbow
frank elbow
#

I adapted rxi/json (with changes for Kahlua's string.char quirks) for mine

tough oxide
#

Yeah there’s a good existing one that I assume needed some work that Albion uses

#

I’m pretty sure that’s the same one

frank elbow
#

I suppose I reinvented the wheel lol, but I would've had to anyway bc I rewrote them to be used as encoder & decoder objects

tough oxide
#

Is it open source? I’ll use yours

#

That’s how I want to use it

#

But I want to rebuild inheritance so that should be fun

frank elbow
#

It is, but my library is in an "I am going to make breaking changes at any point if I want to" state (i.e., 0.x version)

tough oxide
#

Same

#

I’m 0.0.1

#

Near 1.0 but I want actual use cases first

frank elbow
#

I don't think I'll be comfortable saying 1.0 on that until my mods depending on it are stable πŸ˜… I don't want to be bothered with keeping the public interface stable before it's necessary

tough oxide
#

Fair

bronze yoke
#

my library is in the ever reliable 'stable unless i don't think anyone uses this and can sneak a breaking change in without anyone noticing' state

wraith flame
frank elbow
#

I've definitely snuck a breaking change into my chat mod's API, but I think in the commit message I did admit that below the first line (including the justification of "no one is using this yet", because no one was at that point to my knowledge)

#

So my semantic versioning conscience is totally clear

wraith flame
bronze yoke
#

for my content mods, major and minor versions are mostly meaningless, major version increases just mean i broke the majority of the API instead of just some of it

tough oxide
#

I haven’t done a public project in awhile so semvar has just been in my head

#

I love that ui

wraith flame
#

ive been cooking in the shadows. big release coming in the next few months

tough oxide
#

I swear at some point I’m gonna wrap up the ui stuff

wraith flame
#

best way for UI just make an abstracted system thats easy to plug n play. every panel is a dream after

tough oxide
#

Yeah it’s why I’m on this journey of making a class that actually respects some oop principles

#

And also started adding some type stuff

#

Very basic at this point

wraith flame
tough oxide
#

On the list is an idea of interfaces

wraith flame
#

i pretty much cooked up nopixel for Zomboid. decoupled from game thread also πŸ™‚

#

open beta in about a month

tough oxide
#

Rp nerd?

wraith flame
#

am a lua hater

#

and yes rp nerd

tough oxide
#

Same

#

Also loving lua and how Wild West it is

wraith flame
#

i use it for client side enforcement but i dont run any logic on it

#

alot of things i had to do in java but im doing everything in rust πŸ˜‰

tough oxide
#

lol - so rust to lua or rust to java?

wraith flame
#

lua - java dumb pipe - rust - db shh

tough oxide
#

Rust never hooked me

#

I did a sample web server and moved on

#

C# was the most recent hook

wraith flame
#

just anoying to work on cause the compiling takes long 😩 but for concurrency is the king

#

no zombies , limited map to 1 city, im wondering how many players i could get at a time. almost everything is decoupled but its still on vanilla packets for player and vehicle state, and other things like chunkdata obv

tough oxide
#

I mean how call you call yourself a dev if you didn’t introduce another language

#

I got so burned out on build processes a few years ago

#

Then introduce ci/cd and the Travis files - I’m good

#

I’m happy to do things in the intended language which is why I’ve been writing this Frankenstein of a class

#

Also lua has a lot of flexibility if you just dive in

#

I plan on adding some level type checking including inheritance

#

I’ll have to toy with pz inheritance to make it work

wraith flame
#

for an in depth RP system running all of this on lua alone would sadly munch the game thread to oblivion. every plant growth tick would be running with the economy tick and so on. i learned the hard way when fiveM was new, and i was making lua soup salad

tough oxide
#

As it stands I can reliably say if you inherit my class

#

I should probably quote finger class cause it’s a table but for its purpose it’s a class

#

does fivem also use lua? i thought they mostly used some form of JS

#

be it preact or whatever

wraith flame
#

cant have a cleaner arch then:

Full Stack Trace: wallet.deposit

Transport.send("wallet", "deposit", {amount = 500}, function(ack)
if ack.type == "ack" then
-- ack.state.wallet = 200, ack.state.bank = 5500
else
-- ack.error.code = "INSUFFICIENT_WALLET"
end
end)

Layer 2 β€” Server Lua (Identity Injection)

Layer 3 β€” Java Bridge (Transport Only)

Layer 4 β€” Rust Backend (Authoritative)

1. Payload validation β€” Extracts amount from JSON, verifies it's a positive f64. Rejects with INVALID_AMOUNT or INVALID_PAYLOAD if malformed. 2. Identity resolution β€” Takes the username (injected by Layer 2, never from client) and resolves it to a character_id via DB lookup. Rejects with NO_CHARACTER if the player doesn't have an active character. 3. Balance check β€” Queries character_wallets for current cash-on-hand. If wallet < amount, rejects with INSUFFICIENT_WALLET and includes current state in the error response so the client can update its display. 4. Atomic mutation β€” Single SQL transaction: UPDATE character_wallets SET wallet = wallet - 500, bank = bank + 500 WHERE character_id = ? 4. Both columns update or neither does. No intermediate state where money exists in both or neither. 5. Response emission β€” On success, builds an ACK: {type: "ack", system: "wallet", action: "deposit", request_id: "<same-uuid>", target: "<username>", state: {wallet: 200, bank: 5500}, meta: {ts: 1707234567}} 5. On any failure, builds an ERROR with the same request_id, an error code, and a human-readable message. Every code path emits exactly one response. No silent failures.

The response travels back: Rust β†’ Java β†’ Server Lua β†’ Client. The client's Transport layer matches the incoming request_id to the registered callback and fires it.

The ATM UI updates balances.

tough oxide
#

for the record i love everything you are doing

wraith flame
#

and back almost 6 years ago i think, was all lua, except nopixel had decoupled

tough oxide
#

do i think its a bit crazy? for sure, but im doing something that people will also love and hate

wraith flame
#

its over engineered to oblivion but my goal is maxmum player count

#

i was able to do 100 concurrent npcs before it started getting a bit funky

tough oxide
#

yeah, i think im probably in the over-engineer camp

#

surely i can do this perfectly, right?

#

i just need to plan for everything

wraith flame
#

or theres always one more thing

tough oxide
#

yeah, i have a list of "one more things"

wraith flame
#

same its called :

tough oxide
#

lol

#

that commit log must be a fun time

wraith flame
#

yea its dispicable

blissful seal
#

this is dope, i like crazy

tough oxide
#

let me see how hard it is to recover my alt git account

#

i cant remember where i linked cause i just started doing everything from my real name

tough oxide
#

--force

paper ibex
#

--random insert Lua meme, ~~/array/ start at 0~~

tough oxide
#

(dont do that)

tough oxide
#

alright, got my alt git account

#

time to start sharing

#

nevermind - i get to pick a fight between my main account and alt account

tough oxide
willow tulip
#

Neat, you can now make soups and stews out of pots of vodka

#

sadly will need some hooks or something to apply the proper amount of drunkenness but oh well..

tough oxide
#

Isn’t that a public method? I could’ve sworn I saw it when I was looking at stats

willow tulip
#

setAlcoholPower?

#

its used for disinfectants only lol

tough oxide
#

lol

#

Of course

willow tulip
#

there is isAlcholic... but that only applys a fixed amount based on the baseHunger (ignores alcohol power.. although I do find the idea of steralizing your wounds with alcohol soup to be funny)

#

and if the item is beer or has tag Low_alcohol or something

#

so unlike fluids they don't have proper arbitrary alcohol in food content support -_-

#

so best I can do is record the alcohol amount in the modData and add a onEat hook that applys it. or something.

#

honestly the drunk effect is meh so I don't really care that much atm πŸ˜›

#

but the calories and unhappyness buff is nice

tough oxide
#

I usually use the drunk effect for rp when it’s time for me to put on my best outfit and clean out a region

#

Pair that with true music

#

And a boombox

#

It’s a great time

willow tulip
#

I just thought it would be funny

#

the calories in a liter of vodka are pretty substantial too

analog mesa
#

Time to convert all the foods into liquids

paper ibex
#
---@param roomName string
---@param noKids boolean
---@return RoomDef
function __BuildingDef:getRoom(roomName, noKids) end

what noKids mean drunk

paper ibex
#

Oh, so that means defining the /bedroom/ with a chance to spawn naked zeds.

bright fog
#

lol funny

blissful seal
#

lmao nice

#

how do folks feel about mods exposing internal events? ive started using this pattern in my mods where i register an event bus, and then fire internal mod events of my own so i can chain together functionality in a more predictable fashion, helps cut down on a lot of boiler plate and duplicate code -- it would also allow anyone to hook into one of my mods and extend the functionality per each event

bright fog
#

Depends what kind of events we're talking about tbh

blissful seal
#

domain specific, like in my cart mod -- i fire an onCartPickup, onCartDrop etc..

#

So like, you're a would-be addon modder, you could say change the properties of a cart on pickup thru that event

#

play a meme sound everytime u drop the cart idk but now its extendable 🀷 and it makes more sense in my brain πŸ˜‚

paper ibex
#

event driven is good

bright fog
#

We do use some stuff like that in the Horse mod yea

#

Tho we use a custom events library

#

Not the vanilla system

blissful seal
#

oh neat, yea i just rolled my own thang its not alot of code tbh but it has made my mods way more consistent

blissful seal
#

whats the library I wanna see

#

oh Starlit duh

paper ibex
#

can try hump signal

blissful seal
#

ah one small difference in our implementations is, I establish event priority, so u can have predictable event ordering

blissful seal
#

anyone interested in a unit testing framework for their mods? I rolled my own test framework also, vanilla does have unit tests as well but I found it hard to hook into that system well

bright fog
#

Actually there's something for that

#

That was released recently too

blissful seal
#

oh shit

frank elbow
#

The vanilla one is written in such a way that it's basically specific to just the timed actions tests; recent addition to my knowledge so hopefully it becomes less half-baked (seemed possible to hook into but not worth the trouble)

bright fog
#

Notloc released one

#

I'll see if I can find it back, we want to use in the Horse mod

bright fog
#

Idk what it's worth tho

frank elbow
#

I opted for external unit tests for the purpose of running them in GH actions, but that's way more of a pain due to requiring mocks

#

Eventually I intend to generate the mocks but haven't taken the time to yet

blissful seal
#

i considered that, the mocks are what stopped me

#

really what i want is headless PZ for testing

frank elbow
#

That crossed my mind too but mocks seemed like the path of least resistance

blissful seal
#

Headless PZ is too crazy but that would be so sick

frank elbow
#

I think it might be technically possible given the existence of the command-line arguments that dictate which server to join, but it certainly wouldn't be straightforward

#

Ironically, the simpler way would probably be a java mod

blissful seal
#

that's probably the way, it would still be pretty nutty, but easier

umbral raptor
#

hi guys, i have a mod idea that might add something new and fun to do in vanilla, but might be a bit difficult to code. i call it the caravaneer mod, its a vanilla trading system, simply across the map there would be new added bunker enterances with intercoms, there would be a trading system where specific bunkers would produce special things like clothes or textiles and sell them for cheap or buy specific things for an expensive price that they need (pre-programmed). would be very fun for a nomad playthrough where u travel around the map trading and essentially running a caravan out of ur car.

so for example, a bunker would exist outside of west point that produces fresh crops and alcohol, but would be willing to buy clothes or guns or ammo at a high price (price determined using itemtype). while a bunker in louisville produces guns, ammo, and medicine, and willing to buy foods, alcohol, and such for a high price. a player could run a trade route between the two points or settle beside one of these points and trade with it what they produce/loot.

#

would such a mod be possible? specially with a pop-up menu similar to vanilla's trading UI

bright fog
#

Yes that would definitely be possible

nocturne salmon
#

Who here has experience creating maps?

bronze yoke
nocturne salmon
#

Rad

umbral raptor
#

after so many playthroughs im honestly trying to spice up my gameplay in some way.

nocturne salmon
#

But I’ll ask here anyways so you guys know the expo center in the Louisville? I’m trying to revamp that place and turn it into a gun expo center but I don’t know what to do or where to begin

bright fog
#

Really

#

You're asking mapping stuff, ask in mapping you'll find way better help there

#

Not much sense to ask here

paper ibex
wraith flame
blissful seal
#

the client tho

wraith flame
#

pipe client logs. fullstack in one place. make an exec function that test across all layers. Only thing missing is visuals obviously.

#

echo '{"type":"command","system":"wallet","action":"deposit","request_id":"test-001","username":"admin","payload":{"amount":50}}'

expected ack:
{"type":"ack","system":"wallet","action":"deposit","request_id":"test-001","target":"admin","state":{"wallet":950,"bank":1050}}

bright fog
#

πŸ‘€

wraith flame
#

call me crazy or call me over engineering andy but it eeze what it eeze

#

imagine an entire RP framework on a single thread

#

not doing that:

lusty drift
#

if i was going to add/change some behavior with zombies would it be best to do it in shared or server?

#

it would also interact with the world

bright fog
#

server folder is also loaded client side

#

server folder is just only loaded when launching a save

#

See the "Lua (API)" wiki page

willow tulip
#

@knotty stone Any chance you'd want custom HP/Weight and trunk capacities for your W900 vehicle mod? And custom engine sounds?

knotty stone
#

Im not rly in the mood for modding atm xD. i have seen your fix stuff in realistic car physics for the trunk and stuff, but have not done anything yet.

lusty drift
#

thanks tho

willow tulip
willow tulip
#

Thanks.

lusty drift
#

i took some code from a mod

#

fairly simple

#
if not SandboxVars.InjuredZombiesStumble then
    SandboxVars.InjuredZombiesStumble = { BaseChance = 40, MinHealthPercent = 70, MinCooldown = 25, MaxCooldown = 60, }
end```
#

some things you can treat as if theyre already there

#

technically globals

bright fog
#

Don't think that works

lusty drift
#

i mean its in my game and it works perfectly fine

bright fog
#

That won't work in MP

#

If I remember right

#

What are you trying to do here ?

lusty drift
#

oh yeah thats fine i just am here to learn the basics

#

thats all

wraith flame
#

learn the basics right fro that start is best imho

bright fog
lusty drift
#

this is a starting ground for me

wraith flame
#

we both thought the same

lusty drift
willow tulip
#

@knotty stone what semi truck is it supposed to be based off anyway?

bright fog
#

If I teach you how to jump from a cliff, you learned something right ? You wouldn't good learning

willow tulip
#

Thanks

wraith flame
#

black moon your the car guru right

bright fog
#

If you don't give me more context, I can't help you

willow tulip
wraith flame
#

what control do we have at runtime vs whats locked

#

with physics in relation to changing hp torque etc. iirc its per model right? like if i change on the fly itll affect all of the cars spawned of that type?

#

and do we have any control on RPM i couldnt figure it out

willow tulip
#

carData.vehicleValues["SemiTruck"] = {horsePower = 425, weight = 8164, cargo = 100, engineSound = "Engine1"} seems about right then.

#

carData.vehicleValues["SemiTrailerVan"] = {horsePower = 1, weight = 4140, cargo = 5000, engineSound = "Engine1"}

#

Hu SemiTruckLite...

#

Do note: overhauled HP is worth 4x as many 'vanilla' HP...

#

So lets see how that works out

#

0~30mph time is now 20 seconds

#

(with empty trailer)

#

10 seconds without, hmm

knotty stone
#

kinda ok for rl but for game a bit slow? xD

willow tulip
#

yea, I'll prob double its HP

#

... making it an insane fuel drinker but oh well

#

guess I might shave some weight off too.

#

Having some problem getting it to take out vehicles it collides with properly.. will need to relook at my physics code.

#

Didn't really want to use 'non realistic' values for this overhaul but at the extremes of semitruck I may just have to.

#

(There is a sandbox setting to adjust the torque of cars indivually, of course)

#

@knotty stone Cool at the animal trailer and lowbed, never noticed those before