#mod_development
1 messages ยท Page 274 of 1
It's not changed lol
i put the preview into common
Delete that!
Yup. That easy.
Switches are optimized in compiler-time too.
switch tables > elseif clauses when more than 4 or 5 on the same comparison.
It's not that bad when the code only runs once.
Bigger issues arise in hotter code.
i swear it doesnt work haha
ok im done it works sry for being dumb lmao
thanks a lot
Hey modders, do y'all recommend switching my current development process over to build 42 completely or wait until there's a more stable branch to bulk update my mods? Or do both 41 and 42 development in tandem?
How long do you think its going to take you to build out the mod?
If you think its going to be some time till its fully completed, I would say B42. If you are almost done, then I would say B41 as that is the stable version and the most played, for now.
As mods get updated for B42, more and more are going to migrate over to the unstable build but there will still be players playing B41 for multiplayer until B42 is updated.
Those are just my thoughts
fair enough. I have a few mods that are completed and I'll get them updated
Not sure if there is a standard yet or not, but dont remove your B41 mod or over write it with B42. I think thats breaking servers.
you'll have to switch to 42 eventually, so it's really about gauging the work it'll take to convert b41 code to b42 code if you wait vs the work it might take if a b42 updates breaks something you already wrote for it
it's like they made made b42 specifically to break my last mod
ISInventoryTransferAction.GetDropItemOffset is now ISTransferAction.GetDropItemOffset
hmm maybe not, that does some funky stuff
maybe if I removed the items from inventory when dropping them, it wouldn't do some funky stuff
I'd assume that's to account for new transfer actions like liquids?
I'd say either build 41 exclusively or in tandem
The mod options UI IS FIRE
malwarebytes is having an absolute conniption with PZ running
that's legit. i was pleasently surprised at all the types made available to us.
Looked into it more, seems to be no reference to animals outside of animations and stuff defined in lua
People managed to get stuff like dogs and human npcs in by modifying and adding actual java class code, so I still have hope. to some degree lol
the debug menu has tons of info
so im having a problem with updating my personal mod to b42 and im not sure what happening but there is a hole in the mesh now and the part with the hole can be seen from the back
also sorry if this is an easy fix i have no idea how to code and its a miracle it even works
thank you
anyone else getting a "Error, container already has id." error or did I break something? ๐
@queen oasis I found a way to get the rendering working without flashing or lagging, it was thanks to someone else randomly bringing it up and some keywords finding the message
setHighlighted() has a secondary parameter, which defaults to true and roughly equates to rendering for a single frame
Setting it to false makes it render consistently until you remove it, which resulted in smooth performance and this final result in terms of an update to generator range
very nice!
Also, the Z level was increased and decreased to my knowledge, does anyone have the exact limits now?
It used to be 0 and 8 to my knowledge
I need to account for it in generator code
32 - -32
so three more things ig how do i get the menu to be normal, the actions for changing are instant and when the hood of the jacket is up and i try to put on a hat it deletes the jacket
Appreciate it
Where can I find all color references for fluids?
just so I have this straight. mod.info in both folders, correct?
because if I can break something, I will
oh god that's awful
I found the thread. it just needs to be in the main folder
why are like half of them in camelCase and half in all lowercase
looks like something I would do
should have thrown some snake case in there for good measure
true
my stuff's been working fine with it just being in common, but it might be best to have both?
i'm not super certain of anything atm
i think you put it into individual 41/42 if you want specific versions of your mod for 41 or 42
what's scary is I found the thread, read it, left mod.info in just the main folder and it broke it so I can't read either
rip
is telling me i'm missing a mod.info file but it's there, gives me same error on the template too
chuck a copy in the 42 folder
yup that was it
anyone know how long it will be till britas updates to b42?
Okay, I spent half day to make it work, and I still can't figure out what's wrong
Console gives out error: attempted index: new of non-table: null
It's on line with ISTimedActionQueue.add(RandomAirdrops.UseFlareAction:new(flare, player))
I checked 'flare' and 'player' variables and they're not null. "UseFlareAction" that declared in lua file in timedAction folder is mostly copied from vanilla game.
What's wrong, pls help
Put stuff in common if it will be the same in every future version of the mod (e.g.: textures, mod.info, etc) and put stuff in 42 that is only for build 42 and you might need to redo in the future for build 42.50 or 43 etc (e.g.: lua code)
this error means RandomAirdrops does exist, but RandomAirdrops.UseFlareAction does not exist
i see, thank you for the clarification.
when you see attempted index: {SOMETHING} of non-table: null, look for tableName:{SOMETHING} or tableName.{SOMETHING} on that line, the error is telling you tableName is nil
Okay, so now I know that problem is definitely in timedAction lua file... Super strange, cause I literally copied most of the code..
Yes, at least 5 more min
Alright
So uh..
Have generators actually been updated to account for the new height limit..?
Looking a little at the java side it.. doesn't seem to be the case unless a new method is being used.
Off topic for mod development, but I wondering where to find the old animated menu of unstable within the folrs
tysm i've finally figured it out
I have found the blink video for the new now removed menu screen. One day this can be used to restore it, but I'm happy that I preserved this before I updated
any advice for getting started with mod development?
Beautiful people ๐ฅฐ
Start with some simple mods; change the stats on an item, add a recipe using existing objects, etc. Look for existing mods that do something similar to see how they did it; that's probably not the only way, but it's a starting point.
Do it out of passion, not profit (at least when you start)
Spend time looking at other mods, and understand why and how they do stuff, you will spend a lot of time reverse engineering both the game code and other Modder's code.
Pick an IDE you are comfortable with, and use tools to make your job easy, like PZ Umbrella, Sumneko lua extension, etc etc. Treat your modding work space, like you would treat your physical workspace keep it tidy and make it work for you.
Don't be afraid to ask for help as it's okay to be lost at the beginning.
Try to have fun, and be aware that people will always find something to criticize and bitch about, and that not everyone will appreciate the work you do for free.
loadModAfter and loadModBefore are new prop right?
If a custom item have no 3d model (like in game, not in script) - what could be the problem?
What I mean by that is when I place my item it's literally nothing on the ground...
And it doesn't give any errors
pretty sure
Hey guys this might be a stupid question but what are these tags and flags parameters in items and recipes??? item 1 tags[GlassBottle] mode:destroy flags[Prop1] itemcount,
is there any page where i can find more info on how to use them?
dont' know how many of those "tags" and "flags" there are already implemented in the game
The tag system has to do with using different generic items instead of a specific one, I am not sure exactly how to define a tag yet though. If you look in the items folder in scripts there is quite a few examples though. For flags I think that is to tell it that it is going to be in one of your hands, like prop1 and prop2 is right and left hand prop I think... but not sure exactly how to use these yet.
if they're working like the old tags you don't define them, just put them on items
That is what I thought but I got an error, it stated something like "No definitions for this tag" or something similar.
I just did a work around using the item mapper though since I don't need mine to be so generic as that.
so if i put [Prop3]] that would throw an error..
Has anyone been able to get a recipe to show up in the crafting menu?
I think Prop3 doesn't exist, but again not sure, I think it has to do with your hands.
I have been able to get recipes into the mod and loaded into a game without a crash but I am not seeing them in crafting menu or in the right click context, even for single item recipes. There may be another layer to it that I am not aware of yet.
i have a working recipe but i don't know many of the details of how the new recipes work yet
i can post it as a working example if you'd like
That would be awesome! ๐
yea yhay would b
module WaterGoesBad {
craftRecipe MakeTapFilter {
timedAction = CutClothing,
Time = 80,
tags = AnySurfaceCraft,
category = Survival,
inputs {
item 1 tags[Scissors;SharpKnife] mode:keep flags[MayDegradeLight;Prop1;IsNotDull],
item 1 [Base.PopBottle;Base.WaterBottle;Base.PopBottleRare] flags[IsEmpty;Prop2],
item 1 tags[Charcoal],
item 1 [Base.RippedSheets],
item 1 tags[Tape],
}
outputs {
item 1 WaterGoesBad.TapFilter,
}
}
}
flags[IsEmpty;Prop2]
So everything is contained in craftRecipe and you got that to show up on the craft menu? Or is there another element to connect it up?
so, this checks if the bottle is empty and is in 2ndary hand?
yeah, this is all i had to do
is there any lists of flags that i can use?
not sure if anyone's made anythingl ike that yet
i see
if i remember right, an unintuitive hiccup for me was it didn't show up until i added tags = AnySurfaceCraft or tags = InHandCraft (would have to check if that last one is exactly correct)
Okay cool I will take a peek, mine looks a lot like yours, is that timedAction custom or is it built in already?
Okay cool I will check that out on tags
I saw that in the existing recipes but mine is missing it, that could be it. Will do a sweep. Thanks! @bronze yoke
Anyone know what Status_Wired means?
Yep, nailed it! Thanks again.
Anyone have any luck with recipe localization files? Can't seem to crack it.
Has anyone found any way to alter the aiming reticle width?
well again here's mine```
Recipes_EN = {
Recipe_MakeTapFilter = "Make Filter",
}
Hmm, looks the same as mine. Location is still media\lua\shared
\translate\EN
and the file is Recipes_EN.txt?
Yep, all looks correct, I have a lot more than one though so I am thinking maybe there is character or something out of place, I am gonna reduce it to one and try and simplify it a bit.
Thank you for the reference that helps! Wasn't sure if it was Recipe_ or if I needed the module or anything.
They removed the loading screens, but is it possible for us to add our own and have it select a random one? Basically, did they also remove the code that allows for that or was it just the illustrations themselves
There is a loading screen build 42 mod I think on steam at this point you can maybe reference that one. I am not sure the name but I saw it pass by here in the chat at some point.
agh. this is so frustrating.
can somebody help me out with this? I've looked and tried and tried but no matter what I do I am missing mod.info somehow?
are comments possible in .txt files for sandbox options?
yes, java style only ( /* comment */ )
Looks like you've got both a mod.info and a mod.info.txt
modversion is the version of my mod right?
which should be OK, but it means youv'e got an extra file confusing you.
For some reason my mods didn't load when I went into debug mode.
how do i override item info for B42? i'm making a little mod to make nails and screws weigh less
I initially just had the mod.info, but since that never worked I thought that maybe the text file would work
but nothing I do seems to work
Same as B41, if that helps.
thanks
Unless I messed a helpful API being added, you just replace the entire definition for the object you want to change by copying it from the default game media/scripts folder (and removing any other objects in the file you don't want to edit)
Makes me miss Rimworld's XML & XPATH system where you can say "find this object and change this property only"
thats what i did, got nothing
i swear there was like, an override function or smth
you can edit them from lua
but i cant find where i saw it, so i have no reference of how to properly use it
local item = ScriptManager.instance:getItem("Module.Type")
if item then
item:DoParam("Property = Value")
end
so if i were to want to alter nails
would i just put nails in the place of item?
or uh, the module type?
that would (probably) be "Base.Nails"
alright so lemme give this a shot
local item = ScriptManager.instance:getItem("Base.Nails")
if item then
item:DoParam("Weight = 0.01")
end
Try it and see.
oh baller i got a hammer now
so how do i implement that?
do i just make an xml file and drop it in the scripts or media folder- whichever one i used for the text
just checked, media
I remember having issues trying to adjust items programatically a year or two ago, but I can't recall details... might have been the specific property I wanted to change didn't work via the API
(followed the lead of a similar mod, so if im wrong, a correction wont hurt)
it would be a lua file
this definitely works lol
hahhaha
im used to xml this, xml that
i've done like six pz mod tweaks in the last two months and i still think xml
still workin on this
if I cant figure this out by myself in 20 I'll be back and depressed
for the build 41 compatibility part, change nothing about your mod whatsoever
this is an another curiosity, will they work when i call the function only once after save is loaded? I haven't dealt with item which already exist in game before, however just want to know. thanks.
Having a 41 folder won't do anything.
there's no 41 folder, just leave it how it is and add the common/ and 42/ folders
build 41 doesn't know "look in /41" so it just checks the top level
it depends when, if you call it before items have actually spawned it'll take full effect, if you call it during gameplay it'll only affect newly spawning items
wont it load that specific version if I want players to use that version of the gun in 41 tho?
ah ok'
I guess I'll delete it
ohh okay I understood how it works. thanks ๐
weird, lua didnt immediately work
gonna go restart pz rq
see if that sorts it out, since it was a new file
cuz who knows what reloading lua can miss
(i dont, i have no idea what im doing lmao)
my source of knowledge is divination from the elders and rough approximation
what does this mean
i ask smarter people questions and i figure basic things out sometimes by guessing and observing
thats how i do mod code
so my files are set up like this, but the lua aint lua-ing
the text file was my first go around
you need to have a actual lua folder
Anyone know a reliable way to refresh the "primary" and "secondary" hand slots in the top left? It seems to be fine in B42 but B41 has an issue where deleting an item currently in that slot results in it just kinda.. lingering? I guess?
probabely because they were made for one-handed model while you set them as two-handed model. i had same problem long time ago.
โฌ๏ธ
Aaaaand nevermind I was modifying the b42 file
thanks, gonna restart with that sorted
see, divination from the elders works
confused
and yo-kai disco keeps me sane enough to keep at it
I have the model oriented in the specific rotation that a rifle is in
and I have set in my scripts it is a two - handed weapon
yet it seems fine in 41- not 42..
scratching my head
i think i gotta krill myself
don't believe me 100% because it has been long time ago.. ๐
it should be in lua/shared/
oh
there is client/server and shared
it only loads from lua/shared/ lua/client/ and lua/server/
alright, did the shared for 42 and common
gonna try again
praying it works this time
goodluck
do you think you might know why I am having this problem-
in 41 the rotation of the gun is correct
but I guess in 42 it isnt
sorry, no idea about that
whomp....
why not mirror the things
like its already fucked as is, may as well try flipping it around and see if that works
if it works perfectly fine in previous versions, what makes 42 the exception though
It would be easy to fix
but I wanna know why mostly
lmao.. my script for a firemode selector I think is broken
did i bungle it?
well.. it should be something like
function functionName()
local item = ScriptManager.instance:getItem("Module.Type")
if item then
item:DoParam("Property = Value")
end
end
and you have to call functionName() in your game to fire the function.
can somebody code a lua function that lets me bash my head into a brick wall until theres nothing but paste left regardless of what my pain receptors say to interfere
you don't have to do that
it should be fine as is, i don't know why it wouldn't work
i have files in some of my mods that look exactly like that
gonna see if its maybe the caps
like maybe i bungled something case sensitive
damnit
it looks like it should be checking out
Did they change how translations are defined
maybe it's my filepath?
I may be wrong because I'm not professional but if you don't wanna define function name and wanna fire only once at start, then shouldn't it be like this?
not sure tho.
(function()
local item = ScriptManager.instance:getItem("Module.Type")
if item then
item:DoParam("Property = Value")
end
end)()
you don't need to do that, anything in the file will run when the file loads
lua runs files as if they were functions, internally they're actually indistinguishable
i dropped your code into my mod with no edits and it worked
i've never known. i'm suprised 
because its not enabled on the main list
like the one accessed in the main menu
i added it on the load menu mod list
like for the specific save
that's what i did too
fuk
are you testing on newly spawned items? i think weight should change for existing items but not sure
pre-existing
i've been using nails sitting on my garage floor to see if the weight has changed
would any of these conflict with it, maybe?
probably not, maybe existing item weights don't change?
yeah just putting them in a box and opening it again should actually work since it deletes all the nails and recreates them
didnt work ๐

gonna do smth even less sensical
open them all
repack them
then open again
that also didnt work
can i see your file structure?
im becoming convinced that's where i bungled
like maybe i put a folder in the wrong place
or named it wrong
or something small you probably would get right on instinct
i just deleted it after i tried it since i dropped it into one of my own mods but it would've just been mods/ModName/42/media/lua/shared/nails.lua
is it possible to add a custom value to an item? like it says embumbrance, could I add my own?
infuriated because mine matches
wanna try check if everything is fine like this?
print("search_here")
print("item: " .. tostring(item))
print("--------")
if item then
print("item detected")
print(item)
item:DoParam("Weight = 0.01")
else
print("item is not detected. passed")
end
print("---------")
I usually do this one by one when i have no solution.
you can check how code was going by search for search_here in your console.txt
This is in your local Zomboid folder? Like, LNS is the file that is placed in the local files
yeah its a local mod
Oh.
No
You are making a local mod, not one youve already uploaded through the workshop
is that wrong? because that's how i got all my B41 endeavors to show up to be tested and uploaded
oh your mod structure is wrong
it should be Workshop/Light Nails and Screws/Contents/mods/
what is your game loading...? it shouldn't show up in the mod list at all like that
gonna krill myself
it was really nice pointing. ๐
hey this is in your game directory too it doesn't load from there at all
it should be in the workshop folder in your cache directory (%userprofile%/zomboid/ by default)
C:\Users\(TheRat or whatever your user is)\Zomboid\
weird, the directory one is whats always worked for me
In the past, were you making your own mods, or modifying existing ones?
modifying for the most part
my biggest projects were private server overhauls for scrap guns and armor
That would likely be why. Since you'd be changing your local copy that already has the correct file structure, so your changes didnt actually trip up anything
moved my b42 mod stuff to the user workshop thing
gonna reload and see if that fixes it
๐ซก
Show me your file pathway for the mod now
You still need your "contents" file. Check out the formatting of the ModTemplate
As per albion's message here
alright so i got that fixed
but im moving them back to the directory workshop
moving them to the user workshop has broken my mod list
as in i had like nine mods visible, now its like i never installed a single one
Right. The way that PZ handles everything is mainly through tables. If you have info in one that is breaking from the standard, it can mess up the table instancing.
Once the format is correct, everything should show up
its showing up, but it's not working
like i can enable it, it has the contents folder, its got the lua
and the nail still weighs FUCKING 0.05 EACH
maybe im cursed or smth
i can make mods but not in a way that i can enjoy the end product
some greek shit or smth
Give me a min, wanna make sure I am not going to give you any incorrect info incase they changed anything ab file structure in b42
But I still think it is a file structure issue
@ashen mist Can you open up your common folder rq and show me whats going on in there?
Nvm, i see you posted that earlier
currently my 42 and common folders are identical
im gonna nuke a scripts file rq
it has my first try at this mod
a text file of the items with my custom weights
it didnt do anything, so maybe if i just wipe it off the face of the earth and run just lua
it might work
the script file thing probably should registered to me sooner
If you still have both versions in your mod file, you might be overwriting one of them with the other, making the new updates not load
it just didnt ig because it didnt do anything
i update both of them each time
My subscriptions are fluctuating a lot on Visible Generator Range and it's making me anxious, bleh
I made sure it was working for both versions so I'm not sure if I missed something or what,,
Or if it's just people bein weird
Probably a lot of people unsubbing from all their mods
Hopefully that's the case, I haven't gotten a bug report like at all so.
I'm just hoping it's people clearing their mods and it's not just a critical error I somehow missed
Trust me, people LOVE to point out when something is wrong. I had people leaving comments regarding a niche interaction caused by some stupidly simple issues with the code that 99% of people wouldnt notice, all within like a day of me posting lmfao
for what it's worth it's normal for people to unsubscribe after an update because they get annoyed when they get a checksum error because of it
it doesn't mean you actually made any mistakes
Okay, good.
It was an incredibly rare update- last one was back in May of 2023.
It's been clear over a year since this mod was fixed up so
It's just kinda alarming just how much it's fluctuating.
Youโre probably getting both pieces actually. People are unsubbing as they clear their mods out for b42.
People are also then subbing because it is one of the few mods available for b42.
That would for sure make it rubber-band like crazy
also people may be unsubbing and resubbing to get the update to actually download
steam's pretty unreliable with that
and i've noticed it seems to show up strangely on the statistics
It's been like 5 hours since upload and it has 450K+ subscriptions, I feel like someone would've reported a bug by now, but it is late.
Nah, youโre def fine imo. If there was a major bug causing people to unsubscribe, they 100% would have left comments
Whew, alrighty then!
Anyone else getting the "Not a valid PNG file at FutureTask.report"
The worst part of updating is when you get NO ERRORS lol.
Can't say I recognize it unless it's throwing a proper error.
https://steamcommunity.com/sharedfiles/filedetails/?id=3387076289
[NEW B42 MOD]
Who will manage to escape from this skyscraper???
19-12-24 00:59:12.726] ERROR: General f:0, t:1734587952725> ExceptionLogger.logException> Exception thrown
java.util.concurrent.ExecutionException: java.io.IOException: Not a valid PNG file at FutureTask.report(null:-1). Message: C:\Users\mdrai\Zomboid\mods\EnhancedDurability\42\mod-icon.png
Stack trace:
java.base/java.util.concurrent.FutureTask.report(Unknown Source)
java.base/java.util.concurrent.FutureTask.get(Unknown Source)
zombie.fileSystem.FileSystemImpl.updateAsyncTransactions(FileSystemImpl.java:314)
zombie.GameWindow.logic(GameWindow.java:396)
zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:76)
zombie.GameWindow.frameStep(GameWindow.java:917)
zombie.GameWindow.run_ez(GameWindow.java:796)
zombie.GameWindow.mainThread(GameWindow.java:610)
java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Not a valid PNG file
zombie.core.textures.PNGDecoder.<init>(PNGDecoder.java:141)
zombie.core.textures.ImageData.<init>(ImageData.java:330)
zombie.asset.FileTask_LoadImageData.call(FileTask_LoadImageData.java:48)
java.base/java.util.concurrent.FutureTask.run(Unknown Source)
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
java.base/java.util.concurrent.FutureTask.run(Unknown Source)
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
... 1 more
^proper?
Well, that's as proper as they seem to get. Looks like a java error though, maybe your game updated awkwardly?
how does player:getHealth() work because i ran a script with an event that trigger on player damage and print the player health then i killed the player issue im having is it print out there health as above 99 until they die they dont drop down at all so im a lil confused
wondering if the causes is the fact im killing them but cutting there neck is it like since it only neck damage it doesnt drop lower then 99?
try player:getBodyDamage():getOverallBodyHealth()
oo okay ill try that
thanks boss that should work way better
how does one full heal the player?
It seems like animation .xml files do not correctly load anymore. Attempting to use custom reload animations I made resulted in the character defaulting to the surrender animations. However if I copied the .xml file into the game directory it worked fine while also logging in the console the mod overwrote the file.
which bewilders me, as it implies that everything there just fails to load.
Does anyone know what the naming convention for the player voices are? ๐ I extracted the ZomboidSound.bank
So I'm not even really sure how the game knows what sound files to assign to which voiceStyle
apparently animsets are bugged and only load from the old folder structure
so if i wanted to make the player injuried like low hp could i just do setHealth(.1)?
thank you muchly. Any solution that works is already till that can be fixed.
worked like a charm ๐
VFE presses ever forward
Is this channel B42 compatible ?
i am back and ready to rip my hair out til im bald again
the patch to make nails lighter remains non-functional for me despite working on someone elses system
So if I spawn, and set of a nuclear bomb, that counts as a win
You are gonna make me bingo ๐ฉ๐ณ
how do i lower the player hp to like really low?
Did you try removing the non-lua stuff?
i did
it still refuses to work
i've restarted my entire pc
didnt work
Alright. Did you also remove the local copy we were working on before?
there's only one local file and it's the original
Ok, cool. So, the mod is showing up in the mod menu, but not working in game, right?
yeah
If you just want to make player health lower, without any injuries, then getBodyPart():setHealth(n) / getBodyPart():AddHealth(n) / getBodyDamage():setOverallBodyHealth(n) will work.
just becareful bodypart and bodydamage is different.
yea but i want to modify just there hp bar
and keep there actual injuries
what im doing is making a down system
so i wanna keep them alive but keep there injuries
i've even tried removing the duplicate of the function files
like "maybe if its just common files it'll work"
it is weird to have both but it should still work
it didnt
i am wholly convinced you are a wizard and mods are intimidated to behave in your presence
then just don't touch player's bodypart, only modify bodydamage.
https://zomboid-javadoc.com/41.78/zombie/characters/BodyDamage/BodyDamage.html#setOverallBodyHealth(float)
Javadoc Project Zomboid Modding API declaration: package: zombie.characters.BodyDamage, class: BodyDamage
i worked on something like that before and it's an insane pain in the ass
so i should just use setOverallBodyHealth(float) ?
wtf is setHealth then?
seems useless
it's probably from a decade ago
oh thanks chatgpt
the game hasn't used a straight up healthbar in years
๐
but yeah albion if you have a chance can you show me how you had the code slotted in when it worked for you?
because i am stumped here and i'm sure it's probably some little thing i missed that i dont know even exists
so is set overall body health 1-100 or 0-1
like if you added it was it just like this or did it have some kind of extra text or smth
i know some zomboid things like having categories preceding code or whatever
is there some way to get the position of a dropped item on the floor?
cant do getparent() or getsourceiso() or anything else i tried
i need to check the distance between a player and the item on the ground
The game isnt throwing any errors right?
not that i've seen
no, that was it
the only difference from your file structure is mine was in %userprofile%/zomboid/workshop/
which sucks because
when i moved mine there
it broke all my mods
my mods went from there to gone
i dont think it should matter if it in mod or workshop right?
even the workshop mods vanished
No, they have theirs currently loaded into the game's steam directory. Not in either the local mods/workshop area
oh yikes
the userprofile one doesnt work
that weird
i tried it, it broke everything
Right, likely due to an issue with the file structure borking the rest of the mod loading
like i said, all mods vanished from the game, local and workshop
yuh that sounds like it gonna be a pain to fix lol
Can you try and move this section here into the local Mods folder?

