#mod_development
1 messages ยท Page 275 of 1
literally just```lua
local myColour = Color.new(0.5, 0.2, 0.8)
oh interesting
the arguments are rgb and i'm pretty sure they're 0-1
I just tested those but none of them worked
i suppose its because im using a modded fluid
how can I work with that?
i think you pass the name of your fluid as a string
:contains("MyFluid")
i haven't worked with custom fluids yet but that looks like how it's meant to work
@late hound did you ever solve this? I'm getting this as well
Youโd need to modify the timed action associated with it.
can anyone give me a run down of how the evolved recipe system works. example; making food on the stove ect.
i dont know if im doing it wrong or if thats not the way of doing it
but it didnt work
So how do i fix the instant actions problem
It's by design. The "ISClothingExtraAction" has a time set of 1, so it's basically instant. This is how you fix it:
local _ISClothingExtraAction_new = ISClothingExtraAction.new
function ISClothingExtraAction:new(...)
local o = _ISClothingExtraAction_new(self, ...)
o.maxTime = 25
if o.character:isTimedActionInstant() then
o.maxTime = 1
end
return o
end```
I personally found "25" to be a good value for that, but tweak it to whatever you want.
I have a mod which works fine in B41, but fails with B42 (shocking, I know ) ```
function RicksMLC_ChatIO:Load(delim, resetComments)
self:DebugModId()
DebugLog.log(DebugType.Mod, "RicksMLC_ChatIO:Load()" .. " modId: '" .. self.modID .. "' path: '" .. self.saveFilePath .. "'")
local fileReader = getModFileReader(self.modID, self.saveFilePath, true)
if fileReader and fileReader:ready() then
...
New server options / sandbox_vars for server owner (B42)
Where do i put this?
media\lua\client\whatever.lua
Change 'whatever.lua' to a file name of your choosing. Restart the game and it should work.
making a crude whetstone mod rn
making it so you can make one with one rock
since i think having two is the issue with the current one
im calling it cruder whetstone
how can I add new properties to modded fluids?
thank you someday i plan to learn how to code instead of Making a Frankenstein of code made in notepad
Do what I do and start by making frankenstein code in notepad++ instead ๐
Not sure you can tbf ?
Might require something else
is there something wrong with this?
it's not showing up in game for some reason
same structure worked for my rope mod
no spaces on craftRecipe names
try craftRecipe CraftCruderWhetstone
@dark wedge I will call my ModOptions file ExampleModOptions.lua
maybe missing a "," after inputs{ ... } ?
Making mods that affect .class files, would decrypting, and then re-encrypting, make it work the same as it did before?
Rat your rope mod had mod id of "ModTemplate" I forgot to say
shit
updated and its still busted
what the SHIT
the recipe worked like an hour ago what the fuck happened
I spent 4 hours rewriting my anim script I'm done tonight mate ๐
why does it break AFTER being uploaded
god damnit
now the mod id wont update???
i changed the fucking files why are you stagnant
wait, maybe its the folder im storing developed mods in
i'll move that
okay that was it
reminder for modders then, dont store developed local mods in a folder within the workshop folder
store them elsewhere
it worked for me in B41, so i did it by force of habit
has anyone managed to figure out how to properly set up the mod.info file or to properly fill the "Version", "Author" etc. slots in the game's mod menu?
awesome! thanks! ๐
okay i learned what it was
SO
my rope mod
uses recipes.txt
the whetstone one did too
so i changed it to recipes_fixing.txt
suddenly, it shows up and works
oh my god don't use generic names like that
How to make character pick up an item, before using it through custom timed action?
every file name in your mod should be unqiue to your mod or you'll accidentally override or get overriden by something
i like to do something like e.g. scripts/ModName/ just so that i don't have to give the files weird names because the folder name already covers it
for a smaller mod something like recipes_ModName.txt makes sense
I don't like just returning false in :isValid() when item is not in player inventory...
so like this?
yeah, that sort of thing
modding for B41 or B42? in B41, you can use a command like
ISTimedActionQueue.add(ISInventoryTransferAction:new(player, item, container, inv))
B42
And yeah.. Trying this rn and it doesn't work for some reason..
2KG The deer ?lol
Ok, this one was not as easy.. I hardly imagine the work needed for big mods like AuthenticZ.. https://youtu.be/9HJjJm6fqwQ
Ports AutoMechanics to B42 Single Player
if no one else knows, you probably have to check B42 vanilla code to check it should be done...
That's what I'm doing and rn it says ISTimedActionQueue:tick: bugged action, cleared queue and I don't know how to make it say where's the problem
Prop1 and Prop2 in the new timedactions system, are what you are going for I think. but you need to use items that can connect to the bones, such as the Base.Screwdriver - if you find out how to add your own item I need to figure that out too. I think it is the same as B41 but not sure where to find a guide to do that.
bugged action usually means an isValidStart failed
check the isValidStart functions of the timed actions you're calling
Ok, I'll check
If anyone figures out how to create an item that can be used in prop1 and prop2 successful, please let me know! ๐
What do you mean by 'connect to the bones'?
Essentially held in the hand. Like a weapon or tool would be.
if not action.character:getCharacterActions():contains(action.action) then is what triggers your error
Not sure if this is the place to ask, but the music folder. Where is the Untitled "34" song located? I went through the music folder in media and couldn't find it.
is definitely a bit weird since the vanilla code seems to call "ISInventoryTransferAction" quite often. The few examples I saw used it in an "if isClient() then ... else" construction though...
Yeah, I'm going through isValid part of ISInventoryTransferAction and still can't find what's wrong could be..
are you trying to pick up a world object or a moveable?
Uh.. Just an item? Like, normal item. I just need to transfer it to player inventory
Am I using the wrong thing for this?
I'll have a look but I use:
ISTimedActionQueue.add(ISGrabItemAction:new(playerObj, object, time))
I also have used this one, but I'll try again...
local time = ISWorldObjectContextMenu.grabItemTime(playerObj, o)
ISTimedActionQueue.add(ISWalkToTimedAction:new(playerObj, square))
ISTimedActionQueue.add(ISGrabItemAction:new(playerObj, o, time))
could maybe just throw it into
ISWorldObjectContextMenu.onGrabWItem
this is what i usually use```lua
local inventory = character:getInventory()
if not inventory:contains(item) then
ISTimedActionQueue.add(
ISInventoryTransferAction:new(
character, item,
item:getContainer(), inventory))
end
That's literally what I have, if I'm not wrong
if it's the same then i'd make sure the arguments you're passing are good
like is the item definitely an item?
Yeah, I'm checking this rn
I tried that in 41 and it kept bugging out on me. Prob cause I'm stuffing 100 actions into the queue
and I'm just bad at this
could also try to use "if isClient() then" and then your transfer action. not sure if it will do smth for you but this is often used in vanilla B42 code
Is :zombie.inventory.types.ComboItem is an item?
yeah, that should be correct
I'm trying to use :getItem() on it and it doesn't work for some reason
local objs = square:getObjects()
for i = 0, objs:size() - 1 do
local o = objs:get(i)
you can getItem() on o after that
if instanceof(o, "IsoWorldInventoryObject") and o:getItem():getWhatever() == "something" then
I thought DisplayName would be the name displayed here?
item Mov_PCZCore
{
DisplayCategory = Furniture,
Type = Moveable,
Icon = pczcore,
Tooltip = Tooltip_ItemTraps,
Weight = 10,
Capacity = 20,
UseWhileEquipped = FALSE,
DisplayName = PCZ Core,
WorldObjectSprite = pczcore_0,
}
How do I reference one script from another
Here is a snippet from ISBaseIcon. It seems to be using :getDisplayName().
local bpItem = backpack and backpack.inventory and backpack.inventory:getContainingItem();
if bpItem then
if not backpack.inventory:getOnlyAcceptCategory() or (self.itemObj:getCategory() == backpack.inventory:getOnlyAcceptCategory()) then
local backPackOption = subMenu:addOption(getText("ContextMenu_PutInContainer", bpItem:getDisplayName()), self, self.onClickContext, 0, 0, contextMenu, backpack.inventory, {self.itemObj});
........
Rn it's almost like your code and of course it gives the same error with bugged action
local playerInv = self.character:getInventory()
if not playerInv:contains(self.flare) then
ISTimedActionQueue.add(
ISInventoryTransferAction:new(self.character, self.flare, self.flare:getContainer(), playerInv)
)
end
come to think of it i don't think i've ported any of my mods actually using that code yet, so it's possible something changed in b42...?
newbie question, but how can i "convert" b41 spawn point mod to work in b42?
like this one: https://steamcommunity.com/sharedfiles/filedetails/?id=3089460885
Maybe, but I don't know how to debug it
hint
check pins
well i took a look and the transfer action looks unchanged, so i have no idea what's going on
when are you adding the action?
In :isValid()
ah, that's not a great idea, isValid is called every tick while the action is running ๐
Damn..
you want to add the transfer action before adding your action
Oh god. Thanks everyone, that was the problem ๐ญ
Does anyone know or have the Keyboard. list of keybinds? I have used OnKeyPressed(key) if key -- Keyboard.KEY_F10 then , but that is for taking screenshots. There must be a list somewhere?
Okay, uh... How to correctly check if player is nearby the item that he's trying to pick up? Cause you can open context menu, walk away, and only then press the button
working hard or hardly working
if luautils.walkAdj(playerObj, square, true) then
that will make your player walk back if they have walked away
no matter what I do getAllRecipes() always returns an empty list. Am I doing something wrong? :/
Yeah, that works, thx
for build 42? ScriptManager.instance:getAllCraftRecipes(), 'Recipe' recipes are legacy
is there any page where I can find stuff like that? Some kind of deprecation log for b42?
it looks like a global in 42? but yea, it returns nothing
no ๐
One message removed from a suspended account.
Anyone know where the new B42 music is? It's not in media/music
put a copy in the 42 folder
i might need to make a fifth mod today
i've found that combining thread is broken
and the pick thread recipe only grants a single unit
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
check pins, it's the old one folder style
Trying to use the InventoryItemFactory now gives the error "attempted index: CreateItem of non-table: null". Is the InventoryItemFactory class changed? ```
function RicksMLC_VendingMachineConfig:MakeContainer(containerList)
-- Returns: ContainerItem with items.
local container = InventoryItemFactory.CreateItem(containerList[2])
if not container then
...```
Ah.. checking the B42 LUA it calls instanceItem() ... dunno where that is in the java code tho
When creating custom model - you can only add texture file to it or something else? Like roughness or normal
https://steamcommunity.com/sharedfiles/filedetails/?id=3387462212
Just made a small mod that increases the lifetime of batteries. It's my first real mod so would appreciate some feedback!
Not sure if my approach is the best way, I was trying to achieve this without hardcoding stuff, and so far everything seems to work. I'm just scanning for input items on the InsertBattery recipe. Sadly this won't work for radios and similar devices.
Code is here: https://pastecode.io/s/dgec4a9a
hey, devs will you update this?
https://projectzomboid.com/modding/index.html
package index
Have multi z level cars been added in unstable?
friends! remember we used to have remove result item parameter from Recipe script?
how that it doesn't work
is there any way to do the same thing? withouth using Lua?
Iโve heard rumors about it but I know nothing has been confirmed
i think you don't need to add a result at all anymore
tried it having the output {} empty
I can confirm you can make a ramp and go up and down with a car
and it stopped the recipe from showing up in the crafting
i went down the construction basemenet on riverside at least
This is fucking amazing
Finally I can make that Rocky Mountain map
Out of town right now though
i have it '''
craftRecipe Use Elixir
{
time = 100,
tags = Survivalist;CanBeDoneInDark,
category = Wuro_Recipe,
needTobeLearn = false,
timedAction = MakingHammer_Surface,
inputs
{
item 1 [Base.Elixir],
}
outputs
{
}
}
'''
but this doesn't show up in the crafting area
Anyone managed to get custom items to generate as loot yet? My Scavenger Skill mod is updated aside from getting the books to populate. I get no errors, but also no books lol
I just confirmed you can run without an output, so your issue I think is somewhere lse.
i see. ty for confirming it. Ill see where it went wrong then...
craftRecipe RipUpCDCGeneralGuide
{
timedAction = CDCRR.RippingUp,
Time = 60,
OnCreate = CDCRR_CollectCDCGeneralGuide,
category = Health,
Tags = InHandCraft,
inputs
{
item 1 [CDCRR.CDCKX93185RapidResponseGeneralGuide] mode:use,
}
outputs
{
}
} - that is mine that worked without output for reference
Yeah if you want to do it standing anywhere I believe you need that
i think you need InHandCraft or AnySurfaceCraft or it won't show up
Wonder if devs will release documentation for tile biome generation ๐ค
does anyone happen to know if anyone's working on a b42 player respawn mod yet
wish someone would make the new tall grass to spawn more abundant even in house and roads
so it looks more 10 years later type scene
Haha, what if someone made a mod that made rats transmit the disease so you could pretend it's the Rat Plague from Dishonored, haha wouldn't that be crazy
Ok, checking Lootzed, my books ARE in the distro list, but my "BookScavenging1" has the same spawn chance as "BookMetalworking5" even though, they dont have the same value in the BookstoreBooks table. Or at least should.
https://steamcommunity.com/sharedfiles/filedetails/?id=3387608427
B42 NEW MOD
Let me smoke and still be athletic !
1:11 Step 1 - Know your file locations
4:06 Step 2 - Storyboard your ideas out
9:03 Step 3 - Get your files from the game or other mods
11:47 Step 4 - Build your mod files
1:01:54 Step 5 - Create the textures (mislabeled in the video, oops)
1:19:45 Step 6 - Put your mod files in the right structure
1:30:37 Step 7 - Test your mod (please back up ...
Is this guide not useful anymore? i wanted to try and make a mod but in the PZ files recipes have input and output
does anyone know how this works?
Since actual multiplayer isn't here yet, me and @vivithedrawn had to try out good old splitscreen and it was a blast!
Credits:
""ZigZag" Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 4.0 License
http://creativecommons.org/licenses/by/4.0/
"Surf Shimmy" Kevin MacLeod (incompetech.com)
Licensed under Creative ...
they are doing splitscreen multiplayer
its related to scripts files that need to be rewritten, lot of busy work
I guys. I create maps for project zomboid, but this time I had a terrible problem that had never happened before: "The mod.info file does not exist in your mod" can you help me?
It was not my mod after all, this was the culprit https://steamcommunity.com/sharedfiles/filedetails/?id=3386729204
Apparently due to an extra comma in scripts\clothing_bags.txt
does anyone know where i can find the script for the campfire moveable?
you can just play splitscreen as long as you have a controller, just press a button on the controller and it'll come up with a prompt to make player 2
you can do it through steam remote play but it won't be a good time with any significant amount of ping
and controller controls for build 42 are unfinished
hi all, what is the best way to update my mod with the b42 structure, but also test both b42 and b41 functions remain the same? Should I make changes and then try launching both versions?
Hi Folks, sorry to bother you, but i need your help. I am experimenting the game with patch 42, but I have a small problem. I can't increase the capacity of the duffle bags/backpacks, as I did in the previous version of the game. It seems the capacity is stuck at 49, whereas I could make it go well beyond that value. Can you tell me if there are any values in other files that need to be changed? (sorry for my terrible english)
I need this!
Check out the pinned messages
So, I'm not sure how you are currently doing it but I would assume its as simple as modifying the capacity attribute associated with the bags you want to modify in the clothing_bags.txt
If you want I can try and get it to work..
When spawning a waterbotte with a recipe output, is there a way to spawn it in an empty state?
Here is the item object definition for WaterBottle:
item WaterBottle
{
DisplayName = Water Bottle,
DisplayCategory = Water,
Type = Normal,
Weight = 0.1,
Icon = WaterBottle,
IconColorMask = WaterBottle_Mask2,
IconFluidMask = WaterBottle_Mask,
CookingSound = BoilingFood,
CustomEatSound = DrinkingFromBottlePlastic,
FillFromDispenserSound = GetWaterFromDispenserPlasticMedium,
FillFromLakeSound = GetWaterFromLakeBottle,
FillFromTapSound = GetWaterFromTapPlasticMedium,
Tooltip = Tooltip_item_OnlyPurifyMicrowave,
StaticModel = WaterBottle,
WorldStaticModel = WaterBottleFull,
Tags = CookableMicrowave,
/* OnCreate = SpecialLootSpawns.OnCreateWaterBottle, */
component FluidContainer
{
ContainerName = BottlePlastic,
capacity = 1.0,
PickRandomFluid = true,
Fluids
{
fluid = Water:1.0,
fluid = CarbonatedWater:1.0,
}
}
}
ah gotcha..
Here you go:
craftRecipe MakeImprovisedGasMask
{
timedAction = Making,
Time = 80,
NeedToBeLearn = True,
Tags = InHandCraft;Engineer,
category = Survival,
xpAward = Tailoring:5,
inputs
{
item 1 tags[Scissors;SharpKnife] mode:keep,
item 2 [Base.DuctTape],
item 1 [Base.RippedSheets] mode:destroy,
item 1 [Base.PopBottle;Base.WaterBottle] flags[IsEmpty],
}
outputs
{
item 1 Base.Hat_ImprovisedGasMask_nofilter,
}
}
I did peek at that, but from what I can tell it always wants to spawn full if using output from a recipe. I may be able to create another waterbottle that spawns empty, or spawn it from a function and modify it, but I am not sure.
nice!
Change your output to be:
item 1 [Base.PopBottle;Base.WaterBottle] flags[IsEmpty]
Happy to help
All I have to offer are git diffs. https://github.com/asledgehammer/PipeWrench/commit/fc46fa086b93a44df859a6326e060d340e54933c
Hey y'all, I am not sure how to word my question so bear with me. I am trying to update a mod for my own use until it is properly done by the original author. I got the file structure setup correctly and was able to find the mod in the in-game modlist, however, after activating and reloading the Lua I got a CTD. Digging through the log I am finding the following: ERROR: General f:0, t:1734665280096> Item.OnScriptsLoaded > Could not find evolved recipe or template: 'Pasta' in item = Base.CannedTomatoOpen. However, the recipe file itself never makes mention of the base item so I am not sure what the best way to fix this for the time being would be. Any insight would be greatly appreciated!
anyone have ideas why my items/models are now clipping into the floor? never had this issue in b41 lol???
Recipes have been redone. Any B41 recipes are going to have to be reworked using the new recipe format... or at least most of them will need to be redone. If you want examples, take a look at the recipes_cooking.txt in the scripts folder.
I think you might have got it flipped, the error isnโt in the recipe, the error seems to be in the item Base.CannedTomatoOpen ?
If youโve changed the recipe for Pasta, the item itself might be looking for the no longer existing recipe?
What is the mod? Can crack it open and see if I canโt help you find any issue
Inside mod.info.
modversion=xxx
author=xxx
versionMin=xxx
"versionMin" should fill in the ZomboidVersion on that screen.
I won't lie, it feels pretty sleazy trying to patch up someone else's mod, so I vastly appreciate the offer to look. I am looking at Superior Stews (3216871233) by Brattymaddy
Unfortunately no, it does not work. I have modified the file in: media/scripts/clothing/clothin-bags.txt but it has no effect in game.
Since it is for personal use only, itโs really not that bad. Looking under the hood of existing mods is a tried and true method of learning how to actually make mods work for this game ๐ but just give me a few, and Iโll see if I canโt find the issue
Howdy there lads and lassies, I'm struggling to recollect where (or even if) there's a file that lists the various item types that can be used in crafting. I think I've gotten reasonably close to patching my simple craftable PAWS characters mod, although I'm trying to see if there's a general item type for paper, sort of like how there's the tags[Write] for pens, pencils, markers, etc.
Speaking of which, Spiffo pens! Didn't know they were a thing, but they showed up when testing the recipe haha
There seems to be a limit or block that sets the maximum capacity of a duffel bag at 49, despite the fact that I chose a value much higher than 49
By paper, do you mean things that can be written on? Or specifically paper lol
Things that can be written on, I suppose. The old recipe used to be just for a sheet of paper, but there are tons of new writable items now outside of those and journals
You can look for CanBeWrite = True, or if you want to exclude notebooks/journals, you can check PageToWrite = 1
Ah, good stuff!
And do we know what file is where they keep the 'recipe' information for looking at notes, etc.?
What do you mean?
I found the issue! :D Good news, it should be a simple fix. Bad news, it is going to take a little work lol
Is there a lua file or something along those lines that contains some of the information on the 'Look at X' or 'Read X?'
I'm not quite sure how to properly explain it
Oh! Yeah, give me a second Iโll see if I can point you in the right direction
My windows explorer is freaking out for some reason ๐ญ
Praise be to the FSM! What will I need to do? (Take your time my dude, you're clearly being pulled in a few directions)
No problem!
Acouple issues now with my gun mod in b42...
-MuzzleFlash In Incorrect location
-Single Fire glitchs out the player
-Muzzle Offset location doesn't show in attachment editor
If somebody could help diagnose and fix these problems I would be very thankful.
Here you go
Beat me to it hahaha
Y'all are the best. Thanks so damn much!
Just rename the file to what it is current in the mod folder and replace the one in the mod folder
๐
The issue is that the new evolved recipes use the Template: line, while the old ones dont
And minimumwater
Btw, that mod legit just doubles the number of allowed items in evolved recipes, dont feel bad about tweaking it lol. Its 99.9% base game stuff
Yeah, when I saw that, I just told ChatGPT to double maxitems in this file and send me back the new one LOL
@sacred harness can you help me, friend?
Yah, working it now lol
Trying to see if there is a LUA file out there with max capacity on the bag item category
ty, I'm desperate, I can't understand what the hell has been changed
Its all good. Everything I know I've pretty much picked up in the last two days....
imho, it's something about the character capacity... not the bag
Check the \Steam\steamapps\common\ProjectZomboid\media\lua\shared\TimedActions and look at ISReadABook.lua
I thought you were trying to increase the bag capacity?
What is the issue? I can take a looksie too
For example, have a bag with 100 capacity and 99 weightreduction
Yes, indeed, but I have the impression that the capacity of the bag is limited by a character value, probably. You can modify the bag all you want, but it doesn't go beyond a value of 49, and if I'm not mistaken, 49 is a capacity limit that the character has, without wearing a backpack. It was just a thought to get to the point
for the love of god. make the zoom mod.
Okay, so the bag capacity still says 49 even though you set it to 100?
i tried with 1000, with 9600000, with a lot of values, but it stucks at 49

The staff does not want us to OP the character xD
Can you post a screenshot? I just want to make sure I'm understanding it right.
sure
Can you send the item script of the item you made/modified as well? Just to be sure
Now it's 63, idk the reason >_<
If you could do this rq? I am not seeing anything native to the code that should be limiting this, seeing as there are existing containers that already hold more than that in the game
{
DisplayName = Duffel Bag,
DisplayCategory = Bag,
Type = Container,
Weight = 1,
/*Icon = Duffelbag,*/
IconsForTexture = Duffelbag;DuffelBag_Green;DuffelBag_Grey;DuffelBagBlue;DuffelBagRed;Duffelbag_Sport;Duffelbag_Sport2,
CanBeEquipped = Back,
CanHaveHoles = FALSE,
Capacity = 960000000,
CloseSound = CloseBag,
ClothingItem = Bag_DuffelBag,
EquipSound = EquipDuffleBag,
OpenSound = OpenBag,
PutInSound = PutItemInBag,
ReplaceInPrimaryHand = Bag_DuffelBag_RHand holdingbagright,
ReplaceInSecondHand = Bag_DuffelBag_LHand holdingbagleft,
RunSpeedModifier = 0.95,
SoundParameter = EquippedBaggageContainer DuffleBag,
WeightReduction = 100,
WorldStaticModel = DuffelBag_Ground,
Tags = IsFireFuel;IsFireTinder,
}```
The question I ask myself is, does this apply to you? Or can you safely change the capacity of the bags?
Can you try setting the weight reduction to 99? I know it sounds dumb, but having 100% weight reduction might be breaking something lol
ok, i try, man
My lootbox mod has given me the superior fit this run,,
It seems like the capacity is hard-coded to not exceed 50. In the Java under "DoParam"
else if (var1.trim().equalsIgnoreCase("Capacity")) {
int var23 = Integer.parseInt(var2.trim());
if ((float)var23 > 50.0F - this.ActualWeight) {
var23 = (int)(50.0F - this.ActualWeight);
}
this.Capacity = var23;
}
That's called on all scripts when being loaded.
I don't see any bags that have that high of capacity, just world containers. And those aren't impacted by that
Ah, thank you! Havent decomped the b42 yet, and the java docs arent updated yet
B41 definitely didn't do this
I would like to know why the staff has to make these changes to complicate things for the players. I understand that it bothers having a character who can put everything in his backpack and therefore gives the idea of the OP, but what the heck, doing it this way means restricting the player's freedom.
Here's the thing tho. 50 isnt a hard cap, seeing as it has been tweaked here
WAIT I THINK I KNOW WHAT IS GOING ON lmfao
that might be a visual bug?
or if weight reduction was changed, you suddenly have more weight
@cerulean yew What is your characters inv weight at?
inventory?
Yea, like not the bag
wait a moment
I will add that a modified bag will show less capacity than it actually has:
You have Weight = 1,, and the Capacity is set to 49. So the logic I provided seems like that's it.
The code takes 50-Weight to determine the bag's capacity when it's set over 50
Right, do you know what the .ActualWeight is doing?
Because that is the only thing modifying the 50, so somehow its seeming making it go above 50
Yes, but I don't understand the point of having to code this value, imposing the limit of 50 on everyone. What do the staff care if I put an entire planet in my backpack?
Does it do the same if you hold the bag in your hand?
i try, wait
here
Can you open the bag lol
exactly
At the point where this is initially called, the "ActualWeight" would be just 1.
else if (var1.trim().equalsIgnoreCase("Weight")) {
this.ActualWeight = Float.parseFloat(var2);
if (this.ActualWeight < 0.0F) {
this.ActualWeight = 0.0F;
}
}
and the capacity in the screenshot showed it was 49.
Right, but I am still at a loss then for why it would go up in this one^
idk why it was done either. possibly due to the inventory management being done on the server though, limits the amount of items you can carry
Unless it is just a visual bug*
This all being said, you are in debug mode, so you can literally just turn on the setting for unlimited carry capacity
Acouple issues now with my gun mod in b42...
-MuzzleFlash In Incorrect location
-Single Fire glitchs out the player
-Muzzle Offset location doesn't show in attachment editor
If somebody could help diagnose and fix these problems I would be very thankful.
reposting this just so that I can get some help-
๐ข
One question, can you tell me which file contains that value? Maybe I can edit it with the DNspy program, although I am not an expert
zombie\scripting\objects\Item.class
It's in the game's Java.
We might need to think outside the box here ๐
If we cant mod the bag capacity over 63, then we could mod the ability to carry bags that are too heavy..
So you could carry three bags, full to the brim at 63, for a total of 189...
Just change this:
local willBeOverMaxWeight = function(character, item)
-- note this assumes the item is equipped. this check is not performed here
if not character or not item then return end
return not character:isUnlimitedCarry() and character:getInventory():getCapacityWeight() - item:getEquippedWeight() + item:getUnequippedWeight() > character:getInventory():getMaxWeight()
end
to this:
local willBeOverMaxWeight = function(character, item)
-- note this assumes the item is equipped. this check is not performed here
if not character or not item then return end
return not character:isUnlimitedCarry())
end
are pz's aim anims broken rn in 42?
Otherwise... you might as well add a trait which gives you the ability to carry as much as you want.
alotta stuff is messed up- my gun was completely backwards in b42, but completely fine in 41, the muzzleflash location is utterly broken too...
In my weapons mod, all models with fbx were broken in version 42, including the muzzle, so I had to redo them to .x.
Sorry, not good with the modeling and stuff. Only good with code ๐
Excuse me, but is this a mod script? Because it's not like I'm able to create mods. I mean, sometimes I have modified and customised them, but I'm always talking about very simple things
right- I use the modern version of blender and just use fbx
Yeah, it would be a lua
modern and fbx are correct.
if making my models into .x will fix these issues then please tell me how
.x is a...pretty bad choice ๐ฆ
it wont. he likely did somehting else. as file type wont fix it.
your rotation attachments etc are all wobbly, is what is wrong.
kinda sucks now all my hard work is gone
I don't understand tho, if my rotations work for 41 what makes 42 not work
pz gets its info from a ton of spots. script, model, attachmentdata, etc
42 changed some. melee weapons got up/down flipped for instance
uuughhhhh. this is hard-coded in the ItemContainer itself too:
private int MAX_CAPACITY = 100;
private int MAX_CAPACITY_BAG = 50;
private int MAX_CAPACITY_VEHICLE = 1000;
Even calling setCapacity directly on an inventory craps out:
public void setCapacity(int var1) {
if (this.parent instanceof BaseVehicle && this.Capacity > this.MAX_CAPACITY_VEHICLE) {
DebugLog.General.warn("Attempting to set capacity of " + this + "over maximum capacity of " + this.MAX_CAPACITY_VEHICLE);
} else if (this.containingItem != null && this.containingItem instanceof InventoryItem && this.Capacity > this.MAX_CAPACITY_BAG) {
DebugLog.General.warn("Attempting to set capacity of " + this.containingItem + "over maximum capacity of " + this.MAX_CAPACITY_BAG);
} else if (var1 > this.MAX_CAPACITY) {
DebugLog.General.warn("Attempting to set capacity of " + this + "over maximum capacity of " + this.MAX_CAPACITY);
}
this.Capacity = var1;
}
That's so annoying. Not sure how I'm going to get around that when attempting to merge inventories in one of my mods.....
Lmao.... but why?? >_<
I am pretty sure that rifles did too
I had to completely flip and rotate my rifle for 42
mine, work good. but im ...a bit nuts when its this.
I wouldnt be surprised if they redid models for b42 or otherwise changed how they are interpreted. It could literally be that they had someone make models, and then realized all the models were flipped relative to the way Zomboid reads them, so instead of changing all the models they changed the code that reads them lmfao
Max Capacity 100? I don't understand
I know that fbx is the best but the game when using .x because everything is made for the .x files, that's what I think, since in 42 the muzzle of all my weapons left their place and the weapons rotated at 180
if you can find the reason why this happened then tell me...
That would be for anything that is not an inventory bag or a vehicle. I would assume that is for things like furniture
that's for things that are not bags it seems.
idk if ash if correct or not, but I think they might be right
rotation. of the model. in blender.
mmh... clear
after that. set new attachdata for muzzle etc.
I'd def trust Ash on this lol. Go look at their mods
its easier said then done
the attachment viewer in debug is broken
so locating attachdata with the new flipped models is difficult
In short, in simple terms, not even modders will be able to create a mod that can appropriately modify duffel bags
yeah look. whoever was behind a ton of the code lately Fumbled the keyboard like a 5 year old.
they call it unstable for a reason.
Yes. You can set them to a max of 50 tho 
if the attachdata worked prior in 41. leave that for now.
its the model. export it a ton of ways and see what needs flipping.
End of the fun... goodbye endless weight in backpacks
The truth is I don't know the reason, what I did was redo the models in .x and everything was fixed and I just arranged the muzzles and that's it. The only thing that's still broken is my MP9, the character contracts up to the waist, that's the only thing I'm investigating.
i am TELLING YOU.
I've flipped the model in blender and gotten it in the correct location
so in the player/hands it is fixed
the only thing that is broken is the single fire and the attachment data
time to go edit the txt file attachdata ๐
take one of them that has all 00's from a pz gun.
match the gun to yours sizewise before choosing
ie dont use m9 attachdata for a rifle...
then edit from there.
is your mod the "Rain's Firearms & Gun Parts"
Get yourself a car apparently. The max weight for containers in a car is 1,000. If you're hitting that amount, then idk.
we needed to be 200% sure that isShop was true!
fumble that odd probably sets it to false ( ie, no shop for you. )
I don't want to talk rubbish, but doesn't the weight affect the performance of the vehicle?
yes.
this is only imagine, can't we make item's weight to 0 when it's in your backpack? idk this is possible to implement tho
my gun stuff isnt out yet. it was being remade for months. but got hit all the same by 42.
and another... that I don't wanna say because somebody might steal my idea...
your ideas are already done. or being done.
mmh... idk
dont let it stop you aha.
idkkk
its a gun that you would be suprised isn't a mod yet
I ALMOST had it ready for 41
DM it. i will be suprised.
Take your time, remember that 42 just came out

Thats the joy of modding! I was racing b42 for a blacksmithing project I was working on. Had a fully kitted alloying system and everything, but real life got in the way haha
i had just started rotating boltcycle testing. its ruined. so yeah we all got hit
perhaps put a negative weight reduction?
wasnt suprised, but idea is good
@winter thunder @dark wedge However, in the next few days I will try to contact the staff or post on the forum to see if this weight thing can be changed, at least allow us to customise the values beyond a certain amount
I hate it
I'm just a freshy modder guy
I dont wannttt everything I knowww to chaangeee
you can try asking here: https://discord.com/channels/136501320340209664/1318920979581501502
its the best time ever for PZ and modding.
Sorry, no offence, can you please avoid spamming on this channel?
thank you, Dhert
Jajajah the good thing is that you learn along the way.


whatever, only positive I see is that now at least there is acouple cooler stuff I can poke and make something cool eventually
simply item:setWeight(0) maybe?
now i try ^^
dont know this will even work because ive never changed something's weight before
with this
no wait a moment, do you mean, 0 weight ofr every item??
What could be causing my mod to be displayed and acceptable on build 42, but when a save is loaded the mod content is just not there? No errors or indicators something is going iffy
only when item is in your modded backpack
ah, the weight reduction...
ah i just realized what you mean D: thought you wanna create a magical backpack
check its even enabled in the load save, mod manager. if thats even a thing now.
It is, in both
sorry i came in middle
pathing issue, is likely
i'm checking by triage now (removing folders to see what happens)
if your file structure is wrong, it can cause this. I would download a mod off the workshop that is b42 compat and make sure your format is the same
They changed the file paths, so the typical structure for b41 doesnโt work anymore
i know, 42.0/common/41.0 subfolders and the like
gonna check a complex mod nevertheless
๐ซก
media works for that yea, still won't use a 41 version of the mod
Correct
Basically, you are adding a 42 and copying your media folder into that 42 folder.
Alright, I'm off for now. Till tomorrow!
NIGHT!
But what would be the way to make a mod for the 42? Because this is just to update existing ones, right?
Or not?
make them all seperate if they are decently sized
small mods are ok for now
Heh, updating for new version be like
Also a lot of new visitors, normally most of my subs are from Collections
Yeah, definitely prime time to be releasing / updating
I jumped in becuse I noticed a Dip in my subs
You worry when this is the general trend
Lol ok, fair enough
that's a weird dip
That's a 42 realsed Dip
Still need find out about new evolved recipies
Also should update the picture of the friuts and cut out the wild apples as they are in base game now
I cut them from the code, but I still should update the pic
Also Collections are your friend
I really need to get the Sandbox settings done.
Could be good idea to also allow pepole to change the forging skill required I guess
But for that I wait for the new docs
I still have no clue how to repeat this
big spike in views for being early to update to B42.
It's nice
Probably a bunch of people thinking "surely this doesn't do what it says it does...."
Oh no
Hey y'all I am extremely brand new to trying to mod, I don't know java or lua but I did get something to work. Can anyone explain how overwriting lua codes works in modding? More info: I have a lua I've edited and it's in a mod folder but I left the name the same. what do I need to do to get the game to pull in and use my lua as opposed to the base game? It's uploaded on the workshop but doesn't show up in the mod list in game. Currently going back to old build to even be able to upload to the workshop,, and then switching back to b42 unstable to check if it's there
I see why it doesn't have a lot of subs 
The proper way is (over simplified) you rename the original, then make a new function with the original name that calls the renamed original
That way you can have multiple mods adding stuff before/after the function without stompiong on each other.
-- C:\Games\Steam\steamapps\common\ProjectZomboid\media\lua\client\Vehicles\ISUI\ISVehicleDashboard.lua
function ISVehicleDashboard:prerender()
original_dahboardPrerender(self)
if not self.vehicle or not ISUIHandler.allUIVisible then return end -- don't run if not in a vehicle or UI is off... otherwise throws an error when getting out of a vehicle when it excutes one final time.
local alpha = self:getAlphaFlick(0.65); -- flickering from crashes etc
local chargelevel = self.vehicle:getBatteryCharge()
if self.vehicle:isEngineRunning() or self.vehicle:isKeysInIgnition() then
--print ("#### Battery Charge is " .. chargelevel)
if chargelevel > 0.75 then
self.batteryTex.backgroundColor = {r=0, g=1, b=0, a=alpha};
elseif chargelevel > 0.50 then
self.batteryTex.backgroundColor = {r=1, g=1, b=0, a=alpha};
elseif chargelevel > 0.25 then
self.batteryTex.backgroundColor = {r=1, g=0.5, b=0.1, a=alpha};
elseif chargelevel > 0.01 then
self.batteryTex.backgroundColor = {r=1, g=0, b=0, a=alpha};
else
self.batteryTex.backgroundColor = {r=0.5, g=0, b=0, a=alpha};
end
end
end```
that is the lua from colored battery indicators (which is now in vanilla)
HOW MANY MODS are now vanialla ? is the top 50 mods just in Vanilla now?
you can see I copy ISVehicleDashboard.prerender, then make my own ISVehicleDashboard.prerender that calls the original but also does extra stuff after.
Lots of small QOL things are in vanilla, it's great
So what I'm changing is ISShovelGround.lua, I just copy the entire thing even if i am only adding a small paragraph?
BTW> the vanilla version of "open a can with a knife" risks stabbing yourself in the hand and bleeding to death because you were distracted by the knife becoming blunt and worn.
I know I need my start as mr Fatty fat fat trait back
is that simpler than trying to inject a small change
Wait did anyone bring back Obiste trait yet?
you don't copy the lua code into your lua file, you use lua to make a copy of the function: local original_dahboardPrerender = ISVehicleDashboard.prerender
Oh nobody did >:)
I guess I going to work on bringing back weight traits
Finally discovered why - mod.info had the same mod id on root folder and b42 folder
Why?
Can't say I've ever had a problem with that, on all the mods I've ported over, they all have the same ID as their B41 version.
I have no clue why, but i just renamed the root mod.info id to whateverbase and the b42 as the legit one
mod is done from scratch tho, may be the cause
probably b41 multiplayer
Done! Let's hope they can accommodate the request
As in, if you lose/gain too much weight you get the trait?
I think all you need to do is change the cost from 0
When I made a quick "betatester" trait to avoiding having to grind initial skill levels to try B42 it didn't show up as selectable, when I made it cost 1 point it did.
So just make a TraitFactory addTrait and modify the cost?
I assume so.
But there would also be code somewhere for "on starting new game if they have this trait adjust their weight"
That might be missing in B42
I just don't understand why they have encoded a lot of files, to which novices like myself can no longer have access for obvious reasons of computer ignorance >_>
What do you mean "encoded"?
hard coded sorry
You mean the stuff in the java side of the game?
It's called Technical Debt
If we talk about debts, we can take up a collection ^_______^
a lot of stuff, man
Well the game is over 12 years old now
Quick question - is a recipe for a custom item written in its own recipe file, or does it go into the item file?
recipes will go into ../42/media/scripts/recipes/YOURMOD_Recipes.txt
items into ../42/media/scripts/items/YOURMOD_Items.txt
Oh I hate they changed the name to "very high weight"
Also! weight works out of the box!
So just need to fix names and such make a pic and I can post
How do I check what errors is Lua throwing out?
Where are the icons?
As in Trait icons
There is like 1/10th of them in the actual folder labled Traits
Run your game with -debug tag to run the debugger, or you can search for console.txt and review that in something like notepad++ or vscode
does the inside of my mod folder need to follow the file structure all the way to where the .lua file is in the games files
Has someone managed to get "Require" (in mod.info) to work? no matter how i set up my mods i cant get it to recognize the required mod on b42.
I am not good at making thumbnails <w>
just set the dependency to \ModID
they're supposed to be WORKSHOP-ID\MOD-ID but they're bugged right now to be just \MOD-ID, so heads up that you will have to change all of your requires when they fix it
thanks. i was scratching my head here why it would not work -.-, i will need to revisit my mod anyway once the api is released. need to look up how they do the water weight anyway so i can maybe include it into my mod.
Yep
i wonder how it will work with newly released mods then. they dont have a steam number till you have uploaded it...
You need to create a "42.0" folder and a "common" folder, inside 42.0 will be all the content of the mod (if there are no changes with respect to 41, then they will literally be duplicate files. Since those in 41 are the ones in the root folder
i know that. my structure is already up to that standard. i simply could not get the require to work. my submod for fish needs the main mod one active.
I think that's better
On the other hand, is anyone managing to get the new translations working? I've taken the time to translate everything into Spanish (based on the EN folder, obviously), but despite coding it to ANSI so that it accepts the accents and other characters, the game doesn't recognize the translation, which is why it looks weird.
For example, let's say here it should be marked as "cinturรณn", but it looks like "cintur?n"
could the games font maybe not support it?
Has comprobado que el encoding sea exacto el mismo que el del juego?
Mmm, tendrรฉ que revisarlo, pero suponiendo que la base de la 41 a esta no haya variado en gran medida (mรกs allรก de la infinidad de lรญneas), deberรญa ser la correcta
What the hell?
My Translation file just up end and DISAPPEARED
also unrelated : does someone know of a good cheat mod for b42? so i can run around and test my mod unbothered by the brain eating residents?
start the game with the -debug parameter
https://steamcommunity.com/sharedfiles/filedetails/?id=3386556284&searchtext=debug
Supposedly is in english
What exactly do you mean by disappeared?
Literally the entire EN catalog was gone
oh well it wasn't a lot so I remade it
I have no clue and I wanna see what will happen
Ive set the containerType in tile definitions and added the container to PropertyValueMap. Still the container name does not appear. Any ideas?
function PlayerConstructionZone.addContainerTypes()
local containerVals = IsoWorld.PropertyValueMap:get("container") or ArrayList.new()
if not containerVals:contains("core") then
containerVals:add("core")
end
end
Events.OnInitWorld.Add(PlayerConstructionZone.addContainerTypes)```
What did you write ?
Literally debug mode lmao
Why do you want a cheating mod
WHY IT DOUBLE
Just use debug mode
Bcs you copy pasta the code that adds traits ?
If I had to guess
It worked fine before
And coppied it from the game itself
The problem is if I don't do Set MutuallyExlusives in my code it doesn't do Exlusive if I do it for some reason doubles them
Ah I SEE
Alright
I was just doing it wrong
There
that should fix it
Also is there a shortcut to reload LUA?
Alright I think it works now
Debug mode
You should have a reload lua button bottom right of the main menu
Prepare for trouble, make it double!
steam takes a few minutes to scan new mods so it shows as private for a second
the embed is going to be broken for a while because it's cached
Link worked for me
will a mod not show up in game unless I make it public
like the files downloaded to my computer after I uploaded to workshop and subscribed
it may be broken and not working but I feel like it should at least show up in my mod list if it downloaded
it should show up as long as you're subscribed to it
Working version for B42
https://steamcommunity.com/sharedfiles/filedetails/?id=3383901556
Now I'm going to sleep, good luck to everyone and remember to enjoy the journey

I don't know anything about modding, lua, java, etc so I think 10 pm was a bad time to start learning and trying to do this in one night
All I am trying to do is get
Can you see it in your mods window when your subscribed to it?
not in game
but in the properties I can
and it has a file size
I think I fundamentally misunderstand how functions work
I was trying to copy the example posted earlier
All this does it make it so you get clay sometimes when you fill a bag with sand/gravel/dirt but also you can still get worms
You'll still see your mod even if your lua files are wrong. I'd make sure your using the right file structure, including mod info
When it does that you have to wait a while for it to update
Or give a variant of the link
So I think adding & fixes it
Yeah
Ah nice
Did you not make the preview a square ?
does that mean within the mod folder, as opposed to like the file path on my computer
Yeah. If your doing a B42 mod, you can subscribe to one on the workshop and see the structure that way and compare to yours
I imagine there's a thread for it but I'm on mobile and can't see one ๐ญ
But your mod should be visible in the mod loader in game, if it's not, then the game isn't registering your mod properly which sounds like your structure is slightly off
it's saying no mod.info now
I think I just am illiterate in looking at file structures in the threads
that people have posted
Have you got mod info in your B42 directory?
Me looking at my mods after updating them
o that's progress
it's got an icon and everything
wow
I bet it works too
red errors are good right
Welcome to B42 ๐
can I just name my lua PatchISShovelground.lua to overwrite the basic one
or is that outdated
How do you add the icon?
add icon to your mod info
I think I've nearly finished this silly mod if anyone wants to give it a whirl sometime.
https://steamcommunity.com/sharedfiles/filedetails/?id=3385343596
32xx32
Only thing I can think to do next is update items in the item stories thing but eh
is it possible for me to put a second value to make the randomizer more likely to hit
or do i need to add another elseif
This looks better
I want to spawn a Super Bulldozer after crafting a recipe. I am a beginner in coding, so I asked ChatGPT to generate this code, but itโs not working properly. I have already set up OnCreate: spawnSuperBulldozer.
May I ask why?
This is B41
What are the lua codes in B42?
If this works in 41 stable, how has it changed from it to B42?
local item = ScriptManager.instance:getItem("HazmatSuit")
if item then
item:DoParam("BiteDefense = 65")
item:DoParam("ScratchDefense = 65")
end```
You could try addVehicleDebug("Base.Taxi", IsoDirections.E, nil, player:getSquare())
addVehicleDebug(String scriptName, IsoDirections dir, Integer skinIndex, IsoGridSquare sq) - that is the parameters you are shooting for I think.
I don't know what I am doing. But working on my first mod.
Here's Roxy saying Ara Ara
(I own the use/distribution to the audio, commissioned by the very Lovely Alexia Renaldis)
Size doesn't actually matter
Hmm... it seems it still didnโt work.
local vehicle = addVehicleDebug("Base.Taxi", IsoDirections.E, nil, player:getSquare()) addVehicleDebug(String scriptName, IsoDirections dir, Integer skinIndex, IsoGridSquare sq)
That second addVehicleDebug is a second message, just showing you what parameters to pass to that function. You shouldn't have that in your code.
You made need to search back on this channel to find more info on addVehicleDebug if that doesn't work.
am I missing something?
name=Evolving Traits World (ETW)
poster=poster.png
require=2859296947/MoodleFramework,2553809727/KillCount
url=https://steamcommunity.com/sharedfiles/filedetails/?id=2914075159
id=2914075159/EvolvingTraitsWorld
versionMin=42.0
modversion=9.0.0
icon=icon.png
description=Makes majority of vanilla traits dynamic (meaning you can earn them as you play). Additionally, adds a few traits, making all of them (optionally) dynamic.
authors=MusicManiac

Requires need to start with \. In your case, require=\2859296947/MoodleFramework,\2553809727/KillCount
ah
uuuh
that didn't help 
modID for both dependenies do not have their workshopID in the modID field in mod manager
is that intended?
It needs to match their mod ID field, so if they don't have their workshop ID in their mod ID, then don't add it.
This worked! Thank you so much! 
that's how it used to be before but didn't it get changed in b42?
It's recommended, yes, but not required.
Still need to have the \.
oh
oh right cuz it expects workshopid
makes sense
ty, works
surely I will be able to launch the game and not get any errors

Does it work with workshop ID yet? Last time I tried it did not.
So you'd just need the \ in front.
Which is also a bug that would be fixed soon.
Technically you shouldn't need a \ if you don't include a WID
It needs to match whatever the mod Id is that the mod maker used. So if they did it wrong, for example didn't use the workshop ID, it won't work.
So it's been fixed?
It's not really a bug from what I can see.
People should use <workshopid>/<modid>, but not all do.
So you need to use whatever they used.
It is optional, as I'm saying. The whole requiring \ might be a bug, however considering how many mods now have that, I doubt they'll change it.
๐คทโโ๏ธ Better to pull the bandaid off sooner than later imo.
Is this mod suppose to replace Dynamic Traits without the a bit of madness that was added later on?
It already does
Been on workshop for a year
Literally DT but better
Can anyone tell me which file is responsible for moodle background color? Previously it was UI.pack, but it seems to work differently now. Or I'm a fool and I'm doing something wrong.
When exactly PZAPI is going up? in b41 with modoptions mod I was able to fetch mod options into shared lua files, now if I have in my shared folder
local modOptions = PZAPI.ModOptions:getOptions("ETWModOptions");
It fails to fetch them
function: ETWCombinedTraitChecks.lua -- file: ETWCombinedTraitChecks.lua line # 8 | MOD: Evolving Traits World (ETW)
ERROR: General f:0, t:1734703794509> ExceptionLogger.logException> Exception thrown
java.lang.RuntimeException: attempted index: ModOptions of non-table: null at KahluaThread.tableget(KahluaThread.java:1667).

What was the floders load order again? shared -> server -> client?
funny I was about to ping you :D
PZAPI is in client. If you're wanting to access it in shared, then you'll have to do it in an event like OnGameBoot
could you elaborate a bit?
Like i know how events work
But I don't exactly get wdym
If I have a file with a bunch of common utility functions in my shared, they are called from other lua files
ah I see the problem
Thing is I was declaring them inside the file instead of functions, for example, this is the beginning of my file
local ETWCombinedTraitChecks = {};
local ETWCommonFunctions = require "ETWCommonFunctions";
---@type EvolvingTraitsWorldSandboxVars
local SBvars = SandboxVars.EvolvingTraitsWorld;
local modOptions = PZAPI.ModOptions:getOptions("ETWModOptions");
---@return boolean
local notification = function() return modOptions:getOption("EnableNotifications"):getValue() end;
---@return boolean
local delayedNotification = function() return modOptions:getOption("EnableDelayedNotifications"):getValue() end;
---@return boolean
local debug = function() return modOptions:getOption("GatherDebug"):getValue() end;
---@return boolean
local detailedDebug = function() return modOptions:getOption("GatherDetailedDebug"):getValue() end;```
so when game loads it won't be up yet
while modoptions were up already
ModOptions was in shared before, but it didn't need to be as it was client only. The new system is definitely client only.
So you need to move those types of functions into client, or delay them until the game has booted.
gotta do it in fucntions now 
i just have to move it inside functions, as when game boots it runs the lua file and thats why it errors
functions inside those files are called in-game only so it'll be fine
why do you need client only code in a shared function anyway?
its not client only
well the options are
ModOptions are intended to be client only.
Sandbox options are the only ones that are "shared" to client and server
as example: I give repair mechanic or whatever when client repairted x % durabiltiy of cars and got y levels of skill
problem is repairs are done on server side so if i want to have printouts to console (which is a mod option setting, not a sandbox setting so in MP it's not forced on everyone who doesn't want it), I have to have the check which gives repair mechanic in shared
its really just debug stuff
if i ditch all my debug prints it'll work as is
how are you checking their specific options and printing to their log from the server?
worked in b41 with modoptions
it was printing to server console I believe
I don't remember at this point, been a while since i done server stuff
if it's printing to the server console shouldn't it be up to the host and not each individual client
I honestly don't remember
i mostly played SP and i didnt get any reports of stuff not working
and with limited testing i done with friend it was working as intended
Hello,
I'm working on a mod for Project Zomboid and need help retrieving the direction of a tile. Specifically, I want to know how to calculate or get the direction of the tile. I look in the API I'm lost ๐ข
Thanks in advance for your help!
I want to target the rails underneath a vehicle to lock its direction based on the orientation of the rail. The problem I'm facing is determining the exact direction of the rail relative to the vehicle.
Initially, I thought about calculating the alignment by checking every adjacent tile and comparing coordinates, but this approach seems overly complicated and error-prone. I'm not sure how to make this more efficient or reliable.
Does anyone have suggestions or ideas on how I can accurately and efficiently determine the rail direction under the vehicle without having to perform complex calculations for each tile? Iโm a bit stuck and would really appreciate some guidance!
Thank you!
Yes it's to make a train.
But I have problems with the axes, the problem is what am I going to do when the rails turn ๐ฌ
shouldn't this work? 
local modOptions;
local notification = function() return modOptions:getOption("EnableNotifications"):getValue() end;
local function weightSystemETW()
if notification() then ... end
end
local function initializeModOptions(playerIndex, player)
modOptions = PZAPI.ModOptions:getOptions("ETWModOptions");
end
Events.OnCreatePlayer.Add(initializeModOptions);
attempted index: getValue of non-table: null
EDIT: nevermind im fucking stupid, when chaning my settings from modOptions to new mod options i missed this setting it's literally just not there cuz it was never created
Is there a way for me to overwrite a specific vanilla recipe? I want to mod a fix for the Crude Whetstone recipe and maybe a few others if I find some more bugged.
why not just submit a bug report? it's unstable meaning it's being actively developed
Yea, it's been reported. But just to make the thing craftable until it's fixed.
hay my mod just isn't showing up in the mod list.
why the hell my zombies are not biting anymore
did they change something in the code
no dice
show you folders structure. if mod doesnt show up in mod manager than either folder struct is fucked or mod.info
check the forwarded msg above
Big thanks to everyone making mods for b42 or updating current mods to b42, we appreciate you ๐ฏ
no dice.
Heya, back with another question here for Build 42. How are custom crafting sounds done now?
i think they're being called directly inside the timedactions file on the scripts folder
Hmm, I suppose I'll give it a look
Shoot, I'm not seeing anything for the animation for writing something down. Would you happen to know where that'd be located? Trying to get an animation for the character to write down a note
Ok well - I got the crude whetstone recipe fix working. But I don't think I can get it to overwrite the vanilla recipe? Not sure how to do that or if it's possible.
Hey everyone, I'm attempting to make a mod to fix the empty welding torch refill bug for b42. The recipe works when I hardcode the change into the game's recipes, but doesn't seem to appear ingame. Do I need to add anything aside from the recipe script to add a new recipe? The mod appears and seems to load fine, logs don't indicate any errors.
Here's the recipe script
{
craftRecipe RefillBlowTorch
{
timedAction = Welding,
Time = 50,
OnCreate = Recipe.OnCreate.RefillBlowTorch,
Tags = InHandCraft;Welding,
category = Metalworking,
inputs
{
item 1 [Base.BlowTorch] mode:destroy flags[NotFull] itemcount,
item 1 [Base.PropaneTank] flags[NotEmpty],
}
outputs
{
item 1 Base.BlowTorch,
}
}
}
use tripple ` for multi-line code
Why does my recipe not have spaces between the words in the crafting menu? ๐ญ
It should be showing like the vanilla recipe (Make Crude Whetstone) but instead it's showing up without spaces?
I fixed this by just adding spaces in mine directly "craftRecipe Make Rough Whetstone" for yours or alternatively and arguably the proper way would be a translate file but I haven't figured those out for build 42
Ooooh okay. I figured we couldn't use spaces directly. It has been probably 10+ years since I really messed with Lua.
I thought it would break on mine as well, I was 100% sure it would but my translate file wasn't working so I just said screw it I'll try
definitely look into tranlate files later on though, probably a lot better of a way to do it honestly
I'll probably copy it from Common Sense - I can kind of see how it works I think
Is it just me or the common folder does not seem to work well? I have put my mod.info in it, but it's not loading the poster or the icon
perfetc, I would just do that first then, I tried to copy it from vanilla game files but it wasn't working for me
pretty sure for Build 42 you need them in the 42 folder, that's where I put mine and it loaded, my common folder only has a media folder
I have the 42 folder, but the poster.png is still not loaded
Something is clearly not working ๐
is mod.info and poster.png in the 42 folder? if it is then yeah something else might be wrong
mod.info and poster.png is in the common folder currently
try moving it to 42, I had an issue where if mod.info wasn't in 42 I couldn't upload on 42
Did you just have to add a script or is there more to it? I'm working on something similar
How do I view the new PZ animations in blender?
no worries glad it worked
Yea, I just added a new crafting recipe. Just copy pasted the vanilla one, removed the second stone, changed the one stone from prop2 to prop1 and boom.
hmm okay thanks, I'll keep poking at it
Heh, thanks from me too! I had the same issue and didn't even realize.
If you find a way to overwrite the vanilla recipe let me know - it just crashes my game anytime I do.
lol glad I could help, it took me a while to figure that one out, was a pain in the ass last night
at one point I had 3 mod.infos
We should be able to keep it in the common folder but I guess that doesn't work right now.
I tried to import a .X file into blender but it wouldnt add the animations, so if anyone knows how to view the vanilla animations in blender?
yeah, I hope they change that, I have no reason to update my mod.info so keeping it in Common makes more sense
since it's pulled from all versions
you'd find better help in #modeling
Yea.
Will do, I encountered the same thing attempting "Override = true"
this is more for coding stuff
I wish to make a building sign(A logo for a business on a server). Something that will go on the wall of the building.
Does this come under mapping or modding? What if I wanted the sign to be neon like the open signs and use electricity to light up? Does it go into modding territory then?
there are no real rules on where to ask questions, it's just more likely you'll find help if you ask in correct channels
probably both in you case depending on issue you're fixing
generally any kind of tile stuff goes to mapping
They've revamped the UI API, and the new Build and Crafting menu use it. Did you insert your traits things in the Character Info panel? They probably changed it there too.
nah I have new character page
and it's a bit borked
imma go google if it's possible to have 2 steam game installs so i can have b41 next to b42

You can copy the entire project zomboid folder and just direct steam to that one in launch options when you want to swap versions.
alternatively you can "add non steam game to library" and direct it to the copied version, doubt it will load steam workshop though
sorry moon didn't mean to ping with that
It won't track playtime either.
true
So for example my default path is /home/deck/.local/share/Steam/steamapps/common/ProjectZomboid/projectzomboid
All I need to do is add
/home/deck/.local/share/Steam/steamapps/common/ProjectZomboid/projectzomboid %command% and it will open the default install of Project Zomboid. But I copied B41 to it's folder so to change that all I need to do is /home/deck/.local/share/Steam/steamapps/common/ProjectZomboid41/projectzomboid %command%
Since my build 41 is just in ProjectZomboid41
I'm on Arch (steamdeck) so for a windows machine you obviously need to figure out what your path is and direct it there.
it'll still load steam workshop and track playtime, it's still connecting to steam
I must resist...
But you can just rightclick the game on steam and open file location
you can't even launch the game without it connecting to steam unless you turn off steam mode
then go back a single directory to choose build41
Did anyone figure out how to use keybinds in B42? I saw the "B42 Native ModOptions Example" but I don't see how to actually listen for the keybind to be used
wouldn't you just compare it to the option value OnKeyPressed?
---Function responsible for opening up ETW UI
---@param keynum number
local function ETWShowUI(keynum)
if keynum == PZAPI.ModOptions:getOptions("ETWModOptions"):getOption("UIToggle"):getValue() and getPlayer() then
local playerObj = getSpecificPlayer(0)
xpUpdate.characterInfo = getPlayerInfoPanel(playerObj:getPlayerNum());
xpUpdate.characterInfo:toggleView(xpSystemText.ETW);
end
end
Events.OnKeyPressed.Add(ETWShowUI);
as example
Ah. very nice, thank you for the perfect example!
@mint hawk Still haven't gotten mine to work, but it looks like "MetaRecipe: [Base game recipe name]," may solve your problem
Apparently there's a new uix object?
Haven't had a chance to sit down with anything other than just playing the game.
Thanks! Is there some official documentation somewhere?
No surprise.
I am currently trying to fix this pain 

I think I might just replace all the UI in the game.

Not that I've found, Common Sense uses it to add additional bandage cleaning options. Did it work?
old ui is supposed to still work but xui seems to be intended to be the modern, easier approach
My baby is coming to B42
albion new pfp
most of the game still uses the old ui anyway so it's not like it's deprecated
ye so my assumption is that there's some fuckery going on with my mod options cuz i use them in ui as well
Would be fun to just walk in and redo all the UI when they're also looking at upgrade from 2000's UI to 2008 UI.
just to be sure it doesn't really matter that lua file is in ui folder, right? I still can throw this at the bottom of it, right?
local function initializeModOptions(playerIndex, player)
modOptions = PZAPI.ModOptions:getOptions("ETWModOptions");
nonBarsEntriesPerRow = PZAPI.ModOptions:getOptions("ETWModOptions"):getOption("TraitColumns"):getValue();
end
Events.OnCreatePlayer.Remove(initializeModOptions);
Events.OnCreatePlayer.Add(initializeModOptions);
I mean I could write a React UI library for PZ with PipeWrench. xD
is there a way to reload all the localization files while the game is still running?
afaik no
subfolders don't matter whatsoever
they're still part of the file path so they affect load order but there aren't magical properties given to your script by putting it in named subfolders like some people seem to think

They should try and work in some sort of logical way of loading mods. Not sure what the best way of doing it would be but that would be really nice. Dependencies are great, however its mod to mod dependencies. If I have a mod that modifies backpacks and someone loads a backpack mod after mine, those backpacks arent affected.
Thanks - I'm trying it but haven't gotten it to work yet.
Which are loaded first?
loadAfter
you can avoid most load order issues with good code
Do we know if the new new ModOptions and Keybinds allow you to have different keybind for split screen? Like, I want to be able to do split screen and have two different toggles for the prox inventory
^
files load alphabetically a-z by their full path, and each of client, shared, server load in separate phases
LOL true, however thats asking everyone to be something they arent
shared first, then client if it's not a server, then server (even if it's a client) (in singleplayer this is delayed until you actually start a game)
if you done your mod properly so it modifies modded and non-modded backpacks then you can just add workshop ids into loadAfter in mod.info
It appears MetaRecipe = does nothing :c
if you modify items through lua, all item scripts are loaded by the time any lua runs anyway, so you don't run into load order issues with that
Right, but that would require me to constantly look for new mods which create backpacks. I'm lazy.
If I could add loadAfter all containers.... then I wouldnt have to add anything else ๐
Is anyone interested in reviewing my code? I'm re-writing Proximity inventory for B42 and I welcome any kind of feedback
I'd be down to take a look in like 2 hours, about go run some errands. One thing I'm curious about is that inventories associated with bags now have a max capacity of 50, so is the new merged inventory limited by that?
P.s. I haven't worked on my inventory merging feature yet (ours run pretty different except for the actual transfer function, not trying to make it seem like i'm trying to steal your code)
Thank you! And I'm looking forward to hear from you
And, as far as I'm aware the 50 items limit is not causing issues with Proximity Inventory
200 items in the prox inv
phew. glad to hear that the AddItem functions just forces stuff in there. after finding that limitation, was worried we were screwed.
I'm currently using proximityButtonRef.inventory:getItems():addAll(items) addAll
Question of the day, do I bother to update my Magnet Fishing mod for B42 at the given moment,,,
Nice. I do the same thing for external bags. nice to see that works.
To my understanding they overhauled like everything in regards to fishing so I'll basically have to reprogram half the mod
Feel free to DM me when you want to share the mod, and I'll take a look when i can. like i said, probably about 2 hours until i'll be back at my desk though. ๐
Thank you I will once I'm done working on it ๐
When I'm using script manager on custom scripts it sometime gives out error parsing error. out of bounds. Does someone knows what could be the problem?
I've been at this for an embarrassingly long time and simply can't get this recipe to appear in game. It works fine when modifying the vanilla recipe, but this one just doesn't show up. Any ideas what may be wrong? Mod structure? Naming? The only change vs vanilla is the addition of itemcount, as underlined
Just realized that in order for me to update my magnet fishing mod I have to manually go through and find everything that'd be magnetic again

