#mod_development
1 messages · Page 141 of 1
it gets called when made by itemfactory
from a previous comment i found in here
lol.. 
hm, I didn't know such a function was a thing
i never knew
watermelon ice
Omg it’s actually there ❤️
its the normal tuesday update/auth nonsense
OnCreate pass InventoryItem object and this obj have no setDisplayName method
that and your random isnt the same length as your flavours?
i trimmed the table so the message wouldn't be so long
🙂
but problem is it will be same item and need to expand item panel each time
You can change item names
ah
better to do a few items
it's just setName()
wdym
it will be same item so it will stack of items instead separate items
hopefully this is changed when item variations are a thing
hmmmmm
I made some of my mods stack based on types
do I go with the flexibility of having it as one item with stacking issues or do i make 16 different flavors
i think i can live with the stacking issue
also I dislike handling vhs tapes for this reason lol
Thank you very much
if u want to do it for workshop and not exactly for urself then better to think will it be good for everyone
well the random assignment idea was cool but I guess i'm gonna have to do different versions for each flavor then
damn
thank you for your help
oh shit
no it doesn't
it separates them automatically
lets GOOOOOOOOOOOOOOO
it changes the name in the spawn window too even though
and this makes it so users can't spawn their fav flavor
so individual items may still be better
is that important? What do y'all think
unspawnable items are bad practice
player spawning is just for debug
and no, USB-C charging doesn't exist in 1990 so you can't recharge them

that's my lore and i'm sticking to it
when it's out of uses, it changes to an empty gnomebar
which i plan to make it so you can still vape it, but you'll audibly cough and not get the smoke effects
i know vanilla metal items explode in the microwave so i'm going to make it do that just in case you try
lmfao
also explodes for unknown reason
that's the fix
if theres a car battery charger within 50 tiles, just destroy it, whatever
yes, items regardless of types stack based on name
and the chat suddenly updated
Idk why discord keeps doing that to me 😅
I just finished my Simple Vaccines mod, it's my first mod I've ever created for this game and I just wanted to thank this discord chat for the help.
Here's the link to the workshop item for anyone who wants to check it out.
https://steamcommunity.com/sharedfiles/filedetails/?id=2954167467
Change the category of the item 🥹 it deserves better
i will
just getting base functionality down first
which i'm on the last part
making all the different icons right now
kk making sure. Looks great so far btw! Congrats
thank you!!
the server should add a SME role for people that know what they are doing lol
does that to me when Im at work on my phone
looking fresh. btw did you say that they are not rechargeable ?
indeed
i don't want to go down the rabbit hole of dealing with batteries and all that
they'll be common enough that you can just find another
sounds good, i was gonna mention batteries but you beat me to it
also is there a way to have the f11 menu not take the entire screen so i can check out the changes live or it is just not supported
Edit: erase i even asked this. i can quickly f11 out of it, i thought it wasnt going to save my current stage
could just look at how flashlights do it
kinda just want to get a v1 out at least because i want to work on other stuff but feel like i need to finish this first
i feel like a different vape mod would be better suited for that anyways
a vape mod where you have one base vape item that can be recharged but theres different vape juice in the world
got the icons to change depending on the item name now
weird the icons don't persist through a game reload
this has been a pain in the ass, i'm just going to make different items for each flavor
more tedious but its easier and more reliable
if you aint planning on adding more flavors it is probably better unless you want to troubleshoot it lol, the simplest way it usually the best way
Could someone give me quick run down how the evolved recipes work?
Trying to add the ability to add some spices to marinating meat
someone was asking about making a sound for everyone just came across this lil thing... GameServer.PlaySoundAtEveryPlayer("Thunder"); lulz the thunder of the banhammer
and apparently that has a server option as well. nice.
hmmm bansteamID command doesnt use that at all.
instead of the recipe being "create Salad" the recipe is "Salad" and i think the scripts are all there too
is there anything that i can follow on how to learn to use the console system ?
got the basics i guess for selecting and reloading, skipinto/skipover ( i think) just having a hard time watching local variable in the specific lua that i am working in
Okay thanks I think I mostly understand whats going on. Follow up question, would I need to modify every base spice item to include the evolved recipe?
cause that seems like a compatibility nightmare
Happens to me too. I bet im replying to an old post
last chance to get your fav elf bar flavor in game
finishing up the mod now
probably publishing tomorrow
"Tropical Rainbow Blast",
"Blue Razz",
"Watermelon Ice",
"Pink Lemonade",
"Black Ice",
"Cool Mint",
"Banana Ice",
"Grape",
"Lemon Mint",
"Strawberry Banana"```
current flavors
what was it cherry cola?
I was a sucker for kiwi passionfruit guava
i think i found the cherry cola one
anything cherry sounds good to me honestly. best ice cream flavor = amarena (which are cherries)
Noice!
Is there a way to unlock recipes added by mod with skill level? Like whenever player have metalworking > 5 then recipe unlocked
Gameserver the class that has all the tools to make MP work, but not exposed to Lua.
looking good
i really am tempted to get started on some other mod ideas but i've been holding back so i can spend my free time playing
i'm upset lol
putting comments on the same line as the statement is what messed it up
everything works now

now just to add the finishing touches and its ready
Hello I was wondering if there is a way to run a function when a Literature item is being read? I want to check the proffesion and depending on the proffesion unlock different recipes

You could try to patch the perform() function in /lua/client/TimedActions/ISReadABook.lua. Not 100% sure but I think this is the code which controls all the reading actions done by the player. You can also access the player's profession by using smth like
local profession = getPlayer():getDescriptor():getProfession()
Ye rn I check on char creation for profession and give recipes like that but would like to link it to a literature magazine
Think the timedaction is what I am looking for tnx for the response
Yea you‘d need to overwrite the vanilla perform function and then check if its your book being read
Or you look into that wildlife magazine which gives you the herbalist trait
overwriting is strictly speaking not necessary. You can just patch the function by using smth like this
function ISReadABook.perform(self, ...)
vanilla_perform(self, ...) -- execute vanilla code
-- add some new code --
end```
With such a code, the vanilla code is still executed but will just execute your new code afterwards (can also put your new code before if you want).
I regularly mean overwriting if you alter the code in any way
Like that would be patching or adding to it
But id still call it overwriting
oh ok. when I hear "overwrite" I always think about completely replacing the vanilla code with your own code (and not executing the vanilla code as in my example). but terminology here is probably not so precise...
Good morning, all
Starting to play around with Cursor (https://www.cursor.so/) and it's providing helpful suggestions for PZ modding
Refactor, understand, and write code effortlessly with Cursor.
Just sucks that right now you're giving up VCS highlighting and all the other cool Visual Studio Code functionality
Offers a quick solution to my ask
Easier than discussing with a junior dev 😉
Although it's wrong about where that queueNext function is called
Not looking forward to the dark near-future of people making and revising bot-assisted code & then requesting help for code they don't understand
chatGPT is good also. especially for writing basic lua functions to sort out tables etc
Requesting help wouldn't even be a problem were it not bot-assisted—something about that just rubs me the wrong way. At least understand what you're doing on some level first
eh
The bots are advancing faster than human ignorance
At work I'm playing with the idea of taking a model, fine-tuning it on our code repos, and making it explain the weird intricacies to new team members
simple solution 'muted'
Fair
talking about it in general I just ignore it but someone started doing what you said... yeah think thats fair.
if anything to me its dangerous... if ya understand it thats one thing doing it without any understanding of the language yeah... bad times coming. 
if i have this
local container = {}
container.table = {}
then the global will still be local right
cuz you have no way of accessing the parent
?
actually a good ?
there is nothing global in that snippet
figured
if you had a global called container then it would be shadowed by your local declaration
you would need to use _G.container in order to access it
here I was thinking table was the global in question...
that's not a global, that's creating a key called table inside container

yeah the coloring was what had me
Can anyone help me with my nitrado server?
contact nitrado support
they are useless
Like no matter what they say it’s not on their end
I’m to the point I’m going to start pulling my own teeth out of frustration. I’d love to just be able to send my log files to someone who is more capable than I and have them sort it. But if not I’ll just give up
Switch hosting to someone who actually play pz
@crisp flicker
He offers hosting pz too
I actually play the game, just trying to switch to a dedicated server from a private host.
I would love help setting it up or having someone host
Yeah contact that dude
He will set u up
Thank you.
So i’m trying to make player automatically “learn” a recipe whenever player reaches certain level in fee different skills. What should i dig up in docs to make this happen? :)
look at how vanilla makes player slearn stuff on the lua
none of those make it clear about how to do what i want
I don't think there is a "how to make an npc mod" tutorial, if that's what you're after
There are existing NPC mods and you can look at their source to help figure out how to do what you want to do. @frank lintel has been poking at superb survivors(?) for a while
I don't want to dissuade you from trying, but it's worth noting that NPCs are a fairly lofty goal for a mod
Trying to... but can't talk I'm at work now
i want to "fix" the Epic Battle mod. at least for my own use, editing the lua file. NolanRitchie abandoned it for Superb Survivors a long time ago and with the new character models, it doesn't work anymore
i prefer EBM over SS
that's my goal
i've accepted he will never update it
if not me, i'd request someone else do it
sounds like that wouldn't be allowed in the workshop
i tried, there are so many subfolders and files i didn't know where to start finding the information i need
i'm not smart
at coding, at least
i do have a basic lua understanding but when i don't know what to look for, i'm out of luck
and i can't find the mod you mentioned above
Thx

