#mod_development
1 messages ยท Page 268 of 1
@nimble vale I'll stop mentioning it but here's a link to examples written in Python for PZ mods. =)
https://github.com/asledgehammer/Pythoid-Example-Mods
at that point if you could design your own llm model loader that can compete with those two you'd be making a lot of money doing something better with your time lol
Thought it'd be relevant to your interests.
I'm not saying you can incorporate python into PZ im just saying, that creating one program to do all of this, even in python is a serious undertaking requiring extensive knowledge in multiple fields
This isn't even discussing model templates, model formats etc
Yes. I'm letting you know about another tool that could help you depending on what you're doing.
=)
Didn't knew you had an example
I took the project seriously. I need to do an edit to Pythoid but I have no access to hardware that can play PZ to test it.
It's all basically ready for production.
I took a look at the ping pong one and it pretty much is all just sending server/client commands mainly but it makes since considering what the devs used for coding pz
Tbf all I need to actually fuck around with it is a proper example of what can be achieved
Yeah. The shader one is complex.
The font one shows sub-classing in action.
(Sub-classing Java classes)
The shader one involves touching private code deeper in the engine to modify shader uniforms in realtime.
Like i said nothing is impossible but you'd need to start somewhere and so far there's no one whose made a NPC mod from the base up besides nolan without relying on his code. So until someone does, it's going to run like jank.
Bandits
....
I already mentioned it
Bandits is the best one, which doesn't involve any of the previous NPC mods that exist
And there's a fuck ton of different projects that didn't rely on older mods
what makes you think they havent used his code as a base?
I'll take a look at it now as im pretty familiar with it
Bandits is unique
It has nothing to do with other NPC mods
It uses IsoZombie, which is way more reliable and the only way to make proper NPC in MP as IsoPlayer does weird shit in MP
from my understanding of it
I hope that you're writing a research paper for uni or something for this.
Don't sit on this as a pet project.
=)
Make it worth your while.
What are you talking about ?
The AI model stuff Ada is doing.
I'm saying do this in a way that makes it good for you in your career path.
It's valuable work.
Depends tbf
If they absolutely do not plan on doing any of that stuff in the future, there isn't much to go there
You can say that. I'm saying simply that it is worth doing a little extra work to form it into a research project.
Still good to have as a portfolio piece. <3
For sure, but if they absolutely do not work in the field, there isn't much need
That's all up to Ada.
There's a lot of people who mod to learn their trade. =)
Anyway I checked your Pythoid example ping pong, so that does something which you can do with lua basically ?
Yeah. It's a basic example.
If you saw my prior messages I mentioned the more complex examples.
BanditPlayer.getPlayerById = function(id)
local playerList = BanditPlayer.GetPlayers()
for i=0, playerList:size()-1 do
local player = playerList:get(i)
if player then
local pid = BanditUtils.GetCharacterID(player)
if pid == id then
return player
end
end
end
end
It is literally structured exactly the same whether they used his code or just did the exact same thing nolan did, it is essentially the same. It's all built off zombie logic.
So the font one is about adding new fonts ?
Who's Nolan, the name of the mod exactly ?
lol nvm then
its kind of funny saying you know something when you dont know what im talking about clearly
Bcs there's multiple NPC mods and a bunch of those don't use the same thing
Name the mod?
๐คฆโโ๏ธ
If you all want to explain to him the history of npc mods go for it im fixing some coffee
So what you're saying is that literally every single NPC mod is based on the same mod ?
There's like 4, maybe 5, NPC mods that come to my mind and all of these are based on the same shit ?
I judged Bandits based on what I knew of the few NPCs mods I know of, and it looked fairly unique to me, nor as he mentioned anywhere basing his work on another person, but you mention a part of code which is used in another mod ?
People have stolen my mods and not credited me, its pretty common.
Why are we talking about you here ?
Hi
Is it me or are they looking for an argument ?
Hi @drifting ore
I didn't mean it as an insult or anything
Just idk who you are in the modding community really, so you're mentioning people stealing your mods and not crediting you, but I don't even know what mod we are talking about here
My point is a generalization that its a very common thing to do
thats the main focus
This convo got really meta in a weird way.
^
Bcs I've been studying Bandits technical aspects a bunch
it really did
Hello
I only have an hour left of time before work. I'm going to go focus on my stuff.
-_-
So you'll never tell me who's mod it's supposed to be from basically ?
If anyone needs login-logout server-side Lua events:
https://gist.github.com/JabDoesThings/582ae80405732d3ae21a5e8605cd488b
Thereโs a plucky modding adventurer whoโs been digging into the PZ mainframe, connecting wires and conducting wild experiments for a while now. Heโs an ingenious soul, and we thought itโd be good for us all to get to know him better. As such, hereโs comes the thrilling return of the Mod Spotlight. Or, more to [โฆ]
But he uses IsoPlayer ?
No ?
I was supposing Nolan was Super Survivor but Bandits uses IsoZombie and from what people explained SS uses IsoPlayer ?
Nice, could share that on the modding Discord
Nvm you already did
Got 1 hit for IsoZombie in the oldest publicly available version of the mod
Hmm
I don't see how it could've been made using the IsoPlayer class

