#mod_development
1 messages · Page 361 of 1
my npcs have a weird delay
let me take vid
or it might be because im using ticks
havent migrated those to servertime yet
i switch to server time and performance tanks??
nvm
does anyone know if the lightswitch -> lamp system is modifiable?
for example, making lamps that need batteries?
so i uploaded a mod to workshop
but now i cant see the original one on me pc
what do
only workshop one i see
@weak needle
I can’t wait
It's been a learning process, that's for sure.
Most everythings handled clientside and not physically currently, outside storing and showing the information
Now I'm stepping into making the actual grave appear in game.
And be interactable.
I plan to also make a sandbox option that allows you to define how many bodies per chunk you want, defaulting to 3.
is there a list on the wiki about current existing ui/windows types in the game?
I tried and still crash the reason is "Unknown recipe param", my item name is correct and exist but idk how to correct this
I have this:
module Base {
craftRecipe RollSativaJoint_Debug
{
timedAction = Making,
time = 60,
Tags = InHandCraft,
category = ZazaMod,
inputs
{
item 1 Base.SativaBud_Debug,
item 1 tags[base:rollingpaper],
}
outputs
{
item 1 Base.SativaJoint_Debug,
}
}
}
Do you have to specify tags still? I forget
I'll check this
As in like, do you have to do tags[base:rollingpaper] or can you just do the base:rollingpaper thing
That's my first guess
In game files it was like that so i don't thinks this is a problem
I see, hm..
in recipes_tobacco.txt
nope i didn't, i wanted to use all items from the game with this tag
not custom item just original items
Oh so it's vanilla
Heck
How strange..
Do you have the custom items defined under Base or
If not it's probably failing to find the items for input
(The recipe can be under Base, the items don't have to be.)
Well, "don't have to be", still has to include base or whatever
yep i changed everything under Base like this:
module Base {...}
Here my console.txt if you want to dig the problem
or if you want the exact error:
ERROR: General f:0, t:1766613981940> ExceptionLogger.logException> Exception thrown
java.lang.Exception: unknown recipe param: Base.SativaBud_Debug at InputScript.Load(InputScript.java:822).
Stack trace:
zombie.scripting.entity.components.crafting.InputScript.Load(InputScript.java:822)
zombie.scripting.entity.components.crafting.InputScript.Load(InputScript.java:604)
zombie.scripting.entity.components.crafting.CraftRecipe.LoadIO(CraftRecipe.java:599)
zombie.scripting.entity.components.crafting.CraftRecipe.Load(CraftRecipe.java:523)
zombie.scripting.entity.components.crafting.CraftRecipe.Load(CraftRecipe.java:370)
zombie.scripting.ScriptBucket.LoadScripts(ScriptBucket.java:258)
zombie.scripting.ScriptBucketCollection.LoadScripts(ScriptBucketCollection.java:125)
zombie.scripting.ScriptManager.loadScripts(ScriptManager.java:1642)
zombie.scripting.ScriptManager.Load(ScriptManager.java:1577)
zombie.GameWindow.initShared(GameWindow.java:217)
zombie.GameWindow.init(GameWindow.java:1179)
zombie.GameWindow.mainThreadInit(GameWindow.java:690)
zombie.GameWindow.mainThreadStart(GameWindow.java:560)
zombie.MainThread.mainLoop(MainThread.java:58)
java.base/java.lang.Thread.run(Unknown Source)
Idk why
It doesn't know what the Base.SativaBug_Debug is
That's what it's getting mad at
Did you define the item under a different module?
If so, use that module instead of Base.
(Not for the craftrecipe holder, just for the item name.)
MyModuleName.SativaBud_Debug
i defined this item in Base look:
module Base {
/*imports {
Base
}*/
/**************** DEBUG ****************/
item SativaBud_Debug
{
DisplayName = Sativa flower DEBUG,
DisplayCategory = ZazaMod,
Tooltip = Tooltip_NLK_ReducePanic,
ItemType = base:food,
FoodItemType = Vegetables,
Weight = 0.1,
Icon = SunflowerHead,
WorldStaticModel = SunflowerHead,
StaticModel = SunflowerHead,
StressChange = -15,
UnhappyChange = -40,
BoredomChange = -20,
ReducePanic = 30,
DaysFresh = 6,
DaysTotallyRotten = 8,
HungerChange = -1.0,
ThirstChange = 4.0,
/*Tags = nlk:cannabis_bud,*/
}
item SativaJoint_Debug
{
DisplayName = Sativa joint DEBUG,
DisplayCategory = ZazaMod,
Type = base:food,
Weight = 0.01,
Icon = CigaretteRolled,
CantBeFrozen = true,
CustomContextMenu = Smoke,
EatItemType = Cigarettes,
OnEat = RecipeCodeOnEat.consumeNicotine,
RequireInHandOrInventory = Base.CandleLit/Base.Matches/Base.Matchbox/Base.LighterDisposable/Base.Lighter/Base.LighterBBQ/Base.Lighter_Battery,
HungerChange = 0.0,
StressChange = -4,
StaticModel = CigaretteRolled_Lit,
WorldStaticModel = CigaretteRolled,
/*CustomEatSound = ,*/
Eattime = 460,
FoodSicknessChange = 14,
InverseCoughProbability = 10,
InverseCoughProbabilitySmoker = 2,
Tags = base:useall;base:smokable,/*nlk:cannabis_joint,*/
}
/**************** DEBUG ****************/
}
Like i said, to be sure i changed every module NLK to Base
..how weird.
yea..
Maybe there's something wrong with the item def.
I just copied an item in game files to be sure it worked before the recipe thing
i think the recipe system is broken or idk
The recipe system was working fine for someone else I was helping the other day, something is up with the script.
The issue is the scripts aren't typically the best at telling you what's wrong
you know what
i put in comments the recipe and the game doesn't crash anymore..
it is very weird
does in 42.13.1 the recipe systeme changed?
The recipe system I think was mostly unchanged(?)
If unsure, just test with individual components.
yes i'll try it now
Copy a vanilla recipe and just keep regular items, then try modded items and see if it does the same error.
(Probably name it something different though so there's no conflicts)
okay renamed vanilla recipe with regular items works and with modded items works too...
i think something messed up in my first recipe
b42.13 changed the way recipes and such were registered.
oh okay? did you have an example for me please?
I'm not sure, if you look at the website, it has an example mod that shows the new registration system in use
Indy stone, its in the updates forum
i didn't found it, if you have a link
Ill see if I can find it
okay thx
@quasi kernel thanks for trying helping me i found a solution that is very weird
No worries! What'd ya do?
i put the item name in [] and it works
module Base
{
craftRecipe RolledSativaJoint
{
timedAction = Making,
time = 60,
Tags = InHandCraft,
inputs
{
item 1 [NLK.SativaBud_Debug] mode:destroy,
item 1 tags[base:rollingpaper],
}
outputs
{
item 1 NLK.SativaJoint_Debug,
}
}
}
i also changed my others module name from Base to NLK like it was originally
Did you know how to rename the recipe name? the text is RolledSativaJoint but i want with spaces like this Rolled Sativa Joint
I found it, in recipes_en.txt
Oop, yeah that's it
Sorry I got distracted
no problem, it's a little bit difficult for modding in PZ for the first time but it's very cool when all works
Yeye! You'll pick up more little bits of knowledge as you go
Yeah, for sure I'm literally doing this for a friend who asked me for a cannabis mod 🤡
Oo!! I hope your friend likes your mod!
So I was trying to find out why my nested containers mod doesn't work in Multiplayer and it seems it has to do with a ItemTransactionPacket in the ISInventoryTransferAction:new function?
I'm kinda clueless now, does anyone had a similiar issue?
So basically I try to move the nails into the green backpack and I get a infinite action bar.
I traced it down to the action which fails because it get's a maxTime of -1
I'm not modifying the item move function itself, just adding container buttons and I have no idea what to do with that information.
I just overwrote the original function and added some debug prints to figure out where it actually fails.
I'm guessing it's because the mod files are inside lua/client so I'm only modifying the container buttons on the clientside I guess?
I read the API for Inventory Items.pdf but mate... no Idea what they want from me.
Unsure on your exact issue, but the UIs are fully client side so being in the client folder makes the most sense
Yeah but I think I'm currently modifying self.backpacks on the clientside so the server doesn't see the backpacks I added there and can't handle the item transfer...
Such a headache, guess will just try to get it working somehow and hope it doesn't break again.
Isn't this a shared timed action now?
Yeah I think the same but I'm just confused rn because I'm not doing anything with actions itself.
But I do modify the clientside inventory buttons which get used by the server in the actions so it's a indirect issue with that?
If you've overwritten it in client then server won't be able to do anything
It needs to be in shared
(or server)
Yeah and that's what I have to adjust because simply making it shared breaks my modOptions somehow...
I bet there will be more issues on the way
I am not sure why that would be, unless shared loads after mod options stuff?
Well I'll just give it a try but nothing has been easy modding for this game
Not even sure how PZAPI.ModOptions works on the serverside
Yeah thought so... so I can also modify the whole mod since I have a few options there for the client visuals inside the code.
Mod options are useful for the server
Any options which should affect every clients should use sandbox options
Yeah but it's a personalized setting for each client, that will be fun to do serverside.
local depth = 0
local function handleItemContainer( inventoryPage, itemContainer )
if depth >= nestedOptions["nestedDepth"] then return end
depth = depth + 1
local inventory = itemContainer:getInventory()
local items = inventory:getItems()
for i = 0, items:size()-1 do
local item = items:get(i)
repeat
if not item:IsInventoryContainer() then break end
addItemContainerButton( inventoryPage, itemContainer, item )
handleItemContainer( inventoryPage, item )
until true
end
end
I'm adding container buttons based on the users settings, which means I have to somehow let the server know the setting of the player so that the server can also load / add those containers...
Because every user has their own wish of how deep the containers nest
Simple example:
I'm adding the green backpack button on the right, so it's in inventoryPage.backpacks for the client, but the server doesn't have that rn, that's why the transfer fails.
I'll just remove the multiplayer buttons, problem solved.
There's this weird interaction between setting air tiles to solid, having other clients walk over them, and "walk to" combined. For some reason, characters that are not from the client that sets tiles to solid will disappear while on it, however, if you hover your "walk to" square over that set square, the player will come back and everything about that square will be treated as if you did actually set it to solid. I'm guessing because this would flag the solid tile as TreatAsSolidFloor as well? Honestly very confused by how that even happens and why they're different.
I see
Well simply have users send their settings on option changes
You can do that, you can detect when your mod options change
Check out the wiki page for mod options
why does the server even have the concept of inventory pages? something doesn't sound right there
Then with a simple command send you can load the current options
I think it's just knowledge about which containers are in range ?
Actually not sure how the server handles the player inventory rn or which event I'm supposed to use now since I used OnRefreshInventoryWindowContainers which is a clientside event.
Would need a serverside event which triggers when the inventory of a player changes.
what exactly do you need to do on the server that requires the player's mod options?
Does the PDF they released "API for Inventory Items" help? Section 5, "Synchronisation of the creation, deletion and modification of items and objects"
most likely you just need to allow the transfers, only the client should care about what items it can see and try to transfer
you don't even need to know the player's depth limit, you just have to disable the check for being inside a container entirely (assuming there is one), since they could always just set the setting higher it's not a security risk
I'd assume you just do the move on the client and then use these:
Odds are good the server doesn't care about containers being nested or anything, it just needs to know which container to add/remove the item from.
the client can't call these, there would be no security at all and the entire thing would be pointless 😅
the server moves items and then sends the move, the client just asks it to
Actually I got it backwards - those commands are for the server sending the change to clients. I think. I'm still very new to multiplayer modding.
Yes what albion said
I was typing as he she said that! 😛
she
Yeah but from my understanding the server also needs the same backpack buttons as stupid as it may sound.
When I take a look at the action which fails it uses self.backpacks ( which basically contains the buttons / containers I also add )
But I don't know the server side code
But yea the server knows all, the client doesn't now jackshit
That runs only client side actually
perform runs only client side
Complete runs server side only
SP both are ran
There isn't
Awesome
yeah i'm not really sure how the inventory transfer action works right now
it's not using the new network model
That timed action is extremely weird
It's abnormal
Tbf that timed action is duct tape on duct tape
So I'm supposed to write code for a action which you can't understand, because there's no serverside code you can look into
It's shit going everywhere when you study it lmao
yeah i've never looked too close at it even in older versions because it seems to be extremely complex and unique among timed actions
There's commands being sent I believe
We don't mod Zomboid because it's a nice clean codebase that is easy to work with....
Yeah I noticed that the first time I tried to
That one is particularly shit tho lol
It doesn't follow the classic code of PZ and it' sone of the finest spaghetti you can find in PZ lmao
it looks like createItemTransaction is probably doing the actual transfer
No joke it's quite the spaghetti timed action 😅
We should have a little community competition for worst bits of code in Zomboid. Moving inventory items around is a good contender, I remember trying to make sense of it well enough to bypass weight restrictions and... ugh.
Not helped by weird hard coded limits in Java... that are enforced by lua and ignored by java.
Tbf, that timed action is hard to organize I feel like
It's a lot of logic of don't do that in X Y Z condition and do that in I J K condition
The spaghetti comes from that
Yeah seems so but I also can't find a definition for that so it's probably java in the background or something...
it's java yeah
Check the Java decompile
Yeah will have to do that, first need to decompile the new version..
never needed it and done it like once
Is Steam workshop down for everyone, or does it just hate me?
It's super easy with the ZomboidDecompiler - get the latest version, run the .bat file, a few minutes later you have the decompiled source.
Figured for the end of 2025 I would post this here letting you know it working with the help of another dev for the coding
I thought Street Smarts would be a big pain to update but in the end all I had to do was change one Z to z becasue a private java field I was accessing was renamed.
Yeah done it, but hasn't helped that much yet, trying to use debug logs now since they're also being used in that file but I cant read the logs...
Am I supposed to get two other ultrawides so I can stretch it or is there another way?
look in console.txt
or might have a different name if it's from the server... but in single player everything on that lua console is also in console.txt
where is that file? user folder?
c:\users\<your username\Zomboid\
Alright thx
I get that information with the message that it timed out
That's a transfer that worked.
I'm trying to update my mod to b42, but am having no luck especially since I chose the worst time to do this (steam is down?). Can anyone break the file structure changes down for me? The mod is showing in b42 mod selection window, but no clothing items are visible and the throw an error when selected in character creation.
From B41 to B42?
The very short version is you need a 42 folder and a common folder in your mod. You can leave common empty, but it must exist.
If you want to support multiple versions of B42 you can have more specific folders and move things like images to common... but everything in 42/common is empty is a good way to get started.
Ok, so I'm assuming I would copy the original contents of the mod over to the b42 folder. While the mod is selectable in b42 now, it seems like there must be more work to be done.
Almost certainly, but it depends on what the mod actually does.
Items and recipies need to be rewritten using the new format (NOTE: B42.13 makes more changes to these, so compare to vanilla instead of relying on tutorials)
Code stuff... depends what it does, could be anything to "works with a minor fix to name" to "complete rewrite needed"
I just managed to get the muzzle flash & bullet origin working properly for my guns. It's a mess! I think the new-ish muzzle flash code is exposing issues where things were not perfectly set up that previously were not obvious.
This tutorial is still accurate on the needed scale/rotation/orientation needed in blender before exporting to .fbx, and if you don't get this perfect you can end up with gun attachments working and muzzleflash being wrong: https://steamcommunity.com/sharedfiles/filedetails/?id=3060255898
The muzzle attachment point should look something like
attachment muzzle
{
offset = 0.0000 0.1368 -0.0246,
rotate = -90.0000 0.0000 0.0000,
}
with a -90° rotation on X, then translate it to the right point. And hope that no-one is relying on the muzzle attachment point to stick attachments on your weapon because now those won't point in the proper direction.
Finally you need MuzzleFlashModelKey in the item script. Then it all mostly lines up... even the vanilla guns don't quite match if you look close.
Ok great. Thank you for the help.
Well my mod broke, found out its becuse now I need to add prefix forageSystem to everything
Also do you guys know a good way of testing spawns outside of just wandering for hours among the zones?
Enable LootZed in debug mode, right click on a container that should have distributions for your item set up, and it should show you the probabilities.
Ah I mean for forging forging not loots
hi, please someone can tell how to add forage items ingame with 42.13, old way seems not to work ty
Ah mentioned it right above, you need to add a prexif forageSystem.
forageSystem.addItemDef("Mulberry", Mulberry);
And also you need to add name before the definition
spawnFuncs = { forageSystem.doWildFoodSpawn, forageSystem.doRandomAgeSpawn},
altWorldTexture = forageSystem.worldSprites.smallTrees,
itemSizeModifier = 1.5,
This solved my errors issue
Still have a issue with checking it ACTUALLY spawns
Hey Guys, Im new to coding and im trying to make a simple mod food mod. I did alot of research and still actively learning as i go and reading. Im currently stuck at my LUA function not sure if this is whats causing infinite errors when trying to even click on the item in the crafting menu. this is my Lua Function:
Aaaand the error?
sending now
I asked another mod creator for advice and they told me to make a registries.lua
sent the error, im just stuck on what im doing wrong to cause Vanilla functions to break
hold on i think i left out the other errors
One thing I see you calling the in game stuff to then call your own thing
function Recipe.OnCreate.JKGiveDriedMeat(craftRecipeData, character)
I feel this is the problem
What would I change this to?
One second but I feel this should be a Event
i can send my craftRecipes and items files, they are really short just 4 items lol. Starting small so i can learn and work my way up
What exactly you want to do with this ? I know give random amount but for what
So I created an Item aka DriedMeatPackage which then can be opened to randomly give one of the 3 Dried Meats
pretty basic just trying to learn
the recipes work and but the one recipe that calls the LUA function just causing mayhem
its ony the one recipe that breaks, i can post a video ingame
If I understand this right you want to give one of 3 random options?
yeah
java.lang.IllegalArgumentException: Default namespace 'base:base.jkdriedchicken' is not allowed!
Somethings off here
Oh I see
You didn't put them as strings
Yeah they suppose to be in like that
You put them as refrences to nothing
what strings would I put?
Just put "
character:getInventory():AddItem("Base.JKDriedSteak");
sendAddItemToContainer(character:getInventory(), "Base.JKDriedSteak");
should I keep or remove the registries.lua too?
No clue never used that
It has to be either a string like I posted or
instanceItem("Base.JKDriedSteak")
From what I am reading in the docs
function Recipe.OnCreate.JKGiveDriedMeat(craftRecipeData, character)
local meatChance = ZombRand(1,4);
if meatChance==1 then
character:getInventory():AddItem("Base.JKDriedSteak");
sendAddItemToContainer(character:getInventory(), "Base.JKDriedSteak");
elseif meatChance==2 then
character:getInventory():AddItem("Base.JKDriedChicken");
sendAddItemToContainer(character:getInventory(), "Base.JKDriedChicken");
elseif meatChance==3 then
character:getInventory():AddItem("Base.JKDriedPorkChop");
sendAddItemToContainer(character:getInventory(), "Base.JKDriedPorkChop");
end
end
Yea try that if not try doing
local idstake = instanceItem("Base.JKDriedSteak"
character:getInventory():AddItem(idstake );
sendAddItemToContainer(character:getInventory(), idstake);
you need to use a : not a . between the namespace and tag name.
https://pzwiki.net/wiki/OnCreate_(craftRecipe)
Here I see it should is instance
local lid = instanceItem("Base.JarLid");
local mData = jar:getModData()
local cond = mData.LidCondition or 9
lid:setCondition(cond)
character:getInventory():AddItem(lid);
sendAddItemToContainer(character:getInventory(), lid);
And if you want to make use of the tag in lua later assign it to a global variable:
JKITEM_MEATPACK = ItemTag.register("jk:driedmeatpackage")
I don't know if you have to use all lowercase, but the examples did so I have stuck with that.
yeah same. i kept the same logic for mine when it worked,
no changes if it works, means no issues ever
WAR's M9A4
Until something changes! Street Smart's B42.13 update consisted of changing one Z to a z.
Too pretty for zomboid!
they all Are 
I know it nuked the forging system for me
Still don't know if you can find my modded fruits
At least I killed all the errors
Pretty sure this is the correct way of registering stuff now?
How should I synchronize the Global ModData set on the client side?
ModData.transmit(“xxxxxx”) did not synchronize it.
Manually
My first guess is you'd probably have to copy the table data manually-
Yeah
Global mod data in particular doesn't feel like the sort of thing to have a built-in transmit simply because it's global.
The rest are usually hooked to an object.
No the problem is it's massive
Global mod data tends to have a lot of data
Oh, it does?
Not necessarily
But this tends to be the kind of mod data with a lot of data stored by modders
I mean, couldn't you apply that same logic to any object with mod data?
Would i have to declare 3 different instanceItem then run the ZombRand ?
And it was already bad practice to try to use transmit because it wouldn't work properly
Object mod data tends to be lighter
True, though certainly more plentiful.
But transmit for global oftened bugged out and a lot of data wasn't getting transmitted
yea for each item
But it's one by one
One object only gets its data synced
Hm, interesting. I guess doing it manually you could narrow it down to what needs to be sent anyways.
True..
Exactly
Sending the whole table is costly for no reasons
You never need to sync the whole thing
I think the horror mod I'm working on will be the first time I use global mod data actually lol
And in fact, data should systematically be stored in the server for the most part now
I've used object mod data every other time
Just to check, global mod data exists to be saved between sessions, correct?
Because otherwise I don't see the difference between using it and just storing stuff in modules like I do-
function Recipe.OnCreate.JKGiveDriedMeat(craftRecipeData, character)
local DriedSteak = instanceItem("Base.JKDriedSteak")
local DriedChicken = instanceItem("Base.JKDriedChicken")
local DriedPorkChop = instanceItem("Base.JKDriedPorkChop")
local meatChance = ZombRand(1,4);
if meatChance==1 then
character:getInventory():AddItem(DriedSteak);
sendAddItemToContainer(character:getInventory(), DriedSteak);
elseif meatChance==2 then
character:getInventory():AddItem(DriedChicken);
sendAddItemToContainer(character:getInventory(), DriedChicken);
elseif meatChance==3 then
character:getInventory():AddItem(DriedPorkChop);
sendAddItemToContainer(character:getInventory(), DriedPorkChop);
end
end
like this right?
It's persistent while local lua tables aren't
Okay then yeah, to save stuff
I dont typically have a need to save much so
I would've used it to save checked chunks in my last mod, but I couldn't check chunks anyways on the server, not reliably anyways.
yee
How so ?
Cells didn't exist, couldn't reliably get adjacent chunks because of that.
Well, they existed, but were empty.
I ended up using a tile-based solution instead.
Thanks, I'll check server/client source.
sadly same thing still happens like in the video i sent
not sure whats wrong
Send the new error log
base:base.jkdriedporkchop huh?
im gonna remove the registry lua and see if it changes
this is with the registries.lua removed
same thing
Yes I in main menu reset LUA
Try maybe not adding to the base then
It was in registries.lua but I removed that file and reset LUA ran again same issue
All those Vanilla lines break
module MattSimpleAddons
{
imports
{
Base
}
Try this
Then remove the crafting UI
For item def
Okay will try
Just name it your way don't copy mine <w> I use it to keep track my mods
Ah do not put forageSystem.addItemDef("Mulberry", Mulberry);
Put forageSystem.addItemDef(Mulberry, Mulberry);
Just tested and its suppose to be like this apparently.
uuuugh finally it woooorks
I can find them in the wild
alright, perfect my mod is working agin
This! You can can even see the error message about not putting registry stuff into base.
You can still put items into Base, but any tags/traits/whatever that you add using the registry have to use a different namespace
i removed the registries.lua and get this error
Your mod adds items and recipes, correct?
I'd start by removing all recipes and justt getting the items working. Compare the item scripts to the vanilla 42.13 items to make sure you have the fields correct.
Then once that works (i.e.: you can start the game without issues and use the debug menu to spawn your items) work on the recipies.
You may not need a registries.lua, if you are not registering any new tags/etc.
Post the recipe script
Also, if it's using an OnCreate function see if that is the cause by getting rid of it... though the error makes me thing it's something in the recipe itself breaking the UI
module Base
{
imports
{
Base
}
craftRecipe OpenDriedMeatPackage
{
timedAction = PackingBox_Small,
Icon = JKDriedMeatPackage,
NeedToBeLearn = false,
Tags = AnySurfaceCraft,
Time = 60,
inputs
{
item 1 [Base.JKDriedMeatPackage]
}
outputs
{
}
OnCreate = craftRecipe.OnCreate.JKGiveDriedMeat,
}
craftRecipe RehydrateSteak
{
Time = 100,
ToolTip = Rehydrate meat,
Tags = RickClickOnly;InHandCraft;Cooking,
SkillRequired = Cooking:2,
xpAward = Cooking:3,
AllowBatchCraft = true,
inputs
{
item 1 [Base.JKDriedSteak],
item 1 [*],
-fluid 1.0 [Water],
}
outputs
{
item 1 Base.Steak,
}
}
craftRecipe RehydrateChicken
{
Time = 100,
ToolTip = Rehydrate meat,
Tags = RickClickOnly;InHandCraft;Cooking,
SkillRequired = Cooking:2,
xpAward = Cooking:3,
AllowBatchCraft = true,
inputs
{
item 1 [Base.JKDriedChicken],
item 1 [*],
-fluid 1.0 [Water],
}
outputs
{
item 1 Base.Chicken,
}
}
craftRecipe RehydratePorkChop
{
Time = 100,
ToolTip = Rehydrate meat,
Tags = RickClickOnly;InHandCraft;Cooking,
SkillRequired = Cooking:2,
xpAward = Cooking:3,
AllowBatchCraft = true,
inputs
{
item 1 [Base.JKDriedPorkChop],
item 1 [*],
-fluid 1.0 [Water],
}
outputs
{
item 1 Base.PorkChop,
}
}
}
I think you need an output
Since i couldnt find anything anywhere ChatGPT assumes the game expecting a table onCreate and thats whats breaking it
STOP! Do not trust ChatGPT
- it's always been terrible at anything Zomboid Specific 2) even if it wasn't, it hasn't been trained on recent changes.
try making the output something like a piece of Base.JKDriedChicken
in case it's unhappy because the output section is empty (presumably because it will get populated with the OnCreate)
although empty output is legal:
im framing that one
Still crashes even with an output
What about without the OnCreate?
Maybe stupid question but when does that trigger?
if not server and not client
it's a shared lua file
Not a stupid question at all... and I can't remember the answer, but I do remember isServer and isClient not acting like you'd expect them to.
bruh alright thx
same errors without oncreate
these are my items and recipes, i must be doing something wrong
i removed oncreate and left put 1 item in the output just to test and still crashes. Also deleted the lua file to since i removed oncreate
OnLoadSquare event
Access squares
And I assume you could access chunks like that
Or anyway you can do some simple math to check the squares of the chunk
And whatever you need to do
So it's either something in that recipe, or something in one of the items referenced in that recipe since you don't have issues without that one recipe. Except the recipe didn't have any obvious issues.
One idea to isolate the issue; make the problem recipe a copy of another recipe, confirm that works, then change it one line at a time into the recipe you want and see exactly where it breaks
No you are not module base, rename it, don't be Base
try
module JKMods
and replace any mention to base next to your items with it
same with items try to have your own module instead of adding to the Base
This good?
Ye test it alos change them in the Lua file
i got rid of the lua files
tryna test the one recipe to get it working but idk its broken
What is the error
STACK TRACE
function: restoreJoypadState -- file: ISPanelJoypad.lua line # 344 | Vanilla
function: calculateLayout -- file: ISWidgetIngredientsInputs.lua line # 198 | Vanilla
function: calculateLayout -- file: ISTableLayout.lua line # 437 | Vanilla
function: calculateLayout -- file: ISTableLayout.lua line # 103 | Vanilla
function: calculateLayout -- file: ISCraftRecipePanel.lua line # 109 | Vanilla
function: calculateLayout -- file: ISTableLayout.lua line # 437 | Vanilla
function: calculateLayout -- file: ISTableLayout.lua line # 103 | Vanilla
function: calculateLayout -- file: ISHandCraftPanel.lua line # 112 | Vanilla
function: calculateLayout -- file: ISHandcraftWindow.lua line # 109 | Vanilla
function: prerender -- file: ISHandcraftWindow.lua line # 159 | Vanilla.
[25-12-25 08:10:37.640] LOG : General f:39775, t:1766668237640> __len not defined for operand.
[25-12-25 08:10:37.640] ERROR: General f:39775, t:1766668237640> ExceptionLogger.logException> Exception thrown
java.lang.RuntimeException: __len not defined for operand at KahluaUtil.fail(KahluaUtil.java:99).
Stack trace:
se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:99)
se.krka.kahlua.vm.KahluaUtil.luaAssert(KahluaUtil.java:89)
se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:542)
se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:167)
se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1756)
se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1600)
se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:35)
zombie.ui.UIElement.render(UIElement.java:1668)
zombie.ui.UIManager.render(UIManager.java:366)
zombie.gameStates.IngameState.renderFrameUI(IngameState.java:1189)
zombie.gameStates.IngameState.renderframeui(IngameState.java:1178)
zombie.gameStates.IngameState.renderInternal(IngameState.java:1290)
zombie.gameStates.IngameState.render(IngameState.java:1248)
zombie.gameStates.GameStateMachine.render(GameStateMachine.java:24)
zombie.GameWindow.renderInternal(GameWindow.java:460)
zombie.GameWindow.frameStep(GameWindow.java:846)
zombie.GameWindow.mainThreadStep(GameWindow.java:597)
zombie.MainThread.mainLoop(MainThread.java:68)
java.base/java.lang.Thread.run(Unknown Source)
.
its breaking Vanilla somehow
yup
i could join a vc and share screen to show my file and folders
could len not defined for operand be saying something is coing up nil like i forget to add a value to something that i shoul've?
Try thoes
mod loaded but
.
[25-12-25 08:47:48.259] ERROR: General f:3605, t:1766670468259> KahluaThread.flushErrorMessage > dumping Lua stack trace
STACK TRACE
function: restoreJoypadState -- file: ISPanelJoypad.lua line # 344 | Vanilla
function: calculateLayout -- file: ISWidgetIngredientsInputs.lua line # 198 | Vanilla
function: calculateLayout -- file: ISTableLayout.lua line # 437 | Vanilla
function: calculateLayout -- file: ISTableLayout.lua line # 103 | Vanilla
function: calculateLayout -- file: ISCraftRecipePanel.lua line # 109 | Vanilla
function: calculateLayout -- file: ISTableLayout.lua line # 437 | Vanilla
function: calculateLayout -- file: ISTableLayout.lua line # 103 | Vanilla
function: calculateLayout -- file: ISHandCraftPanel.lua line # 112 | Vanilla
function: calculateLayout -- file: ISHandcraftWindow.lua line # 109 | Vanilla
function: prerender -- file: ISHandcraftWindow.lua line # 159 | Vanilla.
[25-12-25 08:47:48.259] LOG : General f:3605, t:1766670468259> .
[25-12-25 08:47:48.530] ERROR: General f:3605, t:1766670468530> KahluaThread.flushErrorMessage > dumping Lua stack trace
STACK TRACE
function: restoreJoypadState -- file: ISPanelJoypad.lua line # 344 | Vanilla
function: calculateLayout -- file: ISWidgetIngredientsInputs.lua line # 198 | Vanilla
function: calculateLayout -- file: ISTableLayout.lua line # 437 | Vanilla
function: calculateLayout -- file: ISTableLayout.lua line # 103 | Vanilla
function: calculateLayout -- file: ISCraftRecipePanel.lua line # 109 | Vanilla
function: updateTitleWidget -- file: ISCraftRecipePanel.lua line # 183 | Vanilla
function: update -- file: ISCraftRecipePanel.lua line # 143 | Vanilla.
[25-12-25 08:47:48.530] LOG : General f:3605, t:1766670468530> __len not defined for operand.
its just the OpenDriedMeatPackage
this how it makign me feel lol
You have level 2 cooking on the character?
Oh yeah
Cant even click the item in crafting menu
I made it so you need a soucepan or pot
they still shouldnt cause the UI to delete to click the item to see what it requires in crafting menu
Ah no it rehedrates correctly yes?
Alright, yeah I just made there mode:keep
but I think I can just delete the whole line there about it becuse its only needed for stuff
Also I am in a better Debug mode <w>
im just baffled on whats wrong
Have a idea
I think I found it
Let me test it
Yup fixed it
You forgot a single comma here next to inputs
here be file fixed
blep
This one
Forgot that I also removed the icon for tests
Aint no way
i swear to god i went and made sure to check for all the ,
man i feel so stupid LMFAO
Check the rehydrated stuff recipies I fucked with them a bit and you might need to re-roll some of the changes I did <w>
You should be able to just run the Lue we finished now too
The last version
with isinstance
For my use case this wouldn't work
Unfortunately, I tried it lol
World Items apparently spawn pretty late including after squares are loaded
Added the LUA script to randomize it and won’t give me the item so I’m gonna test different functions
singleplayer
I could've sworn in the earlier 42 builds there was an isSingleplayer global function added (that would avoid having to write it as in that screenshot), but I guess it was decided to be redundant
declaration: package: zombie.chat, class: ChatManager
ChatManager is not exposed
& the info is available via isClient & isServer anyhow, it'd basically just be a shortcut for what NikkuMiru sent
Oh, if that was meant as a potential answer as to what I was thinking of: I meant a method exposed as a global Lua function in LuaManager.GlobalObject. Pretty sure it was added at some point & then removed
print(getWorld():getGameMode())
in sp you get Apocalypse -> Sandbox
in multi you get multiplayer, is that good enough?
I appreciate the effort, but again I'm not really looking for a solution 😅 Like I said, covered by the existing 2 functions lol
I've moved away from a non-Steam game & just use a script to launch pz with different profiles (e.g., pz dev → dev mode, pz → playing the game), but the usual method is described there
oh
not sure if this is the same tho
wait
there no other way?
problem is that they both show up as the same mod
What is it about the way explained in that message that seems insufficient for your use case?
If you have 2 separate environments (i.e., Lua cache directories) for testing you won't see both
nvm i just renamed the dev one
why is steam workshop down 😭
what do u guys do when u run out of ideas
something else
Shake and cry
good option
idea's for mods? i dont really run out. lol
Ah you're the person working on that thing yes
I finished it already lol
I'm working on The Horrors™ now
Have you been able to create ItemActions with IsoGridSquare or InventoryItem instances as parameters for the creation function (new) in Multiplayer ? Here is my log of the function client side, notice the first parameter (IsoPlayer instance) being passed: LOG : Lua f:312, t:1766691459269, st:24,174,113> Arc.ISBuildFromBlueprintActionMP 1 IsoPlayer{ Name:null, ID:389 } LOG : Lua f:312, t:1766691459270, st:24,174,113> Arc.ISBuildFromBlueprintActionMP 2 zombie.iso.IsoGridSquare@746e9674 LOG : Lua f:312, t:1766691459270, st:24,174,114> Arc.ISBuildFromBlueprintActionMP 3 Arc.Blueprint:zombie.inventory.types.Literature@10f0ed3e Here is my log server side: ```
LOG : Lua f:83, t:1766691459284, st:24ÔÇ»174ÔÇ»131> Arc.ISBuildFromBlueprintActionMP 1 IsoPlayer{ Name:null, ID:56 }
LOG : Lua f:83, t:1766691459285, st:24ÔÇ»174ÔÇ»132> Arc.ISBuildFromBlueprintActionMP 2 nil
LOG : Lua f:83, t:1766691459286, st:24ÔÇ»174ÔÇ»133> Arc.ISBuildFromBlueprintActionMP 3 nil
Here is the code ```lua
function ISBuildFromBlueprintActionMP:new(character, square, blueprintItem)
local o = {}
setmetatable(o, self)
self.__index = self
o.character = character;
print('Arc.ISBuildFromBlueprintActionMP 1', tostring(character))
print('Arc.ISBuildFromBlueprintActionMP 2', tostring(square))
print('Arc.ISBuildFromBlueprintActionMP 3', tostring(blueprintItem))
can you post the full new function?
full function: ```lua
function ISBuildFromBlueprintActionMP:new(character, square, blueprintItem)
local o = {}
setmetatable(o, self)
self.__index = self
o.character = character;
print('Arc.ISBuildFromBlueprintActionMP 1', tostring(character))
print('Arc.ISBuildFromBlueprintActionMP 2', tostring(square))
print('Arc.ISBuildFromBlueprintActionMP 3', tostring(blueprintItem))
o.x = square:getX();
o.y = square:getY();
o.z = square:getZ();
o.isTargetPositionValidated = false;
o.item = blueprintItem;
if blueprintItem then
local md = blueprintItem:getModData()
local arcMD = md and md[Arc.Key]
if arcMD then
for bID,serializedData in pairs(arcMD) do--there is only one here
if Arc.Verbose then print('Arc.getBlueprintItems SD',bID,serializedData) end
o.serializedBuilding = serializedData
end
else
if Arc.Verbose then print('Arc.getBlueprintItems no arcMD',tab2str(md and md[Arc.Key])) end
end
end
if not o.serializedBuilding then
if Arc.Verbose then print('Arc.getBlueprintItems building definition found.') end
end
o.stopOnWalk = true;
o.stopOnRun = true;
o.stopOnAim = true;
o.maxTime = o:getDuration();
o.pageTimer = 0;
return o
end
error on o.x = square:getX(); client side. ```attempted index: getX of non-table: null
ERROR: General f:83, t:1766691459295, st:24ÔÇ»174ÔÇ»141> KahluaThread.flushErrorMessage > dumping Lua stack trace
STACK TRACE
function: new -- file: ISBuildFromBlueprintActionMP.lua line # 108 | MOD: Architect
ERROR: General f:83, t:1766691459297, st:24ÔÇ»174ÔÇ»143> ExceptionLogger.logException> Exception thrown
you're misunderstanding how this is called on the server
each parameter will be sent the value the client had for a field of the same name
so you receive character correctly because you assign it to o.character, but there is no o.square or o.blueprintItem so they are sent nil
i recommend doing anything complex with arguments in a separate helper function that calls new(), and having new() just assign fields from arguments
that's not really an option. The kind of arguments I can pass is limited to those set as serializable and I prefer to keep the size of them as small as possible. Still, I'll simplify the new function as you suggest and do stuff in another function called when not client.
yeah use your best judgement, this looks much more complex than any action i've written so my experience may not apply to it
works like a charm. you're magic
I mean, I still misunderstand, but now I can use 😄
Hello EtherealShigure, I saw many of your mods and I was questionning myself, how you do high quality texture for the vehicles ?
how do i? or how is it done
local player = getPlayer();
local stats = player:getStats();
if player:hasTrait(CharacterTrait.Desensitized) then
stats:remove(CharacterStat.STRESS, 100)
end
end
Events.OnPlayerUpdate.Add(DesensitizedNoStress);```
Why dosnt this work? I get TONS of errors lol
I just did a vehicle mod of mine with high quality texture but in-game is like blurry/low texture
And I was asking myself how you did such high quality texture on for example small 3d models like the scooter traveler
what is your texture res at?
2048x2048
I uploaded 2 screenshots of ingame and in blender
Like the render its really not the same in-game and I thought that maybe I did something bad
havent seen a texture at 2K get that minced before... its new
Ah crap, thanks for help tho lol
so i need to save some values that are not attached to any object
what is the best way to do that?
Global mod data
oh right
ty
another question
removefromworld cant seem to remove isoplayer characters
Unsure on the proper way for that but I believe there's some remove from square stuff too
Might be something related to that
then what do
What are you trying to do?
trying to remove isoplayer npcs
skyrim approach and teleport them far away and kill?
This is single player?
Wasn't aware you could make isoplayer objects that isn't attached to a client
Only in SP
Zombies are used bcs they work in MP
mod is mostly for learning how to mod anyway
but i guess
i teleport them off the map and kill them
only solutiion
You can't tp them in an unloaded area tho ?
Can you ?
then what do
idk never tried
i guess i could
set them invisible then kill them
we going to 30 fps with this one
Seems to run fairly well no ?
I was able to remove isoPlayers in b41 with removeFromSquare, removeFromWorld and update in that order. Not sure if all of them were actually necessary
Hi, Is this where we can ask for help with modding?
I am probably missing something or this is a skill issue but I am having issues getting a simple object to load in.
I get this or I get no object at all.
I will apply the Item data and also the error for when it doesn't load my model
(the atari is from the video game consoles mod. I swapped mine out with it to make sure it wasn't my model that was the issue but this is the issue its managed to pull with that model).
(these scrips are in the b42 folder and the files are the same in all the media folders).
Any help and knowledge would be appreciated.
Easy
You didn't put your mod in the right folder
I suggest reading the Mod structure wiki page if you haven't yet
I did read it but I will take another look, Thanks
Needs to be in the Workshop folder in your cache folder, not mods
That folder shouldn't be used for mod development overall
That explains a lot actually as it turns out I had a older version without the newer assets in there
Yup !
Same issue though, things are still not loading.
I am not on 98, I wish this was.
This is just windows 10
What isn't loading ?
the model it self isn't loading, or the texture, what I have placed isn't the model or texture.
that is the icon name
No that isn't
Read that wiki page
You'll quickly see your mistake
Item_ isn't supposed to be present in the script
In the file name yes
Yes it's confusing
Also verify that your model is in the right folder
ahhh,
The models are located here
Figured I'd show off what I'm working on here a bit too cuz why not https://cdn.discordapp.com/attachments/908459714248048730/1453906346544988161/theHorrors.mp4?ex=694f274d&is=694dd5cd&hm=cd0d29dce82e95d6fe65a9a7fccadb8487db21ba9b4f8b26797e4b29e8d8067a&
yooo, happy xmas
this doubt is probably the most asked
how to setup the VS Code project to enable intellisense and make coding easier?
Sounds good (I think)
thx will check
So I'm just contemplating the best way to refactor Inventory Tetris for the new TimesAction changes in MP.
I've previously avoided changing the signature to ISInventoryTransferAction:new as that would be a hard incompatibility point between mods that did the same. Instead I opted to push some extra data in immediately after creation of the action (data = where the item should be placed in the destination grid)
With the new server realization stuff for TimedActions, I'm not certain how to best get this data into the action without overriding :new().
Does anyone know if the game provides any packet order guarantees?
If I call a command to send some data before making the action can I trust that will always get to the server before the action?
If I have to I can just override the new() params, but it would be unfortunate for mods to have to be competely incompatibile over some fully serializable metadata.
I highly advise you don't overwrite parameters, that's at least what I'd suggest rn for less problems later
I agree, it feels wrong, especially under the new system
Timed actions are now expecting the parameters from the new to be as fields to that timed action class for the server to locate them
The problem is that this bitch of a timed action that we ISInventoryTransferAction follows absolutely zero codes from the new timed action synchronization system
And it is unclear if they'll properly port this monstrosity of a timed action over to the new system
So is it a good idea to overwrite the parameters ? Probably not
Should you give a fuck ? Idk 😅
Regarding the commands sent to the server, you can be sure that your action will be done before the server receives it, or at least you should consider that always
Because when you send the command, your code still runs, packet received or not by the server
And thankfully or everything would just freeze constantly
Ok, does the server at least guarantee action order?
Wdym by action order ? Like command order ?
So if you send command1 command2 command3 it receives them in the right order ?
Nah, like if I send 3 rapid inventory transfers to the server, will they go in order?
I know Zomboid uses UDP, but they must be using reliable UDP at some points
Specifically TimedActions
My knowledge on networking stops there I think
I don't remember of a case where respecting the order of timed action matters since you never run two at the same times ?
i don't know about any order guarantees, but commands are definitely sent reliably
Ok did more testing, It now seems to just load icons.
I am not entirely sure why it places Icons and not the models.
I'd verify that the model properly exported by reimporting it in Blender
Is your item in the world "invisible" ? Or is it still an icon ?
Its still an Icon, though it did nothing when the character attached it as primary. Hence why the atari model was borrowed from a kown working mod
Also blender is able to reimport my model.
B42.13 (before fix)
The DisplayName parameter no longer exists
Not the source of your problem
But just noticed it
Removed, Better to catch now before I copy and paste this across all of the mod lol
Yup
These are the 2 scripts currently.
I don't notice anything wrong with model script definition but I could be missing it
What I would suggest is to download VSCode and the PZ script extension
It can possibly help you catch some problems
darn it, back to VS code I go lol
Will also make it easier to manage your mods
VSCode is great, really
Get used to it
It's the norm in the modding community
It helped me out a bunch, just being able to search for things in the vanilla Zomboid files.
I was removing it from my systems due to it enabling features that make no sense on some of my systems.
I guess I will remain stuck to it
What features ?
Sticky scroll kept enabling randomly,
Some AI features.
To note is that my laptops are like 15 years old and so I don't want something too intensive as the batt lasts like 3 to 5 hours (good for its age but as its that old it risks degrading quickly)
Which reminds me, why are the blacksmithing recipes stuck inside a folder invisible to everything but VSCode?
*My main PC is not 15 years old
I just don't want to spend money on laptops
but oh well lol
I shall elaborate, stand by.
Sticky scroll idk wtf that is
For the AI features, that was a discussion we had recently and you can disable those in the settings
Its horrible, basically every function on your screen gets a top slice of the screen and it just expands as you scroll down.
Nevermind, I dumbed again. I was looking in scripts/entities/blacksmith instead of scripts/generated/entities/blacksmith. I thought there were phantom files on my bitch.
Yea not sure what you mean 😅
This,
The more functions you have and the longer the file. The worse this gets.
Its that bit at the top of the file
it should only show the scopes you're currently in, your code may be weirdly complex if this is an issue?
and it's almost certainly something you can just turn off
Its that it turns it self on sometimes on some of my computers
that was my issue
not that its a feature, but when working on some projects it turns on and I then have to remember its name and disable it.
I never had such problem
Think I have a plan now.
Keep my code changes to the ISInventoryTransferAction. But when I have grid data to go with one, create my own version of the action that extends the normal action and includes the grid data in the params.
Then all the functions other than new can just directly reference ISInventoryTransferAction.
No packet order to worry about.
Maybe do a clean reinstall of vscode
One day.
Its 2 to 3 devices that did it so far.
Anyway it didn't see anything wrong ether other then not recognising the ItemType.
Yea that extension isn't up to date
where is your mesh located?
I plan on updating it
just double checking but mesh = TestPuter, would be looking for models_X/TestPuter.fbx
42\media\models_X\TestPuter.fbx
Here
Howdy
does anyone know anything about the umbrella plugin for vs code because someone told me something about it and how it can color code the syntax in the zomboid files just thought itd be nice to have
it has the download link and installation guide
thank you
what questions did you have btw?
Should I ask it here or in the modding discord?
Does it matter?
Well, I've got some confusion regarding file structure. From what I've gathered, (since I'm making it strictly for B42) it should look something like Workshop>MyMod>Contents>mods>MyMod>42>media and then lua and scripts and what not. Since I'm only making it for 42, I don't need a media folder in the MyMod folder with common and 42, yeah?
and since I'm going to be adjusting existing systems, I shouldn't override anything and try to monkey-patch everything to avoid conflicts
either is fine
yeah you dont need any of the b41 stuff
b42 wont even read it i think
does anyone have any experience adding items to be foraged in build 42?
I want to add an existing item and Ive already found the files and stuff holding the code for foraging categories Im just wondering what all I would have to add in my own lua script in order for it to work
thank you ill look into it
When I'm developing a mod, should it reside in Zomboid>mods or Workshop?
The wiki says that developing in Workshop makes it easier to upload, but its also forcing the mod to load even trying to play unmodded.
I would reccomend workshop but I dont know if its supposed to be forcing the mod
Is there any way to use external libraries like lua websocket?
Or any way to send and get http requests?
Why there is strict restriction on modding in this game 🤨
hey guys, where can I find the documents for 42.13 MP?
no lua library that relies on a c library will work
is there a mod that can give me 106’s goggles
howdy folks, im looking to make an in depth pharmaceutical mod.
how do i go about making a mod that adds items into the game that can effect player stats and moodles?
it would basically be redoing the current in game drugs (painkillers, beta blockers, sleeping pills) with generic medications that achieve the same purposes
i know next to nothing about scripting, but im assuming that all i'd have to do is duplicate the code for the existing drugs, edit the values and names, and change the sprites
how to insert and remove from Distributions? such as inventorymale = {
suburbs distro has some nice functions but they dont seem to work?
try to install this mod here, then look at the code.
that would be the easiest non-coding example
Sourdough, Vinegar, & Cheese (42.13.X)
https://steamcommunity.com/sharedfiles/filedetails/?id=3625348470
for the moodles part i cannot comment yet since i just started modding few days ago
i beleive i have discovered the keys to the kingdom nvm
how you did it?
can't find any info about workstations, is it possible to mod them? ty
i used this (link to msg) but changed SuburbsDistributions (and the other) to SuburbsDistributions.all.inventorymale #mod_development message
will need to verify it removes it just from that list but it does remove it via lootzed
maybe try seaching for "workstation" in the game git repo
yeah but i mean, do you have any information to how recipes are done or something like that?
also how do i do this?
https://gyazo.com/ce8f709dcba4d696c989276f7a757be5
for context: im trying to add true music radio to my world after i created the game
i did not investigate workstaion yet, lets hope somebody will reply later
sounds like you asking for this file here. some mods add options at the end
its for a singleplayer world, idk if "severtest" means its specifically for a server or not
sounds dumb, but i just dont know
good question, i never tried to change singleplayer settings
Ever started with custom sandbox settings, only after hours of playtime to realize that you forgot to enable multi hit? 🔥
In this guide I will show you how to do that and a few other options as well 😄
Enjoy! :D
📜 Video Contents:
00:00 Intro
00:33 The sandbox options
01:06 The sandbox file
01:42 Test time
01:47 The zombie speed test
03...
found XD
please share!
Workstations
"C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\scripts\generated\entities"
Here you can find all entities=Workstations and all recipes related, yw 😉 i put the first word the title so if someone will search in discord will find this.
to add to this, this is how ive setup my file
local function postDistributionMerge()
RemoveItemFromDistribution(SuburbsDistributions.all.inventorymale, "Wallet_Male", nil, true)
RemoveItemFromDistribution(SuburbsDistributions.all.inventorymale, "Locket", nil, true)
RemoveItemFromDistribution(SuburbsDistributions.all.inventorymale, "CigarettePack", nil, true)
RemoveItemFromDistribution(ProceduralDistributions.all.inventorymale, "Wallet_Male", nil, true)
RemoveItemFromDistribution(ProceduralDistributions.all.inventorymale, "Locket", nil, true)
RemoveItemFromDistribution(ProceduralDistributions.all.inventorymale, "CigarettePack", nil, true)
end
Events.OnPostDistributionMerge.Add(postDistributionMerge)
is it working?
well when inspecting with lootzed they no longer appear in male zomboid inventories. still havent checked any other container tho
eu5 time
Thank you 🙂
try this way as well
where is the lootzed button in the debug?
you need to activate the "Cheats" than open any container and you will see it
in addition to this, just open to pz steam folder and create .exe's shortcut and add -debug. then move to the desktop, can also pin to taskbar for quick access.
is there any one inside indie stone here? I believe modding is highly resticted cause of this limited lua support. it'd be awesome if they had extend this limitation.
If you have specific suggestions there's https://discord.com/channels/136501320340209664/1318920979581501502
nah, it'll take forever for them to implement
What's your thought ?
We can't utilize the power of Lua I believe
It'd be awesome for us to be able to use native libraries at least
Also, modding in Java also would be nice
Java modding is possible
It's true that there are gaps in Kahlua (the old, unmaintained form of Lua in use by the game with some modifications), but if you say what you're missing maybe we can help with alternatives
e.g., rather than io, there are some global functions provided by the game's API that serve a similar purpose
nah nvm its bad
Wdym we can't ?
I just realized I can reload scripts without having to open/close the game every time..
You can do that with Animations and models too in most cases
Does anyone have a breakdown of what changed with B42.13?
My mod quit working, and I was wondering if anyone had ideas where I should start.
there is a sub topic tho im not sure if thats what ur looking for
modding migration guide 42.13 it say
I'm a part time modder on PZ. It's not something I keep a close eye on.
I uploaded the ancient armor and weapons, from B41 to B42.
Thanks! I'll look into it.
Ah I see it! Thanks!!
ur welcome
anyone know whats wrong with this?
it keeps printing no square
but ik the startposition is valid
Why are you still not using Umbrella ? 💀
I swear this has been the 3rd to 4th time I've been telling you to use it to catch problems easier
so continued modding straight up
It takes literally two seconds to setup
Also for array looping, don't use ipairs but use direct array size looping
Yes
ye should change those in me code some time
And seriously I'm not joking, go install Umbrella
Stop asking modding question if you don't even use Umbrella, it'll catch half of your problems seriously
installing it rn hold on
You're already using VSCode, so no excuses
done
wait
aight so im kinda new to modding and vscode so sorry about that
but
it doesnt seem to recognise
IsoPlayer etc
How did you activate Umbrella ?
i installed emmyslua and enabled umbrella
Enabled Umbrella ? You don't enable Umbrella
What did you do to get Umbrella
That's LuaLs
Not EmmyLua
Uninstall LuaLs
And read the Umbrella wiki page
alright i installed it and it works
though i dont understand why its warning in some parts
ah nevermind
I still need to set that up
Did you put your cursor on the thing that's highlighted
do i have to manually declare long?
That one might actually be one of the rare times where it'll scream at you for no reasons
@bronze yoke I assume in this case he should either do a --[[@as number]] typing to TimeMill ?
no message in this one, just outlined
That line is normal
It's not an error
When it's a straight line like that it isn't at error, it just means that you redefine a variable at some point
what version of umbrella is this??
You're using EmmyLua right ?
oh i see
the b41 version of umbrella is really old and blows
oops
it shouldn't matter
I thought B41 Umbrella didn't support EmmyLua ?
well seems useful regardless so ill keep
it doesn't support emmylua's extra features
When it screams at you an error now, you know it's for a good reason the majority of the time
😭
Fix those errors and it's likely to prevent problems before they even happen
This is why you need to use Umbrella
but most work fine tho
That's good, it means you did things well the majority of the time then
hold up
just fixed an bug thanks to this
because of misspelling
ok fixed original bug
Question: I need to cancel the effects of one of my mods after the player exits the game to return to the main menu. Would OnSave or OnPostSave be the correct events for this?
usually you don't need to do anything, lua resets when you exit a save no matter what
Well it reduces the volume, so when you return to the main menu, it remain a lowered volume until you start clicking stuff
ah yeah, to be honest that's tough, i don't know if there is a good event for that
It's my functional ear muffs mod. I'm just trying to fix the script up nicer now that I know a bit more about lua
Ill try OnSave. I think it'll do it
Verify your code for placing and creating the tiles
Tbh I don't think you need to use vectors here
i wanted to do adding and subtracting easily
i was able to load the mod into my save world, but i dont think its working. all of the preset frequencies just play static
You can already do that with simple maths tho
im prolly doing something wrong with the mod setup 😭
Before running this, cache the coordinates of NewCenterPosition into x y z variables, then simply create new_x, new_y, new_z variables that you add the TileData coordinates to
Also I'd advise using key tables for your TileData here
It'll make it easier for you to manage and expand in the future
How can I make the rally lamp bar light up too? I've already put the headlights in the texture mask and the headlights in the texture light. Can anyone help me?
And the rally lamp is an item that I can detach like that :
So whats up with moddata on servers?
Do I have to manually trigger send and receieve now?
You always needed to sync those when needed
Hmm, maybe it was more so there was a local cache before?
Wdym ?
Just for client stuff on the player
It persisted on its own I thought
But maybe I'm misremembering. I didn't have a good test workflow before for server stuff
What persisted ?
Client side only moddata that I stored in the playerObj moddata
it is server auth now
are clientCommands the go to way to sync mod data on objects that aren't the player?
the server sets mod data and calls object:transmitModData() to update the clients: if you need to set it from the client, you need to send a command to tell the server to do that
What about things like InventoryItems?
They have moddata, but no transmitModData()
gotta do some sketchy shit like convert thigns to strings/integers etc and save that, then reconvert when loading
Atleast, tahts what Ive had to do
syncItemModData(player, item) where player is the player who has the item
i'm not entirely sure looking at that that this api accounts for the case where you change the mod data of an item that is not in a player's inventory
Hmm, gets me most of the way there.
Will need to explore ground items though, mainly for Inventory Tetris grids for bags on the floor
onsave works good.
Hey so I'd like to make a clothing item that is invisible when worn. How can I do that?
yeaaaa people be complaining about trying to repair stuff on the ground
and im like.. cool. more stuff for me to disable -_-
also fluid syncing doesn't work for objects inside vehicle containers
Im like this close to just writing all my own sync packets because all the vanilla functions seem broken.
you have to add a transparent texture and then have the item use the texture
@willow tulip
Kaboom?
Kind of? The results of flipping a car on its side violently does give off the same results, just add the pipe bomb explosion lol
I'm already seeing what I can do to add jump and landmine
You can actually make proper helicopters with this
That is if they ever plan on making it work for extended periods in the air lol
After too much time in the air, the car freezes up
Helicopters already exist in PZ
And in B42 they can even properly change Z level
And land on roofs
It's not as smooth as this tbf
It feels like flappy bird
Im confused...
Imagine a car bomb from underneath, but without the explosion and the car nearly instantly flips to a position (not a teleport because it carries momentum). I have not tested this, but you need to define a square and a vehicle, so I'm assuming the square is the position the explosion is coming from?
Is this something in vanilla or?
Like I said, I haven't looked into it fully, but I'm going to try and implement it.
Very vanilla, easy to call as well
If you want to apply an impulse to a vehicle, there is a bullet function for that
public void addImpulse(org.joml.Vector3f impulse, org.joml.Vector3f rel_pos) on baseVehicle IIRC.
@willow tulip it's just vehicle:onJump() and vehicle:onHitLandmine(square)
Super basic
Well just hope and pray for better vehicle physics sooner than later lol
Not like this is related, but good for testing
Doing jump tests mass and suspension work, 1 jump can send the player into the shadow realm, so it's clear they need to work on that
public void onHitLandmine(IsoGridSquare square) {
this.ApplyImpulse(square.getX(), square.getY(), square.getZ(), 0.0F, 0.0F, 1.0F, 300000.0F);
DebugType.General
.println(
"Hit a land mine! %f, %f, %f. isActive: %s, isStatic: %s",
(float)square.getX(),
(float)square.getY(),
(float)square.getZ(),
this.isActive ? "true" : "false",
this.isStatic ? "true" : "false"
);
}
new to B42.13.1
also... not how impulse is used lol
actually wait I guess thats the offset position.. well whatever
... still pretty sure that should be a relative position to the car
Whatever they did, it's over the top for the current physics
yea that'd be the 300000 part.
lol I didn't notice that
this.ApplyImpulse(this.getX(), this.getY(), this.getZ(), 0.0F, 0.0F, 1.0F, 1000000.0F);
DebugType.General.println("Jump! isActive: %s, isStatic: %s", this.isActive ? "true" : "false", this.isStatic ? "true" : "false");
}```
just.. sigh 😛
The jump is super weak though?
shrugs
actually nm they do subtract the positions in applyImpulse
Prob because jump has to lift the entire vehicle while landmine only has to flip it
Does the square actually matter when flipping the car? Like, less power from a further distance?
Or even just flipping in a specific direction
All things I will look at myself anyways because this is funny
Should.
the further the distance, the more it will rotate the car instead of lift the car
Hey guys this is my first time in this discord server I don't know if anyone here is a modder but I had an idea if anyone sees this
I think it would be really cool if there was a stranger things mod like i know making the upside is probably impossible but i think it would be cool if you could make the zombeis like demogorgons and make the vines and stuff blue and make it dark and spooky
broken timed action on MP, anyone have the same problem?
They changed some things, you need to adjust them
Break your idea down into a list of specific things. Then have a look at what is and isn't feasible.
Then start modding.
ty very usefull, anyway the problem was this
Is it possible to mod in animals in PZ? With their own behaviors/AI and drops and such?
I tried looking but I couldn't find any (except Fauna but apparently they're "props" so I assume they dont move or anything)
I guess the overall question is how far can you mod PZ
Like in Minecraft you can virtually code in new game systems into the game, how about PZ
https://discord.com/channels/136501320340209664/1366841696796672031 there are a few, but this one seems to be most advanced
Its still wip i belive
Of course we talk b42+
does gametime.getservertime change with gamespeed?
my ai seems to go goofy if u speed up the game
PZ is divided up into two major parts: Java and Lua. Anything in lua can be modded, and a lot of java stuff has a LUA API. But there are also lots of things that only exist in java with no easy way to mod them.
Java mods are possible, but require users to manually move files around and they tend to break with every update which is a pain with the unstable version.
So the answer is "technically you can mod anything, but in practical terms there are a lot of limitations"
the most challenging thing with animals at the moment are getting the animations down.. that and knowing how to navigate animaldefinitions.
to be honest, i’d recommend holding off on doing animals until tis releases better api for them. this is coming from roughly 2k hours of modding them so far x-x
we can give them custom behaviors, equipment items, you name it ~ all it needs is custom lua code 
So, i wanted to update my torchrefill mod
local items = craftRecipeData:getAllConsumedItems();
local result = craftRecipeData:getAllCreatedItems():get(0);
local previousBT = nil;
local propane_refill = nil;
print("Server - RefillBlowTorchMod OnCreate called - isClient: " .. tostring(isClient()) .. " isServer: " .. tostring(isServer()));
for i=0, items:size()-1 do
if items:get(i):getType() == "BlowTorch" then
previousBT = items:get(i);
elseif items:get(i):getType() == "Propane_Refill" then
propane_refill = items:get(i);
end
end
result:setUsedDelta(previousBT:getCurrentUsesFloat() + result:getUseDelta() * 30);
while result:getCurrentUsesFloat() < 1 and propane_refill:getCurrentUsesFloat() > 0 do
result:setUsedDelta(result:getCurrentUsesFloat() + result:getUseDelta() * 10);
propane_refill:Use();
end
if result:getCurrentUsesFloat() > 1 then
result:setUsedDelta(1);
end
end```
Working fine now in sp, but in multiplayer it seems that its not loading the function when crafting, the print statement only triggers once, when the server loads?
Yes it does
somethings wrong with my saving then
You don't have to save jackshit
What's up with people having problems with that shit, mod data is a dynamic table, throw things in it and forget about, worst case you need to sync with the server/client
You shouldn't do any kind of saving of the mod data
It already saves the mod data itself when you quit a save
You don't have to hook to OnSave or anything to save
ah i mean the way i save my objects
Uh ?
ok i save
a table that holds where npcs are going to be spawned right
and its called militarystructure
for some reason when i make a NEW save
fresh one
Where do you save the table ?
global mod data
In what way do you save ?
it acts as if there is already one saveed
What do you do to "save"
Mod data should have its data dynamically injected
You don't store ANYTHING with a save or whatever
You don't SAVE
You just throw shit in it
See that's your problem here
You trigger that mod data on multiple events
And there's no reasons for you to do any of that
wdym
local player = getPlayer()
local modData = player:getModData()
modData.myString = "Hello World"
modData.myNumber = 42
modData.myTable = {1, 2, 3}
modData.myBoolean = true
It's a table
Store things in it
That's it
No you don't
isnt the only difference between a normal table and
mod data is that it saves to game files
The fact you have a save function is the problem here
There's no saving to do
It's a table
oh
get or create also ...creates it
i thought it saved no idea where i got that from
chatgpt?
You're the second person to fall for some shit like in 2 days
I think I need to clarify this bit on the wiki page because that's abnormal, it comes from other games modding