🚬
Hey yall! Is there anything I can peak for some extra info on HotKeys menus? Trying to add a toggle for a menu
Hotkeys menu wdym? R u referring to the right click context menu?
hotkey as in key binds under options
If you want a key to do a certain action you can use the key down event
But if you want it to be configurable there's a bit more to adding it to the menu
i have added to the menu already. I am having issues actually using it if that makes sense
I have the HotKey.lua file (I think correctly) and i can see it under options
So the triggering event that I see a lot of mods use is simply key down -- then you check what key was pressed
There's a good example in vanilla with flashlights and shouting
Good afternoon everyone
Good afternoon!
do you know to happen what the file is called?
@ maemento how is your mod doing?
Basically finished
All the models and textures are done
All the items are defined and added
I think it should be released today
Only things left are getting item distributions right, which I'm dreading because itemzed doesn't work on my pc
And also adding a cough animation / popup to hitting a dead vape
And adding an icon to the tool tip
Makes them lose hp when hitting dead vape
You are going fast with this lol. I just added a little thing under the char info tab
Not lose hp but definitely some unhappiness
Shouldn't be too hard. There's a weed mod that makes you cough and smoke half a joint sometimes so I just need to look at that code
i have been using the workshop as stackoverflow in college. same thing
Hahaha
What did you add to the char info tab?
At this point with how many smoking mods I've made, I'm tempted to make a map with a smoke shop and custom tiles
I could not find a counter that showed how "old" the map is, so i made it show how many days it has been since the map was started.
I wanted something that did not reset when you died. I played a bit too mch ARK and for some reason I like to see it
would it be your first map in pz ?
Yeah
That's neat honestly
Does it reset on a map reset?
the only way for it to reset is if the current time is changed
since it is current time - og time pretty much
and kinda neat, the game actually does not allow you to go before the start date as far as i could see/try
Kinda like that on the bottom for now. should be good enough, it was just to play around with things 🙂
Your pfp reminds me of a silly prompt I put into a generator with Woody from Toy Story.
Hey Neko! I will look into it I was already searching that, but are you sure it's not another mod since I can't actually seem to replicate it 😦
I don;'t think we have another inventory mod rthat could be doing it.
we do have an inventory hotbar mod or 2.
I'm just a simple modder doing honest work
Mhmm interesting 😦 would you mind dming me the list of mods at some points? I can check if it could be some weird imcompatibility. But the fact it's drawing certain at a darker color is really weird.
🤔
got ideas, but have to check if someone already done that
Steam Workshop search is too literal
That's why I Google search sometimes instead
Identifier tags + project zomboid steam workshop
Sometimes it works better
You could even filter results to only show workshop links
There's another mod that adds tabs for bags -- maybe you have both on?
Darker textures are usually held by the sub item listings when they're expanded
Perhaps thats related?
I'd have to check once home - ping me in like 2 hours
But you can try to find it looking for the key down event
Sure thing, thank you i appreciate it.
I will start looking and see if i can find it myself
I'm about to dig through some files too so I'll let you know if I spot anything
Thank you both 🥹
I have made the key binding menu in the options. next is to actually implement it
@reef karma
https://pzwiki.net/wiki/Modding:Lua_Events/OnKeyPressed
the key release event
the you check if it's the right key number
if i add lumberjack profession like this, does this override the vanilla?
local lumberjack = ProfessionFactory.addProfession("lumberjack", getText("UI_prof_Lumberjack"), "profession_lumberjack", 0);
lumberjack:addXPBoost(Perks.Axe, 2)
lumberjack:addXPBoost(Perks.Strength, 1)
-- lumberjack:addFreeTrait("Axeman"); this line commented out, rest is vanilla
UI_vape_cough0 = "*cough* *cough*",
UI_vape_cough1 = "This thing is out of juice...",
UI_vape_cough2 = "Nothing but burned cotton...",
UI_vape_cough3 = "I need a new vape...",
can anyone think of other good things to say when a vape is dead / out of juice
Not very NPC like, I just thought it was funny lol
"Time to go find another..." could be one but it is very similar to your last one
you're still pushing for it
lmao
i guess i have to add that feature now
for those who missed it
putting the vape it the microwave should make it explode
like how vanilla does with metal items
i'm curious if this will even work because its not a food item
but then again in the lua i could try to set cookable to true
but that could lead to some weird results lol
can you set it to only cookable only if in the container ?
i am pretty sure that microwave allows for non food items to be placed in it, so maybe you can use that
that's a pretty good idea
i bet you can
ill have to look up how to do that
but first I should see if i can even find how the vanilla items explode
because if i can't find that, it's all for nothing
i would hope the game has a way to see if an item is in a container (it has to so it can deal with weight reduction from bags and what not)
set on fire command 😛
microwave gets set on fire and vape deleted xD
oh wait
all vanilla does is just start a fire on that tile
(id actually never seen how vanilla works lol)
that shouldn't be too hard?
yea that is what i thought. if you manage to get if the vape is in the microwave, you could get the location of that item and set its tile on fire and let it unfold.
Or you can just make it explode, which ever one is easier
the joys of learning modding
thank god for tab search
i need to start using tab groups more
but i'm just lazy
i used to be so organized
tab groups are amazing if y'all don't know about them btw
you don't need to
middle click the tab to close it
or right click the group to close all
oh shitttttttt
i just hit a milestone
i got over 1k subs on my mod
loses satisfaction. but yea, group tabs are great, i lose them for work