Items now have a 'hasMetal' tag you might be able to leverage to make that easier.
I would be happy to help with a review as well. Long time user, love the mod! Really helpful for the death distribution checks ๐
Thank you! I'll ping you too once im done ๐
Sweet! Good luck!
This is true, though I don't know when it was last updated.
It may add more hassle than it solves if it's legacy.
Wait, nevermind I misread
There is a temporary fix to that mod that Nepenthe makes mention of in the comments. I was able to use that to good effect for the time being.
You said hasMetal tag, not :getMetal()
I wonder if I could manage to dynamically sort into tiers that way.
Yeah there is a tag hasMetal in the item lists in scripts/items. You could either write a program to parse everything and find all hasmetals and give you a list, or you could find the tag somehow in your code. - AI coders are good at writing parsing apps if you don't want to waste your time with that to get a fast list out.
So hasMetal is unique to B42?
I believe it is, I am not sure that we had tags at all before, maybe we did? But I am fairly certain this is brand new.
Tags have been around since B41 at least, doing a quick search demonstrates hasMetal has been around for a bit, hm.
I'll run some code to get an idea of what items I can expect to see from it and work from there.
Might be what you want, I do think has metal doesnt specifiy if the metal is magnetic or not though, like BeerCan is hasMetal but by 1993 those were all aluminum. So there is that to consider, lots of non magnetic metals to worry about in here if you wanted to be accurate.
True..
Probably best to avoid it perhaps.
Unless I want to sort with an exclusion list
Which could work, depends on how much hasMetal returns.
Yeah, might need to consider your options but hopefully that helps! ๐
Appreciate it, last time I was working on this I was exclusively looking at :getMetal()
Which was prior to even B41 to my knowledge.
(In terms of implementation, not since I've been modding. I started making mods in B41)
It is kinda fun looking back at all the old code, I don't remember writing most of it anymore haha
@elfin stump @dark wedge
Hey guys I think I'm done porting most of the code to B42: https://github.com/mxswat/pz-ProximityInventory/tree/b42
Branch: b42
Please ignore the old B41 code in: Contents/mods/ProximityInventory/media
Sweet I will peek at that today once I get a moment here and will ping ya.
Thank you!
Nothing I could see wrong here, I tried it out by adding this same thing to my mod temporary to check if it shows up. It did show up in the recipe window. My text is the same as yours, so you may have an issue somewhere else.
module Base
{
craftRecipe RefillEmptyBlowTorch
{
timedAction = Welding,
Time = 50,
OnCreate = Recipe.OnCreate.RefillBlowTorch,
Tags = InHandCraft;Welding,
category = Metalworking,
inputs
{
item 1 [Base.BlowTorch] mode:destroy flags[NotFull] itemcount,
item 1 [Base.PropaneTank] flags[NotEmpty],
}
outputs
{
item 1 Base.BlowTorch,
}
}
}
Hey thanks a ton man, I hope you didn't have to transcribe it manually.
I did but typing is like breathing so no worries ๐
Does your mod have a similar structure?
It does in that it has recipes as well. All I did was create a separate text file in my recipes folder and inserted that code. If you have multiple recipes on one file, it could be an issue with syntax. - is console.txt reporting anything when it fails?
I need help making a function with the new liquid system. in b41 it was easy but now its a mess unless im looking at the wrong systems. Basically im making a teetotaler trait that prevents smoking and drinking alcohol. the smoking block works, but not the alcohol. I can still drink.
https://gist.github.com/KuroNeko87/03ee9ec919b3464696ae34228f7318d3
Nope, no errors or anything. Is your recipes .txt named anything unique? That's the only recipe I'm trying to add. Maybe it's some weird whitespace thing
If that is the only recipe you are trying to add, it might be breaking elsewhere and it would be hard to tell. Can you add an item as well and see if it shows up in the item list? Or add a second recipe and see if that shows up, one that is exactly like vanilla with different name for example.
Hello everybody! I'm very unexperienced with Lua and PZ modding, so excuse maybe a dum-dum question, but I'm trying to create a small mod which will alter zombie stats. So I'm trying to figure out which function do what and what should I use in a code. At this point I have working barebones but still have to figure out a correct method to use. I'm referencing javadoc but unsure what results I'll get. So the questiong is: is there any way to use method in a console/debug to see what response I'll get? For example, for zombie.characters.IsoGameCharacter method getSpeedMod()
A difference I see between yours and mine is you have "42.0" and I have "42" but I am not sure that matters at all.
bump, still need help w/ this
both 42.0 and 42 work as well
Seems like it was a whitespace/weird character issue. I pasted the code into ChatGPT, asked it to remove whitespace or weird characters, and it worked. Thanks for your help!
The manual transcription was the cure afterall lol
You likely want to reference this: https://projectzomboid.com/modding/zombie/characters/IsoZombie.html - to grab IsoZombie you can use events - https://pzwiki.net/wiki/OnZombieUpdate - OnZombieUpdate is probably what you might want to get zombies easily.
declaration: package: zombie.characters, class: IsoZombie
Nice!
I'll take a look thanks, kinda a lot of resources to look into ๐
You will put a script in ../media/lua/server and within that put the example that is on the OnZombieUpdate page, where it says "--Your Code Here" you can start with print(tostring(zombie)) - if that doesn't work you can find or generate a lua script to print a table and try passing zombie to that. - That should start getting you closer to where you need to be.
It isn't just you, I have noticed that models that are thin and clipping on the floor as well. I think that the ground plane is shifted or something as it seems to affect a lot of models including vanilla ones. Things like magazines that are very flat seem to have the issue. It could have to do with your models origin and scaling as well. If you are able to take your model into a 3d program and move it upward so its origin is a bit lower, that might fix your issue - though it might be an issue they have on the radar since I have seen it with vanilla items too.
tysm for the response, ill do it when i have the time :)
I would recommend filling that script with a lot more output to console to report what is happening. Your trait detection is working as shown by the smoking one, so you could add print("YOURMOD_CONSOLE: "..informationHere) along each step of the way. You have output for detection of alcohol but not for not detection of alcohol etc. I would fill it out with a lot of debug logging so you can track where exactly the failure is.
Hello Lua perf people, I need advice: ```lua
--I have self being a lua table and use the following code in some render
self.instanceParam[stringKey].var1 = val1
self.instanceParam[stringKey].var2 = val2
self.instanceParam[stringKey].var3 = val3
self.instanceParam[stringKey].var4 = val4
self.instanceParam[stringKey].var5 = val5
-- and so on
--Is the following code an improvement or just added complexity ?
local param = self.instanceParam[stringKey]
param.var1 = val1
param.var2 = val2
param.var3 = val3
param.var4 = val4
param.var5 = val5
--and so on
quick question since I saw you typing. is there anything special I need to do with my code that uses MoodleFramework for B42?
getting a weird issue where my mod wont let me enable it because it says I need MoodleFramework, but I have it installed and enabled but its still giving me a dependency error
nothing needed. you may wanna add to your mod.info "require=\MoodleFramework"
notice the "\"
ah, ok
am I able to see fluid names in debug mode?
if you do it: when TIS will change their dependency check system, it may break
thanks ๐โโ๏ธ didnt know we needed to add the \ now
if you do NOT do it, you wil have users complaining : "mod does not work"
they will just have not activated the framework
Is it weird that I'm not really worried about crazy version control in B42 so far..? I kinda released an update pre-emptively for visible generator range that accounts for the new height limits when the game doesn't actually do that yet, but the developers will probably fix in a hot fix soon.
Like, why have the specific version at the moment when B42 is still in unstable? I can understand down the line but atm it feels a bit redundant when you probably won't be able to fall back to previous versions of unstable.
I might just be weird for it, I dunno.
Trying to get https://github.com/Konijima/PZ-Libraries to work but the gradle task createRunConfigurations isn't there...
id 'io.pzstorm.capsid' version '0.4.2' is in my build.gradle tho
dont have any experience with gradle but i'd assume this just pulls a package from somewhere
I like it: everyone can adapt to the version switch they want when they want how they want.
cannot find a Java installation on your machine matching this tasks requirements: {languageVersion=8, vendor=any vendor, implementation=vendor-specific} for WINDOWS on x86_64.
i have java 8 installed and openjdk 17.0.13
ok just had to add java toolchain to the build.gradle
second one would technically be faster but should be irrelevant
most of the performance hit is calling into java from lua
The code looks good to me, I am no lua master but I couldn't see anything that was going to break or make anyone mad.
I also temporarily added the code to my test platform and did a stress test as well found all functionality to be working and I was not able to generate any errors or exceptions.
-Auto looting from entire selection works.
-Looting individual item works.
-Looting a control-clicked selection works.
-No error or odd behavior if user tries to put item in prox inventory icon.
-looting between zombies and containers works
-looting only containers works
-looting only zombies works
-Zombie Only Sandbox Setting: This has the only issue I found.
I am prevented from looting containers, however they still get highlighted by the system.
Potential Issue: Users that do not know this setting is on or forget that may believe that containers are empty when they are not.
Overall everything looks great, that one issue when using Zombie Only setting is the only thing I could find.
I removed all code from my test platform as well.
Looking forward to the release of this one! ๐
'org.gradle.api.tasks.JavaExec io.pzstorm.capsid.zomboid.task.ZomboidVersionTask.setMain(java.lang.String)' now im getting this error when running setupWorkspace ๐ญ
damned if i do, damned if i dont
im just really confused on why this is erroring in B42?
BedroomSideTable has been removed.
oh? I saw it on the list of distributions
Let me verify but it was the same one breaking my code yesterday. Could maybe also be the casing.