lol
ahah good for you
i need to add
nail box weight reduction
nail carton weight reduction
and the same for all three of the screw options
ur making a mod to just reduce nail carton weight?
Thats easy. Just do exactly what you did, but change which item you are looking for lol
No worries hahaha
reducing nail/screw weight
because 100 nails weighing 5 encumbrance is fucking insane from B41's 1 per 100
chatgpt not being helpful
Lots of fun changes to figure out. But, I got my most subbed mod updated. Figuring out the changes involving item "Tags" was fun.
step one: dont use chat gpt
i tried .5 and 50 and both gave errors
then use what lmfao?
because google not gonna be helpful
yea but that being lazy
its called being smart
you can either bash your skull into a wall forever
this chat is comical.
if you can get the answer somewhere else first
or you can ask somebody who knows it already for help
it worth a attempt
Technically there is a way to just iterate through tables, so you'd only have to really have one function and then a list of items and their corresponding weights... But that is painful, and the code only runs once so lmfao
then you learn from them
yea i agree after you attempt it first lol
im not just gonna ask every question i have to people they got better thing to do lol
๐ญ
I personally suggest just use chat gpt BUT in the proper way.
don't use gpt for getting a answer, use gpt for talk and study.
i use it to get a baseline of what im doing
like if i have no idea how something works i use chatgpt to get a baseline of how it work then for more complex answer it fail to get i ask actual people
but tbh if you know how to use chatgpt right it can be very useful in learning thing
I like using it for checking for errors I miss or for figuring out ways of handling things that are more complex than I understand. Just have GPT explain to me how it works
Like iterating through tables was something I just couldnt grasp lmfao
i fucking hated table learning them
but after i learned them they became my favorite thing ever
there so much fun to use
i use them a shit ton in my roblox game you can make some really beautiful bit of code with it ๐
But fr, your actual best friend when it comes to PZ modding is the massive treasure trove of existing coding work that is already out there hahahaha. Once you understand the basics, look at the java docs for the functions and look at existing similar mods to get a concept of their implementation
yea very true lol i mean table in themselves is pretty much just data science basic lmfao
and i mean coding fundamentally is just handling data so it work perfectly
Probably has some outdated things ab it now, but this was my reference doc for folks
https://rentry.co/BluesModClues
Anything comparable to Override:true, with the new craftRecipes? Trying to override a base game recipe but the script loader is not having it.
Hi i'm always blocked by my mods to drop all items from a contenair to ground, how i can target these contenair ? (it woudld work like originally button to transfer all item to you inventory from contenair)
Tbh, every time you write anything in Lua, you are meshing with the existing Java code. So even if you dont know Java, looking through the Java docs shows you what functions are actually accessible through the Lua and what their params are
btw you can't directly use setOverallBodyHealth to character. you have to call(?) bodydamage first like this
getPlayer():getBodyDamage():setOverallBodyHealth(0.5)
Are you using the new recipe format? The one with input {} and output {} etc?
ah okay that makes sense that what i thought was wrong but wasnt sure how to execute it
thanks boss ill try that
Pretty sure the game natively does this now, if you just make a recipe with the exact same name, the mod will take precedent
true true but i just started learning like yesterday so i think ill hold off on that for now lmfao
but yea ill definitely take a look at that once i get a bit more experience
It's complaining about duplicate Prop1 and Prop2 so it feels like the game is trying to load both scripts at the same time
For anyone who hasn't seen it yet, the new format for recipies is quite different (\ProjectZomboid\media\scripts\recipes)
{
timedAction = Making,
Time = 50,
OnCreate = Recipe.OnCreate.ScratchTicket,
OnTest = Recipe.OnTest.ScratchTicket,
/* CanWalk = true, */
Tags = InHandCraft;RightClickOnly,
inputs
{
item 1 [Base.ScratchTicket],
}
outputs
{
item 1 Base.ScratchTicket,
}
}```
testing this mod im making kinda messed up if slashed my character throat atleast 10 times now
also i did this but it didnt heal them at all?
also would healing them with overall body health heal there actual limb injuries?
setting overall body health doesn't really do anything because it's recalculated every frame
so what should i use?
the overall body health doesn't really matter itself, it's just the result of some calculations based on the health of each limb
you can add health to the limbs to keep the player's health up, it won't actually heal the wounds or anything
i dont wanna do that
i just want to heal their health bar
so they dont die
but keep the limb injuries
well that's what adding health to the limbs does
do i have to do it like that?
hmm I can't check right now because I'm outside anyway isn't it lower each body part's HP average too to fit average HP?
i cant add hp directly?
i think there's like addoverallbodyhealth or something but i didn't find it reliable
mhmm
I thought I'm already using that for my posion and I haven't felt any weird before. the mod is kinda outdated tho
btw addHealth() is also available for each body part
can i use addhealth to add straight health?
cuz as i said i dont wanna heal the limbs
just the overall health
yep minus is also worked. -10 will decrease specific body part's hp
epicc
then no. it's for bodypart if I remember right
like upper arm, torso, stomach...
using it to damage is fine, but the specific goal of keeping the player alive without healing injuries is really unreliable
i mean i know it possible
ive seen a mod do it
they just keep healing them with a while loop id assume
the mod i was maintaining had a persistent issue of people just getting more and more injuries until it reached the point where they would die in one frame before they could actually be healed
well im gonna have it timed so you can still die regardless
so that shouldnt be an issue
but yea instant dying is a bit of an issue im worried about
This mod had healing items, you could check what they did.
https://steamcommunity.com/sharedfiles/filedetails/?id=2790147088
how do you look at mod code?
subscribe and open its folder
Download the mod, then go to Steam\steamapps\workshop\content\108600\THAT_MODS_ID and bang!
ah okay yea ill try that out
also btw i dont think addHealth work unless i used it wrong
gave me an error
addoverallbodyhealth didnt work either both gave errors
thats interesting. I will also try this when I get back to home to refresh my knowledge. ๐คฃ
i kinda like the new stressed moodle so i got the old moodles mod and made this having never made one before
if you figure anything out can you let me know lol?
having a hard time getting this to work lol
what is your goal? hp is always 100% but injuries are still there?
lmfao i like that
not 100%
what i want is when they get low enough basically dead they'll be no longer able to move or move at a massive reduce speed and it would effectively keep them alive but on a timer which if they dont stop the bleeding by the time ending they die
and how it would work is another person could bandage you up then use an item to revive you
it meant for a zomboid life server where your not really meant to full die
Here is one close to that.
https://steamcommunity.com/sharedfiles/filedetails/?id=3338664412&searchtext=revive
oh yeah I was trying to search that mod
thanks ill take a look at that
will i need to change off the b42 to see this mod?
like in files
not ingame
If you want to see it PLAYED, yes. But just reading the code, no
W that works too
Also, fun tip I learned a few years back. You can have both versions installed and swap it real fast. If you rename your current "Project Zomboid" folder to like, "Project Zomboid B42" then tell steam to swap you back to B41, it will just make a new installation of zomboid. Then you can swap version by renaming the folders.
oh wow
that dandy
to be frank tho i just think im not gonna use b41 anymore lmfaooo
atleast until i wanna play a server ig lol
my dumbass like "oh this mod doesnt look that complex" then proceed to find 500 lines of code ๐ญ
New Mod !
Switch to the old version of your speed controls !
https://steamcommunity.com/sharedfiles/filedetails/?id=3387129936
I can say with confidence now that at least in my experience this is not the case. It works just like when you created an identical recipe before where it just lumps them together as one. Really wish they woulda kept the old Override variable as this made it simple. Really hope I'm just doing something wrong tbh as this is proving to be a real headache.
Does anyone have suggestions on how to measure performance in PZ?
I'm looking into updating my prox inv mod for B42 and I'm reworking some parts of it but I'm worried it could be slower than expected as in the past for B41 I had to do some caching to ensure it would not kill FPS
Out of curiosity, does anyone know if there's an easy-to-access location / method to access a specific bag or container's item distributions?
I mostly ask this because I thought it'd be entertaining to try and get procedural "fresh spawning" containers working.
(I mean container as in the item, like a gun case, not a container like a world object)
I still need help...
I'm not familiar with it but distribution within bags is define like any other distribution
- Too small (scale model up)
- No/wrong model script
- Bad referencing to the model in the item script
- Wrong export
Perfect! I would've responded on my PC but it appears my scroll wheel failed.
I can't actually scroll through my server list-
im currently stumped. i installed my mod locally to test it for 42. however something is wrong. once its installed locally the mods menu breaks. shows nothing (not even the subscribed b42 mods i used as reference) once opened in -debug it shows a error screen yelling something about not being able to get the ID of the mod. im at loss i cant find what i did wrong.
Yo guys has anyone figured how to add extra voice types/replace voice types yet?
can someone have a look over my mod.info? i have NO clue why it crashes the mod menu : (Edit removed attachment)
yea, you can find it in the procedural distributions
for containers anyway
i cant get it to work i just uninstalled my mod and now it crashes everytime i open the mod menu. i has no clue whats going on and cease modding till later.
What does the error say in the console log file?
So I wanted to finally try making a mod - of course large mods that I would really want like armoring vehicles is way beyond my scope. So I figured add VHS tapes, but it seems some VHS tape mods overwrite the vanilla VHS tape file?
Does anyone know what the "flag[mayDegradeLight] means in flags[MayDegradeLight;NoBrokenItems]
it says this :
hmmm, I can't really tell what it's saying the problem there is. What does your mod.info look like? You might have a value that is not recognised?
right now my mod is completely removed and it bugs out without it. i have 2 b42 mods in my list.
downloaded them for reference to update mine.
and it's definitely not those 2 mods that are causing the crash?
it worked before. i seen both mods in the list. added mine, edited the mod.info and added thenew folder structure. mod menu crash. removed my mod. still crash
fun i just unsubscribed from those mods as well. i have NO mods installed. mod menu crash.
console gives same error as above.
Is your ~/Zomboid/mods folder empty as well?
both /mods are empty. the one in the steamapps and the one in Users/myname/Zomboid
Interesting, I'd suggest verifying the steam cache.
very strange
im going to uninstall Zomboid. make sure there is nothing left over and make a clean reinstall. someething is wonky.
yea sounds like there's something gone funky
I can't see why adding and removing a mod would still cause it to crash though
well in the end i had no mods installed and the mod menu kept crashing.
Yeah I've been mangling mods all day and no permanent issues.
well i deleted everything now (after backing up my workshop folder) and make a clean install.
I wish they had updated the "example mod" to be more useful for times like this
Does anyone know what the "flag[mayDegradeLight] means in
flags[MayDegradeLight;NoBrokenItems] ?
found the culprit. it was my workshop item. "versionMin=41" is invalid. it hung up on THAT.... the mod menu broke because my WORKSHOP version had that line in.
im kinda lucky. my mod works out of the box without needing to change my lua. however i havnt tested it with all the new stuff.
ok anyone knowing how the "require=Modid" works now? i have a submod that needs the main active. however i cant get it to recognize the main mod.
Is it impossible to just.. spawn a bag with its corresponding loot table?
- I tried 1x of the model and to 1000x model: nothing changed
- Model script:
model SmokeFlare { mesh = WorldItems/Flare, texture = WorldItems/FlareTexture, scale = 100.0, } - Model is in
common/media/models_X/WorldItemswith nameFlare.fbx - It looks perfectly fine in windows 3d viewer - I was exporting it using blender and someone's guide
If problem was in bad referencing to the model - shouldn't there be an error?
I guess, maybe it is something wrong with export, but I don't know how to check it to be sure about that
It might be too big... I tend to export at 0.01
Uh.. If it's too big - shouldn't it be on the whole screen? But i'll try making it smaller
It. Is. Definitely. Too. Big.
Even on 0.01
lol
I scaled it to 0.00003 to become normal ๐ญ
yea when it's too big you're inside it and you don't see the inside faces due to backface culling
If you're using blender, then export it at 0.01, and make sure you're not scaling it up in the model code
Yeah, now I'll export everything smaller
and make sure your blender world units aren't using meters or something big
it happens a lot ๐
I guess, If I need to rotate a model - it's better to do it in blender, right?
Hello, I decided to join this forum to fix up my mod or find out how to make it better for the 42 version of the game.
I made the "Wild Fruits" Mod and honestly forgot what I did. It's been 2 years <w> For example, I have ItemTweaker despite not doing anything with Vanilla Items <w>
So, One thing, did anything change in Forging? For now I just using Event on Add Forage Defs
BlackCherry = {
type = "MattSimpleAddons.MSABlack_Cherry",
skill = 3,
maxCount = 15,
minCount = 5,
xp = 15,
snowChance = -10,
categories = { "Fruits" },
zones = {
Forest = 15,
DeepForest = 15,
FarmLand = 5,
Farm = 5,
},
months = { 5, 6, 7, 8, 9 },
bonusMonths = { 6, 7, 8 },
malusMonths = { 5, 9 },
spawnFuncs = { doWildFoodSpawn },
altWorldTexture = worldSprites.smallTrees,
itemSizeModifier = 1.5,
},
Also, some people complained that the amounts were high. I disagree, but how would one change the quantities using the custom Sandbox settings?
So they can pick how much it is
you need a sandbox-options.txt :
`VERSION = 1,
option YourModId.Optioname = {
type = double,
min = 0,
max = 2,
default = 0.5,
page = Pagename,
translation = YourModId_Optioname,
}`
and in the lua itself you can check for it with : local VARname = SandboxVars.YourModId.Optioname ;
I suggest rescaling it in Blender
you also in your "Sandbox_EN.txt" (and any other languages you want to support)
Sandbox_YourModId_Optioname = "YourText", Sandbox_YourModId_Optioname_tooltip = "Your tooltiptext",
Also do you know what NecroList is ?
I used that but I think I literally had no idea why
yea
Doesn't exactly need to be your mod ID
No idea
Also why did I give wild fruits higher chance to grow on farmland
Also this, how does it work exactly? As in do I just set a option and then just do Sandboxcars.Yourmod.Optioname.Max ?
Also I see why my farmland was so big I was just coping the Strawberry stats
Also reason why pepole were complaing about amoutns
but you finding a ENTIRE BUSH of the stuff
you basically request the value in your lua and then use that variable. reason you should give your sandbox options a max and min value as well as a default
I mean, when I was a kid, there was a raspberry bush near my house that was a few HUNDREDS of raspberries on it
Where do you put this?
i have it just in the media folder
You have any examples maybe of how it should look like ?
How does the tracer particle effect system for ranged weapons work? All I can find right now are .txt files with configuration numbers
It goes in the media folder.
Does anyone know how to make it as options? The solution there is for ranges I need more rigid options of Low/Defulat/High
You need to set it to type = enum and specify numValues. Then have a valueTranslation that refers to values in your Sandbox_EN.txt file with names like Sandbox_Modname_Value_option1, Sandbox_Modname_Value_option2, etc.
I know B42 supports the advanced mode as well, not entirely sure how that's translated into the enum type personally.
Also was this fixed?
Or should I use the quickfix still ?
Also Can I use something like this
Local table = [1,3,10,40,100] and then have just table [Sandbox_Modname_Value_option2] ?
No ? Unkess that's new in B42
But that wasn't a thing in B41 ?
I am python head
The value of the sandbox variable will be the value of the selected enum, so you'll need to check the value and tie it to your logic.
Just can I use a table and then just have the option selected as postion in a table
so then I can just -1 from enum
Sure, but it won't be what you put above, it'd be SandboxVars.Modname.Value if following the same example.
Could just be lazy and give granural control to the player
but I think it's better if it's simple
I'm pretty sure B42 supports either or if they click the Advanced checkbox, just not sure how personally.
Is there any documentation for PZ modding ?
There is, but it's not updated for B42.
Is there a way to make character pick up an item that you trying to use through custom TimedActions script?
does anyone know what is wrong with the logic applied here?
I ended up leveling up a skill 2 times instead of one
if randomPerk then
local currentLevel = self.character:getPerkLevel(randomPerk)
local oldLevel = currentLevel
print("CurrentLevel", currentLevel)
while currentLevel == oldLevel do
self.character:LevelPerk(randomPerk)
self.character:getXp():setXPToLevel(randomPerk, self.character:getPerkLevel(randomPerk))
end
end
Bots
where there is assuming a lot of very tech literarate pepoel
Hm, I think I keep the mod how it is now and just test if it works in B42
I don't see much that has to be changed
outside of that
Does beautiful-java work for Build 42?
The Sandbox settings would've been lovely to have tough
I have to migrate a lotta shit from modoptions to new mod options
I think I wait till someone makes a documentation for 42
so I get modoptions
As i want it as simple as possible
I wish I could just have table
Tables are king tables are love
I've ported a bunch of mods over just for my own personal use - so far the things that are majorly different are recipes and shaders. Most other things just work, with slight changes.
Well more sandbox settings <w>
Do the EvolvedRecipe still work?
Can't say I've ever used that, so no idea.
I'm fairly certain all recipes need to be reworked with the new system though, having said that, it's not too difficult to work with.
Wait, did the mod manu got overhualed?
I had it modded for so long I forgot how it looked orginally <w>
Yeah, it's got most of the features from the Mod Manager mod now. I feel it just needs a way to sort the list.
Also how do I add Zomboid Version to my mod ?
In the mod.info file, there's a few version tags you can use. For example versionMin and versionMax, as well as your own mod's version: modversion.
Mod Id needs to be defined there? Is that the translation files wasn't working for me?
Yeah you need to put your mod Id in the sandbox translation file.
Anyone taking on creating an example mod for everyone to follow?
All recipes are in a completely different format, no old recipes will work as far as I can tell.
Anyone have any luck with prop1 and prop2 on timed actions? I am trying to see where the items are coming from, such as Base.DishCloth_Hand, but that doesn't seem to appear anywhere in the items list. My guess is that useable (in hand) props are defined somewhere else, but cannot seem to locate how that is done. Any ideas where to start?
Also how do you make your mod display in the Mods?
Like I noticed I have to put it into folder called 42.0
You also need a common folder.
Check out the pinned message on that, it has the structure for ya on there.
Yey it works
Also man I looked at the crafting menu, this game really went full Hydrocraft eh ?
They removed an event one of my mods depends on. Was there a list of the changes made, like a code commit with a diff or anything like that to look at?
Found it lol.
New Moodles in the Old Pixelated Style / No old ones.
https://steamcommunity.com/sharedfiles/filedetails/?id=3386984752
how do I update thumbnail ??
change your preview.png and update the mod ๐
I did trhat
It works in the selection
but it didn't update the steam workshop one
here it did it
here it refuses
Also its up and running now
But I can't change the thumbnail to say 42+
it looks like you replaced the one in the mod's folder, you need to replace the one next to workshop.txt
nice
I'm looking for the event that replaces Events.OnRefreshInventoryWindowContainers
If anyone finds something, HMU?
Is it correct to use one of this: ISInventoryTransferAction or ISGrabItemAction, to make character pick up an item near him?
I'm trying to make a player pick up an item he trying to use with custom timed action... 
I may be incorrect in thinking it was replaced, and there is another issue at hand.
Anyone else having problems with getting the Sandbox Options to display the correct tool tip, lable and page?
I'm trying to link it to the translation, but it keeps pulling from the sandbox-options.txt file
when i was updating the event doc i didn't notice any notable removals
i might be becoming a modding addict again
i finished one
now i need to make another
does anybody know how to make B42 recipes
because suddenly i wanna recreate some qol mod recipes i knew before
like 5 rags to make a rope, undoing a rope to make twine
Nope. Figure it out for us please ๐
me af rn
awesome, lol, I just assumed it wasn't firing anymore, and got into a rabbit hole. I appreciate you updating that btw
ok time to lock in and dig into the base game scripts
https://www.youtube.com/watch?v=JuSNWLAiucg
From the Bardock - The Father of Goku OVA.
Since this isn't a vgm, I'm not gonna add more details in the description like usual.
Are custom tooltips or stats possible now for items? Like if I wanted to add a "radioactivity" meter to all rat items, is that possible
okay doesnt look too bad
Or was that something ever accomplished on build 41?
Surely you could just check for item type instead of making a new tooltip? Would that work?
It'd be less conflictive as you wouldn't be changing any item files
That's what I'd do ๐คทโโ๏ธ
here's what i got so far
I meant I'd want the UI to show it somehow. It shows durability, thirst, hunger, etc stuff in the context menu
No idea how I could easily add and show a value from 0 to 100
Ah gotcha.. not a clue ๐
on 20 minutes of making the rope mod now
now booting up a debug save to see if it works
Anyone know if player:setVariable still works in b42 for playing .xml files with anims in?
I saw a thread saying the AnimSets folder has to be in both the original and the 42 folder, tried that but not loading as it did in b41
HAHA!
IT WORKS!
FIRST TRY, OH YEAH
now i just gotta fix up the recipe names so theres spaces
behold
Nice nice nice!
with B42, 'uninstallPart' command was removed from VehicleCommands.lua and filtered out in ServerOptions.java. but still the uninstall works. anyone knows how it works ?
Is there a discord to recruit devs/modders or is everything done here?
I tried to link you to the right discord but I was cancelled by a protection bot :D. you can look for "PZ Modding Community"
I found it (:
Can I ask someone to help me?
I'm trying to load a mod, but I keep getting a message that my mod.info file is missing, although it is in the folders
how can i port a b41 mod to b42?
Here is a rough template of a recipe with the new mapper feature included for reference. It is rough so I recommend writing out your own not trying to copy and paste this and fill it in. But this shows a lot of good info that otherwise you would have to hunt through existing recipes etc. If game fails to boot in debug mode when making recipes, make sure to double check your syntax to existing working examples - not this template file as it is possible that there could be incorrect syntax within the commented out sections.
pins
if config is local wouldn't you be unable to access values from it from other files?
so im curious
with mods n stuff
is there a place to talk about new ones i've made or smth
so non modders know they even exist
yeet it in here and #1162438206516645948
i havent really used showcase but i'd guess it works
I'd say you can also yeet it in #pz_b42_chat as long as you dont do that regularly
You can probably share your workshop page in community recruitment channel as well.
exactly! and your workshop pages are a great way to bring in engagement as well, steam community is live and active for PZ.
You can pass it around where needed from wherever you created. Alternatively, you can also use this to retrieve your options at any time:
local options = PZAPI.ModOptions:getOptions("UNIQUEID")
Then to get a specific option:
local option = options:getOption("OptionID")
Then that value:
myVar = option:getValue()
do i have to do a tripple call or can i just make my config global since the nills will be replaced with proper values during game init?
Here is what I did:
-- Fetch the multiplier from sandbox variables
local edMultiple = SandboxVars.Xaviors_EnhancedDurability and SandboxVars.Xaviors_EnhancedDurability.EnhancedDurability
-- Validate the multiplier; fallback to 1 if invalid
if not edMultiple or type(edMultiple) ~= "number" then
print("[EnhancedDurability] Error: Multiplier is invalid or missing. Defaulting to 1.")
edMultiple = 1
else
print("[EnhancedDurability] Sandbox variable found. Multiplier set to: " .. edMultiple)
end
you do know that you can set sandbx min and max value
you dont really have to validate
option EvolvingTraitsWorld.AffinitySystemLoseDivider
{
type = double,
min = 1,
max = 100,
default = 2,
page = ETWSettings,
translation = ETW_AffinitySystemLoseDivider,
}
as example
Yeah, that validation was for debuging purposes
ah
LOG : Lua f:0, t:1734632958108> [EnhancedDurability] Sandbox variable found. Multiplier set to: 1
Just so I could confirm it was being set. Trying to figure this stuff out so I debug everything! LOL
Making your config global would be fine, but it's not best practice. And you'll need to determine the best method for you on if those settings are updated ingame (why i wanted that event). But if you just need a specific value, you could always just do:
myVar = PZAPI.ModOptions:getOptions("UNIQUEID"):getOption("OptionID"):getValue()
Just be sure not to get anything wrong or you'll get an error. ha
i'd recommend just not using globals ever

there's not really any reason to (except a couple areas where the game requires them) and they cause a lot of issues
kinda funny everyone always makes that mistake
you can pass around locals between files
I dont use globals either was just wondering
ye but that requires you files to not be circularly dependand
imo if you have a circular dependency then your code is just structured weird to begin with
also tru
there are still ways to get around it though
i dont think i have any but i dont wanna fuck with passing locals over tbh anyway
make a specific file for handling the config, only ever require that file (never make it require anything) and you're g2g
here we go found it
This question is for anybody and ร am clearly not hoping for an answer of the EGB: how do I override the java method (from lua only) lua self.character:sendObjectChange with character being an IsoPlayer instance and sendObjectChange a method of IsoObjet ? Bonus point for the way to cancel the override. ```java
class IsoObject
public void sendObjectChange(String var1, KahluaTable var2)
its really been over 2 years since i started my require crusade ๐
do you want to override all calls or just calls within lua
you would not believe how many people just cannot comprehend the concept ๐ญ
you were once one of them XD
lua only ๐
i mean you understood it fast but didnt know what was going on at first
No, Albion was born with wisdom of lua