ooo
i'm so happy that people are using my stuff
feels good to be able to provide a cool thing
i think one of mine is at 400 or so but i only made it for my server and i didnt realize there were like 10 that did the same thing lmao
pz community has been great so far, cant say the same for most other games i play xD
I wonder if I can sneak in an update that will do weird stuff on saturday. and drive people crazy.
No plz, i use your ladder mod
ah, more fall chance gotcha
you made the ladder mod?
bless u
i use that in the doomsday RV for even more interior space and it's amazing
im waiting for the official ladder mod patch so i can go back to it
how do i structure an array like this is lua?: a = {[x1,y1],[x2,y2]}
Tables can contain tables; you can just include them like that
a table of tables
Yup
or also known as a 2d array
arrays in lua are only for stuff like lua {"Monday","Tuesday","Wednesday"}
with no pairs
so then you go array[1] for Monday
co` made the ladders mod actually
I would argue arrays aren't a thing in Lua but I just got back from work so I'll save semantic arguments for another time
true that is a single dimension array, in the example that you showed you just added another dimension.
it can be called multiple things depending on the language. Usually 2d array or matrices. i think lua calls it matrices ?
Just scrolled up and saw y'all's tabs and I'm sick to my stomach
... that is, a table wherein each element is another table
Again, this is a semantic argument & not all that important—that section of PIL is discussing how to represent those well-known data structures with tables
how does my workspace make you feel
I would have a breakdown every time I turn on my computer

Two screens is quite enough for me lol
Yeah I could tell, seems potentially useful but especially with multiple windows per monitor it'd be too much for me
I'm sure I could get used to it, but I like keeping it simple
i made a function that makes ctrl + right click make the topmost window go to the bottom so I can navigate stacked windows super fast
so that makes it more manageable
Such a programmer solution lmao
The workflow must remain, I CANNOT alter it. I will create a keyboard shortcut to make it better
I've been there a couple of times too (so no judgment here)
i cant do vertical for some reason. i have 3 horizontal and i still complain
i would like one on top ngl
vertical is really only used for secondary things for me
references, chats, email, spotify
my main monitor is like 32in or something so its big enough for lots of stuff
I use my left monitor for secondary stuff, usually discord as a default
Idt I could do vertical either
right is for discord only pretty much. middle is for actual things and left for all learning stuff. and work (diy work-pesonal setup) discord sometimes gets replaced by notepadd++
invest, you wont regret it
i must mod the shit out of every game I play until it breaks
I just realized that I do not have a light in here after I saw yours in the back
me playing skyrim in 15fps with like 400 mods
this frustrated me so much
i wanted cute characters
not big tiddy lewd ones
No light at all?

I usually go w lamp light because the ceiling light is too much for my hermit eyes
eh i mean, behind me? so it dont really do any good lol
who needs light when i have monitors to shine the way?
on dark theme.
Ah, gotcha. I use my bed lamp behind me & a smaller desk lamp
Praying for your eyeballs
light w rgb bulb for maximum coding effectiveness
I have Hue rgb on the only light i have xD
My bed has rgb lights that I didn't realize were there when buying it
I have never used them
had glasses sine i was 6 so my eyeballs be gone already. i am not blind, i can see without them but it does not feel normal lol
I'll save my eyeball prayers then
yea better for someone else
But do you have them
under your bed
also say hello to my junior developer
helps me on all my projects
If they were under it then maybe I'd actually use them
I thought there were two animals in that picture bc my brain (poorly) pattern recognition'd the jacket
very out of the bloom but here is what I think of my dog and bigger supported during work hours.
I think i have a dog at least
there are two
one is under the jacket lol
she likes to be tucked in and covered w things
I never should've doubted pattern recognition, thank you hunter brain
I got the keybind to work 😄
Good job!!
I wonder if I should add a keybind for a vape button
Question, to make a dev launch of PZ did you just add a non steam game and added the -debug to that instance?
or is there an easier way? I am getting tired or removing it by hand every time
1sec
kk
thanks for the help. can i ask one more? I'm just trying to do a couple nested for loops on
table.insert(SuburbsDistributions[x][y].items, [item]);
table.insert(SuburbsDistributions[x][y].items, [chance]);
but im still trying to figure out how to do that in lua.
i just dont know the syntax yet
-cachedir=H:\ZomboidLocal
You also need this
@reef karma
wherever you want it cached
then you would add -debug after that too
so my options for the non steam game are like this
thank you! that is what i thought
I would look at another mods' distribution code
it will be much more helpful than trying to get random snippets here
ive been doing that for days already and havent seen any
Probably dumb question again but how do I add this?
You'd need to know what x and y would be
ill get you the code
one sec
[h1]If you like this mod, check out my [url=https://steamcommunity.com/id/Meylmao/myworkshopfiles/?appid=108600]other mods![/url][/h1]
if you want a full rundown on how my description is laid out I can give that
Wait you can do basic html in the description?
that is so cool
Tired of poopy looking clothing patches? This mod makes leather clothing patches a dark grey / black color.
This is my first mod, so it only includes leather patches for now.
If there's further interest, I wouldn't mind altering the rest of the patch types as well.
[h1]Compatibility[/h1]
[list]
[*]Safe to add or remove to any existing save.
[*]Should be compatible with any mod
[/list]
[b]Game may need to be reloaded for texture to take effect.[/b]
[h1]Feedback[/h1]
Please leave any suggestions, comments, issues, or feedback that you have. It would be greatly appreciated.
[b]Don't forget to like and favorite this mod if you enjoy it![/b]
[img]https://steamuserimages-a.akamaihd.net/ugc/1660101375273576639/0C12E325C464F5DC166E5FF2AB70A43581BED64F/[/img]
[h1]Permissions[/h1]
[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]Workshop ID: 2949818236
Mod ID: darkPatches
Version: 1.0[/code]
[h1]If you like this mod, check out my [url=https://steamcommunity.com/id/Meylmao/myworkshopfiles/?appid=108600]other mods![/url][/h1]
[url=https://steamcommunity.com/sharedfiles/filedetails/?id=2949818236][img]https://steamuserimages-a.akamaihd.net/ugc/2046362392225211607/72B0EBF6F283ADFEC058805DC437E6B06EEC21CD/?imw=150&imh=150&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=true[/img][/url][noparse] [/noparse][url=https://steamcommunity.com/sharedfiles/filedetails/?id=2951287846][img]https://steamuserimages-a.akamaihd.net/ugc/2046363109997134551/25FB1A820B4AD7852AF82B879EE045769A79EC91/?imw=150&imh=150&ima=fit&impolicy=Letterbox&imcolor=%23000000&letterbox=true[/img][/url]```
theres the code for this
so you can see what the tags do
Is it okay if i use your style ?
yes of course
i love text formatting
lol
spreadsheets?

