#mod_development
1 messages · Page 142 of 1
For parse script to work you'd need the string to be the contents of a script file
This is actually probably advanced so I can help write it up when I'm home
I was going to suggest something else that's kind of advanced 😅
what's up?
Which would be to generate the functions too - so you don't have to maintain those either
i love how my mod images are just random screenshots with text added with mspaint
these are all superb suggestions
defenitely adding them to a list because it would be cool to structure it like that
So ideally for you to add new flavors you would need to just add the texture/name to a list
Assuming their stats are all the same?
yeah except the empty one
That's how I structured namedLit
Trying to practice more segmented code writing -- I was able to breeze through a massive overhaul of that mod because of it
i should be better at it
rn mine is basically just one lua file
kinda messy
it works tho
1 file is fine, it's more about not being afraid of making multiple functions
A good indicator I use is if there's any repeated code it could probably be it's own function
while you're here I have another question
local opt = context:addOption("Vape", isVape, callVapeAction, playerObj)
Right now i add my context menu like this
it adds it to the bottom of the stack
do you know of a way to move that to the normal "eat" position
like move it up in the stack
i'm not sure how to even google that one
i was checking iscontextmenu.lua but didn't see anything
how does the vanilla cigarette handle it?
food item with custom context menu parameter i believe
{
DisplayCategory = Junk,
Count = 20,
HungerChange = 0,
Weight = 0.005,
RequireInHandOrInventory = Matches/Lighter,
Type = Food,
DisplayName = Cigarettes,
StressChange = -5,
Icon = IckySticks,
>>>>> CustomContextMenu = Smoke,
CantBeFrozen = TRUE,
OnEat = OnEat_Cigarettes,
StaticModel = Cigarette,
EatType = Cigarettes,
WorldStaticModel = CigarettePack_Ground,
CustomEatSound = ,
}```
yeah
that's how
but mine is a completely new context menu
wait theres an insertOptionAfter
i'm just blind

There's other addOption functions
One is for addToTop, here's another for add before/after another specific option by name
there's also a way to make the tooltip a different color, right?
In its rgb values yes
do you know the function?
right now the tooltip is just set in the item definition script
not in lua
idk how to set a tooltip in lua
Do you wqnt your option to have a specific color?
yes
Im looking through ISContextMenu but there is no option to specifically change an options color
You could set a new background color and a new background color on mouse over
LOG : General , 1680184445003> ERROR: Missing translation "-- Out of juice"
this is in relation to the item script parameter
Tooltip = -- Out of juice,
how do I get that to stop?
I tried setting the tooltip in a lua function via a translation instead but it still gave me the error
hey, so dumb question
I'm making my first mod
and I'm trying to override the base game Frog item
This works for changing the icon but the display name stays as Frog
would you need to create a translation var like UI_xx_out_of_Juice = whatever and then use that var instead of the actual string?
Prob wrong and made no sense but that is what i had to do with mine to fix the translation errors i had
okay try this
set a parameter onCreate = frogSpawn
in media\lua\server create a new .lua file
in that put
function frogSpawn(item)
item:setDisplayName("Unidentified Frog");
end
this makes it so every time a frog is spawned, the frogspawn function is called on that specific frog, which is then renamed to "Unidentified Frog"
thank u sm! I’ll give it a go
=(
You cannot change the tooltips contents aside from the text
But you can mimic it alongside it
I also do this for named Literature
To spoof the color values for literature since my mod makes them all 0
b42 feature when?
Sounds like something that's a consistent ask here in the mod dev chat.
Yeah, Konijima wrote a tooltip API for the former community project
I'd have to ask him if I can use it for it's spiritual successor
What I do in namedLit is hijack the tooltip render and stretch the box down based on font heights and lines, then fill the area with text rendering
I'm saying that this shouldn't need a hacky workaround if simple changes are made in the vanilla code.
Yes, but in the meantime we can flex our modding skills
Thanks! Current plan is for it to turn frogs into mystery box style collectibles
Also the hackish part of stretching is due to me wanting to keep the vanilla box
with maybe eventually pocket kitten style pet features
It would be more stable if I just added a box below
I mean.. sure? I think it's a flex when your time is spent modding what you're actually modding.
Fair, but pragmatically theyre working on other stuff that is new content
Stuff that's good in the end is still pushed back if outwardly no changes can be seen
Okay that's it
Simple fixes and documentation are current items and actively being worked on. I think now's the right time to request an improvement in this area.
I'm spending today learning to understand that damn mod down to the detail
Because it keeps being relevant to what I need to do
It at least got the context menu in the correct location now
Been too busy to work on any PZ projects this week..
hey, I'm sure I've done something dumb but do you have any idea why this would happen when I try to spawn a frog?
function frogSpawn(item)
item:setDisplayName("Unidentified Frog");
end
Look for the error line
Under the files
"tried to call nil" means what ever you're calling doesn't exist
How do you parse the function?
Didn't someone yesterday say setDisplayName is a script function?
You want "setName()"
ive crammed too much into my brain in a short amount of time
Thank u all sm!! That worked
is there a way to check current zombie population?
@sour island I'm digging through your named lit mod for the tooltip stuff right now
you put a ton of work into this
good job
Can you add an already cooked item to loot tables? I know you can find cooked meat in ovens but looking at ProceduralDistributions.lua I can't figure out how they did it.
Not at home to take a look, but the meat in the oven may be a random "story" from the Java side. There are a few hard-coded (but randomized) "table stories" that define stuff like breakfast on tables; might be smth like that for the oven if you can't find it in the Lua code
Mhmmm I'd have to decompile some java then?
To look through it and see if that's the case, yes. Dunno whether there's a way to do what you want, but that'd provide insight
Aight. Just gotta find the file that contains these "stories"
fernflower FTW
Found it but it's a java function to make the food cooked directly. Mhmmm.
you could add the uncooked item to the loot table and give it an oncreate to make it cooked
stuff spawns cooked so should be possible
Could be done in item spawning
Basically I want to add cooked canned foods in kitchens
Not that I know of, I'm sifting through distributions
But you can find cooked meat in ovens and that's not in there
dang bro how much dab you hit?
You could handle it via onFill I guess
Ive seen a sauce pot with something cooked in it on top of an oven before
That's a "story" if it's a world item
So "stories" are like tables with food on it
I have an idea for a mod, I was thinking of a mod that lets you sharpen knives with a sharpener sharpening increases condition and the lower the condition the less damage it does. Sharpening would become less affective after 15 times and would have a chance to damage the knife instead after that point. Dm if you can’t help. I can model and shit
I've seen a few sharpening mods in the workshop before, might be a good start
Could you aid me? I have no idea how to use the workshop jaja
Project Zomboid - Project Zomboid is an open-ended zombie-infested sandbox. It asks one simple question – how will you die? In the towns of Muldraugh and West Point, survivors must loot houses, build defences and do their utmost to delay their inevitable death day by day. No help is coming – their continued survival relies on their own cunning, ...
You can look for mods here
Well I know that I just don’t know the inner workings
@sour island I shot you a dm a bit back
does some spring cleaning and turns their amps up to 1kw and blows off some of the dust from his speakers
Any workshop people dm me to aid me
does anyone know if loot table values less than 1 actually work? my testing is suggesting that they are just getting rounded up to 1
You mean for chance?
yes
the default table is full of values less than 1, but the results are suggesting to me that they all get rounded up
If it was rounded up you'd see a lot more of these 0.001 rifles in houses
eh, i see a lot of rifles as is
Although, speaking of that, I'm finding way more gun cases than loot tables would have me think
1 is 1%, and most containers have 4 rolls on each item. so that's about a ~4% chance per viable container, which is usually one per bedroom. that sounds about right to what ive seen
bear in mind the loot settings you use
Guns in wardrobes are 0.05% * 4 it shouldn't be so common
and yet they are?
Yeah. Weird
Maybe it's because you have like 5 different gun cases that can spawn lol
I've already done some testing that backs up my claim.
i dont really understand what you mean
the loot table i made is working fine. the problem ive got now is that it generates too much! and changing the item probabilities from 0.1 to 0.0001 doesn't seem to change the number of items generated at all.
Some tables in the distro might have rolls of more than 1
Distros get re-ran for each roll
OnCreate might work for my pre-cooked thing. Just have to make sure that it only does that when the item is in a specific container
number of rolls doesnt really account for what im seeing
id expect that if i reduce an items probability by 100 fold that id see 100 fold fewer items generated. but instead i see the exact same number regardless
I have an idea for a mod, I was thinking of a mod that lets you sharpen knives with a sharpener sharpening increases condition and the lower the condition the less damage it does. Sharpening would become less affective after 15 times and would have a chance to damage the knife instead after that point. Dm if you can’t help. I can model and shit. dm if you can help
That's one way to do it
You could also do It on prefill
The event for when loot is "found"
i'm hoping oncreate is called after the item has been added to the container, otherwise it's going to make stuff like this a lot more annoying
I don't think I've ever seen that in the code?
Never really bothered with events
But that sounds like a good place to search
(Where is it located?)
and down the rabit hole ya go.
Never to be seen again
while ya down there keep an eye out for when the jumpscare event is triggered
Considering I have the gnome alert mod I'm probs gonna get gnomed
and whats even more f'd up I still cant find the jumpscare sound either...
You could look for events.onprefillcontainer.add I believe
chuck's referring to OnFillContainer
Or that lol
Not at a PC atm
Also you may need to run OnAge() or something -- ages stuff to rotten based on world time
it isn't 
OnCreate is anytime the item is created for the first time or even when loaded?
would think so...
well i got 800 errors upon loading because i expected the container to exist, so let's see if i get 800 more when i reload
Oh he means its ran before it's added to the world
I just wanted cooked food to spawn in kitchens what have I gotten myself into
That sucks lol
yeah, i was hoping to use it to simplify the whole dummy item thing i've been doing
OnCreate should be reserved for things specific to only that item not it's location then
Dummy items?
Script replacements?
it's sort of a patchwork solution for the way item spawns work, i wrote it for a true music extension and it's seen use in a pony mod too
I mentioned this as a suggestion this morning - great minds I guess
the idea is add one item to the table and replace it with a random item from a list instead of having hundreds of items in the probabilities table
So it's a way to have control over variations with out adding more scripts?
whispers join the dark side...
Ah
it can be used for that too, but at the moment it's just being used to control spawn rates
OnFill would be better then I assume
yeah, the problem is onfill doesn't get called for zombie corpses and patchwork solutions i've been using to get around that have all fallen apart in multiplayer
Where is OnFill found in the code?
Uhh you could call on inventory drawing
that's what i've been doing but it's not working in multiplayer
That's odd - changes to modData and items works for me
i don't really get why myself
Corpses might have a particular weirdness to them
wait till ya meet player corpses
maybe if i complain on the forums they'll add the event to corpses for b42 😅
Nope no idea where to find these events
most people just use this guide https://pzwiki.net/wiki/Modding:Lua_Events
it's a tiny bit outdated but it's mostly pretty reliable
Oh, that'll help. Thanks.
is there a way to remove the top box
where it has the name and encumbrance and such
so I can just only show the custom box below it
So OnFillContainer is applied when the container is filled by the game?
You could override the vanilla tooltip render to not run on specific items
that's what i'm trying to do currently
Hello, everyone!
There is a slightly specific question: can anyone help me with checking the mod I generate with AI ?
I don't know English and for some reason I can't understand programming at all, so I'm resorting to such methods and can't check this code properly myself.
P.S. I'm Russian, so I'll be glad if there is someone who can help me in this language. But I can also communicate through a translator. I apologize for any inconveniences on this subject, if any.
Have a nice day, everyone! 
local oldRender = ISToolTipInv.render
function ISToolTipInv:render()
if not ISContextMenu.instance or not ISContextMenu.instance.visibleCheck then
local item = self.item
if itemTypes[item:getFullType()] then
injectTooltip(item,self)
oldRender(self)
end
else
oldRender(self)
end
end```
```lua
local function injectTooltip(slotsTypes,self)
local fontSize = getCore():getOptionTooltipFont();
local th = self.tooltip:getHeight();
local height = fontConfig[fontSize].y*(5)
self:setY(self.tooltip:getY()+th);
self:setHeight(height);
self:drawRect(0, 0, self.width, self.height+10, self.backgroundColor.a, self.backgroundColor.r, self.backgroundColor.g, self.backgroundColor.b);
self:drawRectBorder(0, 0, self.width, self.height+10, self.borderColor.a, self.borderColor.r, self.borderColor.g, self.borderColor.b);
local x = 15
local y = th+5
local gap = 5
self.tooltip:DrawText(self.tooltip:getFont(), "THIS IS A TEST", 5, y, 1,1,0.8,self.borderColor.a);
Do you wanna swap the places for the tooltip boxes?

If you comment that out the original won't render
i need to go to bed
i just keep getting the "i need to fix one last thing first" energy
thank you very much
Could anyone walk me through how Obsolete:true and Override:true works?
I’m trying to overwrite the Slice Frog recipe but I’m not sure how to insert the Obsolete:true
#mod_development message
recipe yeet
Ooh thanks, I’ll take a look!
Will try to work on the formatter for ZedScript this weekend.
i don't think you need to use the yeeter for that
you just need to add Override:true into your recipe
Maybe I can sit down and flesh out the documentation for Item properties.
This is what I've got
My problem is that if I go onto Frog there's two Slice Frog options
Do you use VSCode?
missing comma
where was the module person
Oh my god. I said I dread this happening, like, yesterday
nope, what's that?
yeah seeing that made me 
Laugh. I love and welcome seeing that actually.
We're here. We're in the dark future
The chaos will be delicious.
Oh ok. I saw your screenshots and thought it was VSCode.
oh it's Atom, just because it's a text editor I already had installed for Ren'Py
I should probably get Notepad++
You and other new modders are the target of a VSCode extension that's a WIP right now for helping with scripts.
That's all.
Been a project for the past couple months.
Its syntax highlighting and partial documentation should help people for the moment while other features gets implemented.
Does anybody know what event fires when a player connects to the server?
Or possibly what chain of events fire
I believe it's only client-side. If so, you'll need to send a clientcommand to the server to make your own event. I could be wrong though.
Haven't launched the game since early January.
Oh... Hmmm, That would make it... Well, more throughput requiring, but mkay
Just a bit of extra code then
So, what events do I need to hook into?
Are you looking for when they connect, or when they spawn?
I'm not sure which one would be better for my case
I need to send down Sandbox options to them
Not sure when the game is ready to receive those
I already know the functions I need to call, I just need to know when to do it
I plan to buffed the calls, so that several players joining wouldn't result in several calls
Gotcha. I think I ended up using OnCreatePlayer for that use case recently, but I think you'd probably be fine with OnConnect. I had chosen to do it when spawning because I thought I needed the player for sending a client command associated with the connection (later found out that's not the case)
I'm curious as to what your method is. I'm still not entirely satisfied with how I did it. Haven't released the mod that uses that quite yet
Well, I found out that the power grid fixing mod is triggering the sandbox settings update
So I just cracked that mod and found how they did it... And did that
I'll check that mod out then, thanks
It's just instancing a new SandboxOptions object, copying values from the current one(maybe adjusting something), then sending it to server... All on the server;s side
cracked? o.O
Glyth3r was signed there, so... @ancient grail thanks
I thought that was an interesting word choice too lol
Sorry, Just had some... pain issues
unless this is .class stuff then that kinda applies
Back pain,. Also the unsynchronized settings has been a pain in the *** for the past several weeks
I went on a week-long charade trying to find why the duct tape on our server sometimes had 16 uses and sometimes it had 4
I fixed the damn holes in the back
onconnect is no good
I do hope a fix for that is included in b42
it's called long before client commands start working
ah the hopes of the usage of ---@async 
Ah dang
And that's why I use a timeout.
Unless TIS makes it so you can execute Lua code on another thread, that won't happen. =/
Oh, so... How should I detect when a player connects?
no but you can make sure coders know it ^_^
We do have coroutines, at least, but I have never used them in a PZ context
So no idea how they work or if they work & not looking to find out anytime soon
Unfortunately that only chops up execution of code into ticks.
Yeah
Pro tip: Render code for UI Lua code is on the main thread too.
It uses the same sprite cache renderer as the game's world.
Isn't there an option to... Render it separately or something?
why likely they have that fps limiter for UI offscreen so it dont go nutz
The game's code has become too fragile to try to move to a multi-threaded solution so easily.
This is why none of that has happened yet. =)
Introducing the Reifel Quick Join mod (R-QJ for short) for Project Zomboid
- a hassle-free way to find and join community servers in your language. With our mod, you can say goodbye to typing in IP addresses, ports, server passwords, usernames, and user passwords + no more need to go out looking everywhere by yourself to find a MP server to play. Simply be part of the R-QJ mod community and select your language and hit the Quick Join button to access servers.
Plus, our mod comes with an auto-fill feature that automatically fills in all the necessary details, including server IP, port, password, and even your most used username. It's a steam cloud sync/save of your favorite community servers too. our focus on this is to offer the most friction-free way to access and play MP servers
In tech, friction-free refers to the idea of removing any barriers or difficulties that may impede or slow down a user's interaction with a product or service. The goal is to create a seamless, effortless experience for the user, without unnecessary steps or complications. A friction-free design aims to make the user experience as smooth and efficient as possible, reducing the time, effort, and frustration associated with completing tasks or achieving goals. This can be achieved through various methods, such as automation, intuitive interfaces, and eliminating unnecessary steps or distractions.
designing a friction-free experience is an essential part of a UX designer's job. It's about creating interfaces and interactions that are intuitive, easy to use, and don't require unnecessary effort or frustration on the part of the user.
(current indexed 74 servers, check the table on mods pages, and contribute too) sneak peak:
EN BR AR ES RU KO CN JP
21 3 6 5 5 6 6 1
all server data on our mod is obfuscated and lightly encrypted
consult the mod page to check if your server is eligible
https://steamcommunity.com/sharedfiles/filedetails/?id=2954954791
lol @ ad
I was just pointing out that atleast using that in documentation sense anyone looking to use it knows 'there might be a nice delay here...' plan on that.
you're posting a whole ad in here 😟
Sounds handy but those text walls sound very corporate lol
Is it a mod or a business plan
Can I counter-ad?
no pls dont.
Can you recommend me how I should detect when a player connects to the game server?
i ended up doing it on the first player update
This game is way too small to have corporate-speak in the mod channel.
I... I see
So onPlayerUpdate I do a thing, and then remove it from that event?
sorry :/ as we are missing UX people, it is important to forment an show more UX contributions
yeah, that's what i did
that part is gonna be harder than the actual syncing part huh
it seemed very abrupt recently
I have my personal org but it isn't focused to do actual business.
Wait, are modders unionizing
I know MC did a lot of this in recent years as a sort of business approach but man all the ones I tried out were abysmal.
But for PZ?
I'm just modding with focus on our server... And oh god my meds ended
That sort of terrifies me.
tbh I totally ignored that...
People come to me for comms and I refer them to others but to make a business with PZ right now?
Wait until b42.
i didn't think the market was big enough for it to be worthwhile
The last opportunity was in 2022.
oh you didnt get the whole opinion of the support for modders rating ads be happy
I think I did like 8-10 commissions last year?
Are there many mod groups? I've only seen Glytch3r's and what I assumed were just collabs from others
I mean I thought his group was like Konijima's group.. Until he tried to sub-contract me for something.
(Which I don't)
I didn't know Konijima had a group either, huh
Unless I've misunderstood that message
well i imagine it's not active anymore
It wasn't focused on comms and paid work AFAIK.
huh... I mod a bit with UdderlyEvelyn, but it's mostly helping out for her server
Gotcha, so nowadays y'all are observing a shift to what seems more business-focused
No money, just... satisfaction
I guess I haven't been paying enough attention lol
I mean.. chaos is a good currency.
I can aid in modeling in yours if you need help
Thanks for the offer. Right now focused on building modding tools for the modders.
If you ever need help just hit me up g

Damnit.. I haven't really made a content mod.
10 years and still no release of something that actually provides gameplay content.
I'm sure you hear this plenty already—I hope, anyway—but leaning into being a tools dev is noble
making this custom tooltip is going to be the death of me
I just make stuff that's like "I want this and I haven't seen an implementation of it/haven't seen one that I'm satisfied with"
Hey. Thanks! I find it to be more fun on its own.
I also think it's funny how I haven't launched PZ since January and I know that somehow I'm helping people out.
Also, you are more than welcome to hop onboard with the ZedScript extension. I wrote a mini API so people can populate the documentation for script properties.
Might contribute at some point (I tend to say things like that and then never do so & that could very well be the case here)
Don't worry.
It's how things go.
We all do it.
I'm currently mostly concerned with implementing diagnostics support for the extension.
have you found examples?
So people can see when they're specifying invalid values, or leaving off a comma/bracket? Sounds handy
Exactly.
yes
ive got it //working//
just formatting it and such is a pain in the ass
just a lot of reloading and trying stuff out
I really hope though that people do benefit from this work.
I stopped my personal project because people won't stop asking questions about scripting in here.. usually the same problems.
More workshop related question. How to add images to the description?
I use [img]link[/img]
But, instead of image I need, i get this small image
it does that when you have a bad link or a file type it doesn't support
use imgur to host it
or steam itself
it doesn't support most other things from my testing
even the official TIS forum
lol
Then how to add image/link from indie stone mod permissions thread?
https://theindiestone.com/forums/index.php?/topic/2530-mod-permissions/
These are the different levels of permissions available to be applied to your mods, so that other modders know how they can be used. After selecting the appropriate mod permission for your project, just include the relevant image and link to the proper permission in the first post of your WIP/Com...
it doesn't work
i just went through that
youll have to host that image somewhere else if you want it
i ended up just doing this
Understood. Thx
[code]This mod's permissions fall under TIS's policy [url=http://theindiestone.com/forums/index.php/topic/2530-mod-permissions/?p=36477]Credit Where It's Due[/url]
You are free to use the mod for personal use, in multiplayer servers, and even include it in mod packs! Just please do not redistribute or reutilize the files of this mod elsewhere without permission ❤.
This mod can be added to and extended by anyone in the community, but credit must be given to the original author within the files of the mod - and posted alongside the mod wherever it roams.
[/code]```
code if you want it
just wanted to say thanks to everyone who helped me out today
Frog mod basics are up and working!
Yay! Nicely done!
Maybe the image thing is a quirk with that format vs the [img=URL][/img] one?
huh wait
Oh, nevermind then 😄 that was a guess; I haven't used images in descriptions
Does it not work?
Now I don't know what to believe 
no it only showed up in mx's tool
Ah, gotcha
usually it goes the other way around
Alright, I got my thing to work. OnFillContainer event was the key
Still debating whether or not having jars give you back their lid is balanced or not.
to balance it, require 10 strength to open jar
Strong Fire Officers: "Am I a joke to you"
A better way to do it would be to add more lid spawns to the game since they're so bloody rare.
I think a separate "jar with lid" item would make sense, too. Surely some people would keep the lid with the empty jar (my mom does some jarring & I believe she keeps most lids on the jars)
The lid could be removed from that item, of course
the same way you would add an image normally. just get the image address by right clicking
Could you share some details? None method helped me so far
Idk, it doesn't work for me
can you copy exactly what you are typing and send it here
if you are copying the link it will not work. it has to be the image address
Depends on the model, and it's hard to tell in this game. But there are lids reusable for many years if you're careful enough. And many years in PZ might as well be infinite!
I'll make lids reusable for now and see how it goes. If it's too strong, then, I'll remove or make it a % chance to break the lid.
We are trying to figure oout what I do wrong in Steam
workshop descriptions?
yes
Yep
Oh I'm not familiar with that then, but it should work with [img][/img]?
i think you need to use a dif image address
try copying the image address from someone else who used the image in their mod
or upload it urself privately and use that image address
Host it to imgur or something and then use that
u should host it on steam
@twilit rune check DMs g
we already told you
that image doesn't work as an image for steam workshop description
like specifically that image
i tried all the variations back when I was uploading my mods
if you want that image, it must be hosted elsewhere
Its same for me with any other pics
I posted Imgur links in Mod Resources, it's already done for you
try imgur as a host
Check it
Here is the link again https://imgur.com/gallery/YI54Od0
I wanna make a mod where I can specify a list of items and have those items get highlighted in corpse inventories. I thought a good place to start was cooking and freezxing - they change the color of inventory UI elements - but I couldn't find where that happens in code. It feels like it would be a Lua thing instead of a Java thing.
many ppl seem to look for the ui recoloring and i've never seen someone come back and say they figured it out
Appreciate a lot
I figured out how to use grep to find the location of an item in the world and people told me finding that info at all was impossible. It was surprisingly easy.
I think I found a loose loop in ISInventoryPage.lua and will post back here if I find anything
ive decided
good luck!
i'm making a workshop description formatting guide
because its coming up so frequently
Are you a modder?
May I add this to the guide
LOL I am now
Do you mod items and stuff?
please lmao. we all wanna make it look but aint got the power
More like a padawan modder. I literally just started today but I have tons of programming knowledge and experience.
Workshop Description Editor created using create-react-app
There is an existing steam guide for the format, but it doesn't have everything
Can you colab with one on a mod? It’s pretty simple one.
who made this?
Not yet, no, I don't have enough knowledge to contribute. Maybe after I try my hand at this one.
mx
Ok!
woah horizontal rule! i needed that!
@fading horizon may prove useful, if you haven't already seen this
thanks for pulling up all the resources y'all
this helps a lot
hopefully this guide will be of use
Something to note with the HR + most of those is that when using them via workshop.txt it adds a br for each line. I place it at the end/beginning of a line to avoid that
can someone pin that pz editor?
Does the PZ dev team know "separation of concerns" and "single responsibility principle" are things and not just things but things that generally help you when practiced?
they probably do but didn't ten years ago
I say that not as a dig at them or anything like that. It's just evident looking at the Lua code, seeing UI setup right alongside logic/etc. It helps me understand why progress on this game has fairly slow-going - just finding where something happens in code is a heavy cognitive process.
On that note - I found these luaexamples but they're not commented very well. It feels like some comments detailing why particular things are there would make them more helpful.
RE: updating the colors in inventories - I'm getting closer. updateTimers feels like the right place for that sort of thing because then you can update the Cooked stat for the item alongside increasing the amount of red/blue to account for cooking/freezing.
new dumb question
does anyone know why this item always spawns with 0 PoisonPower
I'm spawning it knowing it is poison
My guess would be a mod overwriting it?
but when I edit the item in debug I can see it's 0 PoisonPower instead of 75
I'm not using any mods besides the one I'm working on
Add what tho
the imgur link
with those images
actually i'm just gonna put the images in the document itself
It's in #1070852229654917180 if that's what you're referring to
Oh! Update! I’ve figured out it’s poisonous if I spawn it in, but if I get it through a recipe (Slice Frog on a poisonous frog) it’s not
this is the recipe but I'm still not sure on what's removing the poison
@spring wind
if item:isIsCookable() and not item:isFrozen() and item:getHeat() > 1.6 then
I JUST FOUND THAT hahaha - thank you confirming that.
Ah you meant the formatting guide. Go ahead
I wasn't sure exactly where it was, but I remembered seeing it
Wait not that line precisely - but thats super close
its the same block of code
I'm surprised they don't use more constants? .... does Lua even have constants?
I'm sure you can do that with metatables
lua doesn't have constants
hey guys, i am trying to create a new texture for zombie and have that zombie spawn with a less % than the others. would I have to make my own model for that as well ? Not too sure how the texture modding works yet
if you want to arrange things so that only certain zombies have that texture and spawn less frequently than other zeds, you probably have to make that texture a clothing item somehow
Yeah, textures are universal, you'd have to make a new type of zombie, set it to the new texture, and have that randomly spawn
is there a command to turn off the power besides changing the power shutoff day to before current day?
i assume i just gotta struggle with it?
cant find much on subject
Tbh i don't know anything about zombie code, you should look at some mods that add new zombie types to see what they do
yea i have been. it is quite hard to know what they do without knowing anything about it lol
i spawned the new models but they only spawn naked xD and my texture doesnt apply
There's the setHydroPowerOn from IsoWorld, not sure how persistent it is though.
you could also try the renderdetails() function in ISInventoryPane.lua
i see
how can i decompile those files to read in vscode
I've been using this one.
https://steamcommunity.com/sharedfiles/filedetails/?id=2748451514
thanks!
Are you a modder?
Everyone who frequents here is a modder - the question is why are YOU asking?
I want to colab in a mod with someone
Lay it out then, got any ideas?
Yes
I have the synopsis here “I have an idea for a mod, I was thinking of a mod that lets you sharpen knives with a sharpener sharpening increases condition and the lower the condition the less damage it does. Sharpening would become less affective after 15 times and would have a chance to damage the knife instead after that point.”
i dont have any expertise in what you are looking for
Hmm pretty basic in terms of execution. I don't have any experience with weapon items though. I think if you start on it yourself, and just ask questions in this channel, all sorts of people might be able to answer and help
this might be a silly question, but is there any documentation for the zomboid Lua API, because I have not found any
package index
thank youuuu
thank you toooo
Hey, does anyone know how pocket kittens allows users to rename the cat items
I’ve been looking through its code but I can’t figure it out
Not sure but you can name them and everything else with the mod "everything has a name"
There's a thread for mod ideas @stuck saffron
You'll probably get more responses with a bit more detail
i don't know anything about making mods 😭
I'm directing them because they had an idea in pz-chat
That's certainly a method for trying to get people to collab, I suppose 😅
Thank you!
just wanted to know how hard it is to
A) make a TV station repeat it's shows endlessly on the day loop like they play out the first week.
B) Interject new movies/shows and stuff into the already preexisting TV channels as more shows that can play out.
I need someone to make a mod with me ,I can do all the modeling and stuff. I have the synopsis here “I have an idea for a mod, I was thinking of a mod that lets you sharpen knives with a sharpener sharpening increases condition and the lower the condition the less damage it does. Sharpening would become less affective after 15 times and would have a chance to damage the knife instead after that point.”
i think A is just setting some flags, but B is a huge pain
In debug mode while in game can I easily reload a Lua file, or reopen the debugger menu stuff like when you first load a save?
f11
and the whetstone model, the magazine model, the inventory icon, animations, and the dull knife varient icons and models.
thanks
I tried that, not a big fan
I want mine to be simple and and not over powered, I want it to just apply to short blades and long blades
Or axes
Not axes*
cant you just modify the existing mod (ask for permission and credit him) ?
Hmm I suppose
Idk how to mod tho
and that is ok but the way i see it is this. you can't really colab with someone on making a mod if you dont know how.
I would just pay someone to make the mod
I can model tho
If I asked someone to define and/or point me to what a string is etc for Lua. what would be your answer?
modellers working with programmers is a fair exchange, you just need to find someone interested on working on it
i would call it fair if it was the equivalent amount of work.
I am not saying that this mod is not.
But you can't say it is fair if one person makes one model and the other one makes a full fledge revamp with such single model
'dude it's just a string'
dude there a reason Im asking. because you likely would not be pointing me to the java 15 javadoc page for string would you?
i'm saying that's what my answer would be
okay html that to a link. I'll put that in :P
if you're curious about the lua string library, it's detailed in this chapter https://www.lua.org/pil/20.html
and I asked here cuz I figured modders opinion would be the best choice. but this why Im asking. check param's out. https://pzwiki.net/wiki/Modding:Lua_Events/AcceptedFactionInvite
i guess it's because they're technically java strings (is there even a separation in kahlua?) but yeah, not the most useful
strings are interchangeable afaik
as are booleans
things get dicey with numbers/int/floats sometimes
thats the other thing
another weekend of updating all of my mods and not doing anything new
like no its a number..
it's kind of weird that this event passes strings at all
methods to convert things into specific types would be nice
you'd expect it to pass the faction and player objects, not their names
it might have just been intended for a very specific vanilla use, probably for ui
I need of a programmer.
Still needs to be prettier, but here is everything, everywhere all at once
That’s sick asf
Ty
Hello modders, I am modeler in need of a programmer for a mod I have in mind. It’s quite simple and not over complicated. DM and I will give the premise. Thanks!
trying to implement clothing is frying my brain
I’ve somehow managed to make the player and zombies turn invisible
what masks do you have in the clothingitem.xml active?
depending on the amount of masks it can mask the entire player/zombie its on
I’m gonna be honest
I saw that
Thought to myself
Oh this is a hat not a mask
And deleted it
Do you know what it should say?
Helmet
this is what my mask one says
gimme a sec to grab one of my helmet.xmls
ooh thats too large
thats what one of my helmets say for the .xml
(static) btw not skinned
skinned means its weight painted and already bound to certain bones via weight paint
hope this helps ya
Thank you! I’ll let you know how it goes
I still can’t see my hat but I’m no longer getting lots of errors which is a definite improvement
I think I might have to go back over it tomorrow
npnp
when are vehicles spawned when creating a world?
would making changes to vehicle distribution tables in the sandbox options and then linking that functionality to Events.OnInitWorld work?
does anyone know why the tooltip for my hat would be blank and this would come up + hundreds of errors when I hover over it
it also crashes if I try to inspect it
item hat
{}
hmmm
I think you're missing a Weight = (number) ,
2nd from bottom
all items need a weight afaik
hmm does the tooltip show up?
what is this for?
oh sorry, I read it, sometimes the responses are faster than the action
awesome though, never knew you could input some of these into the descriptor and get cool categories like that
this looks really cool
thank you!
I don't want to spook you, but the formatting changes if you instead post bbcode in a comment or a discussion post
wdym
links are different in discussion posts: they are underlined
comments: just don't work sometimes?
well
regardless, hopefully this will help at least one person
and if it does, that's worth it
plus i just fucking love making spreadsheets
is that Zyzz? @glass basalt
I believe authors can also use codes in comments where users cannot
Specifically for bolding and headers
I believe it is just h1, b, and i
links and other code does not work in my experience
kinda got interested: does anyone else do this? my to-do list for my mods
ah, so it's the other way around. thanks!
do what? keep a to-do list?
ye
i know i do
if i'm being honest i have a bad habit of just adding things to it and never actually going through the stuff i have to do on there, but i think everyone who's been modding for a while should keep one
this is my bad habit for all of my to-do lists
I didn’t know you made this mod! I have subbed when it was first released. Great idea dude, is that a sneak peak of part 2?
I have a whole list dedicated to merging to-do lists. the list for lists 😂
yeah, he's been at it for a while
im sure i sound like a broken record at this point, but im stuck on figuring out why this function isnt working:
RandomItems.AddToLists = function(ProcList)
for i=1, #SuburbsDistributions do
for j=1, #SuburbsDistributions[i] do
if SuburbsDistributions[i][j].procedural then
table.insert(SuburbsDistributions[i][j].procList, ProcList[1]);
end
end
end
end
explain to me what you are trying to do
are you trying to add an item to distribution tables?
or add a whole table into another distribution table
both.
have you looked at procedural distributions?
yes
ProcList[1], do you want that always to be one?
placeholder
what isn't working
[1] is just the only entry in the table until i can get the function to work. then i can add to ProcList as I like
im trying to go through the full list of distribution tables. some are procedural lists, some arent. this loop is for adding an additional procedural list to the procedural tables
Yea, working on the UX to be smoother
That is great man! Congrats again
one issue i can spot is that SuburbsDistributions[i][j].procedural will give you an 'attempted index of non-table' error if it isn't a table (and looking at the distributions table this will happen)
not sure if it's the only one but there's some isShop booleans in there
SuburbsDistributions is a keyed table
oh, i'm missing a bigger issue here
you can't use [1]
they aren't numeric indexes
table.insert(SuburbsDistributions[i][j].procList, ProcList[1]); already works fine. ive tested it.
i really missed the forest for the trees 😅
its the for loop iterating through the full distribution list that isn't working
for i=1, #SuburbsDistributions do
for j=1, #SuburbsDistributions[i] do
SuburbsDistributions doesnt have numeric keys
you should be using pairs
The snippet I gave you for replacing parts of a nested list would work for any part of that list
RandomItems.AddToLists = function(ProcList)
for _,room in pairs(SuburbsDistributions) do
for _,container in pairs(room) do
if type(container) == "table" and container.procedural then
table.insert(container.procList, ProcList[1])
end
end
end
end
```something like this
local itemsOverride = {
"item","chance",
"item","chance",
}
for roomID,data in pairs(SuburbsDistributions) do
for containerID,contData in pairs(data) do
---if room's container's data has an items list OR if it has a junk list with items
if (contData.items and #contData.items>0) or (contData.junk and contData.junk.items and #contData.junk.items>0) then
contData.items = itemsOverride
contData.junk.items = {}
end
end
end
This is what I gave him yesterday for context
i'm going to be honest, i do appreciate the help but im not that good at reading code and you threw a lot at me that just left me really confused and without an answer to the question i actually asked.
You're trying to parse through a nested table - the first two nests are not numerically keyed - using a for loop that counts up won't work
you're trying to do SuburbsDistributions[1] in a table that's indexed with text like SuburbsDistributions["aesthetic"]
right. but i didnt even know how to make a for loop in lua at the time. and i just wanted to figure that out.
im only really figuring out what pairs() even does
It splits the keys and values for key,value in pairs(table) do
makes a set of paired variables to call in the for loop - but the order is not guaranteed unless the keys are numeric
Notice the middle for loop doesn't print anything
Surprised it doesn't toss a warning or error though
Also pairs() on a non-keyed or numeric keyed table works too:
Does the proclist matter if you're scrambling the items for everything though?
i cant get around the fact that item probabilities below 1% are seemingly being rounded up to 1%.
Are you testing this in a zombie free world?
the item list contains 1500 items, and most containers roll 4 times on each one. so nearly every container ends up stuffed full of crap even on the lowest loot settings
you can set their rolls to 1
sure, but that still ends with an average loot density about 60 times higher than i want
also at 1500 items you're going to get alot of items regardless
i had mistakenly assumed that since the developers use values below 1 that they actually worked
they do
the reason you're seeing so many items is because every item is rolled for individually
more possible items = more items
you could try dividing the chances by 100 or 1000
yes, i know. but ive also tried probability values below 1/10000 and im still getting full containers
i get the same same number of items returned whether i go with 1 or 0.00001
i know extremely low numbers cause issues but it's not as bad as capping out at 1%
even at 0.00001 i was getting DUPLICATES of single items. which is just such a minute possibility that i shouldnt have seen it occur multiple times in a handful of attempts
did you try setting the rolls to 1
- if you're testing in a zombieless world the lootchance is like 400%
you should verify actual loot drops with the loot tool
they're right that at 0.00001 multiple rolls still shouldn't land, that might be below the level at which the probabilities start messing up
there's definitely something going on
every attempt was done on a standard apocalypse sandbox with loot set to normal because normal doesnt apply a modifier to loot
@bronze yoke How do you activate the loot tool again?
you turn it on in the debug cheats menu and then right click the container icon in your inventory
every attempt being a new world?
yes
here, i ran another test for demonstration
all = {
bin = {
rolls = 10000,
items = {
"ScrapMetal", 0.01,
},
i got an average of 40 scrap metal per trash can. which equates to an actual item generation rate of 0.4 instead of 0.01
thats 40x higher than expectations
there's other factors impacting loot spawn
if you check the lootspawn tool you'll see the in-game chances
there are, but if ive done all i can to negate those factors and the loot rate is still FAR above expectations, then im out of options
population density has an impact
population changes loot?
yeah, areas that spawn more zombies have more loot
then continuing my test, id expect riverside trashcans to have less scrapmetal than the muldraugh cans ive been testing at. so far the average is actually higher
how do i see these things with the lootspawn tool?
turn on lootzed in the debug cheats menu, and then right click the icon of the container's tab in the inventory
V1 of a steam workshop mod description formatting guide i'm making just released
hope it can help someone one day
wait
how did you do in the google sheets (excel) ?
are they just nicely formatted tables??
thank you, i can see the numbers now... im just not sure how to interpet 63% chance from my 10000 rolls test
that is what it looked like. that looks awesome lmao
took like all day
barely even worked on my mod
i guess it wont be releasing today after all
Friday is a good release day though
friday is the best day
i did manage to find some trash cans in more remote locations that only had x10 the drop rate i put in instead of 40 60 or 80x
increasing the drop rate might fix it
very low numbers don't work properly because of some kahlua bug or something
increasing the drop rate isnt an option for what i had in mind, so i had to scrap the plan. thats the conclusion i had reached this morning
also, any idea if population density altering loot still works this way when using uniform zombie distribution?
no idea
its so frustrating how obfuscated this is
to answer my own question. tested uniform zombie distribution. it changed the amount of scrap generated by trash cans in each area. but not in any way that makes sense.
Mixed this up w a different server?
it looks like somewhere between 0.1 and 0.5 the number of items generated starts approaching the actual expected results
Zomboid\Saves\Multiplayer\savename\players.db
"Sledgehammer", 0.001, "Sledgehammer2", 0.001,
seems to be the lowest value
you could shave the chances down and cap it using math.min()
i dont know man, even at 0.1 i was getting x10 what i should have
which is why i assumed previously that it was just rounding up to 1. it just turns out that the truth is far screwier than i had anticipated
im doing tests right now that prove its not because of the rolls value
i think ive thoroughly disproven the rolls theory at this point
you said you have duplicates of items
that would only occur if you added duplicate items yourself
yes, but im running a much more narrowly focused test right now that proves what im saying beyond the surprising mod results i pulled up this morning
im testing with trash cans that only contain one item in the drop list
ive run multiple probability tests that SHOULD have resulted in cans generating one scrap metal on average. instead i get 40-80
that is one HELL of a margin of error
Why do you think it's supposed to be 1?
because 10000 rolls x 0.01 drop rate = average 1.
and 1000 rolls x 0.1 drop rate = average 1
and 200 rolls x 0.5 drop rate = average 1
instead, i get 40+
10,000 x 0.01 = 100?
which is divided by 100 because the loot chances are in %
that's not how probabilities are combined
large number probabilites. the larger the number of rolls, the more likely the result over multiple iterations will approach the average
Also, idk if this helps but this is the loot calculation: (10000) <= chance(modified by luck) * 100 * lootmodifer + zombiedensity * 10
loot modifier should be sandbox settings yeah?
but how is zombie density calculated?
it's based on the map zones I believe
well, on the 200 rolls test the results came out nearly as i would have expected. its the 1000 rolls and 10000 rolls tests that were giving RIDICULOUS numbers
try making the scrap metal 0.001?
even worse results
im getting MORE metal
literally every trash can is FULL to capacity with scrap metal now
no matter what you think of my math you cant argue that 100,000 x 0.001 = 10,000 x 0.01 they should be the same results. but instead, 100,000 x 0.001 is equaling a larger number
yeah, it's definitely weird
and i think your math is correct and i was thinking of something else anyway
@sour islandI've been digging apart your named lit mod code to see how you do the tooltip rendering,
I've gone through most of the code and made adjustments just to test if it would work for me and it does ; however, the vanilla tooltip is still showing.
Do you happen to remember how you hid the vanilla
because mine is basically the same idk why its not working
Modeler in need of programmer for a mod, dm and I will fill you in on the details. Thx!
I didn't hide the vanilla, I warped it
Made the default tooltip longer
Then added my lines over the extra space
If you replace the vanilla render function the vanilla tooltip shouldn't appear - I would assume?
i would think that's what this is doing
if its not a vape, do the regular render
but if it's a vape, render the custom one
so it should only be rendering the custom one I would think
Modeler in need of programmer for a mod, dm and I will fill you in on the details. Thx!
please don't start doing this every 10 minutes..
I need help
Idk what you expect
well posting it again in the chat when theres been literally 10 messages since your last post which was exactly 10 minutes ago
everyone still sees it fam
Where do you reccomend I go to get help
i recommend you be patient and wait and hope that somebody comes by that wants to help
🙂
or go try to learn it yourself
Hello need help .
You are closer and closer to perfection brother, keep it up! 
lua/server... if that was a code ?
alright, im seeing that some of the procedural loot lists dont have a weight selection on them. i'm not getting errors adding a second procedural list, but does anyone have any idea how they interact? does it default to the first list? or does the first list get a default weight value?
@maemento i have never heard of the vapes you that you are using in your mod until i started reading this channel. I am gettings ads about them now on tiktok
lmao
the only ones i see without a weight are ones that don't have any competition, in which case a weighting wouldn't do anything anyway?
i might be missing some though, i didn't crawl through the entire distributions of course
which causes a problem if i add a second list with a weight, doesnt it?
ah, yes
we're getting there, slowly
actually, should be fine
im not confirmed yet, but i think the default weight is 0
the default weight is -1, if all weights are -1 then it just picks randomly
actually no... if the weights total to -1 it picks randomly... that seems like an oversight
i have to set a weight to my added list because it also gets added to other list lists that do have weights
yeah, it seems like having multiple with no weight would be bad anyway... you might have to add weights to the ones that don't have them
yeah, im already trying to figure that one out and am getting errors. so it goes
and then theres the forceForTiles that i have to deal with. and the non procedural containers after that
how do you check if a value exists in lua?
thank you
if var won't work in the specific case that var is false
if that's a possiblity in your data use var ~= null
nil not null
oooh fernflower command line decompile yummy
been reading too much of the java 😅
it happens
you using the actual zulu version?
ah, will adding weightChance to the forceForTiles containers cause them to appear in rooms they shouldnt?
it looks like weight is completely ignored if there's any forceForWhatevers
or rather ones with those properties aren't included in the picking for that
is that for when its the designated tile/container AND for when its not?
if it's the designated tile/container it just uses the forced one, if it's not then the weight stuff still happens but anything with a forceForX doesn't get included in weight calculations
thank you for clarifying
would have been nice if LootZod showed weights for lists
if containerData.procList[i].weightChance ~= nil then
containerData.procList[i].weightChance = 100
end
resulted in no weights being added. : /
/facepalm
i should have spotted that one on my own, thank you
with how many exceptions there are when dealing with the non procedural containers, i think im better just manually creating a list of containers that need updating than trying to program exceptions to each of them
otherwise i could end up with containers containing containers that contain containers
i was just browsing through isui and found this
and remembered someone was asking something similar
so here you go if it's relevant
oh the message is too long one sec
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
i just realized the custom tooltips don't follow the mouse
i think this may be more of a pain than it's worth
in case this ever pops up for anyone searching for it: Project Zomboid handles Unix LF line endings fine, and you can use them instead of Windows/DOS CR LF line endings
...I was skeptical about it.
why hide the amount left though?
i'm not
i just haven't added it yet
it's a completely custom tooltip
idk how i'm going to make the little bar remaining thing
could say its immersion lmao
got this working my way, and covers the most variations out of all of the mods I've seen.
nice work
Is it just DestroyResult:True to remove the result of a recipe?
anybody knows how to disable button
I want to disable NEW CHARACTER button. just disable it not delete
depends on what kind of button. ISUI elements all have different superclasses and such
local button = ISButton:new(buttonX, buttonY, buttonWid, buttonHgt, getText("IGUI_PostDeath_Respawn"), self, self.onRespawn)
RemoveResultItem:true
try looking for button.enable
either true or false
tried it but notther workds
you should make it so once its close to be empty it relieves your smoking stuff but makes you unhappy because the flavour runs out for immersion
already does
oh thats so cool
i think i'm gonna just take what i have now and put it in a stable state and release v1
i'm tired of waiting
copy2 i look into it
is that a vape mod? lol
didn't know those were around in '93
waiting for what? it's your mod lol
they weren't, it's just a cool item
Overwrite its OnClick to do nothing
whats it gonna be called? for sure gonna try it out
You may even use nil for it but im not sure
Gnomebars
oh
itll be out tomorrow prob
yes2 thanks
neat
@old crescent
ISButton.lua
function ISButton:setEnable(bEnabled)
self.enable = bEnabled;
if not self.borderColorEnabled then
self.borderColorEnabled = { r = self.borderColor.r, g = self.borderColor.g, b = self.borderColor.b, a = self.borderColor.a }
end
if bEnabled then
self:setTextureRGBA(1, 1, 1, 1)
self:setBorderRGBA(
self.borderColorEnabled.r,
self.borderColorEnabled.g,
self.borderColorEnabled.b,
self.borderColorEnabled.a)
else
self:setTextureRGBA(0.3, 0.3, 0.3, 1.0)
self:setBorderRGBA(0.7, 0.1, 0.1, 0.7)
end
end
function ISButton:isEnabled()
return self.enable;
end
use setEnable(false)


