#mod_development
1 messages Β· Page 315 of 1
If you want to just make it go very fast you could make it teleport constantly in the right direction when you reach fast enough speed
Overriding common sense on the cruise control doesn;t help
Unless someone has a different way of teleporting, when you teleport or set vehicle facing the speed resets to 0.
I was working on a mod that woudl align the car to the road if you were a few degres off, so you didn't drift back and worth... but using setAngle bumped speed to zero every time
That would be kind of janky, but you could have it to keep teleporting to seem like it is moving until you release the button
teleporting 60 times a second?
as long as you do it ontick it'll happen as often as the game renders
I think it would be convincing enough when the speed is comically high, but not for the lane keeping
then coming to a dead stop as soon as the teleport finishes... sounds horrible, but might work
I think a better option is to just redo the texture for the dashbaord so instead of 0/30/60/90/120 it reads 0/60/120/180/240
i am assuming that the speed limit is do to rendering because too fast and the world cant load quick enough?
I expect so, 120 "miles" per hours is already above whan can load & render smoothly in a lot of places.
Though B42 does do a lot better than B41
Also, if a 120 mph crash creates this moodle:
what will a 240 mph crash do? π
oouch,
and so ig that's why it normally set to 70 in multiplayer because of sever upload speed and all that
And extra-janky vehicle updates in MP
also i think thats the normal not infected death moodle yes?
i got a very interesting issue with custom item icon, so what im trying to do is to make a custom icon(32x32 72dpi index color 8 bit bit depth) that has the same property as the vanilla's for a modded item, but still, with inventory tetris view, there is a white border surround the icon, and it seems the resolution seems not correct, any tips guys?
anti-aliasing?
yea, i think in that way too,
but i dont know how to remove it lol, it seems all good in the windows photo viewer
can you share 32x32px re-sized png to me?
I can check if there's any anti-alasing
maybe thru zip or something..? (idk if it's allowed to share zip in here)
seems fine to me :3
nah this is not what i looking for lol
just in case, your png file is 32x32 right? I mean, in your texture folder. I had similar issue when using tetris inventory mod. (because I just putted 256x256px icon in texture lol)
yea same idea, so i gonna tried to draw it for myself
so i look for the vanilla icon,and tried to remake it with similar property
and im stuck in this now lol
like this, really need to figure out how vanilla icon was made, its method, file property, data etc
Ik, but this can help with making your own if you already the model of the item
You can render the way you want in Blender, on a transparent background
Then pixelize it with this tool
i gonna try it too thx anyway
so i tried to use vanilla icon to replace it, and it seems the problem was not about the icon itself, but the mods
there may be some options require to tweak in order to have auto upscale
do you mean the blurry pistol icon unlike wooden axe which you sent?
yes, this blurry pistol icon is from the official icon file, i use it to test on the mod item
it should be clean, but its not lol
so i start to suspect on the mod itself
this weapon mod
maybe vanilla icons are saved as .pack file however your icon is .png?
still everything is guessing :/
yea its reallly interesting and annoying
i saw the vfe mod has its own pixel icon design, dont know how they solve it
or maybe it will have similar result
you should rewrite the magazine api for me, I've been struggling - its B42 but I want B41
got it into game but error'd a bunch
i test vfe too, it definitely modding issue lol, for any reason we cant get a perfect pixel icon
they got blurry too
not problem about custom icon itself, well i guess im gonna give it up for this one
It's because they aren't in pack files
so is there anyway to solve it ?
Don't think so
you can pack them
Ah wasn't sure if you could pack stuff for your mods like that
I guess that's used for tiles anyway
yea i never saw people do that too lol
Bcs people never need to usually
Also adds a few more steps for not much gain overall
What program is your source image in, and how it is handling matting for any semi-tranparent pixels?
I've seen that sort of halo when an image on trabnparent background is exported and teh the exporting program treats the half-visible pixels as if they were on a white background.
Seems fine though, disabling the alpha shows everything is black...
assuming Discord didn't mangle the uploaded file
It is indexed, not RGB... that's probably not correct
Can you zip up the original image file and post it so we can see it witghout Discord being helpful when rehosting images?
Oh fuck yeah, finally got gamepad to work well with my mod
Nice !
This is clean
Good job with your mod, I think I'll link it as a UI mod example for the wiki page since it takes on multiple things related to UI
sorry but I don't want to spend extra hours for b41 because I don't play anymore.
Also, since B41 has MP and I have NEVER played MP, that work will consume lots time because I have to study about mp system. (sync, server, anti cheat, etc)
so I will not officially support for B41 until B42 mp is out.
However, I will tell you everything in here for back port from b42 to b41.
-
You have to change all
instanceItemto something. I already forget but keyword for search:itemfactory -
You have to download B42 and see which code has been added for timedAction override.
-
And after comparing, back to B41, add all codes which added by me.
these are the necessary first step.
Also there's new functions in ISReloadWeaponAction.lua you will have to implement those functions too with B41 method.
after then, you can do literally anything with my API and upload as your own mod. (fine tune, MP Compatibility, Additional functions, etc...)
While you are modding this, if you encountered any error, just ask in here.
Not only me but also everybody will help you.
don't worry if your question is too-basic. everything is fine π
wtf lolll.
42.6.0 just dropped.
https://theindiestone.com/forums/index.php?/topic/82337-build-4260-unstable-released/
NEW - Added the missing foraging zones to WorldMapRenderer.lua - Added Bendable Fences framework. Only for Wire Fences (for now). - Added sandbox options FenceThumpersRequired, FenceDamageMultiplier.- Show crafting inputs by Uses if whole item is not consumed - Pickaxing/etc Ore, Limestone or F...
Oh niiiice
Glad to see no huge changes to core features this time. Still a little sad we haven't gotten our container capacity alternative yet tho.
But most mods should be fine, which is awesome to see.
Haha yeah I was holding my breath reading the patch notes to see if there'd be something breaking my mod, but doesn't look like it
Same hahaa.
It's getting a bit scary now that I have over 1k users, I don't want to disappoint all these people π¬
well, 42.6 breaks everything I've done in 42
please don't say they break your capacity bypass code 
You can drag a zombie with wal;k to now, so there's hope for that one
you already know it does
sry fc
the joys of modding the unstable branch
really sad..
I haven't even pasted your code yet.. ugh
I was planning to do some study with that in this weekend π
because your code seems to be a fine example of what I asked before
#mod_development message
I'll dig in to it in a bit. It's prolly just bad coding on my part
Well that sucksss.
Don't forget it's very easy to decompile the game code, big thanks to @bronze yoke
Any hope for the capacity bypass?
idk yet, just got it deompiled and will have a quick look. I hope so.
Fingers crossed!!! π€
@primal schooner (Regarding your report about the linux mod loading issue) I run the native linux version and it loads mods from the user folder just fine. Symlinking mods to the folder causes loading to fail because incorrect path is generated (worked in B41). Have you checked what the path looks like where it tries to load the script from?
I'm not sure if this is the same issue you're having or not, so haven't reported it yet
I do have both /Zomboid folder and /Workshop folders symlinked, yes. I just tested it again and it indeed works when directories are not symlinked, though I remember trying that before initial report and it didn't help, unless I made a mistake somewhere back then. Well, that's great to know, but symlinks are essential to me and issue is still there, hope it will get fixed. Thank you.
Same. I had mods symlinked from a git folder and B42 broke that workflow
I even went as far as trying different capitalization in symlinks haha.
The issue might have something to do with capitalization. This is the path it tries to load my mod from /home/username/Zomboid/mods/home/username/zomboid/mods/modname/common/media/scripts/vehicles/vehiclename.txt
The mod name was also changed to lower case
yeah same, but i did try to have symlink as lowercase, didn't help
Hi! Is it somehow possible to get older versions of Zomboid's B42 lua files? I am looking for 42.5.0 or 42.5.1.
The game seems to fail loading the script even if I actually have it at the made up path
yep

i don't understand why TIS didn't just go with all lowercase everywhere to avoid all of that all together
they do have toLowerCase in java almost everywhere when it comes to paths anyway
I see, I think they fixed a bug where it wasn't checking effective capacity
I kind of wish I had kept the 42.5 files to compare
whats the file called? i still have 42.5 installed on my laptop
Looking for ItemContainer. Just out of curiosity
mainly just the 2 hasRoomFor functions
also @main pasture , this helps me a bit -modfolders steam,workshop,mods, not getting errors if I am subbed to the mods which I have locally because it prioritizes steam
Hi! I am also looking for 42.5! Maybe you can share? Best thing for me would be if you could share the whole lua folder...
trying to figure out if i had 42.4 or 42.5, i try not to open steam on this laptop lol
For me, 42.4 would also be fine. Should just be a version before 42.6 ...
I see. Good to know, thanks
maybe just backup-ing your files before do anything on steam??
last saved 3/11, and i uploaded something on pz for b42 on 3/12, so i think its 42.5
backing it up now
I think this should be 42.5
Worst case, you could try to find a π΄ββ οΈ version of 42.5 just to get the old files
ok, it still works, I'm dumb. They changed the type name of the bag I was testing with
check your dm
thank you!
In 42.6, they changed the size of the 3d character model in the character customisation screen. From what I see, they seem to have changed only the size 3d character model but not the size of the overall rectangular window where the character is displayed. Does anyone knows a way how to change the size of the 3d model without changing the size of the window?
what's like, the feasability/practicality of reimplementing java object code in lua to bypass needing to alter java files with manual installations....
asking for a friend,,,, who is hellbent on messing with barricades for a mod,,,,,
well, i use both ps and asprite to make different sample for test, since i saw the offical icon file bit depth is 8, so i tired to mess around with indexed
im confused the window is massive now
it takes up like a third of the char creation screen
but what i can confirmed is that it will not relate to icon file itself, i tired to replace it with one of offical icon file and still is blurry
see this
It just depends on where the code you want to change is called from really. You can override a java function in lua, but it will only over ride those calls made from lua, not any calls made in the game code
I think that massive window at the center of the screen was already introduced before 42.6 (maybe 42.5 or even 42.4). In 42.6, they leaved the window as it is and just made the actual character model a bit smaller.
do you happen to know how the zoom can be changed in lua? I am working on a mod and would like to make the character a bit larger again, as it was in pre 42.6.
i mean, most of the code as far as i'm aware that needs changing is in the ISBarricade class, which mostly handles the creation, health, damage, and sprite logic, which is all hardcoded,,, and so i'm trying to make variants of barricades
I currently have custom ISBarricadeAction code, but to really surpass the hardcoded health values and sprite conditionals, I'd have to essentially reimplement the java, which would be called from the actionqueue after selecting it in the context menu
yeah i think i have to implement the entire class in lua lol
if the health values and sprite conditionals are checked in lua, it should be possible
unfortunately not
it's all handled in the java code
in the lua code, there are conditions for whether you can create each barricade, but the logic for deciding what the barricade's health will be is hardcoded based on carpentry/welding level, and also clamped to max values which are not exposed to the api
some examples of said hardcoding in the IsoBarricade class from the decompiled code
simply unlucky
Wait, what?
you should be able to make a lua file in the lua/client folder that just has this in it to replace the vanilla function
function CharacterCreationAvatar:setFacePreview(val)
if val then
self.avatarPanel:setZoom(14)
self.avatarPanel:setYOffset(-0.85)
else
self.avatarPanel:setZoom(1)
self.avatarPanel:setYOffset(0)
end
end
my game hasnt updated yet so this should be the old zoom
im updating now so i can check though
ok.. I see there is a setZoom() command but I didn't yet figure out how to make it work
is the condition of an item clamped to a maximum value of 1? or could i set the condition to something above 1?
thanks! got it now!
yeah i was right the new one is zoomed out more
yeah, they changed from 1 to -3
btw, I am also working a bit on a compatiblity patch for your character customisation with my body mod
VehiclePart condition can't go above 100%. UseDelta for items with charges can. Not sure about other cases.
any idea on like, equippable items, say, a plank?
Patch notes look good, now I'm going to check Reddit to find out why the devs hate us and are trying to ruin all our fun.
the UseDelta is what getCondition() retrieves?
No, but give it a try and see what happens.
UseDelta is seperate, it's basically "how many charges"
Like how much fuel is in a blowtorch or lighter, charge in a battery, etc
ahh
There is probably a check in the game to prevent item's condition from going over 1 like with stats
condition is just a number.
So plank has 10 condition and
2 lower chance so
you can hit something avg 20 times before broken
while crowbar has 15 condition and 70 lower chance
(avg 735 hits)
Wish it were possible to smash door windows the same way you can with cars to unlock them
hmm, something is changing the game speed after an action outside of ISTimedActionQueue.onTick
I have been just saving the getCore():setOptionTimedActionGameSpeedReset value and then setting it to false to prevent ISTimedActionQueue from resetting speed
Have you looked at Poet's Stronger Walls And Barricades? It's B41 and I don't really know what's changed but might help you along.
https://steamcommunity.com/sharedfiles/filedetails/?id=2508717129
I did take a look at it, it seemed like the consensus was that the mod doesnβt work anymore on b41 and I also canβt really make sense of the code (for the time I spent on looking at it) and how it really changed anything
Iβll double back on it though
Not sure but this might be resetting the speed without my damn permission. updateInternal in AnimatedModel:
if (this.bAnimate) { gameTime.setMultiplier(1.0F) ...
Hey, I'm new to PZ modding and Lua language and got a couple of questions!
To follow the proper modding guidelines, I'm trying to overwrite as little as possible. The thing is, I'm not exactly sure about how to go about that.
If I go to media/lua/server/ClientCommands.lua, and modify a function there, that function is the only thing I have to have in my file of same name in my mod directory, right?
no, if you have a file of the same name it will load instead of that file, so anything else will be removed
OHHH I see
A function which can be accessed from a different file (usually global for vanilla, or modules) can be modified from a completely different file
As long as the original function was loaded first, of course
Usually the go-to is not to overwrite a function however
If you are not forced to directly modify the internals of the function but simply add new behaviors to it, you can do decorations
Simply put, hook to the function
Essentially I just want to change how much certain items are used in barricading etc
So you hook to the timed action ?
I now realise I actually have no idea what I'm doing
Thought this'd be as easy as just changing a couple of numbers in a function or two
Hmm, depends
The hardest thing is usually finding what you need to change
In your case, what do you want to change exactly ?
You said how many items are used for barricading, but which items ?
Well for the barricading for example, I want to change the amount of nails used
First off, my first guess is to check ISBarricadeAction.lua
The 42.6 update has modified the container highlighting mechanism, but the flickering issue hasn't been fixed yet.
You'll need to modify this function
From the look of it, I think you'll have to overwrite the function sadly
Because removing the nails is done internally
Aha! I'm not stupid, I'm just a bit blind. I completely missed that file
Or if you REALLY don't want to overwrite it, you can technically readd nails in the player inventory I guess
Hello all!
Is it possible to have multiple Intro Texts that the game could randomly select from?
No idea tbf, depends if it's Java or Lua sided
you can hook RemoveAll to change the arguments when called
but that might just be overcomplicating it
Thanks guys! I think I've got it now
you might want to muck with isValid too if you're going with the overwrite complete option
Yeah Imma look through the entire thing to see what's up
That's completely true, to make sure the players can build with only 1 nail (if you go from 2 to 1 nails needed)
Right, very true! Imma make it 4 though, because it makes no sense to me to nail planks of wood with just two nails 
Oh you want to increase it lol ?
Yeye
Wait that makes it easier then
Bcs you don't have to overwrite the whole thing I guess ?
zombie coming in my house? imma use 25 nails
Tho you do need to change the check
Ah yeah
Gotta make sure the barricade stays LOL
I hope you increase the health of barricades lol
I absolutely will not!
Figured lol
hi all π is this correct?
item 1 [Base.Pot]/tags[Bucket] flags[IsEmpty] mode:keep,
No
You either give an item list of flags
Wait no
tags*
You can't give both an item and a tag
I'm struggling. How would I get the animated model of the player? I'm trying to keep my eye on isAnimate()
ty
Wdym the animated model ?
declaration: package: zombie.core.skinnedmodel.advancedanimation, class: AnimatedModel
use: package: zombie.core.skinnedmodel.advancedanimation, class: AnimatedModel
You can't
Anyway I've never seen that thing before
Why do you need it ?
me either but I think it's messing with the game speed
I was hoping I could keep my eye on that bAnimate var and see if that's my issue
Most methods here seem to just be ones in IsoGameCharacter, IsoPlayer or IsoZombie
Why would bAnimate have anything to do with AnimatedModel ?
the only way I saw to check that bAnimate var is with isAnimate() which is part of AnimatedModel
Your awesome my guy thanks, I'm gonna start off by changing the instance items and go from there, got some rough waters ahead
-ps didnt know she was your mod π
If I wanted to make books visible in-hand, how would I do that since they already have models but just don't show up when equipped
I found 2 ways, First one is in item script StaticModel = yourmodel or something like that (don't remember if its exacly like that and can't check right now, This one should be tried first, then second option which allows for more customization (though requires blender or other 3d software), you parent the model to armature, weight paint it to hands ( you can do 2 models, one for each hand), export them, make XML files and fileguid entries (so pretty much like you would do a clothing item) and then add :
ReplaceInSecondHand = YourClothingItemXMLLefthand holdingbagleft,
ReplaceInPrimaryHand = YourClothingItemXMLRighthand holdingbagright,
I'll start with the first method and see how it goes
I'm trying to add configurable hotkeys. Would I be adding to the global keyBinding table or use getCore():addKeyBinding(p1, p2)?
Are these extra hotkeys for your mod, and are you on B41 or B42?
For B42 I use Mod Options.
NepHB.options = {
activationKey = nil, -- NepHB.options.activationKey:getValue()
[...]
NepHB.initOptions = function()
NepHB.options.activationKey = options:addKeyBind("activationKey", getText("UI_options_NepHB_activationKey"), Keyboard.KEY_PERIOD, getText("UI_options_NepHB_activationKey_tooltip"))
[...]
NepHB.onKeyPress = function (_keyPressed)
if _keyPressed == NepHB.options.activationKey:getValue() then
<do the thing>
That adds a keybind with default value period, and in Options -> Mods > High Beams the player can click on the setting and set a new keybind.
b42 - why not have the bindings in the main menu > key bindings section? more idiomatic to do it from modoptions?
Honestly: because it was easier for me to do it that way, putting everything in one place.
So... I had some extra code messing with the context menus... and somehow missed hooking into the wrong events not once, but twice...
...I swear I'm an idiot. lolll.
Wasting hours because of a silly mistake is part of being a programmer.
I was ALSO hooking into the world context menu handler in the inventory one as well. Just... all around I am an idiot and it's embarassing hahaa.
Use Mod Options
Don't use anything else, it's the standardized method
If you do anything weird with adding keybinds in a different way, it might just confuse users overall
Mod Options... my mortal enemy... 
lol should I break the Iowa whiskey out again?
Silly mod idea: Japanese and Scottish alcohol. It's just a percentage chance to rename "whiskey" to "whisky"
I grew up in Kentucky. Whiskey is spelled "bourbon"
just want to say that this page is put together very well!
Thank you, I had some fun making it and testing some bits 
the lua capacity over ride was updated to accept a table of types and weights so you can make more than one container weigh 500 lbs
#1070852229654917180 message
still need to figure out how to change the tooltip. starlit either didn't like it or more likely I don't know what I'm doing sometimes
would also like to have an "equipped" weight, ie like zupercart is 13 when it's equipped even if it's loaded down
i think isomehow found a solution. thx for the info from @bright fog. its pretty simple, just to pack all png icon file into texturepack, make new folder as texturepacks and put it in here, add this line "pack=xxxxxxxxxyourpackname" in mod.info, and profit! you dont even need to change png file name, just as normal item_xxxx
It's easy to add to a tooltip, removing things from a tooltip is not possible... the whole things is done in java.
and yes! @hidden compass big thx to you, i got inspiration from your mod about this lol
Maybe you could generate every single bit of the tooltip in lua by replacing 100% of the java, but that's a lot of effort.
correct, I did manage to add the "0 / 150" to the bottom but it was not happy trying to remove the tooltip added from the java
What I did for Authentic Battery Charge Detection was create a fake battery item that looks like a battery but doesn't have a charge, and then in the inventory code I swap the actual item item with the fake battery/allow the tooltip to be generated/swap the items back.
Which works when I just need to make one instance of a fake item and use that, would be painful to do it when teh tooltips are not 100% the same every time like a cart.
I thought about trying to suppress the tooltips and just add my own
I haven't even checked if that's possible though
oh, i never pushed the fix that made it work for containers π
container tooltips accidentally removed the part of the tooltip with the icons of the items in the container and everyone was bugging me so i disabled it until later
that makes me feel better
Can all three of these use the same model?
WorldStaticModel = Bible,
WeaponSprite = Journals.Bible,```
or does weaponsprite have to be different
they can
Models need to be .fbx?
B42.6 borked my save so it's time to pick up everything that survived and move on...
sucks bro. I havent been playing because of that
Just taking this time to learn how to mod in a lot of different ways
It's fine, I'll take my favorite car/drive to a new place/delete the map to refresh everything.
Bye Bye Echo Creek One-Stop Post-Apocalyptic shop.
i got my key bindings to appear in the in-game "Game Options" menu, but not in the title screen's key bindings menu. Any ideas how to add key bindigs to the latter?
So firstly I've tried to look for the instance items and was unable to fully understand what you mean by this: The item ids themselves?
as per the Timed and reload/radial api's I have no clue what those would be in B41 as I assume there is no template for B41 of this code- I do not have the skill to create a new lua with the same code but for a new version)
Any way you could put this a little simpler
- I think I'll first learn this with B42 and see how it goes.
there should be instanceItem(something) in code
you have to change this into
InventoryItemFactory.CreateItem(something)
awsome
~~quick friendly reminder to add your tile def here
https://pzwiki.net/wiki/List_of_Tiledefs_in_use_by_mods~~
they didn't add any tiles though
Any good firearms mod suggestions? Im currently using the vanilla firearms expansion (b41)
Do you want a stupid amount of guns with half a dozen new mechanics, or something that keeps the feeling of vanilla weapons?
For the later, I think you already have the best mod.
For the former, Britas probably has what you want and 500 extra things you don't need.
Also, wrong channel - this is meant for writing mods.
oh so if its icon they dont need tile def?
i did not know that
wrong chat
Happy you managed to make it work !
i've pushed that update now, if you need any help using starlit's api let me know
How are you guys making crisp pixel images mine looks like it was washed up by the rain or something lol. Tried gimp and boy i sucked at it.
In the tool settings for scale, set interpolation to none. I think itβs cubic by default
You make the pixel art then scale it up with interpolation turned off π
Will try it later today.. thank you.. π
just realized the trumpet shotgun says slamfire, lol. Good thing I haven't updated the mod yet.
yes
I use a hidden test mod to set up layouts n' stuff
No wonder there's animation issues with this mod. I'm starting to wonder how it functioned at all in B41. Tons of syntax errors, one of the XML's is even named wrong... just... smfh lolll.
Damn it's so hard to stick to finishing one mod before I want to make a new one lol
Just realized that those foldable kick scooters were made in 1990 and now I really want to make a mod to add them
Wdym one of the xml is named wrong ?
One of the XML's had a typo in the name. There was also inconcistencies everywhere with trolley vs. trolly.
Wdym a typo in the name
This doesn't make much sense
How can you typo the name, in what way ? Because the name of the file really doesn't matter
Also there's typos as in wrongly written names for a bunch of vanilla stuff, like some animations
It's an example of the issues with the XML's. There's typos EVERYWHERE. The typo in the name is just me pointing to the lack of entire care put into all of the XML's.
Say whatever you want about it, but fixing the typos fixed a ton of issues with the animations.

You're so awesome! I'll give it a shot and let you know if my 2 brain cells can't figure it out. Thanks so much!
Does anyone have any idea on how to change the text especially for the TV and Radio news?
I'm trying to modify them so I can possibly make a mod where the news say smth like this
"From what we are hearing from the CDC, it appears that the Cordyceps has somehow managed to 'bypass' the FDA's detection systems."
"Several recalls have commenced throughout the nation as reports of people having 'food poisoning' and having 'seizures'."
Does anyone know how to do that?
I really wanna make it compatible with Week One
I wanna make this mod for those who wish to experience the development of the Outbreak, etc
In a TLOU way basically ?
That'd be cool !
I'm unsure how you can do that. You can possibly modify the translations of radios
Yes exactly! I got this inspiration from the mod itself
Yeah I could do that
But I'm very new to modding so..
Kinda need some guidelines
How I started was just find and look at the code of mods that do something similar and go from there
https://pzwiki.net/wiki/Translations
I think check this
Also if you are interested I work on TLOU mods and I made a group for modders who are interested in making mods on the subject
Tho I haven't been modding for the past month and mostly have been documenting for the wiki
That's pretty awesome ngl.
I see
I would like to get invited
vscode has the manners
phenomenal
It does for xmls, since xmls that build off it will reference the file name
Like the unload animation xmls will reference the reload animation xmls
If the file is named wrong, it doesnβt reference it
is there a mod that adds in the sounds the zombies make in black ops?
That's only if it extends another XML and you typo in one of those
Don't think so
Then do it
i don't mod
Then don't ask lol. I'm going to be straight with you: your request will get lost
Unless you pay someone to do it, it is extremely unluckely you just gave someone an extraordinary idea to implement as a mod, and even if you did you need to get lucky to find someone who'd do it
It wouldnβt be difficult, just some sound replacements. Im sure even a first time beginner such as yourself could
Would be a decent introduction to the file structure too i think
Not trying to be snarky, trying to encourage you.
i actually found a mod that does it but it hasn't been updated in several years
i'll probably have to look into it
Does it still work?
it's for 41.60
Are you wanting it for 42?
i mean i still use b41 im not sure if it functions for the stable build
Could try, i dont think the sounds would break. Maybe file structure would be different tho
Worth a shot to see if it just works lol
i'll have to make a new save to try
Wait why is my text red? Or is that just me? Lmao.
This is the only message i see in the past hour
uh ?
photo bombing
Must've marked it as spam or something??? Idk.
I meant to respond to this with "Yaaas!!!" but it didn't like it. Lmao.
could have been a network thing too
If I can figure vehicle trunks out, it should be on the workshop sometime tonight or tomorrow
if it isn't working, it might be the type string you're using
I got it. Need to learn how to spell
The feel of this style is awesome; it would be great if it could also be displayed like this in the game.
works with bags, crates, vehicle trucks, etc.
I'm a happy boy
that would require working with ui elements and idk how to do all that
plus, where would it even display?
Maybe in tooltips or somewhere else,Idk. It just looks really nice, lol
Actually you could possibly easy render that in the item tooltip ...
Simply in the translation file, show the image
With rich tags
seems a bit redundant tbh
Yea agreed
It's overall a bad suggestion imo, at least to do it JUST for that mod
But if you wanted to do it, you possibly could do it
I think the new XUIbuild might make future UI creation much easier, but for now, Iβve only seen the crafting panel using XUIbuild.
Whoop whoop! Can't wait!
Modern Status looks incredible btw
That and CleanUI just... chef kiss.
just curious if this is the way to go for making this an "api" for others to use or if there is a better way
local JB_MaxCapacityOverride = require("JB_MaxCapacityOverride")
-- { "type", weight, prevent nesting same container, override with an equipped weight } --
-- override with an equipped weight is a WIP
JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE = {
{ "Bag_ShotgunDblSawnoffBag", 125, false, 25 },
{ "Bag_TrashBag", 40, true },
{ "militarycrate", 75, false },
{ "TruckBedOpen", 500, false },
}
JB_MaxCapacityOverride.PREVENT_NESTING_ALL_CHANGED_CONTAINERS = true
I usually just make it global but thought I would maybe not do that this time
No
Make a function
The way you just did it, everyone's going to overwrite CONTAINERS_TO_OVERRIDE
Make a function which appends an item with the desired config
shit, I didn't think of that
JB_MaxCapacityOverride.addContainer = function(type, weight, allowNesting, _equiped_weight)
...
end
Add fail safes
So if the parameters are wrong, don't add the item
And throw an error
Or at least print in console that the added config is wrong
using a helper function also lets you change the actual implementation later and not break mods using it
if you needed to add an extra field for example
helper function ?
i googled it and apparently that term means something specific that i am wrong to use here π
but i just mean that all this function will really do is insert its parameters into a table, it's not really strictly necessary to exist
Also how does your API work ? Does it check in any way if the item is in the list by using the Type ?
Yes, tho there wouldn't be much point to not using it I guess, besides performance impact I guess
it creates an api which is good for future proofing + error checking
the utility is more that it creates a separation between the library's api and its actual workings than the function actually doing something particularly useful
local function isContainerToChange(itemType)
for _, container in ipairs(JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE) do
if container[1] == itemType then
return true
end
end
return false
end
that'll need to change a bit with the "helper" function but yes
Dear god use lookup tables
Jesus
At the very least don't use ipairs π
better?
local function isContainerToChange(itemType)
return JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE[itemType] ~= nil
end
π
Better, if you change CONTAINERS_TO_OVERRIDE to a keytable
remember that while it might be fine for a single mod to do things like that, for a library O(n) is really bad as the data could get massive due from many mods using it
Exactly
is this what you mean by a key table?
JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE = {
["Bag_ShotgunDblSawnoffBag"] = { capacity = 125, preventNesting = false, additionalField = 25 },
["Bag_TrashBag"] = { capacity = 40, preventNesting = true },
["militarycrate"] = { capacity = 75, preventNesting = false },
["TruckBedOpen"] = { capacity = 500, preventNesting = false },
}
I'm not used to coding for the masses
Yea
cool, we're on the same page
ok, I'll get the function to stuff the key table done and then I can fix the rest
Also, I'd inline that
Unsure if it'll matter much, depends how many times it's called
got it
Reorganized a tiny bit the vehicle script block page
Page will need a major reorganization later down the line anyway.
https://pzwiki.net/wiki/Vehicle_(scripts)
Same with item script
https://pzwiki.net/wiki/Item_(scripts)
https://www.youtube.com/watch?v=I0w0BZAveVs&t=14s - blink and you'll miss it π
In this video, we take a look at some of the best new mods for Build 42 in Project Zomboid! This video looks at new mods in March 2025 for Project Zomboid.
Enjoy!
π½π½π½ LINKS BELOW π½π½π½
π Mods In This Video: https://steamcommunity.com/sharedfiles/filedetails/?id=3447585615
π VOD Channel: https://www.youtube.com/@mratomicd...
No, that ?
What does that mean
What do you mean
I understood that your mod was in duck's video, that wasn't my question
files in debugger went from eye-searing to dark with some minor release version no?
b42.x
it always looked like that for me?
in that case today i'm less foolish than yesterday
I mean, it might have been a setting I changed but can't remember
No I think he's right, I think it was in white mode before
praise spiffo
well that's awful
ok, my add function:
JB_MaxCapacityOverride.addContainer = function(containerType, capacity, preventNesting, _equipped_weight)
if capacity == nil or type(capacity) ~= "number" then
print("JB_MaxCapacityOverride Error: weight not specified or was not a number")
return
end
if preventNesting== nil or type(preventNesting) ~= "boolean" then
print("JB_MaxCapacityOverride Error: allowNesting was not specified or was not true/false")
return
end
if not JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE[containerType] then
JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE[containerType] = {}
end
JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE[containerType] = {
capacity = capacity,
preventNesting = preventNesting,
equippedWeight = _equippedWeight -- or nil if not used?
}
print("JB_MaxCapacityOverride: Container override added succesfully: ", containerType)
end
can it be better?
Verify containerType even exists in the scripts
Also
Dear god
Remove that last print
oh no
For the SANITY of everyone
I was, it was for me
Jeez thank god
I hate that shit
Bcs that's what Item Tweaker did and it's the reason it wasn't very efficient
no, I was messing around and forgot to change it
nah, he's right, I fixed it right before he mentioned it
_equippedWeight in the code because I can spell
Wait give me a sec need to verify something
I left it last in case it's nil. I didn't know if it would care or not
No it's good
I don't think it will but didn't feel like checking right now
It will be good
You can leave as is
I wasn't sure if you could do that, but you can I just tested it
I think it's ignored but lua can be meh
No Lua is consistent, as long as you follow the rules
Here it's not a problem
It is however a problem if it's an array
you seen my code, I am not consistent
yea, usually I wouldn't ask but I figured I should for this one and I appreciate the help and advice big time
When you release it, I'm interested in getting hold of it so I can make a Modding project wiki page for it for easier sharing
I'd advise you make a Github page too if you haven't already
Should help with handling the project or overall other modders reporting issues
I know a looot of people will appreciate a patch for the container capacity limit
I need to figure out why trunk damage isn't being factored in to the effectiveCapacity
Added missing section for tags for inputs
https://pzwiki.net/wiki/Inputs#tags
irrelevant to conversation above
wait I'm a dumbass
Still a lot less than I am.
Low bar, I know.
meeee toooo
who took the picture?
The third dumbass
I don't think I can do anything with trunk / seat damage lowering capacity. It looks like it's all java side
Hey, everybody!
Dedicated servers have peculiarities of receiving messages from game to discord and sending from discord to game. But this feature is already outdated and has some kind of bugs π¦
I am currently developing a bot that could perform this functionality. I know that the bot looks at messages from logs, processes them and sends them to discord. But I ran into a problem:
How to send messages from discord to the game?
RCON is not suitable, because /all messages (to the main chat) are not supported in console commands, I tried to add support for such a function through modification, but I am not strong in kahlua, does anyone have any ideas how to send messages from discord to the game?
I write the bot in Python (no bugs so far).
My guess is have a Lua script read server side in a file which receives Discord messages
ID Discord user to in-game players, if player is in-game or some shit, then send server command to client to Say the message
However I'm unsure if player:Say(message) writes in chat but I'd figure yes
Yes, I've seen that you can send information to a file like dc_log and forward it to the game using a script. Can you tell me, do I need to invent a mod for this? Or is it possible to make it read through world.ini?
hmm, how far do I go?
it's java but i know mods have overridden it before
Nah you need a mod
The mod will have the Lua part
There's possibly better ways of handling this
But I'm not familiar with file reading so can't give much informations on that sadly
I know it's possible however
I know it is done by some mods, some servers
if I can find the formula, I can flub it
Thanks for the tips, I created a topic on theindiestone.com/forums, will be interested in their opinion
yeah basically any external communication needs both a mod and an external process
Highly doubt you'll get any help there lol
Never heard of anyone using the forums for development
You're better off asking the modding community I feel like
In general, I thought to feed a request to send to the game in RCON, but for this also need to write a modification, because the admin command pool does not support sending to /all
Your process involves a mod, that we can help you with
The bot part is your thing however
No idea what you mean
Thanks for the advice, just I did everything myself before and here I got into a dead end and as an adequate person chiseling on all fronts in search of help)
usually what you'll do is write a file to the cache directory that a mod periodically reads to check for commands
we can't add more rcon commands with mods so you can only rely on it for the very limited things it can already do
Thank you for the consultation!
I'll be back as I start developing the modification, I've figured out which way I need to look
You took the picture, JB is holding the gun, and I'm the oblivious one staring at Earth.
Hey guys could you help me to find file in games folder that has animals paths script? Wanna figure out how does it work
That's going to be in the Java
Also didn't note it but, you can throw an error with error
That way modders actually fix their fucking shit bcs they are forced to or their mod doesn't work, instead of leaving broken entries
I didn't know that
i mean either way the result is the same since they return after the prints, it just gives it a an easier to debug red error + stack trace
does that break out of current execution?
prints disappear in the sea really easily
Return will not stop other entries from being added however
Basically
neither will error
It throws a manual red error
What ?
I was pretty sure error would do it ?
There's something to do it right ?
Isn't there guide on advanced workshop stuff? I have looked everywhere, and I'm sure my dumb butt just can't find it. Like, gif screenshots, better screenshots in general, etc.
In the modding Discord
error does end the execution of the function, but since pz's kahlua is modified to call all functions in protected mode, that doesn't propagate out and basically just acts as a return
print("JB_MaxCapacityOverride: WUT? capacity not specified or was not a number")
Aaaah yeah I remember that shit
in standard lua you'd expect the entire call chain to be halted
Well anyway probably better to use error so they have a big marker of where the problem is
yeah definitely
Yeah now I remember that protected thing
it's a bit annoying for a couple reasons but in fairness the game would really not work whatsoever if they didn't
How so ?
gotta have a hard stop somewhere
imagine the consequences of the entire lua callstack halting every time you get a red error
typo causes whole game to crash
when things error they'd take half the game with them
is there a way of controlling where the error is "caught"?
if you've ever modded the main menu ui you'd know mistakes in there sometimes make the menu fail to load and softlock the game, that kind of thing would be much more common that way
like try-catch
lua has pcall for that but it doesn't work well in pz for a couple reasons
since all function calls are protected anyway, if the function you're calling internally calls another function that errors, it won't reach your pcall
also, even if you do catch an error with it, it doesn't prevent the red error, so you'll get bug reports
Amazing
Perhaps the best way is to always use pcall whenever you want to call a function, that way everything can get caught or some shit ? 
before i found out pz basically does this i would've taken this as nothing more than a joke
another troublesome thing is error is supposed to take an argument which blames a higher part of the callstack for the error (for example, if you do error(message, 2) the stack trace would blame the function that called this function and not this one: good for reporting errors with incorrect library usage, it isn't an error in the library, it's an error in the user) but pz just ignores it
can you mark b41 mods as incompatible the same way you can with b42?
incompatible=RamshackleRecipes,``` doesn't seem to be working
I also tried it without the comma
so no passing error up the call stack
no
π
@bronze yoke Linked your GameTime guide in the relevant page, until that wiki page actually gets reworked into something decently useful lol
https://pzwiki.net/wiki/Game_time#See_also
is it possible in vs code to enable displaying unknown as error?:
---@class SomeTable
SomeTable = {
value1 = {
type = "int",
value = 1,
},
value2 = {
type = "boolean",
value = true,
}
}
local normalValue1 = SomeTable.value1.value
local mustBeErrorValue1 = SomeTable.value1.someErrorType
local mustBeErrorValue2 = SomeTable.value1.someErrorType.sonsgsgasgdswgsdf.sdgdasgfgdg
Now only when hovering it says unknown but it doesn't show up as an error
try ---@class (exact) SomeTable
i think there is also a setting somewhere to make this the default behaviour of all calsses
yeah this is why i hate using it
it needs every single field to be defined by an annotation
yep, I have a lot of fields and I don't want to declare each of them
and how do you deal with this problem?
here i'd probably do something like this```lua
---@class (exact) SomeTableValue
---@field type string
---@field value any
---@type {string: SomeTableValue}
SomeTable = {
value1 = {
type = "int",
value = 1,
},
value2 = {
type = "boolean",
value = true,
}
}
SomeTable.value3 would not error here though if you want that too
i'm not sure if that is possible
without hardcoding a full list of fields
got it, thanks
Might be obvious, but didn't see it mentioned: you can disable damage lowering container capacity from the script with conditionAffectsCapacity = false. (You can also iterate throught the vehicle scripts on startup to change it for every part/vehicle automatically)
nice, that got me right to the java code for it. thanks!
please tell me, if instead of declaring fields I just make a lot of classes, does it give the same check, but there is no need to register fields, or is this a bad implementation?:
---@class _
ScoutSkills = {
type = "ScoutSkills",
name = getText("UI_trait_scoutskills"),
desc = getText("UI_trait_scoutskills_desc"),
---@class _
xpBoosts = {},
---@class _
freeRecipes = {
"Herbalist",
"MakePlantainPoultice",
"MakeComfreyPoultice",
"MakeWildGarlicPoultice",
"Black Sage Growing Season",
"Broadleaf Plantain Growing Season",
"Comfrey Growing Season",
"Common Mallow Growing Season",
"Wild Garlic Growing Season",
},
---@class _
values = {
defaultWalkSpeedIncreaseMultiplier = 1.2
}
},
besides the typo that broke everything that I had to fix already jeez
Hi! In .txt files of the tranlate folder, how can I insert quotation marks in the UI text? I already tried
UI_myMod_myText = "Display \"quotation marks\" here."
using backslash \ before the " but this doesn't work for me.
i've seen vanilla use regular unescaped quotation marks
oh XD I just try this!!
@bronze yoke please tell me, if instead of declaring fields I just make a lot of classes, does it give the same check, but there is no need to register fields, or is this a bad implementation?:
---@class _
ScoutSkills = {
type = "ScoutSkills",
name = getText("UI_trait_scoutskills"),
desc = getText("UI_trait_scoutskills_desc"),
---@class _
xpBoosts = {},
---@class _
freeRecipes = {
"Herbalist",
"MakePlantainPoultice",
"MakeComfreyPoultice",
"MakeWildGarlicPoultice",
"Black Sage Growing Season",
"Broadleaf Plantain Growing Season",
"Comfrey Growing Season",
"Common Mallow Growing Season",
"Wild Garlic Growing Season",
},
---@class _
values = {
defaultWalkSpeedIncreaseMultiplier = 1.2
}
},
i've never tried this, i don't know
got it, thanks
looks good to me!
works perfectly!!!
why does calling refreshAnimSets(true) return the error nil: Object tried to call nil in ...
good catch, it's not actually registered as a function
methods are supposed to have this LuaMethod annotation to actually expose them, that one doesn't have it
i think that's the only public method in the class to not have one
got it, thanks
yeah you have to, I usually have 2 separate defs for it like
--- @class (exact) SomeTableValue
--- @field type string
--- @field value any
--- @class (exact) SomeTable
--- @field value1 SomeTableValue
--- @field value2 SomeTableValue
--- ...
I think it's the only way to do it sadly π’
nvm I just looked above. wth does the class _ magic do?
When parsing through
playerInv:getItems()
and looking at containers.
Which element is the maximum item encumbrance float
omg, found it. MaxItemSize
is it possible to add a custom Crafting bench? (B42)
More generally - is there a guide to the stuff we can annotate to make umbrella more useful?
there's a wiki page for annotations here https://luals.github.io/wiki/annotations/ we don't have any umbrella-specific instructions though
That might be because what I think of as "Umbrella" is actually some generic lua stuff AND the zomboid-specific umbrella stuff.
Thanks for the link.
umbrella is (mostly) definitions for zomboid's types, the actual annotations system is all the language server
Is there any way to disable the display of the moodles UI?
How can I fix this, or which editor are you working in?
Hey, i dont know if i should ask this here, but starting today i have a strange problem with the editor displaying text when starting my pz to test a mod i am currently trying to create.
Does anyone know whats going on?
Did you check your debug log?
That's my favorite error screen btw.
Yes, the fonts where messed up all over the place. Im uncertain what the problem was. I restarted the pc and it still showed, then i checked offscreenrendering in the options on again and it went away. then shut it off again and it didnt appear again. Confusing, but at least its gone... O.O
which editor are you working in?
Me? I use visual studio code to write my mod. Or did you talk about ingame? I only started with moding pz so i dont know if there are ingame debug mods like with the mod loader...
That's all, it's a survey.
Do you happen to know how to set up IntelliSense with parameters from the Project Zomboid Lua API?"
No, i tried to use the extension for pz script support, but then it woudnt highlight lua anymore. Have yet to dive a bit deeper into vsc to set it up better.
Havnt done much with lua till now, so i still have to get a feel for the whole thing.
Thank you for the response.
I know you can make stuff require an object for crafting, idk about the new stuff like smithing or the bandsaw tho
If anyone knows if you can, that would be really cool to have custom workstations with their own recipe menus
I think it should be possible tbh, I've been messing around a lot with recipes and the crafting/building menu lately and they're pretty damn flexible
Time to do a deep dive into animations so I can get this bad boy working
dont remember exactly when it happens but it always happens when you have some kind of syntax error in your lua code
you just have to check the console.txt and see where its happening and try to figure it out
the error is always really vague
Wdym ? Fix what ?
We use VSCode
Error before loading the Lua or some shit like that
Very early error
Is this not enough?
I understand that VS Code doesn't recognize the parameters of Project Zomboid (API), or am I wrong?
hey guys could you give me some advices
im wanna start making my own mods but idk which languages should i learn. ive heard that modders use Lua but im not sure this is enough
That's the wrong Umbrella lol
You are not supposed to download an extension too
You need to use ctrl + shift + P if I remember that right
And search for addon manager or some shit
Simply follow the correct tutorial
Thank you all so much for your help, I appreciate it, but my problem is still not fixed."
Lua is what PZ mods are (mostly) written in, so learning it will definitely help a lot, but more importantly you have to learn how to think like a coder.
For example I hadn't touched Lua at all until about two weeks ago, but I have experience in Python and JavaScript so picking up Lua wasn't very difficult.
I'd still suggest doing some Lua code course though since it will get you started with modding faster, but make sure it teaches the fundamentals of coding too, like data types, variables, control statements etc.
Do you have this one as well?
https://marketplace.visualstudio.com/items?itemName=cyberbobjr.pz-syntax-extension
I also use these two
https://marketplace.visualstudio.com/items?itemName=ILKA.umbrella-vscode
https://marketplace.visualstudio.com/items?itemName=asledgehammer.zedscript-vscode
Where can I find the Moodle related content? I want to add an option to hide it from display.
I haven't touched Moodle before
If you're on B42, use the unstable version
Also to generate random, it's suggested not to use ZombRand
It seems that it started offering the necessary parameters, and as for the errors after disabling 'EmmyLua', the problem is gone. Thank you all for your help.
- ....
I tried checking how exactly they work, but I don't have much time to dig deeper, but you're basically gonna have to mess around with MoodlesUI.
There is a setMoodleUI on the UIManager, so you should be able to pass an empty MoodlesUI element as the second param.
But it might not be as straight forward as that.
If that method doesn't work, try checking how some other Moodles mods are manipulating them
Thank you, I didn't know that UIManager has the setMoodleUI method.
Youre absolutly right. I tested it. Turned out i had the mod activated from the start menue on and when it loaded it throw an error and that was the result. Thx, that clears it up. Also: Dont activate unfinished mods. ^^ Thx again. π
Hey Iβm kinda desperate for food n stuff atm so Iβm trying to do commissions.
If anyone is looking to commission any sort of gun/melee/armour mod it would really help me.
I also have some experience with lua and recipe scripting if you have other requests that donβt fit the previous stuff.
Iβm not looking for a lot of money, just some to help me scrape by.
If anyone is interested, please DM so we can discuss details. I have a Kofi and PayPal.
what TimedAction is use for construction via buildingmenu?
looking in client\Entity and/or shared\Entity\TimedActions should get you close to what I think you're looking for
thanks
If all else fails, you could add some loggers to ISUIElement (or even ISBaseObject) in the vanilla code to see if you can find which method or function that's called to create the moodle UI
From my understanding of it, the moodles are java sided
I think something changed in B42
But still
Oh, the sweet release of being able to play a game instead of modding. β€οΈβπ₯
It's healthy to escape for a while, but you do you lolll.
I enjoy modding almost more than playing the game tbh π
modder at its possible peak
Yeah it doesn't seem to be directly exposed, but I figured since it extends UIElement it should still be possible to get the reference to it and manipulate it with the methods that are exposed, but I haven't really had to deal with anything that isn't exposed yet so not sure if it would work
moodles are pure java + the most hardcoded thing in the entire game
to hide them i did```lua
local ui = UIManager.getUI()
for i = 0, 3 do
ui:remove(UIManager.getMoodleUI(i))
end
Ah nice one, that makes sense
@slim swan check Albions message above if you haven't got it done already
i think i tried setMoodleUI to nil first but that caused a bunch of null pointer exceptions, this just stops the ui manager from actually rendering the moodles
Why iterate from 0 to 3 ?
What's the reason ?
hello, can i ask, where are the files for characters talking? like text above their heads, i wanna make a mod that triggers a random piece of text when you eat something.
It's the :Say method on your player object
thank u so much dude
im new, i apologize, but mind telling me where do i find that in the files? and maybe a lil extra info? im watching a tutorial rn but i still have a hard time actually doing something
my goal: each time u finish eating, a gordon ramsay quote pops up.
ive always wondered about this, but, when making a clothing mod: how does the game know where to put the "scratch defense" or "bite defense"?
blood location on the item script
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\actiongroups\player ?
same way it knows where to put holes
i cant really find the player object or :Say anywhere.. anyone help? again i apologize
Iβve already made it,thanks guys.β€οΈ just need to getInstance and then setVisible,not actually remove it
Remove is still a better way,if it work I donβt need to set a event onpreuidraw,I test it tomorrow
Four MoodlesUI instances are created during UI initializationβone for each potential local player index
figured that was probably for that
Tried searching through the Lua codebase of PZ? Helped me a lot.
Sorry I can't explain super in-depth because I'm on my phone, but you're gonna have to learn how to make a .lua file and write some code to do what you need. I suggest checking this https://pzwiki.net/wiki/Modding
And go through the game files to see how things are structured and how to interact with the game using lua code
You will have to use the eating timed action
Hook to the perform method of it to trigger the player saying the quote
@elfin jungle How much prior experience do you have with programming/scripting?
Can I modify my mod files in real time through debug mode while the game is running?
Yes
Some stuff react differently
Models usually reload
How?
Animations and AnimSets too
Automatically
in the case of Lua files you need to reload the specific Lua files
Requires your files to be reloadable as depending on how you write your Lua you might not be able to reload
And some stuff won't even apply and still require hot reload of the Lua
Scripts don't reload
Need to reload Lua in the main menu or reboot game
scripts can be reloaded in b42
in the in-game debug menu there's a script manager button which lets you view and reload scripts
What's the keyboard shortcut to open this screen?
one of f9 - f12
f11
Question. How can I create a garden gnome for a player to add to their inventory?
getPlayer():getInventory():addItem("Base.Mov_GardenGnome")
this may work
How come between these two functions, the line local zombies = getWorld():getCell():getZombieList() always fails when called on whichever function appears second in the code? If I swap the placement of the functions, the first one will always work, and the second will always fail on that line. Is this a lua thing? I'm not super familiar with the language.
what the error says?
there shouldn't be any way that would happen yeah
Not sure, can I expand the callstack? I'm getting this in the debugger when freeze zombies is second for example. If I switch the locations of the functions, I get the same thing with the other function.
at the top there should be an errors button, the one at the bottom is the most recent (it starts at the top π)
how do I get my icon to show up in the mods list?
i have icon.png in the same folder (/42) as mod.info, which has a line icon=icon.png
Is this what I'm looking for? Is this the whole thing, or is there more?
I just refresh and check console.txt
those look like the debugger crapping out π it does that a lot
one of those should point to the line that errored in your function, along with an actual error
(if you try to double click objects to inspect them it just errors out half the time)
that should be right
you can try using this icon from one of my mods to see if the image is the issue
yeah
oops thank you you were faster than me
I was just confused hehe and I was sure right after then.
That should work - as well as trying with a icon.png from another mod to confirm the file contebnt isn;t teh issue, doublecheck to make sure it's not something silly like the icon file being called icon.png.png
is there any file which including opening UI window function in vanilla PZ? I want to reference vanilla file but I have no idea.
I just want to create a window and write something inside. from the scratch. (studying)
Is there any way to quickly apply setUseless to every zombie in the entire world, including as they spawn in from the side of the screen? I tried one hour, and it wasn't nearly enough, and every ten minutes also feels like it might not be enough
@tacit pebble every bit of UI gets it's own code.
Some java, some lua, some mixed.
What about the OnZombieCreate event?
I have no idea what the exact behavior is for it, but it might be part of teh solution for you.
setuseless sometimes makes zombies stop moving forever. I tried it when I made my first mod, but I didnβt dig deeper into it.
In my Mad Crafter mod, I set setUseless(true) after an attack and then set it to false after 1 second. However, this occasionally causes a low probability issue where some zombies stop moving forever.
The best approach is to check the files inside entity/craftRecipeCode, which contain the crafting UI elements and also use the XUI.
@silent zealot thank you both for reply, I've been watching some code still yet
I can't test now but seems ISPanel could be working as window(window which I imagined)
can't wait get back to home for testing 
Good luck, there is a reason no sane developer writes a UI engine from scratch instead of using a framework of some sort.
Needs to be in the versioning folder
Not common
Put mod.info in versioning folder
Not common
He did say it was in /42
Didn't see mb
In my defense, I haven't made a mod, just considering to make one and stalking/reading through here and forums.
But looking at some other mods it looks like you need the icon png in your version directory like you have (i.e., /42) and update the mod.info file to include icon=[NAME OF ICON].png. Maybe you're missing the icon line in your mod.info file?
He said he has the line
OnObjectAboutToBeRemoved
will this trigger multiple times i mean 1 per client?
before i came here i was reading that
you might have missed the trigger
im aware that you added the trigger side but that event doesnt have that so,.. yeah..
iirc that event is not fully documented
looks like its server sided
if it doesn't specify that means both but i think in this case it was set that way because i didn't know
i see
cuz im afraid of using it sorta. well i can test but it might act differently when its dedicated server
idk
i plan to use it to spawn an item on the ground based on the spritename of the obj
but if its client sidded then it will spawn x amount of items based on the players online that recieves the trigger maybe
ill try to
triggerEvent("OnObjectAboutToBeRemoved", obj)
interesting, the GameServer triggers have been removed in build 42 (i assume your screenshot is build 41)
it might actually be client only in build 41, unless they were just moved to packet code (which is removed from the public build so we don't have it)
its server
yes
which means i cant trigger it that way sinc eits a server event im about to find out
the trigger in IsoGridSquare is shared, the method it's in is called in a lot of places including GameClient in one case
it works on both
oh snap my bad the other one was on shared and another was manual added using console.. but yeah since vanilla uses it on server then iits confirmed that its both.. ill just use it server sided to be safe
Might want something to differenciate
too late at this point, i wrote most of that stuff like two years ago
Am I crazy or is it absolutely necessary to have custom animsets in ./42/media/AnimSets AND in ./media/AnimSets even if I'm just making the mod for b42?
When uploading a mod for the first time, do I have to give it a workshop.txt, or does the game do that?
yes, it is absolutely necessary
for some reason you have to make one for it but you should leave it empty
Thanks for confirming, I was pulling my hair out trying to figure out what was wrong, but looking at other mods with custom anims I noticed they all have it in both places
the bug is that the game scans ./media/AnimSets for names of files to load, but when it actually loads them it uses the common/version folders correctly
so the contents of the one in ./media technically doesn't matter at all, it just needs to exist
Aah okay that makes sense
i remember telling people to just wait for TIS to fix it any day now before they make animation mods... that was about three months ago π
Hahaha damn, hopefully whatever fix they put in won't break everyone's stuff when it comes π
Is there any easy way to make every zombie wear the same outfit?
Yup, bug
Yea it's been there since unstable release....
How would you do this?
If anyone on here accepts payment on fiverr or similar for modding please message me.
I'd like to see a mod that adds end game goals like repairing a dam, electrical station, or summoning bosses to collect their badges. Something that takes serious hours and forces the player into peril.
If this isn't allowed, please feel free to delete this.
B41
There's a commission channel on the Zomboid modding discord... Search for "commission" here and you should find a link.
Do you have the ideas for what you want sketched out in more detail than the very high level concept? That will help a lot of you're looking for a programmer, having specifics of what you want
And how it would actually work in game.
Woohoo, making some good progress finally. Just need to make a kicking and a breaking animation, and get the transitions right
Hello there, I have a small question concerning Lua and InventoryItems in Build 42.
I'm having trouble choosing a way to differentiate between Bags and KeyRings.
I want to get all wearable items but as bags arn't clothing, I get all InventoryContainers, except well KeyRings are InventoryContainer too.
Right now I'm considering using something around the like of item:getDisplayCategory() == "Bag" to extract bags, but the display category seems to be pretty inconsistent.
So I've been thinking about matching a pattern against the item type as such item:getType():match("^Bag_") as they seems to be more consistent.
But still, I am wondering if there could be a better way to get all wearable items at once (Both clothing and bags) or was I on the right track ?
Thank you in advance.
instanceof(item,javaObjectName)
Replace by the type of java object you are checking
Each item types are a subclass of item
KeyRing is a subclass so check for it
Thanks for the quick answer !
Do I need something else to get the subclass of an InventoryItem to use with instanceof() ?
Right now using :
instanceof(item, "KeyRing"))
Where item is of instance InventoryItem doesn't work, which seems to be expected.
This returns true if item is a KeyRing
Well there must be something wrong with my code then, let me triple check
Alternatively don't use the display category but get the item category
I think it should ?
Aren't both KeyRing and Bag of the Container category ?
Also maybe I should have precised, but I'm working on Build 42
Considering the following snippet
---Is the passed InventoryItem a KeyRing ?
---@param item InventoryItem
function IsKeyRing(item)
return instanceof(item, "KeyRing");
end
---@param playerNum number
---@param context ISContextMenu
---@param worldObjects IsoObject[]
function DrawWearWorldItemMenu(playerNum, context, worldObjects)
-- ... Code here ...
for _, worldObject in ipairs(worldObjects) do
-- Skip any object that is not an InventoryItem
if instanceof(worldObject, "IsoWorldInventoryObject") then
---@type IsoWorldInventoryObject
---@diagnostic disable-next-line: assign-type-mismatch
local worldInventoryItem = worldObject;
local inventoryItem = worldInventoryItem:getItem();
dprint("Is " .. inventoryItem:getName() .. " a KeyRing ? : " .. tostring(IsKeyRing(inventoryItem)));
end
-- ... Code here ...
end
-- ... Code here ...
end
Hmm then instanceof is the go to probably
Anyone happen to know why my animation is playing so quickly?
I tried adjusting the SpeedScale in the .xml but it's not making any difference. The animation is 186 total frames and I used Mystery's Rig. Playing it in blender at 60fps looks perfect, but I can't get it to slow down in-game.
Well not that I found but I'll keep looking
Modifying the fps in Blender will modify the in-game speed too
Ah okay, I'll mess around with that then, thanks!
The default setting was 25 fps and that was playing too quickly as well, but I'll experiment with it and see what works best
Hmm, it's got to be something else that I messed up, because no matter the fps I set in blender or how much I space out the keyframes it still plays super fast. Checking the animation in-game using the animation viewer have it looking correct.
Ah, I think it's being affected by walking increasing the speed of it, because if I make it my idle animation and stand still it's playing properly, but when I start moving it speeds up.
Wait it's not a vehicle lol ?
Nah I made it an item that just attaches to the player, I looked at a wheelbarrow mod as reference. I figured trying to make it a vehicle would be way more difficult and impose some limitations
True
That's cool !
Haha thanks! With it being an item I can also make it so it's foldable which decreases weight so you can attach it to/put it in your backpack and bring with you everywhere
Yeah definitely the defaultWalk kicking in that's messing it up. I set the vanilla defaultWalk speedscale to 0.2 and now my animation plays nicely, but I'm moving super slow lol.
Guess I gotta figure out how to override the defaultWalk completely but still make it so my animation moves the character π€
Also we have a better rig now
Mystery's rig is bugged
Use Paddlefruit's one
Blend time ?
Cheers I'll give it a try
Not sure tbh, I got it to work so that my scooter kicking xml is overriding the defaultWalk, but now my character isn't moving, and even though it says the animation is playing in anim monitor, nothing happens. I'm guessing the animation is tied to the movement speed, so once I can get it to move the character maybe the animation will start working too
Is there a tutorial on that one? I kinda figured it out, but I liked how Mystery's was automatically adding keyframes when moving the limbs
Automatically adding keyframes is just a simple button in Blender
It's the button that looks like a record button
Also the rig has a tutorial on the Github page
Ah yeah found it, thanks
Paddlefruit was developped by Paddle and a few animators for the game that have some experience with PZ animations, the various issues with the available rigs etc
So overall it's Mystery's rig ++
Cleaner IK structure and fixed PZ default rig to be able to use mirroring and shit
Ah sweet, yeah I can tell it looks cleaner, just gotta play around with it a bit to get used to it
I'm guessing from the readme that I'll have to mess around with the translation data too in order for my character to move.
Well, I know what I'm doing the next couple of hours lol
Translation data needs to be used whenever the character needs to move yes
Trying to find where to ask about a mod being created. Is this the place?
You mean as commision? There is community discord with system in place for requests
Where?
I mean it should be simple enough. Pause if hit 50 health. I have died to many times while doing crafting for being overweight. Would be nice if there could be a safety in place.
Sorry. Playing PZ
Unless they recently changed it (which i doubt), if you exceed your carrying capacity to the point of taking damage you will stop losing healt at 75%
did you try item:isKeyRing()?
Was ripping clothing and weight went over 65 for some reason.
I'll check my mods so thanks for reminding me of that update.
The modding Discord is actively looking for people who have experience with animations who can help animate horse animations for an upcoming mod managed by the modding community. A rig is already made for the horse in Blender and implementation of the horse animations in-game is already taken care of. We currently just lack the proper talents required to finish it !
If you are interested in becoming a contributor, join the modding Discord (https://discord.com/channels/136501320340209664/1125248330595848192) or DM me !
You can see the whole project and the current plans here:
https://trello.com/b/7qt7QpBM/horsey-time-zeehaw
Organize anything, together. Trello is a collaboration tool that organizes your projects into boards. In one glance, know what's being worked on, who's working on what, and where something is in a process.
Let's Cook
https://steamcommunity.com/sharedfiles/filedetails/?id=3446732380
Version 1.03:
Code clean up
Fixed; counting items already added to base item of evolve recipe
Fixed; open radial menu for specific item when right click and selecting "Lets Cook" menu item
Fixed; check if base item has enough water in it, if it needs water
To do; Press and hold (or right click) to add 2 or 3 items per ingredients
To do; Test using controller
New things learned:
The number of items already added to a base item:
local ingAlreadyUse = evoItem:getExtraItems()
The number of spices already added to a base item:
local spicesAlreadyUse = evoItem:getSpices()
Beware, for spices check if evoItem is of type Food:
instanceof(evoItem, "Food")
nice
is ANYONE so kind to personally coach me how to make mods? no need for call, but js a starter pack of what to do, (ideally including b42), i tried this: https://www.youtube.com/watch?v=-yrmCAwzTbY&t=153s but i think i need answers to some of my questions too, thanks beforehand π enjoy yalls days
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 there a b41 mod that makes well water tainted?
Would it be possible to make all zombies the loaded area around the player walk out of the loaded area and despawn?
I've never seen one, and with a cursory look through the workshop, I didn't see anything
Brother codes with Notepad++ in his video, I've seen enough 
Cuz I like the implication that b42 has with tainted well water.
It implies that the knox virus was/is water borne, but can be filtered using proper filtering methods (hence why plumbed water isn't tainted)
But I haven't seen a backport of this feature
There might be a way but involves some complex stuff possibly, and unsure if that's really possible
I headcanon that tainted water contains the version of the virus the player is immune to, hence why it makes them sick/can kill them, but doesn't zombify them outright.
This head canon is the only reason I'm okay with rain water being tainted
Rainwater isn't safe to drink IRL without boiling it
I've seen Bear Gryll's drink much worse and be ok-ish
yeah but nowhere near as dangerous as it is in pz for sure
Is there any "easy" way to make zombies pathfind away from something?
i've never really understood where TIS is going with water in general π rain water is tainted, but every tap in the entire game keeps 20+ litres of fresh water in it forever? also it seems like every other update tainted water flips between 'mild nuisance' and 'insanely lethal'
maybe they donβt know either xd
I'm driving myself insane with this, which means it's probably simple.
How can I get the players currently selected "bag" in the inventory pane?
just messing around Iβd guess until some form of recyclable water is added as a possibility, like chemical filtering or whatever. Are piped sinks filled from rain still clean?
yeah, the piped sink is always clean even if the thing they're piped to isn't clean
that could always change but I canβt recall how high a priority water systems are on their roadmap, canβt imagine v high
you should add a sandbox option to water goes bad that makes wells and pumps tainted π
i wish lua was strongly-typed
honestly probably should
I'll give you a kiss if you do
wells never really bothered me because they're rarely in good spots anyway but getting rid of easy infinite fresh water sources is definitely in scope
tainting any groundwater sources after x amount of rain cycles would be immersive
maybe sipping on toilet water should be bad
Some modded maps have very convenient well placement, so it would be a good coverall
but like, also, chemical water filter systems could also be a potential add
tho idrk much about water contamination and the chemistry to know what would automate the process other than like, boiling it
to get rid of the bacteria
I guess a mod that focuses on more water filtration methods + no easy infinite water would be dope
Where does the game store outfit definitions?
media/clothing/clothing.xml
Can I create a zombie outfit with a piece of clothing that is a particular color?
Still struggling hard with this damn animation.
When it says to "animate the location of the 'CTRL_TranslationData' bone", is this what it means?
The modding starter pack is "find a mod similar to what you want to do, look at how they did it" and a link to https://pzwiki.net/wiki/Modding
Then when you have a specific blocker ask here.
Yes
Should be that
Dang, I think it might be time to put this one on the shelf for a bit, I can't figure out how to get him to move.
I put my xml in AnimSets\player\movement and I can see that it triggers correctly in the anim monitor, but there's no movement and the animation doesn't play.
Animation doesn't play ?
Then that must be a completely different problem
I suggest you ask in the modding Discord in the animation channel
It plays if I put it as my animation in my idle anim xml, and it plays if I don't put the kick anim xml in the movement folder, but then the speed is all messed up instead
I'll give it a shot, thanks
Does plumbing a rain collector to a sink no longer purify the water in 42.6, or is that because Easy-plumbing is just taking the original liquid instead of converting it to water?
I want to try plumbing a whiskey tap...
Can I disable entire lua files using sandbox options somehow?
what happens when you don't pay attention and just save all
I like how you think
Can you describe your goal in more detail?
add this at top of your file
if [yourSandboxVar] then
return
end
But sandbox variables are not available when the files load.
I have a zombie outfit and hair file that override every zombie's clothes and hair, and I want to be able to disable that with a sandbox option, but I don't know if the haircutOutfit insert needs to be done before loading the world, and if it does, what to do then
oh you may correct
OnInitGlobalModData is the earliest event you can use with sandbox variables.
So you can attach a function to that which starts with "if MySandboxSetting == false then return"
What do you mean by "weather iso"?
If you want to affect the weather look into the climate manager, which can get using the global getClimateManager() function.
https://steamcommunity.com/sharedfiles/filedetails/?id=3453311433 Quick mod so I can wear a different watch instead of "would you like a red or black digital watch for this playthough?"
Anyone know if there is a way for items in item scripts to inherit from another? For example, I decide to create a bunch of variants of an item like a security camera. They all have some consistent properties such as tags, but they might also have some properties that need overriden such as FOV. Basic OOP stuff with abstract objects and concrete ones.
I wish that feature existed!
Zomboid goes the opposite way - you often have to have more than one definition for an item becasue "black digital watch on left wrist" is a diferent item to "black digital watch on right wrist"
Then another two items for the red version, and another two items for the gold version.
Oof
Nop
Kind of assumed that but was hoping
do not be tricked, scripts are not in any sense a scripting language
it's just raw data like json or xml
And I am once again missing rimworld's XML approach
Oh I got you there, it's just fancy serialization
You're wrong: it's not fancy at all.
π
i hope they'll consider doing this in the future since both mods and vanilla have huge amounts of nearly identical items
There is some improvement n B42.
For example "torch" and "torch with no battery" are no longer two seperate items.
Fancy is just a nice way us poor people say "obtuse and/or overly contrived"
In that case, Zomboid is so very fancy.
You have to give them at least some props for wanting to build it from the ground up. But @bronze yoke I agree, it would be a neat addition. From what I can follow on the changes from 41 to 43 they're starting to change the API structure to be a little less of a mess, so... Maybe?
I don't think it would even be a huge amount of effort to add "InheritFrom = Base.TemplateItem" to the parser, that just copies all the fields from the source template item.
(provided the source was loaded before the new item)
Ever since you mentioned the XML thing a part of me has dreamed they'll convert scripts to a format like that in the far future
But I know that is not likely to actually happen π
I don't think they will, but we can dream.
Having it would make creation of frameworks a little cleaner
It would make a lot of thing much easier.
The rimworld "components" lets you add a comp to soemthing. Want a heater? Add the UsesPower and CrreatesHeat comps to something.
Zomboid has everything tied to monolithic java classes.
they've pivoted to that in b42
At least for that part it seems like they're going in that direction
but all legacy systems are unchanged