Thank you again. I feel like i am getting baby sited in here lol
I have a hate towards this. dont get me started xD - i blame my job
i'm just happy to be able to help
yes, thats because its a continuation of my nested tables question earlier. table ={ {x1,y1}, {x2,y2} }
normally id have something like: for i in table: table.insert(SuburbsDistributions[i[x]][i[y]].items, [item]);
i just dont know how to properly write a lua for loop
oooh
are x and y the same or are you trying to nest the items in multiple sublists?
distros are a bit of a tricky situation cause there's multiple levels
distribution tables are listed as a 'room' and a 'container'. like 'armysurplus' + 'clothingrack'
i can make a for loop to insert into every room/container type that i like without repeating hundreds of table.inserts
whenever you get the chance.
For the image part of other mods sections, the image has a steamlink, did you save it in the library or just snagged it from the mod preview?
mod preview
ok, I'm still up against a wall on this logging thing.
{
Base.Cigarettes=2,
Result:NailsBox,
Time:60.0,
keep ATMReceiver/ATMReceiver3,
NeedToBeLearn:false,
CanBeDoneFromFloor:TRUE,
Category:APA Camp Shop,
OnCreate:Recipe.OnCreate.Logger,
}```
```lua
function Recipe.OnCreate.Logger(items, result, player)
print('[APA-ATM-Transaction] Player: '..player:getUsername()..' -- Recieved: '..result:getType())
end```
that on create is running on the server, why isn't it printing to the debug log?
Got it thank you 🙂
I got it, now it does not look like crap anymore. thank you again
of course
for future reference, i'm always happy to help with text formatting
i seriously mean it when I say i enjoy it lol
things... must... look... pretty
time to test if all the new stuff i added to the mod will work
fingers crossed
okay, do i have this right?
for i=0, containerTable:size()-1 do
for j=0, itemTable:size()-1 do
table.insert(SuburbsDistributions[i[0][i[1].items, [j[0]);
table.insert(SuburbsDistributions[i[0][i[1].items, [j[1]);
end
end
let us know! and thank you again. I will make sure to ping you without pinging directly lol
I prefer more something like this but minus the bg, it be something dark.
Anyone know the resolution size for steam workshop images? The ones I'm using now got pretty distorted
as in for your mod?
the preview ? isnt it 256x256
icon is 256x256
256 yeah
not the preview, like the slideshow ones on the workshop
slideshow can be any size i think
no there is a limit I believe I ws just looking that up yesterday 1 sec
The usual display size in the Steam Workshop is 200×200 pixels.
Previews can be any size (they'll scale down to 636x358, however) which is... odd. However using a 16x9 screenshot should downscale close enough.
As for thumbnails, again they can be any size but they'll scale to 100x100 for the smaller versions and 268x268 on the page itself
thats like um 2106
600x900 atleast by 2019 might even be higher lemme look more
I was on some reference page that had a whole table of all that stuff
still never found on steam like official documentation saying for community mods what is what, names etc cuz some sites talk about icon_sm lg huge etc
yeah I'll have to play around with them I think. Thanks for the link tho, I'll try some of those
If there's only two values you can use a keyed list to seed
they all say for the icon square and then the poster or anything else pretty much is 16:9 long as you keep that in mind doubt ya'll have issues
ipairs Chuck right finally...
I was thinking he could use the keys as values technically
but if he wants specific items for specific places
then like... I don't know why he isn't just inserting them by hand(?)
dont mind me I was looking at the page I posted above... actually liking the minimal color scheme.
we pair'd up in topic ^_^
local yourList = {["armysurplus"]="clothingrack", ["a1"]="a2"}
---option #1
local itemsToAdd = {["item"]="chance"}
for roomID,containerID in pairs(yourList) do
for item,chance in pairs(itemsToAdd) do
table.insert(SuburbsDistributions[roomID][containerID].items, item)
table.insert(SuburbsDistributions[roomID][containerID].items, chance)
end
end
---or option #2
local itemsToAdd = {"item","chance"}
for roomID,containerID in pairs(yourList) do
for i=1, #itemsToAdd, 2 do
table.insert(SuburbsDistributions[roomID][containerID].items, itemsToAdd[i])
table.insert(SuburbsDistributions[roomID][containerID].items, itemsToAdd[i+1])
end
end
This would work if the items are the same for each container
You could also ditch the keys and for i=1, #items, 2 to use every other entry
could do an associative list too
if you want different item groups
yeah all depends what you trying to achive
Also, I don't think this saves on too much time/energy as oppose to just typing up the inserts lol
no but logic wise like your 50/50 split is like clean and FAF
I wonder if the [""] are needed
you could try that in the online compiler easy enough
i'm essentially replacing the entire loot table for every container.
some 600 items on some 1000 tables.
following the example given, i couldnt just link ["armysurplus"]="clothingrack" because theres also armysurplus/counter, armysurplus/displaycase, armysurplus/etc etc etc
ah true the keys would match
then I guess you could make both for every other entry
that is if you want the same group of items to be inserted
still surprized it still ran on the top one... even though it sure didnt like it
I just dont get why the compiler underlining... thats all
my goal is to randomize the contents of every container in the game
id considered it. but then i had the BRIGHT IDEA of doing semi randomization instead and here i am. leave the original loot tables intact so that containers still have a slant towards their original contents instead of building a new table from scratch
add a field 'opened' if it dont exist on containers. should be an on open event, clean it fill it if !opened
if thats even viable dunno honestly but if this was MC thats how I'd do it
yep. im just a weirdo who wants finer control
You can add specifics to the code I gave
"---Add extra exceptions here if needed"
"---Make changes to distro here as well if needed"
im just not a programmer
i dont have the base of knowledge to do creative things
but i am stubborn
What is it that you want to do outside of shuffling the loot tables?
have precise control over every value of every container in the game. no biggie
literally just tested microwave
unfortunately the metalvalue property doesn't seem to do the trick
😭
that means you gotta do it the harder way..
I thought you wanted it to be randomized?
I believe you're over thinking this a bit 😅
thats my specialty
You could group the rooms in rarity categories
then shuffle those within their groups
But randomizing the loot won't be precise - the most precise you can be is to manually make those changes
which is why im brute forcing a for loop to do something like a million lines of code for me?
not really as you'd need to retype the entire distro
unless you're creating a giant list of items to give to every container
bingo. one list of every item to every container.
OH SHIT I DID IT
it blows??
Tags = HasMetal,
This will allow an item to explode in the microwave
video incoming
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
@tribal shuttle ?
thought there already was a microwaveable tag/flag
This would override every loot table's items - you may also have to override the rolls for each container too
right. ive got it figured out at this point. i just came here today to figure out how to write a for loop in lua correctly
Ah yes, it is time
if you let it go, does it actually let the counter catch on fire and burn or does it stop
if fire spread is on yeah
just one more feature to add and its done
then i can get started on my next mod
which is a very small mod but it will be easy
you are just rolling through them uh

its fun
i like making things
plus i'm bored of designing my website so this is a good side project
I have another one I want to do as well, just gotta find some time for it
Would someone be willing to talk with me about a potential mod idea? I'm wanting to commission one but I'm not sure my idea is even viable so I'd like to figure that out before I go waving money around.
I looked into this before after someone else (maybe Poltergeist) mentioned that their mod calling Remove broke some other mods using the same event. The event in question was an OnInit handler. It seems to be a bug in the code that handles events
Since it removes the callback from the list of callbacks while the code triggering the event is iterating through it, it'll cause one of the callbacks to be skipped during that run. Should still fire for future triggers of the events (which is why it'd be noticeable for something like an OnInit~ event)
Custom context menu icon has been added
literally just want to change the position of the context menu and the mod is DONE ||for now||
Done for now is too relatable
"it's in a feature freeze now I will stop adding things I swear"
Actually, I guess I should ask here. Do you have to modify lua for the starter kit or is it strictly server inis?
Pretty sure you can just set the items the player starts with in the INI (idt this is really a mod question?)
Hrm, alright, so it is via the inis. If it doesn't involve lua back to the other place.
so i was trying to make a mod but idk how to make the player stressed for feel pain randomly can someone help plz
What have you tried so far? Where are you stuck?
i tried to find mods that have pain like the more traits mod but i found nothing
so far
Well, I'm seeing setAdditionalPain on BodyPart, but I'm unsure whether you're looking for pain or stress
See ISCleanBurn.lua, ISDisinfect.lua, ISRemoveBullet.lua, ISRemoveGlass.lua, and ISStitch.lua for examples of that
Did you mean "stressed or feel pain"?
yta
ya
like they feel like that at random times
Okay, stress can be set with setStress on Stats, which you can get from the character with player:getStats() (assuming you've defined player)
ok thank you
I'd expect it so, the vanilla code does not utilize Remove as much as mods, so IS does not have issues with this
I did not realize that message was from almost a week ago lol, whoops
Showed up when I opened discord
self.character:getBodyDamage():setUnhappynessLevel(self.character:getBodyDamage():getUnhappynessLevel() + YOURCHANGE); -- !! Add unhappiness bonus
self.character:getStats():setStress(self.character:getStats():getStress() + YOURCHANGE); -- !! Add stress bonus```
Amma take that too for my future mod ^
then just check the every 10 minutes event or something and make a random chance for it to add those stats
that's the basic structure at least
f'n steam rolling back my hours again
Is it possible to completely prevent burnt cars from spawning by modifying VehicleZoneDistribution?
can you not just modify the wreckage spawning in the sandbox settings?
i might be wrong on that, but i think there's a setting in the sandbox settings to not spawn burnt congestion
I still want traffic jams, just not with burnt cars
ah i see
Traffic jams have their own "parking stall" like normal vehicle spawn zones
You need to find the procedural distribution config that adds the burnt cars to trafficjamn, trafficjamw, trafficjame, and trafficjams
For each cardinal direction
I just managed to make it work by modifying VehicleZoneDefinition.lua directly. now I need to figure out how to override it in a mod
I definitely recommend making it a patch, not an override. Might break other mods
Look at the mod "Crashed Cars", it already does this functionality
That's what I did
I made a file similar to it's one, but it doesn't affect the vehicle spawning
If you make a mod that just removes burnt cars and nothing else, I'd use it tbh
Wdym?
Does Crashed Cars overwrite the default procedural vehicle distribution
It does. Here is the traffic jam at exclusion zone border without burnt cars.
No, I mean does it overwrite the file (have the same name)
The crashed cars mod has a file called CrashedCars.lua, so no I don't believe it override it
Okay great, that means its a clean patch
If you send me the file (because I want this mod to work), I can clean up the code and optimize it
For you to then publish
That would be awesome. I'm just gonna tweak it a little, because I think instead of just removing the burnt cars outright, I can replace them with non-burnt ones (mostly functional, some crashed)
Good idea, although it is working as it is rn because the traffic jams are instead pulling other vehicles (the non-burnt ones)
Actually it's working in the picture because I just disabled the burnt vehicles. Though the way the spawning table looks, it seems as though some will be replaced with functional/non-burnt ones, while some while just be removed entirely
The parking stalls each have a table of possible vehicles to spawn
What is happening is that you are removing the IDs of the burnt vehicles
And their weighted spawn rate
And so as a result the table is smaller but the rest of the vehicles have the same, if not higher, chance to spawn
Trying to add vanilla vehicles to the traffic jams won't quite work because they are already in that parking stall table
Although you could tweak their spawn rates, and that would work
When I was going through the world, I a couple of weird traffic jams, I thought something might be up
It is simply random and not guaranteed. Some traffic jams will be a bit weird
It is like that even with burnt vehicles
Unless the burnt vehicles have a table of their own, I haven't looked at the code in a while
Yeah, it's just when I spawned into this world, I got whole bunch of weird ones in a row
If you open up WorldZed or w/e its called, you can see the actual spawn zones, and you'll see what I mean
On further investigation, it seems it might have just been a very unlucky streak of strange looking traffic jams
There are some traffic jams that work as "parking stalls", and then there are the scenes, which are the ones that have two cars crashed and such
And I was looking at this and thinking maybe I should change the vehicle instead of changing the spawnChance to 0
Scenes are handled differently and are harder
Ahhhh I see now, they have their own table
Yeah okay, replace them with their non burnt variants
I would do it as = nil, it's the cleanest way
No semicolons either because lua doesn't need them
I copied this table from the game files
This is the one that currently need to be rewritten as a mod
Wait, the table has normal vehicle IDs? I thought the burnt vehicles have their own IDs
I already modified it somewhat in this image
Ahhhh okay
Including the IDs
Then you'll need to do this: keep the lines with the burnt vehicle IDs, but set them equal to nil (no index or spawnRate), and add your new lines with the normal vehicle IDs and set their spawnRate equal to the number the burnt vehicles have
Lol, i just realized something: you could set burntvehicle equal to a traffic jam table
And that would remove all the burnt vehicles for you and automatically add normal vehicles instead
Here is are the files. VehcileZoneDefinition.lua is the overwritten game file, and CrashedCars.lua is the one from the crashed cars mod for reference
Okay, I will take a look soon, currently AFK at work
Hello, I was trying to make a simple zomboid mod to add a couple extra crafting recipes to another mod, and it worked fine, however it also seems to have caused other recipes to disappear, like sawing logs and such. This is the only file I have for the mod: https://pastebin.com/KeC95nXs
is it by chance called recipes.txt?
you'll replace any file with the same name as your file, so it's important to give them unique names
ive been trying for hours to figure out a way to play the "cough" animation
ive tried with variations of playEmote but I can't get that to work whatsoever
has anyone done this before?
BodyDamage:setSneezeCoughActive(arg0) ?
can't get it to work
i don't know if i'm using it correctly though
self.character.BodyDamage:setSneezeCoughActive(1)
self.character.BodyDamage:TriggerSneezeCough()```
you try it in console?
TriggerSneezeCough() might work, try it
but i think it includes the sounds for sneezing too
if you want to make it just coughing, for smoking, then you need to link the animation & sound, and manually do what that method does
been looking for the dang thing...

thank you for the explanation
i think I will simply omit the coughing feature for now
having the text on the screen is good enough
i got interested, so ill take a look after editing this vehicle distribution script
basically it's a new timed action for vaping
once the action is completed and its in the perform function
it checks whether the vape was dead or not
def needs the coughing lol
if dead, i want the player to cough
i'd really like it to work, i'm just not sure how to make it work lol
but i will keep trying
sadly they didnt exist back then. they all smoked either camel no filters, marbs or newpors and green
am a stubborn bitch
TriggerSneezeCough() did not work unfortunately
setActionAnim("whatever the fuck the animation name is")
self.player:getBodyDamage():setSneezeCoughActive(0); << is code that SS is using.
just happened to come across actual usage of it while searching
alright lemme give that a go
yeah its using self.player not character?
self.character. timed actions usually don't use .player unless you specified otherwise
if you throw the lua file in here then we'll see
well
it did nothing
hmm
no errors or anything
that was using
self.character:getBodyDamage():setSneezeCoughActive(0);
self.character:getBodyDamage():TriggerSneezeCough();```
well 0 is not coughing I would think
maybe it needs to be 1 instead of 0
honestly why its an int is beyond me for bool logic
still nothing
here you go, did all the work for you. double check if this works in your game and then upload it 👍
so i guess what i would do is make a copy of the default cough.xml animation file
remove the parameter permission it needs
make a new timed action that happens after a burned vape is smoked that uses the "new" cough animation with a custom sound of only coughing?
is that how it works
Thanks. I already got it working as a mod earlier, but I'll use this because it's just better formatted
still double check it. I am used a new program for editing lua files, and wanna make sure PZ can still read them 
alright
specifically I am now using LF endings instead of CRLF, and idk if PZ will like that lol
no, don't make another timed action. you can do the anim and sound in one
also no. you just need to call the animation. it's what you want
gonna look and see what the anim name is
It works! Thanks
Yeah, I noticed that as well lol
@fading horizon
yeah ok, just do setActionAnim("Bob_EmoteCough") in the perform() section of your timed action
have an conditional if statement if the vape is empty or not to do the anim
trying it
now, for the sound...
already have the conditional set up
god, so many sound files lol
didn't work
🤔
Object tried to call nil in perform
ahhh, maybe its not bob_emotecough
try the other name, i forgor it
okay, just try "Cough"
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.
https://tenor.com/view/perfect-popcorn-michael-jackson-gif-26271837 sorry this is like watching myself everyday at work
heres the code for the perform if you want to take a look
ahhh, remove the self.character: in self.character:setActionAnim()
you don't need that
or maybe you need something else, ill check my code
example
self:setActionAnim("ParadropFromAir")
change it to "Bob_EmoteCough" or "Cough"
testing
lmao
it did something at least
character is just doing this now
just boolin
🤔 🤔 🤔
my character does the same shit after my animation
im guessing that's the placeholder
which anim name string did you use?
it didn't do the cough animation tho
Wait not it's not working. I think the backup I had in my main zomboid folder of my modified VehicleZoneDefinition might have been affecting it
did you put it in your projectzomboid game files or did you make a separate mod
I made a separate mod, but I modified VehicleZoneDefinition in the main folder earlier, and created a copy of it when I reverted it back
here is vanilla, restore it back the way it was
wtfff
I restored it already, I just deleted the copy of the modified one I had
oh
It had a different name, but I forgot that didn't matter
its looking in the player/actions folder
but cough is in player/ext
so i wonder if i put it in the actions folder
if it would work
🤔
maybe we need to create a new anim in that folder
hold on imma check actions
there is a way to get username or steam name from the main screen?
yeah okay copy the xml into your own AnimSet folder
fuck but it extends another file within that folder
so i might need to remake both
wdym
-<animNode x_extends="Ext01.xml">
so it depends on that file
which is also in that folder
that's in the cough animation
try both
How can I override the vehicle spawns defined in VehicleZoneDefinition with a mod?
you are already doing that
I'm trying and failing to do that
the file I gave you overrides the vehicle spawns, by setting to nil
It doesn't work
I thought it did, but it was the copied file in the main zomboid folder that was prevent the burnt cars from spawning
I have the mod file in "C:\Users\Danny\Zomboid\mods\noBurntCars\media\lua\shared"
so, you aren't able to overwrite other vehicles you are adding, or the file is not working at all?
I'm not able to use the file in a mod to overwrite the vanilla spawns
darn, that makes no sense. that file should work
no luck on my end either