yeah, the latest lua update just broke it completely (i love pushing untested changes), until they fix it you need to edit the path to the correct one manually
it looks like the issue was closed this morning so hopefully the actual release will be soon
Nice
Thankfully I haven't modded a lot these past days so I didn't have to reenable Umbrella in other folders
If you write modules & API objects that people use and you need to be read-only, here's a way to do that:
https://gist.github.com/JabDoesThings/9e1920cd1cc6b77cbabcdcce1aba1219
Okay coffee is done. To answer your question yes, and both stem from the same code, but one is specifically for zombie behavior, which is what bandits uses for their npc's (survivor npc mods don't have this functionality) bandits took it a step further. So while the framework everyone uses is the exact same method. Whether or not like I said before they achieved it in the same manner or used code to base off of. Doesn't fundamentally change the fact that survivor code for survivor mod's including bandits is achieved through jank of zombie npc behavior.
My point is there is no code for npc's (anymore) there is remnants of code and zombies. The end result is the same. I still don't know why it's that big of a deal to you. The main difference is the ability to zombifiy (and zombie behavior once zombified) a NPC or not. Beyond that they accomplish sudo NPC behavior.
and there are references to Isoplayer in bandits as well, most of which in regards to MP situations. Other survivors mods dont rely on Isozombie because they don't use zombification. So it doesnt do anything normal npc's do as a survivor besides turn into a zombie.
The main take away, the base foundation remains the same and likely will be till we get true NPC behavior code.
Whether I use isoplayer or isozombie mainly has to do with the fact, using isoplayer is simplier for my usecase. I don't want to have to worry about extra code on top of normal (alive) npc behavior. So it strips one element of problems i'd have to worry about with my integration with AI by not using bandits.
and if you want to know what syncing ai npc's is like look at BanditUtils.lua in this directory X:\Steam\steamapps\workshop\content\108600\3268487204\mods\Bandits\media\lua\shared (x= your drive)
They did the math, put the bandits on the client side, tried to re-sync to the server, cloned the Player, created a fake player on another layer. Just to make sure multiplayer sync works. It's impressive but right in his notes on the lua file he mentions how difficult syncing actually is.
the cloning of IsoPlayer actually has nothing to do with syncing. It's only use case was to use it in Hit function that was expecting IsoPlayer as an attacker, but the attacker was zombie, so this was a workaround
if the attacker was a zombie, the player reaction hit would look like a bite attack
When it comes to Pz I feel like most mods accomplish amazing things by amazing work arounds. So that makes sense
yea its tons of hacks
That's the same boat I'm in, lack of actual IP api connection so I have to duct tape stuff through text files and read/write code
It really is, I don't play much but the challenge was more fun than using the end result tbh.
I was actually working on a python script for tts/stt/chat integration when I thought of PZ's modding capabilities and did it just for fun.
yea be careful, modding is addictive
:X Yeah I stopped modding for PZ a few years back version updates have a way of taking the wind out of you.
speaking of do you know if your mod will be affected by the upcoming changes in the next major version update?
i have no idea. But my lucky guess is that TIS tries to rather introduce new stuff instead of changing things because changing things will break so many mods
I heard they are changing the mod system based on their aug 29th blog
I'm not sure exactly how much but it was an interesting read since i haven't been in the loop forever
they will require every mod to be explitly marked as b42 compliant
i dont know how it will work for popular mods that are not developed anymire, someone else will have to repost them
Yeah, that part was a bit confusing because it said it will work if you setup a b42 structure, but i assume that only is in reference to b42 beta not official release.
And yeah, I expect a lot of mods to be DOA.
How does the change to zombie heat mapping affect your mod?
or does it?
it should not impact it at all
the risk is for example if they actually fix the bugs:) say the calendar problem, the starting date in multiplayer is wrong and i do correct it, so if they fix it my correction would actually make it incorrect again
So I noticed that, and for some reason I have a similar issue even in single player.
My text files save with a date timestamp, and for some reason it thinks its the next day before it is. which is a bit odd.
things like that should be corrected asap otherwise the technical debt accumulates
The whole timing system in general being linked to frames isn't great either.
That's the whole fallout 4 issue all over again.
One method I contemplated for using instead of OnTick was to pull the osdate (time) then ontick till the desired time, then turn off and trigger an event.
because I didn't want OnTick running non-stop for something that I didn't need constantly
@bright fog @bronze yoke got it, thanks
I ended up not using it for whatever reason, but it'd be nice to have a more standard timing system.
I'm not expecting one though.
realying on real life time is not a good idea i think, game may slow down because of lag but real life time not so you can get unexpected results
Yeah, I had some issue with it (can't remember what) but it was far from ideal.
For me it was because EveryTenMinutes and EveryOneMinute was both too soon or too late for the event I wanted triggered I think.
so use OnTick that has consequitive numTick parameter. Divide that number by 200 and check if the rest of division is zero. It will then execute once every 200 times
I think I did a millis conversion at some point.
But yeah, I scrapped that idea and found another way to accomplish what I needed luckily. Since most of my mod is really just proof of theory (to see if i can) type of situation.
In your opinion knowing how difficult syncing for multiplayer can be, a lot of people seem really interested in integration of AI Npc's, but honestly I think that would introduce way too many sync issues between server/client for each AI capable NPC, on top of NPC behavior. Would you agree?
Because of course each person would have to run an individual AI client side for this to work.
I have no intention of making this mod, but the getting AI text/actions with the NPC on top of multiplayer feels like it'd introduce a host of issues.
i think the game only syncs zombies in aspects of their position, and even that happens with a margin of error. if the position difference gets too big, the zombie teleports to get it fixed. everything else is client controlled and there are two choices: build syncing yourself which i dont think is possible because of the amount of data, or execute the same actions on all clients in more or less the same time
now executing the same actions is a challange because you must rely on objective conditions that are the same for all clients. you cannot use random functions because they will produce different results on different clients too
to illustrate, if you want a bandit to use melee weapon when the distance to the enemy is say 0.40 squares, then on one client it may be 0.40 and on another 0.41, so this is not an objective information
Yeah, that makes sense. Thank you.
Hello all. I have a question regarding OnFillWorldObjectContextMenu.
I have an item that I want the player to place on the ground, and then be able to right click on, and have a context menu pop up and a function ran from it.
I have the event/function OnFillInventoryObjectContextMenu working fine for this so far, but would like to have it work from clicking on the placed item instead.
Can someone give me some info on how to access the name of the object from the worldObjects list that OnnFIllWorld gives you? Keep getting errors, and not sure if it's an object:getName, or getType, or one of those that works, or maybe something entirely different.
Thank you for your help.
Which mod was it that put the check marks on the books you read and the white i symbols on the ones you need to?
sound like "has been read" maybe?
what kind of name are you looking for?
there is an IsoObject getName() but if i remember right it doesn't return anything for the majority of objects because they don't have a reason to have a 'name'
So, the item is just a simple crystal ball, it's a 3D placeable object like most others, not a movable tile. I'm just not sure how to check if that's the item I want, so I can run the code for it.
Here is the code for context.
CrystalBallContextWorld = function(player, context, worldobjects)
local playerObj = getSpecificPlayer(player)
for _, object in ipairs(worldobjects) do
if object:getName() == "Crystal Ball"
then
print("Found Crystal Ball!")
context:addOption("Peer into Crystal Ball", worldobjects, CrystalBallTellFortune, playerObj, object)
end
end
end
Events.OnFillWorldObjectContextMenu.Add(CrystalBallContextWorld)
i'm not sure if that event will actually give you a world item
the list it gives is kinda fucky and often useless lol
Ahh, well shit.. LOL
What method do others use to right click on an item, and get a context menu? Or is it even possible? From what I've seen, it seems to be, but maybe Im wrong.
but if you were able to find it you'd have one of these https://projectzomboid.com/modding/zombie/iso/objects/IsoWorldInventoryObject.html and you'd want to do :getItem():getFullType() == "MyModule.MyItem"
hey uh so like
would anyone know how to add modded items to the loot distribution?
try this within the event```lua
local objects = worldObjects[1] and worldObjects[1]:getSquare():getObjects()
for i = 0, objects:size()-1 do
local object = objects:get(i)
if instanceof(object, "IsoWorldInventoryObject") and object:getItem():getFullType() == "MyModule.MyItem" then
-- do your thing
end
end
we usually just grab the square from the first object in the list and loop through the objects on the square lol
This is a visual guide for mappers and modders who need to add or modify PZ's loot entries using the new ProceduralDistributions.lua approach. Whilst the ProceduralDistributions.lua file has been in the game for quite a while (i.e. the Gigamart shelves having distinct loot types), TIS will be eve...
not really
no clue whats going on in this image ๐ญ
This gives me an attempted index of null error
you probably called the worldObjects table something different in your function
on objects = worldObjects[1]
let me double check
Yes, no camel case.. lol
Let me retry
Bingo
You are the best Albion. I swear. You've answered so many of my questions. haha Thank you very much.
You'll want to add in your item like this, higher the number = more likely to be chosen based on the pool it's inserted into
okay
i think this makes sense to me?
thanks
can i list more then one item at a time or would i need to make a seperate document for each?
Yeah you can do it in the same lua file for multiple items
keep in mind it rarely ever matters what file a lua snippet runs in
okay cool!
i assume that needs to be in ther lua/servers/ file
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\server\Items
Yeah, you can also check the Procedural Distribution lua located here to check for vanilla values
You'll want to weight any items you add similar to vanilla values of a similar item so you don't dilute / ruin the loot pool
as long as it's in server it's good
(also to be pedantic the require doesn't do anything)
alright and one last question
is the name that i put there the display name or the name ive used for the item script?
Item script name not the display name
So it'll be the one that has "_" in it instead of spaces
thanks!!!!!!!!
if your module isn't Base it should also include the module (as Module.ItemName)
?
Which mod adds the numbers next to the bar which how how many units an item like water has left?
Most likely talking about your script folder .txt files, you'll want to import base
Or was that just a vanilla setting?
Here's the media folder for one of my backpack mods if you want to take a look through the file structure
@topaz tangle
Does anyone know how to make vehicle containers that only accept a specific type of item?
thanks
my file structure looks right to me, unsure if it will actually work though lol
is there a good way to like, see if its spawning right?
I don't know if it's the best method, but I tested it by turning on debug mode through steam parametres, then spawned in mauldraugh, turned on fast move / noclip and checked the containers I set it to spawn in
yeah that makes sense lol, ill probably do that too
if you enable lootzed you can check spawn chances in-game by right clicking a container's icon, and you can reroll from there until it spawns if you want to be double sure
i think lootzed is in the debug cheats menu
oh wow yeah im sure that would be far more efficiant
so like, what if maybe it doesnt show my item what may i have done wrong?
(probably something so simple)
fixed it
Hey Albion, I've got my context menu working great now. But curiosity always gets the best of me, and was wondering if you knew how to link a timed action to a Right Click Context Menu Option?
I have it set up, and the timed action runs immediately upon right clicking to bring up the menu, but not when I actually click on the menu option itself. Seems like I'm missing something simple here. Any ideas?
you're probably calling the function instead of passing it to the option
myFunc() calls myFunc, myFunc just passes it
here's an example of one of my context menus:```lua
---@param player IsoPlayer
---@param vehicle BaseVehicle
---@param spraypaint DrainableComboItem
PaintUI.onPaintVehicle = function(player, vehicle, spraypaint)
if not (spraypaint:getRemainingUses() < 1) then
PaintAction.queueNew(player, vehicle, spraypaint)
end
end
-- in the actual context menu function:
spraypaintMenu:addOption(spraypaint:getName(), player,
PaintUI.onPaintVehicle, vehicle, spraypaint)
addOption's arguments are basically name of the option, argument 1, function to call, argument 2 (if needed) etc
those arguments will get passed to the function when the option is selected
the decision to put argument 1 before the function, separated from the others is perplexing to everyone
Thank you, I have it calling the function correctly now, but it's not passing the arguments from the OnFillWorld event now, let me tinker around with this.
Actually, that part is working fine too. I'm getting another error, just read it wrong. The context menu pops up, and I can click on it, and once I do, it errors out.
the problem could either be passing the function wrong or something going wrong in the function itself
it sounds like your function was calling fine earlier so it may be something like passing arguments in the wrong order
not a bad idea to pass a table of args in this case
so you dont need to match the order/number of args
Yeah, Im testing that now. The context menu works fine, it gets the arguments passed from the event/function variables, and thats good. But it says you need to use ISTimedActionQueue.add(MyTimedAction:new(player)) to call the timed action, which seems to make the context menu instantly call the function instead of passing it, so I instead created a RunTimedAction function with that call inside of it, to make the syntax for the context menu work. But it seems that possibly it's not getting the player object it needs still?
This is it. I was completely disregarding that the worldObjects argument was being passed too, and didn't include it in the calling function.
player object is usually passed down in self
simple errors I guess. Overthinking stuff
Thank you Albion and lect for the insight
On the topic of timed actions, do I absolutely need to declare all the sub functions for it to work? For instance function MyFunction:update(), MyFunction:isValid, etc?
i don't remember which but some of them are needed even if they don't do anything
Alright. It kind of seems that way. I guess I'll just compact them down in the code so they aren't obnoxious
it might just be isValid actually
you inherit most of them from the base timed action when you use derive, but the base isValid doesn't return anything, which is treated the same as returning false and ends the action immediately lol
Interesting, alright
Well this is awesome. Not only did I figure out how to get the Inventory and World Context Menus working and doing things, but also Timed Actions. So cool. Thanks again everybody
you would have to modify the container as the vehicle spawn
cuz vehicle containers are similar to world object containers the distro defines the container type
so for vehicle it uses heavy, sport etc
hi all random noob question, for my mod is it possible to make the spawn rate of the clothing somewhat configurable (ie. common, rare, very rare) in some sort of server option? Otherwise I'll just tweak my distribution file until people are happy lol
Iโm not sure for the first part
But I would make the rarity equal to real life, then just a tad rarer (not as many items in PZ as real life)
sounds good! thanks for the input
also another random question, in the debug menu is there a way to spawn a zombie with a specific outfit (i.e. a custom clown), trying to test my clothing.xml
Not that Iโm aware of
Iโd spawn a bunch and just wait till it shows up
Iโd make it super common though to save time, then set it to the rarity you want
the horde manager when you right click the ground lets you pick an outfit
how do i correctly disable recipes? i did recipe:setIsHidden(true) in lua which hides them from crafting menu, but they still show up in the context menu when u right click the ingredients
you could try something like
-- a global function which always returns false for whether or not it can perform
Recipe.OnCanPerform.AlwaysFalse = function() return false end
for --[[...]] do
local recipe = --[[..]];
recipe:setIsHidden(true);
recipe:setCanPerform("Recipe.OnCanPerform.AlwaysFalse"); -- should make every item "uncraftable"
end
``` Aside of that, unsure. (Could probably use OnTest instead, unsure which gets checked first.)
would anyone here know whats going on with this? i sent it in #mapping but im not sure if thats the right place, and all
chatgpt told me to do recipe:getSource():clear() and it works i guess, cant craft something that doesnt have any sources lmfao
Truly terrifying
you can add a sandbox option and use that value in any lua code including disttibution i think
Hello, I would like to know if there is a framework for creating craft panels this way?
Prints from the "S4 Vaccine" mod
Hello, is anyone doing a mod commission? I would like to have a mesh as a hat.
Very interesting, that could do it ๐
Hello, im curious about 3d clothing. I know clothes are generally organized by layers on the texture, however anyone thinks its possible to make clothing 3d for players?
Not necessarily 3D while on the ground, or in a container. Mainly just on the bare playercharacter themselves.
Yeah, there's already 3D clothings in the game
Check out the modding Discord
Even shirts? I thought shirts/undergarments were actually textures applied to the main body using Layers?
Shirts are not, but you can make them 3D I believe
a jacket is just a 3d shirt
they can be 3d but if an item in a higher bodylocation was 2d then it would kind of break the layering since the 3d item would always be above the body textures
Can anybody help me fins sprite IDs in tilezed
what exactly do you need?
just a friendly reminder
pls dont forget to add your tile def on the pz wiki
https://pzwiki.net/wiki/Tiledefs_used_by_mods
What is the roll Function in procentualdistributions.lua file?
number of rolls for the item
the higher the number the higher the chance
it doesnt equate to 100 percent or anything
like that
apparently my immunity mod is not working according to one person after months of no complaints. it's really strange
i'll have to look at it again and make sure the person who reported it was using a fresh save but they said they tested it with only my mod
Did you make sure to properly remove infection ? If you don't, if someone gets bit and you set them as non-infected, and they get infected once more, they will instantly die
yes, i used a bunch of things to remove infection, set infection time to -1, set infection level to 0 etc
which i got with help from others, but if this person is reporting it the bug is either still there, or they misreported
they said they used only my mod to test it, so i'll probably ask them to uninstall and reinstall it
Doesn't matter
A modpacked version will break
Bcs a modpacked version, uses your exact mod ID
And it mixes both mods together
and they r even asking me to mark my mod as broken
And you end up having your current workshop version mixed with a random modpacked
Lol, don't do that
Test your mod, if you can't reproduce, it's not broken
It's only one guy
like almost every immunity mod has that same bug, and i have not seen a single report in months
If you were getting a lot of reports, I get it, but you're only getting one guy reporting a problem
it is not unusual for bugs to go completely unreported for no reason, but it is also not unusual for one guy to confidently completely fail to even install a mod and then blame it on you
in fact, the anthro immunity mod also has that bug which is what they were using at first when they were reporting bugs
so im like 
so ur using 2 immunity mods and commenting on the one that has comments open
they said they used mine in a single player world to test it, but i have a sneaking suspicion they removed anthro immunity and then the bug still happened
Amazing
yeah the bug is inherently one that lingers
but nevertheless, i'll just ask them to uninstall my mod, verify game files, and reinstall it (or actually just not use my mod with anthro-immunity since they r both modifying the same data)
Yes but if you read it im talking about the differences between layered clothing using textures and actual 3d models in game like the jacket you mentioned. @winter bolt answered my question. It would mess up the layering if I tried to incorporate a 3d environment for cltohing. Thank you for the response though!
Something I made up today, its a "Cheat Menu" thats basically integrated into the UI like the inventory system using the astrics key. I am going to add more features, but one thing I noticed about godmode is when you have around 10-15 zeds surround you, you are basically stuck. So I added the "Kill nearby zombies" feature that basically brings all zombies within a radius of "5" to 0 health so you can get unstuck. What are some features some of you guys would like to see in a cheat menu? I know there is a very prominent cheat menu out currently. However I wanted to make my own to use. Both features do work properly and tested
Hello does anyone know a good tutorial for making a like ski mask mod I want to make my own and I want to find out how to
Anyone know how to prevent player from opening the RadialMenu? setEnabled(false) doesn't seem to do anything
Try this
function ISRadialMenu.openRadialMenu(player, x, y)
end
Events.OnKeyPressed.Add(function(key)
end)
end
Heyo, I've seen a log in my console file saying 2x version of HMW_Guitars.pack not found. I'm using the 2x folder for the sprite tilesheets. Do I need to do something with the .pack file itself?
So that should overwrite the function for opening it?
You need to overwrite or completely remove this function?
No I just need to prevent from opening it when in a certain type of vehicle
Where should I call this? I tried calling it when entering a vehicle, and constantly while in the vehicle
you should prefer not isServer() to isClient() in checks like this
singleplayer isn't a client but you obviously want this code to run in singleplayer
Good to know. Thanks
did you place the png file on the 2x folder?
just a friendly reminder
pls dont forget to add your tile def on the pz wiki
https://pzwiki.net/wiki/Tiledefs_used_by_mods
try
local menu = getPlayerRadialMenu(0)
if menu and menu:isReallyVisible() then
menu:setVisible(false)
end
That works. Thanks!
Yea I have the png's in there.
How do I add to it?

have 1 folder outside the 2x folder that should contain all your files(packfile, tiles file, and the png)
the 2x folder should also have a copy of the png file
make sure they are the same file (everytime you try and edit one of em dont forget to copy the new version to both folders)
I've had it like this
yes\
so also add the png inside the 2x file then do the process of saving the pack file again
I've already got the png's inside the 2x folder, otherwise they go weird
dont need to redo the tiles file since its just the property,it really doesnt matter what the png is but the pack files is basically the png with all the spritesheet related data(like which cnumber each sprite is assigned to and the size)so you have to redo that
When I create the pack file, which folder do I chose for the png's?
If I select the 2x folder, it adds all the png's to it
Do I remove all the pngs I don't need while I create the pack, then move them back? That seems silly though...
the folder you made
thats outside the 2x
slr
dont
you probably did everything correctly already
just do the same thing again but this time with the copied png on the 2x folder
thats it really
That's how it's always been, one in the 2x and one in the outside folder. So I'm really confused why it's showing in the console
and check your png dimension?
are you just if anyone has an idea or you want in my dm
hey guys,every time i edit a mod file, save it, then reload my game changing the mod order or turning it on/off, all the files will be updated?
yeah
you can also just reload your save
some file types need game restarts but it's rare, and some like models and textures can update live
thx! with live u mean ingame? O.O thats cool, I wouldn't imagine this
hey! So I've added a sandbox var but it's doesn't seem like the value is getting to the lua distribution file. I'm not seeing it if I try a print statement. Any advice?
VERSION = 1,
option ZomboidCrossing.CostumeRarity
{
type = integer,
min = 0,
max = 10,
default = 1,
page = ZomboidCrossing,
translation = ZomboidCrossing_CostumeRarity,
}
require 'Items/ProceduralDistributions'
--ClosetShelfGeneric
local rarity = SandboxVars.ZomboidCrossing.CostumeRarity / 25
local common = SandboxVars.ZomboidCrossing.CostumeRarity / 10
print("[Zomboid Crossing][Rarity]:", rarity)
table.insert(ProceduralDistributions.list.ClosetShelfGeneric.items, "Base.BobHead");
table.insert(ProceduralDistributions.list.ClosetShelfGeneric.items, rarity);
...
put your distributions code into a function and add it to the OnInitGlobalModData event
file run time is too early for sandbox options
ah I thought so! thanks, I will give it a try
Hey guys!
Is there a way to automatically open the window while triggering the window-opening animation?
My current approach is to add the ToggleWindow method to the ISTimedActionQueue.
The window does open, but since there is no mouse click operation in the game, and the player doesn't perform the animation of opening the window.
OnInitGlobalModData
is the event when the sandbox options first gets loaded?
Check out Braven's mod with the crowbar to open doors and windows
yes
guys i need help,when i open .pack files using tilezed and try to export them as images i do not get any images exported.
Export file path is right .
what am i doing wrong?
maybe this will be a better place to ask
Does anyone happen to know where player zombie kills are logged?
(this message includes self promotion) You may have a look at this mod https://steamcommunity.com/sharedfiles/filedetails/?id=2553809727
If only I could inspect its source, Im building a bot
you can see the source of all lua mods (nearly all mods)
downloading weeee
also thank you already inspecting the lua
hmm, looks like its referencing events like
Events.OnCharacterDeath
Events.OnZombieDead
Events.OnWeaponHitXp
I just spun this new server up today and theres a folder with a good number of logs with seemingly todays date...
anyone here that has an older server that went though new world wipes be kind enough to screenshot just the subfolders of the logs folder?
Just want to confirm if thats a dynamic folder or persistent
wip
mods can write files
most does this each server load
I got so lost in the sauce trying to find where its actually reading the kill counts Im gonna give up lol
SIC+5
SAN-5
After spending weeks trying to figure out how to make my mod (thank you glytch3r btw) I finally finished it but now I can't find it to test it. Its on the mod folder and workshop folder, it shows as subscribed on steam, Ive restarted steam and my computer, but the f`cker wont show in the mod list ingame. Am I cursed?
Cant say much but are you sure that the mod is in this mods folder?
Nope, still nothing
dunno then
how do i get the base plain vehicle textures, i wanna edit some few things
Wdym as subscribed on steam .....
Check in game\media\textures\Vehicles
i want this but without the extra livery stuff
theres this but its missing the shading color things
The shadow information is just hidden but it is still there.
how do i get it
You can make a copy and invert the Alpha value, so you will have a file with just the vehicle colors that will make editing much easier
enjoy
ohh
thanks
sorry to bother again but how do i invert the alpha value?
im new to photoshop and i dont really understand all the features and things
oh yeah i happen to have that too
ok i figured it out, thanks once again for the help i really appreciate it
I have aiming time, recoil delay, reload time and swingtime all set to the same number on two pistols yet one of them fires faster than the other and I can't figure out why
what else determines firespeed?
primarily the animation
those also all seem to be the same
Quick question. Iโm pretty new to Java, but does anyone know what the UI for the dashboard in project zomboid uses?
Did you spawn new guns? If you have a gun already spawned and change its stats like damage/recoildelay it will not affect already spawned weapon (other options like sounds will work when changed, but those two or at least recoil delay remains untill you find a new gun/spawn new gun)
Ah that might be it
I am a fool
Also if you use debug mode you can right click items and edit them there. For guns there are few things to edit like recoil/aiming time/damage and some other base stats, so you can test it there as game runs to find sweetspot for it. Also keep in mind that aiming/reloading 0 and 10 will vary in time it takes to fire/reload/rack guns.
thank you, can you tell me what aimingtime and reload time actually do recoildelay? Like which one makes it so you lose accuracy when shooting in full auto fire
Some things are no longer used, but you should find all things here: https://pzwiki.net/wiki/Scripts_guide/Item_Script_Parameters#Weapon
@uneven vessel
is there a function or method to increase fuel consumption on a specific vehicle? i can only find the creation of speed demon and sunday driver via vs code search and i cant find where it modifies the code to increase fuel consumption. unless fuel consumptions is tied into weight and speed of the vehicle
aiming time doesn't specify if higher or lower is better...
Red dot gives you 5 Aiming time, by that it makes you aim faster and more aimtime = Faster aiming. It sounds confusing
ahhh
Recoil delay on the other hand less=faster firerate
But firerate also depends on animation
you could try adding onplayerupdate
check if player is driving and the engine is running
then fetch the fuel
then slowly decrease it
so your function and vanilla function decreases the fuel
its found on the pack files
will try that thank you
I dont know anymore... I thought I finished it, but the damn thing won't show on the mod loader list. The files are there, but it wont show
Expanded Helis: Super Weird has aliens
guys goodnight, i'm wondering what is wrong
i'm trying to make a code that reads when player is with a weapon equipped in both hands, and then play a sound.
But i can't figure out a way to play the sound(who players and zombies can hear)
You can call player:playSound(soundName)
zombies also hear?
My intention is for the item to make a noise so that both the player and the zombies can hear it.
i already used player:playsound, but i never tought that worked for zombies too
look into WorldSoundManager addSound
this is how you make a sound that zombies can hear, but you do still need to do the actual audio playback separately (player:playSound is perfect for that)
that's great
This item is a chainsaw, so when the player equips it in their hand, I want it to make a constant noise. So that you be very helpful
thank you :)
but one question if you don't mind, How do I make it so that when I take the chainsaw out of my hand the sound stops?
If I define it as loop (there in the scripts). the sound will continue playing even after removing
I'd avoid using any looped sound tbh
I've had only issues with it and EHE
But if you get the player's sound emitter you should be able to check isPlaying(soundName)
So .... you just uploaded your mod without even checking it works ?
Ive never done anything like this before. Glytch3r already told me that was a terrible idea. I have deleted the upload from the workshop and have done some adjustments he told me to do. Hopefully it'll work now, but I can only test it in a few hours when I get home
Im not the sharpest tool in the shed when it comes to this. I started to learn how to mod about a month ago
Ok so one thing: you shouldn't need to download your mod to test it and that's for three reasons:
- when you have a local copy and workshop copy with the same mod ID, they will clash and mix, and you end up testing neither of both
- you already have a local copy, if that copy works, there's 0 reasons for the workshop uploaded version to not work
- tho you have to make sure you create your mod while in Zomboid/Workshop, and not Zomboid/mods ! The reason is that to upload it needs to be in /workshop, and you shouldn't have 2 copies of your mod, in both /mods and /workshop or they will clash together too
Ah, I went the extra mile when I was trying to test by myself and placed the mod in 4 different folders ๐
hi guys, anyone knows why mods that got unique skills like more brews got brewing/wine brewing skills, the code in perk.txt file that defines the xp needed to lvl up is 2/3 of what need ingame?
What about octopus aliens
hello there im currently maikng an inproved vannila radial ui
im in -debug mode but that error screen doesnt come up automatically when errors happen. i cant remember the hotkey to bring it up because its been a while... anyone can remind me? ๐ฅฒ
f11
Nice !
Hello does anyone has a advice .I want to change the Color of the bloodsplatters.open the 1xtile.pack in pack viewer
Find the side with the bloodsplatters Extract (Prefix overlay blood)it in png .Edit the bloodsplatters png and make a pack file of it.But how can i get this new pack file into the original 1xtile.packfile,so it appears in game???
this is my first mod in zomboid(irl too haha), thx to ppl who helped me with my doubts!
https://steamcommunity.com/sharedfiles/filedetails/?id=3358170815
you should be able to just overwrite the file by placing it in the textures folder as the png in a mod. If you want to directly modify the games files to have this you'd have to open and extract then repack everything in the .pack file i think. It may also be possible to put it in the game textures folder. I may remember wrong, i know for sure if you repack it and put it in the texturepacks folder in a mod it will overwrite the old one as long as it is the exact same name
Which mod was it that gave blowtorches 14 units?
That's specific
there was one that was popular that gave them 100 because everyone was mad about that patch if you're thinking of that
i think it was just called something like blowtorch fix
imo build menu is the new standard. not only does it have a blow torch value you can set yourself in the sandbox settings but it just generally makes building far nicer.
houses with actual slanted roofs