true prodigy
sorry for everyone that i have been doing mod ideas since 2022
iirc all i really misunderstood was that i thought it was by value not by reference, but that's still a pretty embarrassing mistake to make because lua literally never does anything like that
if you want to override calls done within java youd have to edit the class file
but within lua some metatable magic does the trick
Raspberries - sorry
does chatgpt knows how to make an b42 mod
my embarassing zomboid lua mistake was thinking hash tables were hash
spoiler theyre lists
#musicmaniacpins new mod options part2
i wanted to test if chatgpt can do it?
it doesnt
it can help if you know what you doing, if you're clueless no AI can help you. Ask again in I'd say 3-5 years
then AI prob can make a mod for you
-- needs to be the actual class of the object, not the class that declares the method like you may expect
local mt = __classmetatables[IsoPlayer.class].__index
local old_sendObjectChange = mt.sendObjectChange
mt.sendObjectChange = function(...)
-- do something else
old_sendObjectChange(...)
end
well i will wait for that time so i can finally get my mod dream reality because i dont want to annoy others! or bother then
yeah i just cant im too dumb!
unluck
yeah thats the truth unlucky
i tried and failed
all the times
atleast i tried
make sure to check argument types when doing this because you don't know which overload is being called
On the bright side that means you don't need to refactor from B41 to B42 ๐
can I do this afterward to release the hook ? ````lua
mt.sendObjectChange = old_sendObjectChange
wait is there really an bright side
yeah, that will work
also tcherno will ignore me forever ๐ญ i do regret my actions but it was meant to learn modding
thanx everyone
so sth like that would be correct assuming my options ID is set correctly
local modOptions = PZAPI.ModOptions:getOptions("ETWModOptions");
local nonBarsEntriesPerRow = modOptions:getOption("TraitColumnsSlider"):getValue() or 4;
maybe i could try modding again but i think it will fail again
keep trying until you make it 
I started my UI page like 3 times and dropped it
until I finally made it work
i been doing it since 2021 i think
but failed
but if you expect people to do your mods for you this aint place to ask, sorry
unless you are willing to pay
yeah because of brazil inflation
1 dollar is 6 reais
yup!
though you probably don't need the or 4 at the end, unless you let the slider go to 0. just set the initial value to 4 on the slider.
so might I suggest to either try to do it and ask questions in the process (by providing your code and explanations on what you tried and what didn't work) or stop kinda pestering ppl
there are plenty of ppl here who are willng to help but they wont do your mods for you my man
Start small, make a tiny mod first, something silly and easy, go from there.
i wanted to test the animal system but it sounds complex as the car mechanic
is that true?
that's not "starting small" my dude
like harder than an car mod
maybe an item mod?
there you go
thats better
and i like britas weapon mod but i aint making huge weapons overhaul
because thats hundreds of hours
i mean like not an huge mod but something that impact the ingame meta
like car crashes
and etc
do an item first, work from there, there is a lot in PZ to learn, but if you try and start too big its going to hurt.
i wanted to do an script that make stuff spawn naturally
look we already gave you plenty of good advice. if you wanna ignore and make metaevents instead of like a crowbar or some shit you do you, but then dont be surprised when its too complex and, quoting you, "fail again and again"
when you start lifitng weights you dont start at 150 kg
you start at 20
start looking into 'distribution'
so go start at 20
yeah thats what i meant
i dont remember why i had to do that, it's in ui render and i believe it had something to do with when modoptions initialize stuff
so i had to provide fallback value
is doing something that modifies population peak harder than item mods?
just wanted to know
or it depends
For that you do not even need a mod, you can alter the sandbox settings to achieve different population and zombie behaviors.
i need a way to check if a container has an specific fluid inside but "item:getFluidContainer():getType()" is not working. how can I do it?
use item:getFluidContainer():contains()
wait when retrieving them from options do i refer to ID of an option?
ETW_config.UIWidthSlider = options:addSlider("UIWidth", getText("UI_ETW_Options_UIWidth"), 500, 1000, 10, 700, getText("UI_ETW_Options_UIWidth_tooltip"))
do i do getOption(UIWidth) or getOption(UIWidthSlider)
well it didnt show me an error but it also didnt work
In that case, you'd do getOption("UIWidth") as that's the ID you created it with
so for example i use item:getFluidContainer():contains(Fluid.Water) to test for water
wait let me check someting
oh so id, gotcha
oh
I was using the other format
thx
Anyone have a guide that covers how to have an item held in your hand? Two methods I think would work for me, one would be making a melee weapon and the other is just having an item actually appear when equipped. I am interested in the system used to have items appear as props in timedaction, and I have noticed any weapon I call does appear. So I am thinking of making fake weapons that never spawn to call just for this - or figuring out the right way and making an item that actually can be held via prop1/prop2 tag. - Any ideas? B41 guides would be fine here if anyone has a link to one.
I am sure it has to due with the rigging to the bone 8 or whatever for the hand, but not sure how to achieve it.
contains tests if it has any of that fluid in it, you can also use isPureFluid(Fluid.Water) to test if it only has that fluid or getPrimaryFluid() == Fluid.Water to test if it is mostly that fluid
Acid
Alcohol
AnimalBlood
AnimalGrease
Beer
Bleach
Blood
CarbonatedWater
CleaningLiquid
Coffee
CowMilk
Dye
HairDye
Honey
Mead
Petrol
PoisonPotent
SecretFlavoring
SheepMilk
SodaPop
SpiffoJuice
TaintedWater
Tea
Water
Whiskey
Wine
thx
I got a note with the possible colors too extracted from the assets, but need to organize
there are plenty of possible ones, no idea if there is a way to customize/add custom ones
you can just construct colours with Color.new()




