#mod_development
1 messages Β· Page 369 of 1
oh.. interesting
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
booo
just use the in-game debugger π
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)
then how to debug on /production/ MP server ? adds print() then publish mod update again? 
kahlua calling java method, not translated to java
debug on host with yourself (generally works)
or release 2nd version of mod π
or sandbox option for more debug output
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:
- 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)
- Steam env, -debug, game load mods from ZomboidClient2/Workshop/ . this is before publish the Workshop
- Steam env, game load mods from Steam/Workshop/ . this is after publish the Workshop . also need control the -cachedir
This is worse, imagine MP servers restart everytime you update the workshop version, like restart every 15mins, when 32 players is playing
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)
afaik if you use mod folders like a seperate mod it won't trigger that
so i split the -cachedir to not mix with each other, also delete Zomboid/Workshop/ after published so it wont load from it , the load folder oder also affected by Debug
the load folder oder also affected by Debug
interesting, didn't know that, whjat changes exactly?
sorry, i have to check again, that was my cli typo error
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
right here https://pzwiki.net/wiki/Mod_structure
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.
Zomboid/Workshop first from my last experience, when join server you still need sub to the workshop and download the mod to steam workshop folder
yea, though iv played on a MP server with my mod (on my PC) and im 90% sure it used the workshop version when I hosted the server that had its 'steam workshop id' filled out in the 'needed workshop items' list
but iv also got checksum off so dunno
checksum off because admin role bypass checksum, or server turn it off
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.
ah yes, when you use host mode, you are not login with admin acc
But that is still better then barotrauma, that as the host, you can lag worst then playing counterstrike via dialup from russia.
try use the cli like .bat on Windows then? steamapps\common\ProjectZomboid\ProjectZomboidServer.bat
bonus points: if you download from server the mod instead of subscribe in barotrauma.. your download goes at < 3kbit/s
Iv honestly not tried in B42
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)
haha. no idea
b42 is the same
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?
β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)
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.
Update you notepad++ lately?
https://thehackernews.com/2026/02/notepad-hosting-breach-attributed-to.html?m=1
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?
or should i even care and just get something installed so i can quickly run stuff locally?
I'd get the latest 5.1 if you're trying to be close to the game version, but of course it won't be exactly equivalent regardless of the patch version
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
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
interesting - i considered doing that myself
but it seems like a very deep rabbit hole
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
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
If the files under test don't depend on game functionality or Kahlua functions it's very straightforward
Certainly true, metatables are the foundation for most if not all OOP in Lua. The game has its own pattern for Lua βclassesβ which most people seem to adhere to (I do too, for simplicity, but with a different base class)
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
Not for the past decade or so...
also, I don't use notepad++
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.
Yes, but its a screenshot from someone elses discord that I screamed in terror the entire time they scrolled the file
ooh ok haha
not sure - i'm looking but OnCreatePlayer is what i use - it doesnt seem to imply the character is pre-existing though
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..
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...)
You could apply similar logic but use global mod data instead. For MP I think it'd have to be indexed on the player username & there would need to be consideration for splitscreen if you intend to support that
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 π)
So it reloads the lua code every time I load a game, no matter whether my mod is already enabled via the main menu?
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)
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.
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?
maybe you can override/hook ISWorldMap.ToggleWorldMap to track
...media/lua/client/ISUI/Maps/ISWorldMap.lua
Ohh okaii I will try it, thank youuu
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 ?
What exacly you want to do, what item?
player object have it own mod data u know
vanilla duffelbags
What do you got so far?
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
Show your item script and which version of game it will be for
42.13+
i have it like that for every vanilla duffelbag just dont wanna send all
module Base
{
item Bag_WeaponBag
{
BodyLocation = LowerBack
Tags = LowerBackDuffel
}
i've tried to do rest through lua. should i send it ?
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
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
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?
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
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)
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)
I'm honestly unsure why would you do it with lua
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)
`
i've tried to do this like that but if you have better idea then i'll try to do it
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?
then what about vanilla ones ? do i need to disable their spawn and replace them with this new created ones ?
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,
``
like that?
module Base { item Bag_WorkerBagLowerBack { BodyLocation = LowerBack Tags = LowerBackDuffel } item Bag_WorkerBag { BodyLocation = Back Tags = WorkerBag ClothingExtraOption = LowerBack ClothingExtraSubmenu = Base.Bag_WorkerBag ClothingItemExtra = Base.Bag_WorkerBagLowerBack ClothingItemExtraOption = LowerBack }
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.
the player mod data sync when client connected, no require extra calls. If client only, how about mod options?
they do not sync automatically afaik
it sync when player login/logout and server save schedule
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
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.
anyone toy around with the getFileWriter and (de)serialization?
looks like most people just use it for basic ini files
JSON is pretty popular too
nice - looks like there might be a pure implementation too
need to file that one away if i ever wanna do a web^ api
wait, we can use json in lua without custom module now?
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
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
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
Just a text I/O, but that does not mean re-designing the wheel if a working one already exists.
here's the one i nicked for starlit https://github.com/demiurgeQuantified/StarlitLibrary/blob/main/Contents/mods/StarlitLibrary/42.13/media/lua/shared/Starlit/internal/json.lua
some others i've tried don't work in kahlua
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
is there a way to influence the probability of vehicle key appearance in modded vehicle containers ?
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"
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)
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
i have no fucking clue why they do that
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
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" },
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
yea assuming self.__index = self was already set elsewhere? my guess
yeah, it happens in :derive
probably all good then
i can only assume setmetatable didnt return when they first started
sometimes its better to be explicit, scripting languages get to be a handful cuz of all the tricks and shortcuts
yeah, im hoping to have enough steam to create something that people get excited about as much as disgusted by
top tier goal setting β€οΈ
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
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
Lua LSP + the umbrella type stubs help for sure
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
that is the way
Also another reason albion is a superstar
facts
yeah, that's why i'm baffled by it π
a normal implementation would look like this:```lua
local MyClass = {}
MyClass.__index = MyClass
function MyClass:new()
return setmetatable({}, self)
end
instead of doing it once when creating the metatable, they do it every time they're about to use the metatable instead
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.
We cannot add tables, we cannot compare tables, and we cannot call a table not with that attitude you can't.
Not without metatables, you can't
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?)
Assuming a does not have a member foo and b is a table without an __index field (passing a table without not bothering to check, but this wouldn't really make sense anyhow so choosing to take albion's word for it) yeah__index treats that table as __index iirc
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)
So an object can override its metatable by having its own instance of the variable/function?
i don't think that's true no
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)
that brings me to my next question
is there some universal function called(?) when you try to access a.doesntexist() ? or a.doesntexist = ?
That would be __index, if it's a function
I believe the PIL pages albion linked explain all this
So it can be a table or a function? interesting.
there was more?
Yes, click the arrow in the bottom right
Oh ok, I thought it was just that one page -_-;
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
@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
it uses __index yeah, specifically the first time that class is indexed it uses that instance to grab all the fields
The "Lua not LUA" enforcers are knocking on your door once again
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
Makes sense considering you have to loop anyway to identify the fields
Ahh cool
So dumb that they only gave us the barest of reflection in release mode π
More devs need to realize they can at least do that level of reflection though.
I'll take what I can get, it works well enough
yea someone made a full LUA based capacity override mod
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 π
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
then it would have worked with any mod, transparently if they did -_-
100 capacity limit on cars is bug, should be 1000, but honestly..... WHYYYYYY ANY LIMITS?!?!
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)
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".
"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
clear steam cache or flush your dns
(infact checking the thumbnail for your mod is under 1MB is likely the only valid advice there)
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
reset Winsock
and
flush DNS Cache
save me, without the need of restart the computer everytime upload workshop
in my testing i think you can override it regardless
and its my goal
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
i need to do more testing, but it seems like __index is called on get regardless
I see. No, that's not the case
let me check
no, you're right
but you can override the set and then by proxy override the get
i think...
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)
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
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"
the most common convention in lua is a leading _, everything else is pretty divisive
does it come with a ruler extension that slaps their hand if they try to set it?
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
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?
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
okayy, I'll try it
ill keep looking
could be ISBuildWindow via ISUI/Building
the adults might be sleeping
I mean.. I guess with no return, it returns nil... but..
return ISCraftingUI.instance and ISCraftingUI.instance:getIsVisible()
seems cleaner.
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
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
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,
}
}
so I guess you forgot to make the registry in registries.lua
I am confused. What am I supposed to register? I didn't have any custom tag. Does module need to be registered too? How?
items need to be registered in registries.lua, you probably have the testmod sample from Aiteron that was distributed with B42.13, right ? if so item registry is part of it
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.
I am so confused now. Is the ItemType.register not referring toItemType = base:normal? But something completely different?
those are different item types π
AVS.ClaimOrb is an Item type, who's meta-type is base:normal.
Nope, doesn't work. I just figured out why, the game simply doesn't like the craftRecipe running from a different sub mod. I don't know why such behavior for MP.
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?
Something like this?
@blissful seal is working on creating scenes which might be up your alley
yea that would be interesting, this thing im working could be leveraged for like "Cutscenes" in game, idk how dynamically they could be done but I was def pondering about that last night -- hers an example scene: https://www.youtube.com/watch?v=g-l-bRmZpHo&feature=youtu.be
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)
i deserve that
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.
that is not correct, these refer only to items' ItemType parameter, which aren't moddable anyway so this registry is useless to modders
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?
I've tried making the shovel back all 0.00 and the effect stays the same as when it's -90 and 180 rotation.
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)
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.
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
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
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
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
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
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.
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
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
trade off, we are mad because of reading noise content from un-trained chatgpt response, right?
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
hmmm, true, you cannot claim an ai generated content
but not mean your brain and time to making it is worthless
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
very hard to me to explain rn, so we know the reason and maybe stop before it become off topic
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 π
Whats the point of reuploading a mod lol but ya strike fast with that
we hadn't released the mod yet, it was highly anticipated and they were just trying to steal our thunder, clout chaser basically
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
Some people will do anything to get people to give them accoladesβanything other than putting in any effort whatsoever
wow the audacity...
That situation sounds incredibly frustrating & I hope y'all can still get it taken down
i really do hate that too, muy unfortunate.
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 π
uk what AI is pissing me off, the AI thumbnails π€£
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 
I barely click on those mods
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
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
Aren't a lot of those just commission mods?
Is that the case? That wouldn't surprise me
add me
Your discord reqs are closed but add me π
Some people -_-; Especially since you'd prob make a framework for animals if they bothered to wait for your mod to release and asked nicely
Hope they enjoy trying to fix all those bugs in their 'different codebase'
well let's not talk about it too much, i think it gets a little unpleasant
98% of zomboid modding is in LUA, and its questionable how much of the PZ api AI knows.
(especially when it changes every other version of PZ)
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
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
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
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.
so as long as your mod works i believe you probably put some effort into it
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
And have your AI learn from the code review? I think not (this is a joke, it'd just be for lack of time)
Ok but iv seen TIS code that im sure wasn't tested by the author once too. Like the debug menu for calories that tell you in very clear terms that a cow only gives you 2000 calories if butchered
And a rabbit gives 3000...
hey the code works, the numbers are just fucked up π
Butcher hook bug still not fixed π
i've seen stuff like mods that use modules but the require paths use the wrong separator and path so they can never succeed
I wonder if this is what happens when Person A is responsible for cows and Person B is responsible for rabbits
The discourse around AI is all about hallucinations and lack of appropriate context, but humans ahve the exact same failigns
Nah im pretty sure TIS are just aliens and once heard some news segment about how people could eat beef every day but rabbit only ever 2nd day and set the calories based on that.
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
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
Depends what your mod changes.. if its just LUA, you can go back to main menu and load a save again
Oh lua updates in main menu?
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)
I HAVE to mention the βLua not LUAβ at this point
Trying to get a locket to show up in the OnNewGame event
It does if your main menus mods are different from the saves mods
So either way I gotta start from menu
1, debug mode with F11 so you can hot-reload the file
2, debug mode on the main screen you have Reload Luas
3, same on server command but need vanilla code inject and rcon, or your custom lua code to trigger reload
There is also a 'Reset Lua' button on the main menu.
You can use a string as a key can't you? I can't figure out why this refuses to index

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)
It prints the table itself as table 0x1398301873 though
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
i bet its time to add more print() to trace, lol
Against gods better judgment i'm running like 50 mods
well, what is your goal at all
toString-ing it doesn't seem to work, do you know if getName pulls the string version of that id or its ui name?
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
Whole mod is in occupation mod, atm i'm trying to add spawn items based on a table filled with the corresponding starting items for each new occupation
you can use the characterprofession object as the key instead
imo, first you can try local development with only your mod active, to make sure its working, then check compatibles with other mods later.
also hot lua reload will not works as expected iF your code file regist Events...Add
try .Remove them first
Something like this?
you'll need to enclose the key with [] but yeah that's what i was going for
Hell yeah that worked, thanks.
I kinda just figured i'd roll with it till I hit a direct problem from it, so far its just my console log looking like an loner kids death note
Like good lord man do you have to print every change
First time trying to mod. I hot-reloaded the Lua file using Events.OnTick.Add() 
item tweaker did the exact same kinds of prints, back when that was popular a server host i knew tried disabling the print and it made their server start up 40 seconds faster
I just wrapped mine in a big fat if statement with a quick toggle
Wait does it not clear them on reset just restart?
nOOOOOOOOO! ||B41?||
in build 42 all event callbacks added by a file should be removed when that file is reloaded
and have no limit of registered event like nodejs
I've gaslighted myself several times just calling reload
someone make a mod to improve the reload experience π
oO good to know
I know baro has a reloadpackage command built into it that was so helpful
I actually like building those kinds of tools, anything to make me even lazier
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
Built into the LuaCS mod*
hey siri make it works for me lol, am i crazy to fear about the rise of terminator
^ 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
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
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 π
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
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 π€£
Your analogy means people using AI are suspectible to becoming "Ikea" coders which is pretty accurate.
we had that before AI yknow?
Any ideas on why a custom item seems to ignore the 'weight' parameter in its definition and just always defaults to 1?
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
It's just the global unpack
Oh so just unpack(table)?
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
this is the true danger of AI.. forgetting how to think
to some extent i definitely agree
but I think of like, lets say reading a 15 page document at work, like a reading tax
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.
I respect that perspective for sure
In my day we learned to page through that document in seconds to the page that was needed at the time.
In mine as well π
.. even without an index.
Hell, iv done microcontroller and FPGA programming...
where you just get an unindexed 100~900 page datasheet
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
but as more of a designer/orchestrator thats what megafunctions are. Modules made by programmers who know how to design a pipelined 4 cycle adder.
Exactly!
Programmers just seem completely against using anything they didn't code when it comes to frameworks π
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
Avr and pic assembly, yes I know them, why? π
Yea I got someone to pay me to learn FPGA's to hack some 1990's car ECU in realtime
yep. Don't think anything ever really came of the project, but I complete my end, the hardware
it's just simply my belief that someone like you, with an AI agent on your side, the sky is the limit actually
Had realtime emulation of the overly complex EPROM bus
it was the weirdest bus thing.
damnnnn
it had a 8bit bus.. No seperate address lines
thats really crazy π
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.
oh my god ur truly hardcore, and i respect the hell out of it
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
so u basically reverse engineered it
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 -_-
that's what its all about tho
yep.
i love all that stuff man
But it also takes an incredible body of baseline info to figure that out
That massive mountain of context us humans are so good at building and retaining
though iv never seen an (E)EPROM with combined address lines since, other then the serial ones
dang u got stories huh Black Moons, u seem like you've seen some stuff π
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
does anyone know if it's possible/how to register tags if another mod isn't enabled?
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
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
Try rooting around in this ones guts https://steamcommunity.com/sharedfiles/filedetails/?id=3342191739&searchtext=trait+magazine
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
Like how the fuck is this thing gonna look me in the eyes and tell me theres nothing in this array to iterate through
table shuffle?
or return one of?
shuffle?
what is your goal of that function
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
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
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
My problem is the rotations don't seem to be working in game for me at all? I've tried all sorts of values and it never changes.
Thats a useful page, had no clue functions were intensive
Are you fully reloading? I had some issues where I swear PZ was gaslighting me and i wasnt seeing changes reload either. In my case I had an old version of the mod in my local mods folder somehow
FWIW it's become less bad since this was written, still avoid them when writing performance sensitive code but it used to be insane
Ooooohhhhh. That may be it. How do I fully reload?
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
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"
posting this again so it doesnt get buried π
Prob because of using ipairs instead of pairs, if your not dealing with indexed items that start at 1 and continue from there
opps saw someone already mentioned that
Ended up getting there
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 -_-
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
each item in PZ is a totally unique item, so you'll have to use a for loop.
(also why you shouldn't just casually have 1000's of bullets hanging around, put them into boxes/cartons..)
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?
level up sounds are bugged, wait for a patch
Ah good to know! Thankyou!
I'm curious now is there a bug tracker anywhere i can follow?
Forums
Thanks!
anyone find the offending code for the AnimSets?
thats what i searching for last week....
Ah I was wondering why they died.... So sad without dopamine hit.
Did u use the evolved recipes?
?
the fire is walking away for me
The vanilla cooking use the evolved recipes to add ingredients ,but its not so good,so I wondering did u have some better way
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
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.
yea theres several factors at play, theres also gethungchange and gethungerchange that do two totally different things
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'
im just scoffing at the fact that gethungchange exists
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
thats some bubble gum on a leak stuff and im all for it
whats the idea behind the kitchen zone?
you get access to all items in the zone within reason?
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
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
Ah see. im just rewriting the whole 'add stuff to evolved recipe' from scratch
because I HATE LEFTOVERS
and I hate clicking like, 20 times just to make a decent meal outta eggs -_-
i work with click counters...
lol
it also shows you how few calories you actually own -_-;
you should, down the road, setup some sort of template where people could make namable meals from ingredients
yea iv considered being able to save/load recipes
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
Asking again
might be worth inspecting \steamapps\common\ProjectZomboid\media\scripts\generated\items\weaponpart.txt or weapon.txt in the same folder
@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.
and maybe ingredient qualilty
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.
Could start with a basic βcuttingβ mini game with a simple rhythm game
Imagine missing a beat and having* a chance of being cut
I was thinking that scrolling bar where you gotta hit the 'good' zone for a bonus, a neutral zone for 'whatever' (maybe it adds an incorrect amount of the ingredient?), and red for injury π
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)
It's gonna be like one of the song rhythm games, might as well go all in and add music 
Two potatos, one knife, CHOP CHOP!
I was thinking more just the ones where you have the bouncing indicator going back and forth
I think I heard a third, CHOP, in there, followed by a screech.
Me personally, more ingredients = harder song IF you were doing it that way
im not adding music lol.
thatβs a hella cool idea 
fun lil cooking minigames would go a long way for breaking the repetition lol
Thanks, wasn't sure if it was just gonna be considered annoying or not.
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"
ooh, one neat idea could be making different minigames for specific recipes 
absolutely! it could be an effective way to add more perks/incentive for lvling cooking
Yea, I was thinking of tying a lot of how good a recipe is to cooking skill, and less to ingredient count
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
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.
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.
ammonia and bleach soup please!
I mean calorie wise, making a soup outta soda kinda makes sense! its horrible, but so is everything else about PZ cooking.
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.
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
is this a web based thing?
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
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.
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 \
ive seen this in my travels, but its doesnt appear to be part of my image - i'd imagine you can do some sort of check with steamcmd
I'm playing about with a server only mod, the workshop isn't involved
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
In case you send those "snapshots" to the client via sendServerCommands, it is quite natural to update the client UI only when such a command arrives (presupposed this is the only situation where the UI should change something).
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)
Has anyone built a server side only mod that can assist with my weird mixed messages?
pz doesn't let you do that, server and client must have matching mods
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:
- snapshot arrives but UI isnβt listening, or
- UI instance isnβt hooked into the event correctly.
public Map<String, ItemRecipe> getItemsList() is this technically returning a LUA table?
(having problems figuring out how to iterate over the keys..)
no
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
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
sads
trying...
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.
This. Is. Sparta!
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.
ahahah that was absolutely amazingly badass
Haha, thank you!
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*
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
maybe you can read the source and solve your issues
nice and thanks for the resource reference!
However its more aimed towards this mod https://steamcommunity.com/workshop/filedetails/?id=3638990871
the mod Im working on is https://steamcommunity.com/sharedfiles/filedetails/?id=3655156528
you mean your mod will hooks or use this mod api?
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?
iirc you need to hook the item tooltip
Would you know what class / lua file that would be in?
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..
ISToolTipInv.render
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
so test it, give basic example?
my next goal is this
local SomeObject = SuperCoolClass:derive("SomeObject")
local myInstance = SomeObject("Values to :new")
print(myInstance:interestingMethod("value"))
Iβll try to get it out tonight
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,
}
Id love some real world uses to show its issues
Do you mean things that aren't available?
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
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β
Yeah, looks like a typo; you could add an issue at https://github.com/PZ-Umbrella/pz-rosetta-source (or just @ albion, I doubt she'd mind, but I think an issue would be preferable)
I wish json utilities were provided by the gameβI imagine many people have either written quick-and-dirty json encode/decode functions or adapted an existing json script
I adapted rxi/json (with changes for Kahlua's string.char quirks) for mine
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
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
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
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)
See https://github.com/omarkmu/pz-omi-library / https://steamcommunity.com/sharedfiles/filedetails/?id=3652613566
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
Fair
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
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
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
I havenβt done a public project in awhile so semvar has just been in my head
I love that ui
ive been cooking in the shadows. big release coming in the next few months
I swear at some point Iβm gonna wrap up the ui stuff
best way for UI just make an abstracted system thats easy to plug n play. every panel is a dream after
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
On the list is an idea of interfaces
i pretty much cooked up nopixel for Zomboid. decoupled from game thread also π
open beta in about a month
Rp nerd?
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 π
lol - so rust to lua or rust to java?
lua - java dumb pipe - rust - db 
Rust never hooked me
I did a sample web server and moved on
C# was the most recent hook
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
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
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
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
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.
for the record i love everything you are doing
and back almost 6 years ago i think, was all lua, except nopixel had decoupled
do i think its a bit crazy? for sure, but im doing something that people will also love and hate
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
yeah, i think im probably in the over-engineer camp
surely i can do this perfectly, right?
i just need to plan for everything
or theres always one more thing
yeah, i have a list of "one more things"
same its called :
yea its dispicable
this is dope, i like crazy
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
--force
--random insert Lua meme, ~~/array/ start at 0~~
(dont do that)
alright, got my alt git account
time to start sharing
nevermind - i get to pick a fight between my main account and alt account
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..
Isnβt that a public method? I couldβve sworn I saw it when I was looking at stats
what is?
setAlcoholPower?
its used for disinfectants only lol
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
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
Yea, id assume rational people would only add a little booze to the soup.. or maybe other drinks, I dunno. I'll mess with it more later
I just thought it would be funny
the calories in a liter of vodka are pretty substantial too
Time to convert all the foods into liquids
---@param roomName string
---@param noKids boolean
---@return RoomDef
function __BuildingDef:getRoom(roomName, noKids) end
what noKids mean 
Check the Java
Oh, so that means defining the /bedroom/ with a chance to spawn naked zeds.
lol funny
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
Depends what kind of events we're talking about tbh
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 π
event driven is good
We do use some stuff like that in the Horse mod yea
Tho we use a custom events library
Not the vanilla system
oh neat, yea i just rolled my own thang its not alot of code tbh but it has made my mods way more consistent
can try hump signal
ah one small difference in our implementations is, I establish event priority, so u can have predictable event ordering
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
oh shit
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)
that was my experience
Idk what it's worth tho
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
i considered that, the mocks are what stopped me
really what i want is headless PZ for testing
That crossed my mind too but mocks seemed like the path of least resistance
Headless PZ is too crazy but that would be so sick
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
that's probably the way, it would still be pretty nutty, but easier
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
Yes that would definitely be possible
Who here has experience creating maps?
Rad
would be really fun, one of my fav games is caravaneer 2 and it would be something new to do in zomboid espcially in nomadic playthrough aside from just surviving or hoarding loot
after so many playthroughs im honestly trying to spice up my gameplay in some way.
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
Really
You're asking mapping stuff, ask in mapping you'll find way better help there
Not much sense to ask here
There are some test cases within the debug menu. btw, dunno if pz headless is worth to trying, but we can use hooks and validate the data. Hmmm, im currently just using assert and pcall
Headless on Linux π
the client tho
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}}
π
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:
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
shared
server folder is also loaded client side
server folder is just only loaded when launching a save
See the "Lua (API)" wiki page
@knotty stone Any chance you'd want custom HP/Weight and trunk capacities for your W900 vehicle mod? And custom engine sounds?
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.
yeah i saw i read further down
thanks tho
Ah k. Mind if I make your truck mod an example patch then? lol
sure why not
Thanks.
i understand it now
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
Don't think that works
i mean its in my game and it works perfectly fine
learn the basics right fro that start is best imho
Sure but learning the wrong things is not what I call learning π
this is a starting ground for me
we both thought the same
then dont criticize and help
@knotty stone what semi truck is it supposed to be based off anyway?
If I teach you how to jump from a cliff, you learned something right ? You wouldn't good learning
Kenworth W900
Thanks
black moon your the car guru right
That's literally what I was here for by asking you what you're trying to do dude
If you don't give me more context, I can't help you
More or less.
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
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
kinda ok for rl but for game a bit slow? xD
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