i don't really have any opinions on this, i never used either
Paint 
I just felt like shouting it out. I didn't follow the convo
on the topic of paint I need a mod that lets you craft it. the paint requirement on a lot of the tiles is annoying
granted even that can be changed or disabled which is nice
Oh that's build menu I can use to set it in? I see
Hello guns do you mean put the new pack file (name it 1xtile.pack)in the mod Folder?But the new one has only the blood Splatter in there.
14 might just be the vanilla value but yes build menu lets you change it
yes it should go into the texturepacks folder and just it having the same name as games file will overwrite it when you load the game
Check out the Machine mod
Hi! Iยดm working with a friend in a mod. Iยดm designing new sounds for new guns of the mod. Does anyone know how can i make the shots sound different depending on whether they are indoors or outdoors?
You can't 
@tranquil kindle can expand on that

Maybe with .bank files there is something that could help. I myself did not visit that territory
Or you could maybe check if player is in building, and then change inventoryitem sound, but that sounds like a pain in the rear
I understand, can i talk to you on dm to ask you some more questions about that?
keep in mind there isn't really mod support for bank files
There is no need for dm's, i know things to some degree, but here you might have a chance to hear multiple advices from diffrent people. There might be multiple ways to do what you want to
Requires manual install
Yea, and two mod requiring modifying of .bank file and you're fucked
i wonder if a java patch for it would be difficult
from what i've seen of the bank code, not really
No idea
question: I know that script files can be made to override the vanilla script entries, example changing a sound pointer from it's original sound to a new file in the mod folder. Is there a way to change that in lua on the fly as opposed to in the script files where lua doesn't run?
Iยดm gonna say to my friend to come here and talk about this because iยดm only the sound designer. He is the one that knows all about game code and all that stuff hahhaha. Thank you so much guys๐
DoParam
doparam is only for items
Ah
sound script objects can't be modified at runtime by lua but you may be able to override them with ScriptManager.ParseScript
thanks, I will look into that
hehe
lunchly
now make the character say "is that.... mold?" when they eat it
item should have like +500g of sodium and potassium lol
they are going to make buildmenu
txt based?? is this a good thing?
it's definitely much better
yeah its better. it makes it super easy for adding context addons to it
Not sure lmao
To be honest they could have left them in lua because projects with a lot of buildables can quickly turn into an organizational mess. LUA allows for modular code that can be split up, reused, and maintained.
Could I recommend a possible car mod? EVELYN the 2002 Subaru WRX STI as a car mod from the twisted metal TV series
if they provide us with lua functions to modify them on the fly i dont think its that bad
something like scriptmanager
but this time for the text based menus
i also think this allows modders who does not use lua be able to create more menus now
yeah sure mate
amateur behaviour
ty
i finished my RV
hello guns ,thanks for your advice it is work fine. now one question more I name the new packfile like the pngs i edit overlay blood floor01.png)now i want to change the color of every overlay blood wall.pngs . Can i put all the png`s (blood floor &blood wall) in one folder, create packfile and what name i must select for the mod folder?Or must i edit two mods folder (one for blood floor and one for blood wall)?
require "ISUI/ISPanel"
MyUI = ISPanel:derive("MyUI");
function MyUI:initialise()
ISPanel.initialise(self);
self:create();
end
function MyUI:prerender() -- Call before render, it's for harder stuff that need init, ect
ISPanel.prerender(self);
self:drawText("Hello world",0,0,1,1,1,1, UIFont.Small); -- You can put it in render() too
myUI:setVisible(true);
myUI:addToUIManager();
end
function MyUI:render() -- Use to render text and other
end
function MyUI:create() -- Use to make the elements
end
function MyUI:new(x, y, width, height)
local o = {};
o = ISPanel:new(x, y, width, height);
setmetatable(o, self);
self.__index = self;
return o;
end
Events.OnNewGame.Add(MyUI)
it isnt working :/ can someone help , im trying to learn how to make UIS
i fixed it , how i can know the cordinates ? like x and y , do i need a site ?
its your x and y on your screen resolution
x=0 and y=0 is top left if you increase x it goes to the right, if you increase y it goes down
thank you , it was more easy if visual studio code had an extension that we could see the ui
but and if i want to put an button inside an ui ?
inside your MyUI:create() function you can do something like this
self.leftButton = ISButton:new(x, y, width, height, "text", self, onButtonDown); self.leftButton.internal = "Left"; self.leftButton:initialise(); self.leftButton:instantiate(); self:addChild(self.leftButton);
function MyUI:create()
local btnWid = 75
local btnHgt = getTextManager():getFontHeight(UIFont.Small) + 2 * 4
self.button = ISButton:new(x, y, btnWid, btnHgt, "My button", self, MyUI.onOptionMouseDown); <-------- imagine that i want to put it inside an ui , do i need to put like the x and y inside the ui?? if i put the x and y like 400,500 and the ui in 600,700 the button will not appear inside an ui but if i want to have a window that can move around , how can i connect it to stay in the same place??
the x and y on the ui elements is relative to the ui itself
if you put your ui on x= 600 and any element on x=400 the element will be on x=1000
the top left of the ui in this case is x=0 and y=0 you need to position it based on the ui
how can i make the ui for i can move it around ?
is something related to ISCollapsableWindow
inside your MyUI:new Function you add o.moveWithMouse = true
you actually know how to make uis , how do you learned ?
mostly looking at vanilla ui code and other ui mods code, also lots of trial and error
hahaha
self:drawText("Text", x, y, r, g, b, a, UIFont.Small)
why so many coordinates,how does it work ?
x y r g b a
x,y= position| r, g, b= color | a = alpha
opacity
ohh okk
need to put the button a little bit more to the left
@indigo pasture thanks for being teaching me โค๏ธ ive been so many weeks looking to learn how to make uis
how can i add this part to it on the top ?
that i don't know how
from the name i'd guess it's what you want probably
That s the tile bar, you probably want to derive your ui from ISCollapsableWindow
That allows you to well, collapse it
Just one mod and one pack file I'd fine. You can load up the pack file with whatever you want and it will overwrite vanilla files with the same name
my tutorial has "This is the base of a UI, it's gonna display a rectangle with "Hello world" write in it.
Note: ISPanel car be change to ISWindow or ISCollapsableWindow."
its actually working but when i open the menu the screen starts blinking
require "ISUI/ISCollapsableWindow"
local FONT_HGT_SMALL = getTextManager():getFontHeight(UIFont.Small)
MyUI = ISCollapsableWindow:derive("MyUI");
function MyUI:initialise()
ISCollapsableWindow.initialise(self);
self:create();
end
function MyUI:prerender()
ISCollapsableWindow.prerender(self);
self:drawText("Hello !", 250 ,20, 0,0,255,1, UIFont.Small);
end
function MyUI:render()
end
function MyUI:new()
local o = {};
x =400;
y =400;
o = ISCollapsableWindow:new(x, y, 500, 400);
setmetatable(o, self);
self.__index = self;
o.variableColor={r=0.9, g=0.55, b=0.1, a=1};
o.borderColor = {r=0.4, g=0.4, b=0.4, a=1};
o.backgroundColor = {r=0, g=0, b=0, a=1};
o.buttonBorderColor = {r=0.7, g=0.7, b=0.7, a=0.5};
o.zOffsetSmallFont = 25;
o.moveWithMouse = true;
return o;
end
function onCustomUIKeyPressed(key)
if key == 21 then
local myUI = MyUI:new()
myUI:initialise();
myUI:addToUIManager();
end
end
Events.OnCustomUIKeyPressed.Add(onCustomUIKeyPressed)
when i click on "Y" the ui opens but my screen starts blinking
To make it more readible in discord do
require "ISUI/ISCollapsableWindow"
local FONT_HGT_SMALL = getTextManager():getFontHeight(UIFont.Small)
MyUI = ISCollapsableWindow:derive("MyUI");
function MyUI:initialise()
ISCollapsableWindow.initialise(self);
self:create();
end
function MyUI:prerender()
ISCollapsableWindow.prerender(self);
self:drawText("Hello !", 250 ,20, 0,0,255,1, UIFont.Small);
end
function MyUI:render()
end
function MyUI:new()
local o = {};
x =400;
y =400;
o = ISCollapsableWindow:new(x, y, 500, 400);
setmetatable(o, self);
self.__index = self;
o.variableColor={r=0.9, g=0.55, b=0.1, a=1};
o.borderColor = {r=0.4, g=0.4, b=0.4, a=1};
o.backgroundColor = {r=0, g=0, b=0, a=1};
o.buttonBorderColor = {r=0.7, g=0.7, b=0.7, a=0.5};
o.zOffsetSmallFont = 25;
o.moveWithMouse = true;
return o;
end
function onCustomUIKeyPressed(key)
if key == 21 then
local myUI = MyUI:new()
myUI:initialise();
myUI:addToUIManager();
end
end
``` Thats what i mean*
hello i am trying to make myself a mod for repairing weapons and tools,
fixing Fix Axe
{
Require : Axe,
GlobalItem : BlowTorch=1,
ConditionModifier : 1000,
Fixer : SmallSheetMetal=1;,
Fixer : ScrapMetal=1;MetalWelding=1;,
}
this is what i use, is there any line of code so that after every repair, chance of success don't drop,i want it to remain at 100 percent so i can repair it forever, i was trying with and without MetalWelding=1 as you can see but it's still dropping? thanks
you can
also show them by doing this
``
--code
``
youre setting the x and y as global btw
use local
local x = 400
local y = 400```
Does any of this work? I remember someone saying that fixers are hard coded and First Fixer will always repair the most, then next one less and so on and so on and that we have no way to change values for those. Same might be with chances of success. You could always make a recipe to fix it. By default i noticed that if you make recipe, get Item you want to repair and other items as that are used for "fixing" and result will be your item, it will repair it slightly (to repair it to full you would probably use onCreate Function to always get 100% condition result), or with something like destroy thing so your item will not use any of conditions of items used:
{
destroy Axe,
Woodglue,
Result:Axe,
Time:50.0,
}
Also using raw recipe will zero your times repaird so your repairs with right click on item will be as efficient as they can be.
I learns something new every day
Though i'll probably forget it soon knowing myself
you can also escape any special characters with \
```lua
--test
coool
we learn something everyday
Nice, I think that's basic markdown
does anyone know how to additem Base.556Clip with full ammo?
setCurrentAmmoCount(int ammo) will set its ammo.
getMaxAmmo() gets the max.
item:setCurrentAmmoCount(item:getMaxAmmo())
thank you
where do i type that
idk what are you trying to do exactly?
ingame, as admin
when i type
/additem Base.556Clip
it spawns an empty m16 clip in my inventory
i want to spawn them full
someone suggested i asked this here
well that's not something that can be done through simple admin commands i think
you can use the lua console
launch the game with -debug as launch paramaters
how do i rotate this ๐ญ
okay i launched with debug
this caused an error
item:setCurrentAmmoCount(item:getMaxAmmo())
ah cuz its not a complete code
wait
what was the item called again?
Base.556Clip
let me get to my pc
the description has something called ammo count
idk what the lua variable would be called but i assume its similar
try local item = getPlayer():getInventory():AddItem("Base.556Clip"); item:setCurrentAmmoCount(item:getMaxAmmo())
sure
is local item a keyword? or is that just a random variable name you are making
It makes the variable local, not global
and how does it know to tie that to the next part item:setCurrentAmmoCount(item:getMaxAmmo())
oh
local is the keyword
item is just a throw away name
?
local is a keyword that makes the variable restricted to the current scope, item is just the name of the variable
Yea
Yoiu could replace item by anything
Exactly
never used lua before
I believe the wiki has a decent lua guide
bump
since albion already got the code for you i decided to instead provide another code that lets you configure what to spawn and how many
local function magSpawner(qty, itemStr)
local qty = qty or 2
local itemStr = itemStr or "Base.556Clip"
local pl = getPlayer()
local inv = pl:getInventory()
for i = 1, qty do
local item = inv:AddItem(itemStr)
local ammo = item:getMaxAmmo()
item:setCurrentAmmoCount(ammo)
end
end
--just change this 5 is the qty and "Base.44Clip" is the item
magSpawner(5, "Base.44Clip")
--without adding paramaters
--this will spawn by default 2x "Base.556Clip"
magSpawner()
@fathom forum
Hello, just joined. I was wondering how folks start creating mods? Do you use notepad ++ or is there a more definitive way to begin creating a mod?
vscode is by far the most popular program for it
Will visual studio 2022 work? It's the IDE I currently use.
i don't really know anyone who's used it for zomboid, it probably works fine as long as there's a decent lua extension but it is built for c++/c# so i have no idea how good of a fit it is
Thanks for the input! I use it for Java but I'm gonna see if it has a lua extension.
Ooooo VScode looks really nice actually XD Will be better for Java for sure. Does anybody have a good resource on integrating written code as a mod into the game?
finally done with dungeon maker mod
Dungeon Maker Mod:
Allows Server Admins to Setup Dungeon Challenges
Keys = Entrance
Chest = Exit (you may also exit anytime via right click context option)
Keys and Chest Colors are related to their Level
| LEVEL | COLOR |
| 1 | White |
| 2 | Blue |
| 3 | Red |
| 4 | Gold |
Teleport:
Entering / exiting will je done v...
Is that a hat? or its supposed to be something else?
If its a clothing item, even if its a hat i still suggest parenting it to PZ armature and weight painting it
hat
So thing is, for hats you don't need to parent them to armature if you go vanila way, however its so intuitive, that you'd probably need to rotate model and move it around, then apply transforms untill it just sits on the head, but the worst part is you either go blind and try over and over, or find a mod that does it exacly the same and use it as a base. Other way would be to use PZ armature, add your hat model, move it so it sits on head like you want to, apply transforms, parent it to Armature. Then you select your hat, go into edit mode, select all faces and weight it to bip01 Head. Then you export it with armature (without body model) and translation data
Bro , YOUR MOD IS SOO GOOD
require "ISUI/ISCollapsableWindow"
local FONT_HGT_SMALL = getTextManager():getFontHeight(UIFont.Small)
MyUI = ISCollapsableWindow:derive("MyUI");
function MyUI:initialise()
ISCollapsableWindow.initialise(self);
self:create();
end
function MyUI:prerender()
ISCollapsableWindow.prerender(self);
self:drawText("Hello !", 250 ,20, 0,0,255,1, UIFont.Small);
end
function MyUI:render()
end
function MyUI:new()
local o = {};
o = ISCollapsableWindow:new(400, 400, 500, 400);
setmetatable(o, self);
self.__index = self;
o.variableColor={r=0.9, g=0.55, b=0.1, a=1};
o.borderColor = {r=0.4, g=0.4, b=0.4, a=1};
o.backgroundColor = {r=0, g=0, b=0, a=1};
o.buttonBorderColor = {r=0.7, g=0.7, b=0.7, a=0.5};
o.zOffsetSmallFont = 25;
o.moveWithMouse = true;
return o;
end
function onCustomUIKeyPressed(key)
if key == 21 then
local myUI = MyUI:new()
myUI:initialise();
myUI:addToUIManager();
end
end
Events.OnCustomUIKeyPressed.Add(onCustomUIKeyPressed)
@ancient grail do u know how to solve ?
thanks for the help
trying to fix
im not sure i think it might be the event your calling
also you lack paramaters on the new
it should have 4 params
What params are missing?
x, y ,w, h
Where are they missing?
is this a good place to chat about mods as a mod user too?
like mod suggestions and stuff
There's a thread for mod ideas, but idt it's really used
For a mod user asking questions you'd want #mod_support, but for discussing creation of mods (including theoretical) this channel makes sense
ah knew i shoulda clarified a bit more
i mean asking for mods to download
like "any cool mods that touch up texture issues"
AhโI think an argument could be made for putting that here but imo #pz_b42_chat is better for that
ok thats fair
i was doing that before i just didnt know if that was the right thing aha
thanks for clarifying!
how do i require another mod file with my mod? and overwrite it
im looking for editing just a few numbers on a manually installed .class java mods (on zombie\ directory) on workshop, what should i start off from? ๐
Hi i'm new to zomboid modding, is there any hotkey to quickly reload all the lua scripts?
no, but you can reload individual files in the f11 debug menu (this will break things if you didn't write around it) or reload the save for a full lua reload
Okey, thanks for your answer!
Check out community modding tools too
You can reload multiple files
Debug tools
That may helps a lot, thanks
Hello everyone. if I make a mod for a car, can I make it so that it doesn't spawn in the world? So that it can be saved only through the admin panel on the server. Is this possible?
yes, in fact it will not spawn in the world by default, you would have to add it to a vehicle zone if you wanted it to
Oh, great. so if I don't add any zones, there won't be any chance at all that the car will appear in the world?
if you code with java, download intelij, its free from their website, i promise your life will change
I found what looks like an old tutorial for intellij for zomboid modding yesterday. Was setting up the workspace when it ran into an error accessing the directory. I had successfully set the directory for the capsid project just before that step but it still failed out. Might be because the tutorial I was following was still referring to Java 17 lol
yeah i wouldn't use it for lua based programming, but in regards to anything java its such a breeze to work with
don't follow that, it's ancient
intellij is no longer a good choice for zomboid at all and the tool it's trying to get you to install is heavily outdated and doesn't even work in modern versions
https://github.com/asledgehammer/Umbrella is the modern equivalent, it works with any ide and doesn't require you to manually generate anything
WARN : General , 1730684735026> MeshAssetManager.loadCallback> Failed to load asset: AssetPath{ "Book
WorldStaticModel" }
WARN : Script , 1730678147712> ModelScript.check> no such model "???.grimoremodel" for Base.Occult_Mag
i get this errors.. im trying to place a mesh model i made into a mod, it also has its texture.
the game gives me the possibility to place the item , but its invisible.. and then it drops the icon image of the item
Yeah setting up gradle I think is where it pooped out
It looks like it's having trouble pathing to the image
it's just built for much older versions of idea, it was long abandoned even by the time i started modding
Ahhhhh, that makes sense. That walk through was asking for oracle dist. Java 17 which was concerning lol. I'll try the other one you mentioned
Is there any way to use a database within Project Zomboid, such as lsqlite3 or similar? I've tried placing a locally compiled lsqlite3 file within my mod to load and call it, but it doesnโt seem to work. Are there any alternative methods to allow a mod to write data to a database?
Any help would be greatly appreciated!
I still use notepad old school, I only use notepadd ++ for translation files to make sure the language symbols translate right, I use VSCode to find things some times though. So those that pull my code into other programs hate me for the formatting issues. doh!
Okay very awesome. I've never made a mod before but I've done a lot of java programming so I'm hoping to get the structural concepts of integrating whatever I write i to zomboid properly. Been playing with the vscode and it's assistive features are fantastic
is there a way to generate custom zombie outfit using lua?
i know this isnt possible since there are xml files and have own guid
but theres a guid function so maybe its possible?
maybe something that is similar to how reanimated player works since its wearing whatever the dead player was wearing
if you want to change a specific zombie's clothing, you can just mess with their itemvisuals
i feel doubtful that you can generate an actual outfit at runtime but i don't know that for a fact
Wait it works with any IDE now ?
Like albion stated, you can use itemvisuals
I think that it means any IDE which has support for plugins that can read meta luta files like how luals does it
๐
i want to like be able to mke custom custom outfit
like getOutfit()
doesnt matter what it looks like
also i cant figure out the syntax for using that item visual thing
i tried before but failed
i probably did something wrong
I don't think it's possible
Yet it's easy
local visuals = zombie:getItemVisuals()
for i = 0,visuals:size()-1 do
local visual = visuals:get(i)
end
It's an array
Of all the clothing pieces
You can print visuals if you're curious, or print single visual
You'll see how it is
Javadoc Project Zomboid Modding API declaration: package: zombie.core.skinnedmodel.visual, class: ItemVisuals
Javadoc Project Zomboid Modding API declaration: package: zombie.core.skinnedmodel.visual, class: ItemVisual
You can modify anything that way
Zomboid Forge is a Project Zomboid framework that can be used by modders to easily create custom zombie types. - SirDoggyJvla/Zomboid-Forge
Check out this part of Zomboid Forge
This is where I handle visuals for zombies
How to remove a clothing for example
https://github.com/SirDoggyJvla/Zomboid-Forge/blob/2567f28311da7a227075b1997e4dcdf3ee5e8b9e/Contents/mods/Zomboid Forge/media/lua/client/ZomboidForge_visuals.lua#L141
Zomboid Forge is a Project Zomboid framework that can be used by modders to easily create custom zombie types. - SirDoggyJvla/Zomboid-Forge
-- this will remove all the clothing pieces from a zombie
local visuals = zombie:getItemVisuals()
for i = 0,visuals:size()-1 do
local visual = visuals:get(i)
visuals:remove(visual)
end
-- that too will (untested)
visuals:clear()
Couldn't you just do visuals:clear() instead of looping in Lua?
that clears the array list
how do i set?
cuz i manage to get this far atleast but couldnt figure out how to set
oh wait ill read the link on modify
found it
item visuals
from zomboid forge
by @bright fog
-- This function will replace or add clothing visuals from the `zombie` for each
-- clothing `locations` specified.
--
-- `1: checks for bodyLocations that fit locations`
-- `2: replaces bodyLocation item if not already the proper item`
-- `3: add visuals that need to get added`
---@param visuals ItemVisuals
---@param locations table --Zombie Type ID
ZomboidForge.AddClothingVisuals = function(visuals,locations,gender)
-- replace visuals that are at the same body locations and check for already set visuals
local replace = {}
local ZData
local choice
local location
local item
for i = visuals:size() - 1, 0, -1 do
item = visuals:get(i)
location = item:getScriptItem():getBodyLocation()
if locations[location] then
ZData = ZomboidForge.RetrieveDataFromTable(locations,location,gender)
-- if data for this ZTypes found then
if ZData then
-- get current and do a choice
local scriptItem = item:getScriptItem()
local current = scriptItem:getModuleName().."."..scriptItem:getName()
-- chose item if current not in ZData
choice = ZomboidForge.ChoseInTable(ZData,current)
-- verify data was found in the list to chose or current is not choice
if choice then
item:setItemType(choice)
item:setClothingItemName(choice)
end
-- location already exists so skip adding it
replace[location] = item
end
end
end
-- check for visuals that need to be added and add them
for location,item in pairs(locations) do
if not replace[location] then
ZData = ZomboidForge.RetrieveDataFromTable(locations,location,gender)
choice = ZomboidForge.ChoseInTable(ZData,item)
local itemVisual = ItemVisual.new()
itemVisual:setItemType(choice)
itemVisual:setClothingItemName(choice)
visuals:add(itemVisual)
end
end
end
I guess maybe
Was mostly to give an example of what he can do
But you're probably right
if it's just an example then its ok!
๐
how to replace moodles
They are kind of hardcoded sadly
So if you mean like the texture, the moodle circle visual, check out mods that change it
But if you mean like modify each moodles themselves, to stop them from appearing for example, you are fucked
texture
Must be stored somewhere, maybe in a .pack file
i dont even know how to access a .pack file
like what tools to use
i think i found something
Tiled/Tilezed
The Project Zomboid Modding Tools
Search in your Steam library
It comes with the game
thanks
Where in pz can i find the little item Icons?I only find the 3d models and the textures .
you mean where they are stored for the game? they are going to be in texturepacks in a .pack file i believe
Hello guns ,the name of the .pack file you know?Apropos it' s work very fine without answers from my previous question about the png in pack file, thanks
In the u2.pack I believe or something similar
Sorry i mean Not without i mean with your answers i have a german correction when i write very fast
Yeah why not
thanks,found it in the UI2.pack
๐
Anyone else ever tried to make a curtain mod? Like a mod that adds a new type of curtain?
there should be some tiles settings which makes that possible
Hi guys, just a quick question, im currently trying to create a mod related to pvp enabling / disabling, and since this is my first time doing this sort of modding, i'd like to know:
- what event do we specifically listen to for registering pvp hits
- does pvp have to be enabled for the attacker for this event to be fired, or can pvp be disabled for both characters and the event would still activate?
Yes, Ive been trying to make one and yesterday I realized it wasnt working because on mod.info I put the wrong name on tiledef and pack, but I wanted to know if anyone had ever tried to make one so that we could maybe work together or could give some tips/references. Glytch3r has been giving me some help understanding what modding is (shoutout to glytch3r btw), but theres almost zero info online on how to do this specific type of tile and wanted to see if I could find more resources
yeah glytch3r's a chad
hmm, have you tried https://projectzomboid.com/modding/zombie/iso/objects/IsoCurtain.html
declaration: package: zombie.iso.objects, class: IsoCurtain
IsoCurtain
DAMN
Thank you, you beautiful angel
try
function isPvPHit()
local attacker = getPlayer():getAttackedBy()
return attacker and instanceof(attacker, "IsoPlayer") or false
end
im afk atm so double check syntax
also iirc
theres a pvp hit state too
and and hitreaction animation
check those if this doesnt work
Hiya, is there a sheet, or place, that lists all the room names? eg. livingroom, laundry, etc.
in Distrubutions.lua i think all of the names at the start of each table is a room name
Guys, can someone send me the sound of a zombie knocking on the door?
Does that exists? Could try using ai to make some variations and see what sounds better... Or use Audacity to record you knocking on something.
It's not me who needs the sound from the PZ
It exists, I just can't find it on websites. I need to either write it down or find it in files, but I don't have access to the game.
you probably want zombieImpact.ogg
I dont have much time to listen one by one, but Im sending you a WeTransfer link with the sounds folder so you can check them out
Sent
most of the sounds in the sound folder are unused so it might not be in there
Ah damn it
I tried searching more sounds with .ogg format and they were all in the sound folder
they're not loose files, they're in fmod banks
the loose files are mostly left overs from before those were used, only a select few are still used
I would be grateful if you send me this sound.
You need to extract the sound files from the ZomboidSound.bank file. I can send you a link I found on how to do it, but if you really just want a 10 second clip of the zombies banging on the door I dont think it'll be worth the trouble unless you also want to learn how to extract bank files
Any mod suggestion to make similiar gameplay like tarkov?
Have you tried this mod? https://www.escapefromtarkov.com
(Serious answer: you're probably better off getting mod suggestions in #pz_b42_chat than here)
Inventory tetris
Does anyone know if its possible to make your character temporarily gain a trait after consuming an item?
yes. when you eat something you can fire a function (idk how)
then you make that function give a trait and make a countdown im moddata (for exmaple, hoursLeftWithMyTrait) and set it to X
then you also add event that fires every hour and reduces your counter, when reaching 0 you remove the trait and remove the event
^
thanks for a point in the right direction, im making a mod for the first time. ill look more into it
Shut up
That's not nice
You can express disagreement or disdain for AI suggestions without being rude about it
Well, I wasnโt intending to be nice
AI is lazy and low quality
You should reread the rules and think about what โbe lovelyโ means, then
Your feelings towards AI aren't an excuse to be rude. I don't care for the suggestion either, but that's no reason to be disrespectful towards someone
Iโm sad that you feel that way
No need for a counter, you can use a timestamp directly
Does he get paid for modding ? No. Then leave him alone
Using AI for art and shit when you're modding is fine tbf
You won't be good in every fields, nor do you have money to put in art, voice acting and shit
Hurr durr, AI = bad, hurr durr
or that
You trying to make a drug mod?
Pretty much lmao, i plan to add different medicines and you can overdose or make different drugs with them
AI when used as an assistanting tool is more than acceptable. Also, saying shut up without adding nothing to solve the person's problem puts it you in the same category of people who try to profit off of AI-only made art. Zero contribution to society, just another clown
Niiiiiiiiiiiiice, a bit like fallout's drugs?
kinda, i dont really remember how that works in fallout. but one of my ideas and reason for asking is cause i wanted to add Benadryl, to cure colds but if you overdose on it, it would temporarily give you the schizophrenia trait from another mod and some bad effects
make cocaine give +4 strenght and agility
yes that was one of my ideas, mainly im thinking it makes you very nimble so you could take it before killing zombies but will have negative effects when it wears off
check out my substance x mod
here use it for reference
@torpid cargo
https://steamcommunity.com/sharedfiles/filedetails/?id=3290580738
it temporarily gives you trait
i used the trait thing to add condition
it should be a trait at all
its just a hacky way of doing the mods project scope
wow thanks bro, will definitely check it out
Guys one question, i see a lot of renders to mods in workshop. Is there any template to make characters pose like this?
I uploaded the .blend file with hte renders on github, you can use it too. I didn't follow any guides specific for that.
https://github.com/eI1on/workshop_resources/blob/main/3D_Renders/BM_Workshop_Renders.blend
But you needed to put every hair/clothing manually and config to the bone? complex or something basic
ah yes, but they are quite simple
I followed this to attach the clothes to the character https://www.youtube.com/watch?v=IkfgHp_eDdE
YouTube is something I do in my spare time, so in order for me to do this full time, support the channel and brand by joining any of the links below and get invited to my private community!
Links to support the channel and/or get help:
Website Membership: https://www.tldstudios.net/plans-pricing
Patreon Membership: https://www.patreon.com/DaleT...
If Im making a mod that is basically a copy of the sheet curtain, do I need to do anything to the option menu to show the option to add the curtain to the window like it shows for the sheet? Like on the dropdown menu it shows "Add Sheet to window" or something like that (dont have the game with me atm) and I was wondering if I need to do a script that will show the same option for my custom curtain
you mean context menu?
OnFillWorldObjectContextMenu
Triggered when world object context menus are being filled.
Integer The index of the player for which the context menu is being filled.
KahluaTable The context menu to be filled.
KahluaTable The world objects available nearby the player.
Boolean Set to true if called for the purpose of testing for nearby objects.
local function OnFillWorldObjectContextMenu(playerIndex, context, worldObjects, test)
local player = getSpecificPlayer(playerIndex)
end
Events.OnFillWorldObjectContextMenu.Add(OnFillWorldObjectContextMenu)
the sheet behaviour is very likely hardcoded to that specific item, you'd have to look around the vanilla game to see how it works
good afternoon guys, for now it's impossible to make custom generators in vanilla style right?
with menu, custom consumption, range etc
I've never seen many mods about it and I wanted to know how difficult it would be to do this
Every step closer I get, I find out victory is further than before
it's not impossible but all the core generator logic is hardcoded java stuff
So basically i can't do for example: a generator that uses compost to make energy
or something like that
you can but you'd basically have to rewrite generators in lua
oh i see
Thank you :)
if you manage to figure out how to modify its data then you just need an event to trigger those functions when the generator is running
A shame that in tilezed, there is no "Iso generator" option ๐
Hi! Has anyone ever noticed that when you change a vanilla item's property via the doParam command, it may cause problems when the mod is added to an existing save game? What happens for me is that the game then deletes the items I want to change with the command. Is this a known problem?
if you change its type, yes
different types use different save formats so it is not possible for the game to load items that have changed type
btw, here is my code from my mod:
local name = "Base.Razor"
local item = ScriptManager.instance:getItem(name)
if item then
item:DoParam("Type = Drainable")
item:DoParam("UseDelta = 0.05")
item:DoParam("UseWhileEquipped = FALSE")
item:DoParam("cantBeConsolided = TRUE")
end
end
Events.OnGameBoot.Add(changeRazors)```
ah... I guess it is because of the "Type = Drainable"?
will it then delete all razors (in my case) from the map? or only from parts of map which have already been visited by the player?
thanks! good to know!
I added a poster.png and I've declared it on mod.info, but I still don't get the thumbnail. Does anyone know why?
most common mistake is to modify your dev/workshop version that is not in C:\Users\usuario\Zomboid\mods. Else you could have multiple mods with the same ID. maybe just restart PZ for the poster (for the icon it is not required though)
I have restarted the game multiple times, and I don't get what you're trying to say, should I upload the mod to the WorkShop and it'll have the thumbnail?
forget it, move your mod.info and poster.png one folder upper (in spitfire, not in media)
it is already there
in your picture above it is under media
check there is no mod.info nor poster.png under media and edit the one in spitfire
in Visual Studio Code it kinda looks like it's inside media, but it's outside
on this picture you are clearly modifying something else than C:\Users\usuario\Zomboid\mods\spitfire\mod.info
so
I still don't understand, sorry
I don't get why you're saying something about the route
mod.info and poster.png are on the Spitfire folder, but outside media
why can't tiled export tile images from .pack files?
you have multiple Spitfire folders one you modify, and one PZ is using
yes, but they're the same
here I have the one that's on the game, but it's just a copy-paste of the version I made
then it works
the mod works, but in the game, there's no thumbnail
just to make sure, the image is actually formatted as a png and not just a renamed jpeg or something?
yes, type of file: png
could you send the image here?
i threw it into one of my mods and immediately got this error:```
ERROR: General , 1730935239161> DebugLogStream.printException> Stack trace:
java.util.concurrent.ExecutionException: java.io.IOException: Not a valid PNG file
at java.base/java.util.concurrent.FutureTask.report(Unknown Source)
at java.base/java.util.concurrent.FutureTask.get(Unknown Source)
at zombie.fileSystem.FileSystemImpl.updateAsyncTransactions(FileSystemImpl.java:314)
at zombie.GameWindow.logic(GameWindow.java:309)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:765)
at zombie.GameWindow.run_ez(GameWindow.java:667)
at zombie.GameWindow.mainThread(GameWindow.java:495)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Not a valid PNG file
at zombie.core.textures.PNGDecoder.<init>(PNGDecoder.java:117)
at zombie.core.textures.ImageData.<init>(ImageData.java:257)
at zombie.asset.FileTask_LoadImageData.call(FileTask_LoadImageData.java:48)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
... 1 more
so, should I change the image?
that's just the file extension, it doesn't mean the data is actually formatted as one
probably yeah
you can open it in paint and then save it as png i think
yeah, it worked, thank you
damn you caught that
that wasnt obvious
amazing
couldn't see anything wrong with the configuration so it had to be the image, and the image was showing up fine elsewhere so it had to be in a valid but wrong format
This is going to sound like an extremely stupid question, but is there a way for me to add icons to recipes I made using the script?
Is there something in lua for that?
if it's added by the time OnFillInventoryObjectContextMenu fires, you can search the context menu for the option and set its icon
Unfortanely i made that using Script
I suppose there's nothing that can be done for conventional recipes.
right?
you can modify any context options through OnFillInventoryObjectContextMenu. atleast from what i can tell
well in the inventory context in this case
heres how you can do this. i haven't done this but i've used to add and remove options but i think this is how it would work.
function OnFillInventoryObjectContextMenu(playerIndex, context, worldObjects, test)
for i = #context.options, 1, -1 do
local option = context.options[i];
if option.name == "Cut In Metal Pipe" then
option.iconTexture = getTexture("your icon texture name here")
end
end
end
Events.OnFillInventoryObjectContextMenu.Add(OnFillWorldObjectContextMenu)
No error appeared, but the icon did not appear either. Is it possible?
you may need the pathing in the name here is how it is done in the game code
option.iconTexture = getTexture("media/ui/BugIcon.png")
I did this
is your icon sized correctly?
this is the icon, and the code
well maybe it cant be done with script items like that, I've set icons on stuff i've added so if all the names line up it should work. So the option.name probably isn't matching, this might be a translation thing?? idk what the game does for sure with this but my guess would be change it to "Recipe_Cut_In_Metal_Pipe"
ughh check out my mod
use it as reference
https://steamcommunity.com/sharedfiles/filedetails/?id=3344228781
basically the mod has a sandbox option for you to set what items you can gather
it adds the items icon dynamically
is there a specific file that controls the amount of xp needed for each level?
modded skills define it in the mod's perks.txt, vanilla skills do not use this system and are hardcoded
Heya, Im looking to make a mod hat that covers the entire head and I wanna ask if there is a way that at the moment u wear the hat the head gets "hide" or "invisible", or a way that the head and hair dont break through the hat besides scaling the model 
i wonder if i can multiply xp in some sort of way based off your level to try to simulate the effects of the required xp being lower ๐ค (i want to make a mod that makes required xp grow less exponentially)
Anyone know of a file that contains the current version number of the game? Preferably one that has existed for a long time
I cant find a way to make the model as the same size as the player head without making it smaller than the head 
As far as I could see there isn't any. Translation files are empty and the way they get the version on the main menu is through getVersion() and looking at the java reveals that they define the version in zombie/core/Core.class java private static final GameVersion gameVersion = new GameVersion(41, 78, "");``````java public String getVersion() { return gameVersion + ".16"; }
Hey everyone, new here, digging into PZ modding and I have a question about the syntax regarding tables/maps in lua.
min = 5,
normal = 60,
max = 160,
}
Blood.algoverBurryShockIndex = {
[0] = { threshold = 0.5, 0 },
[1] = { threshold = 0.8, 0.15, 0.20}, -- 15-20%
[2] = { threshold = 1, 0.2, 0.4 }, -- 20-40%
[3] = { threshold = 1.3, 0.4, 0.5 }, -- >40%
}```
I'm assuming `Blood.pulse` is creating a table with min, normal, and max as values. `Blood.algoverBlurryShockIndex` is creating essentially a HashMap.
I've primarily written with Java as a hobby so I am exploring new grounds. I am familiar with Lua, but I understand this is Khalua. I just need help wrapping my brain around how this works with what little documentation is available. TYIA!
so this is a bit weird
so lua tables are just hash maps, that's the only data structure in lua
when you do { stringKey = 5 } that's equivalent to { ["stringKey"] = 5}, it's just neater syntax for certain things
the Blood.algoverBurryShockIndex table here is a bit strange, they're using it as an array-like table (which is still just a hashmap, but you use consecutive numeric keys only like it was an array)
normally you can just define that like:```lua
Blood.algoverBurryShockIndex = {
{ threshold = 0.5, 0 },
{ threshold = 0.8, 0.15, 0.20},
{ threshold = 1, 0.2, 0.4 },
{ threshold = 1.3, 0.4, 0.5 },
}
i do recommend looking for general lua resources, kahlua doesn't differ from lua 5.1 as a language in any major way, it just has some missing (and extra) standard library functions
Thank you for your advice, that was all I needed!
Is there a built-in limit to how many things the game will try to render on one tile? Like, say, if one of my players tried to stash a few thousand planks on one tile and can't load into the game, now? >_>
Or is their PC just being junky?
My guess, if the server hasn't crashed, it's a client-side issue
no, the client will freeze and eventually time out from the server if there are enough items on a square
You can use this:
local origAddDynamicalContextMenu = ISInventoryPaneContextMenu.addDynamicalContextMenu;
local function getOptionFromName(context, name)
for i = 1, #context.options do
local option = context.options[i];
if option.name == name then
return option;
end
end
return nil;
end
local recipeIconTextures = {
["Empty Baking Tray"] = "media/ui/Moodle_chevron_down.png",
["Slice Pizza"] = "media/ui/Moodle_chevron_up.png",
};
ISInventoryPaneContextMenu.addDynamicalContextMenu = function(selectedItem, context, recipeList, player, containerList)
local result = origAddDynamicalContextMenu(selectedItem, context, recipeList, player, containerList);
for i = 0, recipeList:size() - 1 do
local recipe = recipeList:get(i);
local option = getOptionFromName(context, recipe:getName());
if option then
local texturePath = recipeIconTextures[recipe:getOriginalname()];
if texturePath then
option.iconTexture = getTexture(texturePath);
end
-- local resultItem = InventoryItemFactory.CreateItem(recipe:getResult():getFullType());
-- if resultItem then
-- local resultTexture = resultItem:getTexture();
-- if resultTexture then
-- option.iconTexture = resultTexture; -- assign icon texture from result item
-- end
-- end
end
end
return result;
end
This integrates the icons directly into the dynamic context menu creation. getName() returns the localized name that the player sees (useful for finding the menu option) which is probably why it didn't work for you with the code from guns and getOriginalname() returns the script-defined name of the recipe, the name in the .txt file where you defined the recipe, which you need to add in the recipeIconTextures table. I also included a fallback using the result itemโs texture (commented out here).
yeah by masking
Thank you so much :)
so much time wasted because my "scripts" folder was named "srcipts"
Primary directive of MTF Beta 7 units in [REDACTED] Quarantine Zone remains elimination of SCP-008-1 instances [DIRECTIVE: FIREWORKS]. Secondary directive is to retrieve critical research data compiled by MTF Iota-10 agents placed within the ranks of the LMPD when the Foundation received word of a possible outbreak of SCP-008 [DIRECTIVE: EGG].
05 Council [DATA EXPUNGED] meeting converged on [REDACTED]/1993 to consider reclassifying SCP-008 to Appoleyeon, 5-4 decision to base reclassification decision on results of DIRECTIVE FIREWORKS
is it possible to rotate texture in the UI with arbitrary angles? (or text?)
Hey guys. Could someone explain this to me by steps? Im new to modding and I got a bit confused
I didnt want to ask them directly because I didnt want to be bothering them too much
I made new tiles for my curtain, but Im not 100% understanding what they meant. Sorry if I sound stupid, Im trying my best to learn by myself as much as I can, but this is all fairly new to me and my daily life doesnt give me much time to deep dive into this subject
Will PZ allow me to have two recipes that require two different things but result in the same thing?
I have one recipe that is 5x 2 dollar bills in exchange for a 10 dollar bill and that works just fine. I then have another recipe under it that is 2x 5 dollar bills in exchange for a 10 dollar bill.
The 2x 5 dollar bills recipe does not function and gives an error, but the 5x2 dollar bills recipe functions.
I'm pretty sure the fact it's java hardcoded is bullshit
I'd be surprised if you weren't able to create a sheet tile from lua
And if you can, you got everything needed
Yes
I have no idea tbh. Would you be interested in checking the full convo to check?
I can't really check now tbf
No problem! Im in no position to make any kind of demands or expectations from anyone. Im aware Im out of my league in this subject. Any help is welcomed and appreciated, no matter how small it may be ๐
Could you share the code lines, please? Not sure if I will be able to help, but I can try
Want me to share both the 5x 2$ and the 2x 5$ or just the 2x 5$? I have an error code it hands me as well but my PZ crashed so I gotta grab it again.
Yes, please
What's the error
So the code I am using for the recipe is this:
i would expect the sheet cover functionality to be hardcoded, but i'm sure tilesets can just add new curtain tile, which i think is what they're recommending to you
The error the error finder gives me is this: ```attempted index: getTexture of non-table: null
function: addDynamicalContextMenu -- file: ISInventoryPaneContextMenu.lua line # 2781 | Vanilla
function: createMenu -- file: ISInventoryPaneContextMenu.lua line # 699 | Vanilla
function: onRightMouseUp -- file: ISInventoryPane.lua line # 1444 | Vanilla
java.lang.RuntimeException: attempted index: getTexture of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:641)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallBoolean(KahluaThread.java:1924)
at se.krka.kahlua.integration.LuaCaller.protectedCallBoolean(LuaCaller.java:104)
at zombie.ui.UIElement.onRightMouseUp(UIElement.java:1458)
at zombie.ui.UIElement.onRightMouseUp(UIElement.java:1416)
at zombie.ui.UIManager.update(UIManager.java:910)
at zombie.GameWindow.logic(GameWindow.java:262)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:765)
at zombie.GameWindow.run_ez(GameWindow.java:681)
at zombie.GameWindow.mainThread(GameWindow.java:495)
at java.base/java.lang.Thread.run(Unknown Source)
they're recommending you add a curtain tile which you craft with regular garbage bags rather than trying to get garbage bags to work in the very likely hardcoded sheet cover functionality
Code should be fine as I copy paste a base and then edit as needed, and the 5x 2$ works fine.
I made a curtain tile which requires the player to first craft the item and then apply the item to the window. Are you saying I should focus on trying to get garbage bag to just have the player apply them directly?
looks like something is wrong with your result item if it can't getTexture()
it sounds like you've already done what they're recommending then
in this context the getTexture() error always indicates an invalid result item, but i don't really see how the two you just posted could be - they have the same result so either both or neither should work
are you sure it's one of these causing the problem and not another recipe?
Looking at my trades, I think I found the issue.
But the issue isn't from the 10$ thing I guess, so why won't it show up?
What's the specific code for if you have a recipe that equals item 3. Item 3 needs either 2x of Item 1 or 5x of item 2?
Is it "item2 OR item1" or is it something different?
Found the issue I think.
I mispelled it.
just two different recipes, there isn't really any advanced logic with them
you can have a source that can take multiple different items with item1/item2=5 but you can't have different amounts per item
It all works now!
Oddly that spelling mistake on the bunny ears recipe was holding back a ton of recipes from being made.
And Craft Helper 41 even shows up on the 5$ bill now!
While I'm in the InventoryPaneContextMenu.lua - Candle is coded to prevent more than 1 from being lit...
I spent almost an hour last night pouring over some code until I could figure out why a created item was always nil and looked today and my scripts folder name was spelled wrong. It happens
Hello guys, where can I see a list of all the attributes the TV can give characters, such as PAN+1 and FEA+1
So I've found the item I want to modify, which is pretty simple with just adjusting the item values and renaming it, but is there a directory of what each "weapon" object interacts with? Once I get the media files for the weapon I want to make sure I have all of it's dependencies and interactors handled before testing. Any help is greatly appreciated!
They should be in ISRadioInteractions.lua
There is a maximum of 1000 pages on steam workshop and a maximum of 30 items(mods) per page. So GG guys, with more than 30000 mods on the workshop, some of them cannot be browsed. 
Foolish of you to think most of us have that kind of limitations
Working with OnFillInventoryObjectContextMenu. Is there a better way to get the item that was left-clicked?
for i, _ in ipairs(items) do
for why = 1, #items do
local item = items[why]
if instanceof(item, "InventoryItem") then
print(item:getName())
else
for the = 1, #item.items do
local fuck = item.items[the]
print(fuck:getName())
end
end
end
end
and thanks albion, because without the hint "InventoryItem[] or ContextMenuItemStack[]" I would have never figured out what I have already
i use something like```lua
local item = items[1]
if not instanceof(item, "InventoryItem") then
local item= item.items[1]
end
i don't remember if that's exactly correct though, not at my computer right now
just grab the first item...
thanks!
maybe check items length, and => 2, assume it's a stack.
Thanks!
yeah its both a single item and a table at the same time for some reason
i think even if its just 1 item
but im not sure
it's either a list of items or a list of item stack structures
what a weird implementation
If a vehicle goes to NaN, NaN coordinates, is there a way to bring it back?
i have questions about java mods
is there anyone here who is experienced with this? how does mod distribution work?
can they be uploaded to the workshop like other mods
Yes but they require manual installation
the workshop doesn't really vet what you upload to it at all
as far as i can tell you can upload whatever files you want, it's basically just a file host
thats awfully dangerous
meh, not really
if you're in the habit of running weird files from the internet it doesn't really matter where you got them from
workshop is fairly safe in that any game that supports it (including zomboid) is going to have specific mod support and not just like, e.g. run some weird virus exe
help me
i use addVehicleDebug on server side
but not found getVehicleById({serverside_spawn_vehicleId}) on client
i need function
update request to server side on client OR update client on server side
You can go beyond the client-side 1000 page limit by manually editing the query string fwiw, so they're not totally hidden