tried several different configs
i'm okay with no coughing animation tbh
this is becoming a big big pain lol
@merry saffron okay, try this. simpler code
Nope. I feel like it has to be not because of the contents of the file, but because for whatever reason, the file isn't affecting the game
For some reason, this file in this mod just seems to be incapable of changing anything. I don't get it
lemme try fixing that line ending I was talking about lolol
now try this file
difference is line ending metadata
@ Maemento you can always do an update later on when you get around to it. Sometimes the best thing you can do is step away for a bit and start looking at it fresh.
You didn’t release it yet did you?
It would be great if you can get the animation to work but the mod is still great without it right now
Bruh how the fuck do I go to the line on mobile without having to send multiple messages ? Wtf
can't, sucks ass
I swear it was a thing before
maybe it's the keyboard settings but my phone doesn't let me do anything related to lines
When I was on android I don’t remember having this issue
Maybe Google keyboard had it
Phone
Test
Wtf
witchcraft
That is it. I am switching back to android
I am on android too, hold your horses lol
My phone keyboard auto sends, doesn't let me shift lines
Nha
Android
Just
Works
i guess discord hates my android phone then
Google keyboard or Samsung keyboard ?
other keyboard, foss lmao
Prob a setting you can enable
I already checked settings 😔
Need to switch to a proprietary keyboard to do one thing in discord, smh
anyway
@merry saffron let me know if the new file with CRLF endings works or not. I'll check it myself eventually over the weekend
ciao, I have an exam tomorrow I am not ready for
Good luck, I don’t miss exams. Ciao ciao e notte
Indeed a very important factor of the mod
looks like its own game
i cannot find the specific event that triggers a jumpscare anywhere
umm
it's no big deal. it's not really a priority of mine. i just felt like looking around for it at suddenly
I sworn I seen code that called it
i could only find the tutorial playing the sound, but not the actual conditions for the sound to be played in a normal game
cuz in the tutorial it just plays the sound when u open a specific curtain
search for "ZombieSurprisedPlayer"
that's what i searched for
if (this.isAlive() && var9 > 0 && this.stats.LastVeryCloseZombies == 0 && this.stats.NumVisibleZombies > 0 && this.stats.LastNumVisibleZombies == 0 && this.timeSinceLastStab >= 600.0F) {
this.timeSinceLastStab = 0.0F;
long var25 = this.getEmitter().playSoundImpl("ZombieSurprisedPlayer", (IsoObject)null);
this.getEmitter().setVolume(var25, (float)Core.getInstance().getOptionJumpScareVolume() / 10.0F);
}
IsoPlayer
ah i couldnt find that file, where is it in the directory
ProjectZomboid\zombie\characters
yeah do you have it decompiled?
no i never used any of this folder
thanks
np
noice
In scripts like for recipes, is there any documentation for the key/value options, and for a recipe result can I use a lua function to determine the item to be given?
thank youu
hello, I have a question, where does the clients information stored in server
I had followed the discussion on this yesterday, did you ever manage to make them all list as one item or did you just end up making them individual items? Asking because I had wanted to do something similar but couldn't really figure out the named literature mod to do so.
Looks good btw
i gave up on doing the dynamic option
i got very close
i got the naming to perform correctly
i got the icons to set correctly
but when you reloaded the game, the icons reloaded and became random and i couldn't figure that out
i saved the code in case anyone else wanted to look at it
so i'm glad i did
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.
then in the item definition you put the onCreate parameter to be onVapeSpawn
or whatever you end up naming it
I'll check it out when I get home. Thanks
If you check the mod named Literature I overcome this by setting the variables in modData to be loaded
too late now haha
it made it so you couldn't spawn each flavor anyway so it wasn't ideal
thank you for that info though
Np, but you could technically have both
i'm trying to learn how to do proper item distribution now
much fun
local itemNames = {
"GnomeBars.GnomeBarTRB",
"GnomeBars.GnomeBarBlueRazz",
"GnomeBars.GnomeBarWatermelonIce",
"GnomeBars.GnomeBarPinkLemonade",
"GnomeBars.GnomeBarBlackIce",
"GnomeBars.GnomeBarCoolMint",
"GnomeBars.GnomeBarBananaIce",
"GnomeBars.GnomeBarLemonMint",
"GnomeBars.GnomeBarStrawberryBanana",
"GnomeBars.GnomeBarCherryIce",
}
for _, item in ipairs(itemNames) do
table.insert(SuburbsDistributions["all"]["inventorymale"].items, item);
table.insert(SuburbsDistributions["all"]["inventorymale"].items, 99);
print(value)
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, item);
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, 99);
end```
I can just do something like this right
obviously not 99 but
Using the OnCreate for the item script you could create dummy items that just selfdelete and replace itself with the actual item + set the specific flavor
That way you can have the default be random but also have specific spawns
You don't even have to script these either -- you can have the game generate them on boot

how so
wait i think i get it actually
and that way only one item would have to be added to the distribution table
hmmmm
i don't understand this part i guess
You can generate scripts using scriptManager
And parseScript()
It takes a string as an argument
What you'd need is a table with keys as item IDs and the values as the OnCreate functions
Then pass a template string replacing the ID with the key and the onCreate with the value
I'd be curious if one could load the script for the default item
Would make maintenance one point
I guess you could parse the default script as well 🤔
No script text file at all
Lmk if anything made sense 😅
https://steamcommunity.com/sharedfiles/filedetails/?id=2908173425
decided to make this mod public since there's no reason to keep it hidden now that im not using it for testing features
i'm eating breakfast while trying to wrap my head around it haha
completely forgor the ppl who were asking for it before 
woah
can i know the code for making the table / borders in your description?
didn't know you could do that
like here
yea
is it just th and tr
1 sec





