#mod_development
1 messages · Page 197 of 1
But if you are working with functions that use Java and Lua it’s nice to have access to the library
If you want to do something more advanced like change how something in the game already works.. If it's changing an existing item ingame I think you can use overrides in Lua, but if you wanna for example, make the vehicle physics better, that's a Java thing
Yeah, that's true. But IntelliJ has Bytecode decompile, so if you only need to view the decompiled source without changing it, you just need to load the .class in IntelliJ and it'll break it down to bytecode and format it to be readible
i mean i kinda wanna add a repeating crossbow if thats possible. if no one will do it i will. dont care if it has a dedicated model yet i just want it to work
ill just make it a grey box for now lol
I definitely think you can do that in Lua
It's a free download online
It's the defacto software for any language that doesn't need to compile
html, css, js, lua, etc
I can't link you to any sort of modding tutorial in lua off the top of my head, but you shouldn't have too much trouble finding one if you search google
i feel like all i need to do is make a custom shotgun thats pump action but it shoots custom arrows instead
You could remodel the vanilla shotgun
My advice then is to find a mod that does something close to what you want to do, and look at how it does it. Since then you've got a reference in lua
im thinking that its almost the same thing
There is a crossbow mod you can reference
Although don’t just use the code straight up and call it yours. I’ve made that mistake before 😰
Yeah
Just look at how it adds the bolts and weapon and do your own thing with that in mind
ok
If you're modifying a mod for personal use, iirc, the TOS for Project Zomboid mods covers that and iirc you're completely fine to do so
But if you put it on the workshop then you're covered by those tos too
I remember some kinda caveat in there that mods that don't explicitely have a license are share-alike
would it be against TOS to take a look at the shogun code in the base game and model it after that
Nah I don’t think so considering all mods are using vanilla code for the most part
I'm pretty sure that's allowed
idk even know how to look at the cross bow mod code. i wouldnt copy i would write it myself but i would need to see how they do it
Let me find the tos again
or just take a look at the shotgun code in the base game
where is the code for a shotgun
"4.1. Modification of other users’ workshop submissions is allowed under personal use, but you are NOT allowed to submit work that is not your own, without permission of the mod owner."
And modificaiton of PZ's code is A-okay long as you're not subverting copy protection or breaking people's PCs
it wouldnt be modifcation it would be a coder seeing how they do it and writing it themselves based off of someones code, which people do all the time.
Yeah, just saying for reference
Speaking of, if I modify my dedicated servers VehicleDistribution, do I need to create a mod? Or can I just manually edit them in the server files
As far as my understanding is, you can modify a base game item to add your own thing and distribute that
where is guns under in client
I have no idea xD
I figure it’s server side so it shouldn’t matter right?
You gotta look dude
ok sorry
It's definitely worth checking if the setting already exists, I think it probably does
Looking will help you learn
I don’t mean to be rude but it’s very helpful to look through the game files
I do think the game modding experience is 95% staring at someone's else's code and trying to figure out wth is going on
And judging them for their rushed game controller support
I've been working on a mod just to add throttle and brake axis support and automatic switching between keyboard and controller, and I've got the Lua side of it all done and working
Can't stand wasd vehicle control. All or nothing throttle and brake is a horrible experience
I've got the Java side of it all written, I just need the f***ing thing to compile
I'm building it on top of the Better Vehicle Physics mod, so I've also added individual gear selection
Reminds me of playing Dirt Rally on keyboard lol
I didn't used to mind it as a kid, but these days I've got the luxuries of borrowing my cousin's steering wheel, pedal, and shifter. I'm used to better vehicle control xD
TIME TO BREAKOUT THE G29
im sorry i cant find where the guns are in the files
I like it, I added my own steering wheel. Ended up getting thrust Master pedals
wait
And a sweet, sweet shifter
The annoying thing is that if I just had my coding environment set up correctly it'd have been a quick, 6 hour edit to an existing file to do what I wanted to do albeit badly. But I wanted to add a controller binding system, which I've actually written out
I've got the G29 set. WIth the original wheel, optional shifter and original pedals
It's not mine but I'm borrowing it
I think models might be actually reference outside of media
But I've spent almost a week every day from 8-10am to 3-7pm trying to get this fricken thing working
ok i see isshotgun weapon but that might not help me, how do i find where the modded files are i tried looking but it just gave example stuff
I’m at work so I don’t have my files info front of me
Oh you need to go to the steam workshop for PZ
So click on PZ from the steam library and there should be a tab that will display the workshop
Like, when I modded Minecraft, it took me 3 days without any modding information to break down the item registration, and set up a system to dynamically register items to the client and server on item creation. Because I followed a tutorial that sorted the gradle stuff out so all I had to do was code
yeah and then how do i look in that files
To add axis bindings as an option in Zomboid is genuinely a lot simpler, but because I'm an idiot that doesn't know how to set up a bloody IDE, it's just.. God dammit
Then once you’ve subscribed to a mod, you’ll need to go to steamapps/workshop/10800/MODID#
Gotta love coding lmao
I might just switch to eclipse and try to set up my environment in there. For what I want to do I shouldn't need to use storm, since I've already got a decompiled source
I spent hours trying to figure out how to do something simple like add rendered text on top of a player’s model while they’re typing
Yeah but without modifying ISChat.lua
Lol your project sounds fucking sick
Mine is peanuts 😅
My project was way beyond me and has taken me over 30 hours xD
Was tempted to try and contact the peep that made the better vehicle physics mod and to see if they'd take a comm to make the changes I want to make
It'd take someone that's already got it set up like, 20 minutes
Aside from vehicle physics what are some instances of mods that would require Java?
Something like improved projectiles?
Anything that changes the way something fundamentally works. If you wanted to improve projectile physics, that's definitely a Java thing
Though, only to a certain extent
Eventually you'll run into the point where the devs have used a library to handle the base physics system
And that's written in C and something you can't touch
Makes sense
Do you think it would be possible to assign specific areas of maps that would effectively change the result of when a player dies?
I honestly wouldn't know. You'd have to look through the source and make sense of how it works
Fair enough. I wonder if server options are configurable by areas versus the entire server
My experience with PZ's code is a week of trying to do one very specific thing, and I know a little about that one thing and absolutely nothing else
Coding in a nutshell
Eeeeyup
Hey guys I just made a button, but it keep fails finding an image. local function ZamazonButton() local myX, myY = getPlayerScreenWidth(0), getPlayerScreenHeight(0) local button = ISButton:new(myX - 140 , myY - 140, 32, 32, "", nil, onCreateUI) button:setImage("media/ui/3star.png") button:setVisible(true) button:setEnable(true) button:addToUIManager() end Am I missing something here? I've tested without image and worked fine.
Well, I did it. I set up my eclipse environment correctly and built a modified version of the CarController class
Turns out you don't specify zombie as the source for PZ files, you specify the base directory. And for your project, you don't specify src as the base directory but one up from that
Probably the same issue I had in IntelliJ
Now I'm going to work through the modified file I had earlier with my changes and gradually implement and fix any issues with em
..After I take a break and head down to get energy drink
@indigo hearth Here's what I did in Eclipse, using the default builder instead of maven or gradle:
-
Make a folder for your project, inside that folder make a folder called src, and inside that make folders coinciding with the location of the file you want to edit in the game files. IE, ProjectName/src/zombie/core/physics/CarController
-
Add the base game directory, Project Zomboid as library (steamapps/common/Project Zomboid or something like that). Type, class folder/external class folder
-
This might be optional, but add all of the .jar files in PZ as libraries
-
Change your source folder from ProjectName to ProjectName/src, and remove ProjectName as a source
-
Order them so that your java jdk is first in the build path, library jars are second, PZ is afterwards, and your project is last
You'll need to decompile the game to get the file you want to edit in .java format, to do so, make two .cmd scripts (Don't have them in your project folder. Put them where you want your output to be):
- contains:
decompile.cmd C:\SteamLibrary\steamapps\common\ProjectZomboid\zombie\ .\decomp - contains:
jdk-19.0.2\bin\java -cp "C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2023.2.2\plugins\java-decompiler\lib\java-decompiler.jar" org.jetbrains.java.decompiler.main.decompiler.ConsoleDecompiler -hdc=0 -dgs=1 -rsy=1 -rbr=1 -lit=1 -nls=1 -mpm=60 %*
Change anything such as your jdk location, your game location, and your IDE location according
Then make the folder "decomp" in the same folder you made those scripts in, and run them
I don't know if eclipse has a java-decompiler included, so use IntelliJ to decompile it
Then run file 2. After that, copy whichever file you want to edit from whereever it is in the PZ decompile, IE, zombie/ui or zombie/core/physics to the same location in your src folder. UI folder under Zombie, etc
If anything there doesn't work, I can't help because I just messed with shit for almost 6 hours until it worked
Can someone tell me what the difference is between a door and a door wall?
Dude this is extremely helpful. I’ll test it out tomorrow. I have a few scripts that I want to work on for my server
No worries, hope it works for you 👍
I missed a few details since I'm recalling from memory, so I added a few things
Since you're working from an obfuscated decompilation a lot of the variable names will just be generic "var1" "var2" etc, so you'll have to look at where they're getting their values, and make a note of it or refactor them (Rename all instances and correct the file around the new name)
All good, I’ll figure it out 
Sweet. All good 👌
Is there an event to detect when your access level changes? There has to be right? It's not just polled everywhere IG is it?? pleease tell me there is an event haha
@mellow frigate
https://github.com/Poltergeistzx/Project-Zomboid/blob/main/docs/steamcmd-workshop-upload.md
The steam cmd information for animated preview, vdf file would only need: appid, publishedfileid and previewfile
You can also upload directly everything at once.
Is there a way to catch users who exploit a bug to duplicate items?
What are the base game skill categories called internally?
Like the "crafting" or "comnat" skill (or is it perk?) categories
From what i've seen when mods add new skills they add them under a new new category, such as "Misc". however, is there a way to insert a custom skill into the base categories?
Does anyone have an idea of how I can access certain vanilla animations and apply them on the player, for example, the death animation?
Anyone worked with the global map? Any idea how to add text notation to it with code?
function ISWorldMapSymbolTool_AddSymbol:addSymbol(x, y) looks legit but not sure if that saves it to player map data
Does anyone know how to make my own type of grenade / throwable
SOmaincharactercreation.lua
Would it be possible to make a portable shelter, like the tent, inhabitable and useful for storage with just lua? It's the main reason I want to learn lua but, if I need to decompile the java then I don't want to go that far probably. I know they are looking at doing this in future updates but, who knows when that will happen.
I am confident it is possible. At worse you'll get new ideas poping in the process 😉
That said, it is likely to be a vanilla feature of B42
@mellow frigate Cool, thanks. Can you tell me where to find the lua files of the mods I download? I'd like to get an idea of how long its going to take to learn lol.
Given that loot and vehicle distribution is specified by furniture and room type; Is it possible to specify loot and vehicle distribution even further by grid coordinates?
You could look into the RV interior mod if you are looking to build a tent with an “inside location”
@indigo hearth Yes that's where I wanted to start, I want to look at that code. The only script I've looked at so far was the monkeys biker start. Ill go see if I can find the RV interior one.
Hey guys can i get yalls opinion on somethin
Im thinkin of making a mod to add a bunch of classic books a novels that were written pre 1993 to spice up the world; reading them reduces depression and boredom a lot more than usual books
Maybe the following titles
Catcher in the Rye
Lord of the Flies
Art of War
Nineteen Eighty-Four
Frankenstein
Lord of the rings
Moby Dick
Huckleberry Finn
The Great Gatsby
Charlottes Web
To Kill A mockingbird
Charlie and Chocolate Factory
The BFG
Thoughts?
you should check out Named Literature
What's the difference between an IsoObject's properties and IsoSprite's properties?
Both have a getProperties method
I have found that I can use the properties to somehow identify an object, but... I'm yet to figure out how I can make my custom tile object and give it properties
I've noticed a lot of mods do this to read properties:
for _,object in ipairs(worldobjects) do
local square = object:getSquare()
if square then
for i=1,square:getObjects():size() do
local thisObject = square:getObjects():get(i-1)
local thisSprite = thisObject:getSprite()
if thisSprite ~= nil then
local properties = thisObject:getSprite():getProperties()```
doesn't that work though? Besides the nullchecks
for k,v in pairs(worldObjects) do
---@type IsoObject
local object = v
local properties = object:getProperties()
pretty sure that returns the properties from the sprite, they would be the same object.
I see...
I think... I'll want to make my own buildable barrel
Probably a metal one
I have no idea how I could add it to the build menu though
It's all uncharted territory to me
There’s quite a few buildable barrel mods already, but it would be a good exercise if you’re trying to learn how to add something to the build menu.
Yeah... and I don't want to accidentally let people pour multiple stuff into the barrel.
@heady crystal when telecorn mod
do you know there are already 2 of those ?
really?
search the workshop with keyword telecorn
Anyone know how to resolve this error? I'm not sure how to change the Java compiler in IntelliJ
If you're open with a project, in the project settings
I have a line in the update function that adds sickness, but if the player speeds up time, then the final value becomes less than it should have been initially. How can I fix this and what is the refresh rate in the update function?
Anyone knows how to add symbol on the map with code?
It doesn't seem like there is a proper way without assembling the whole charade with tools that comes with ISWorldMapSymbols
I've published a mod to the workshop, and subscribed to it, but I don't see it in my mod list - only the local workshop version I made. Is this normal?
Another question. How exactly server knows what cell is returned by getWorld():getCell() if there is no player context or XYZ context on server?
I may be finally releasing something today 
pz mods thumbnails is sometimes a different state of art
are the modIDs the same for your local version and workshop version?
in mod.info for both of them
i always add "DEV" to the end of the modID for my local mods
if theyre the same, the game wont recognize them as two separate mods
Hey all, I'm having the weirdest issue. I have been creating custom weapons, and did so a few times successfully. Yet the last two items I made cannot use custom SFX, they just use basic rifle sound. They are both based on the vanilla template though, just like my other guns, and I'm pretty sure I did everything exactly the same. How would I investigate this? Any ideas?
I have a line in the update function that adds sickness, but if the player speeds up time, then the final value becomes less than it should have been initially. How can I fix this and what is the refresh rate in the update function?
https://steamcommunity.com/sharedfiles/filedetails/?id=3037422753
I just released the long awaited witch hat so many you have asked for
Can someone make a crafting recipe that lets you tear the pages out of empty notebooks
How many sheets do you want a notebook to give you
10 since an empty notebook has 10 pages
Even though every notebook I've ever owned had 70 pages minimum
recipe Tear pages from Empty Notebook {
Base.Notebook,
Result:Base.SheetPaper2=10,
Time:30.0,
NeedToBeLearn:false,
Category:Literature,
}
Anyone else have an issue with recipes that require a lot of resources not consuming resources periodically? For example, 100 planks, 200 nails, etc,.
Ima use that ha!
Planning on using ItemTweakerAPI.
Is there a neat database somewhere with the name of every item in the game?
found it nvm
local allItems = getScriptManager():getAllItems() where getType() method gets you ID like Base.something
aight one last question here, let's say I wanted to change a weapon's damage stat
So to halve the damage a weapon does, I would halve the MinDamage and MaxDamage stat?
Roughly yes
Does anyone how how to make a dummy new IsoThumpable? I need it fo make so that my ItemContainer can be marked as locked
ItemContainer.new(ProxInv.containerType, nil, nil, 10, 10)
Having an issue I haven't had before and I'm not sure why this could be happening.
I've made a custom item, attached a model to it. Everything looks as it should when it's on the ground, but it's missing when equipped.
What could even be causing this?
Woops, figured it out. Forgot to add the weaponsprite.
I have a line in the update function that adds sickness, but if the player speeds up time, then the final value becomes less than it should have been initially. Please tell how can I fix this and what is the refresh rate in the update function?
the update function is called as frequently as possible, up to the fps cap if there is one
GameTime provides frame deltas in various formats or you can use an event that gets called at consistent timings to avoid it
You need to multiply the value based on the time speed. If it's being added per tick effectively. You could also try out the calcstats event which I think cycles faster.
Ugh. What is causing these attachments to rotate like this when equipped, vs when it's placed on the ground?
The actual mesh positions are good, and in the script files all the rotations are set to 0. If I try to adjust any rotation rotation values it just does the opposite.
Found the answer in case anyone else finds this. You need to have 'Use Space Transform' unticked in blender when exporting the parts
anyone know that one thing that allows you to restart PZ without closing it over and over?
and @bronze yoke thanks
If anyone wanna help a lazzy dev, I do not remember how to get (in lua from the IsoObject instance) the right parameters matching the chunck debuggers sprite.name (red in attached picture) and properties CustomName (green). I'm also wondering what is the best way to identify a tile from lua (to dynamically apply effect). Do you have any advice ?
There's models for each, ground and hand
You can also make a kind of submodel for world-attachnents
Which would let you use the hand model for ground
anyone know what this is doing?
WARN : Recipe , 1695062241005> RecipeManager.resolveItemModuleDotType> ERROR: can't find recipe source "Ammo_Shotgun_Slugs" in recipe "Place Shotgun Slugs Into Box"
Guyss,why won't my modded car move,the engine is on and it's revving but it wont move at all
have you given it a weight and horsepower rating?
it shall have,i reused a script of a previos car mode I made
it got mass of 950,rpm type generic
anyone lese had this problem?
basically wheels spin but car won't move
Source refers to the itemsbeing used for the recipe - this would suggest that "Anmo_Shotgun_Slugs" isn't an item.
?
DisplayName = 12 Gauge Shotgun Slug,
Weight = 0.05,
Type = Normal,
DisplayCategory = Ammo,
CustomContextMenu = Re-box Ammo,
Icon = MyIcon, }```
```recipe Place Shotgun Slugs Into Box {
Ammo_Shotgun_Slugs=20,
Result:Ammo_Shotgun_Slugs_Box,
Sound:PutItemInBag,
Time:3.0, }```
^
am i identifying the item incorrectly?
if I use itemtweaker API to edit an item that doesn't exist, say, an item that is from a mod I don't have installed, will my mod still function properly?
just ignores the itemtweak for a nonexistant item?
gonna answer this myself if I ever finish the mod itself for vanilla items
I will most likely be fine
that being said - you can also just not use item tweaker and instead employ the API it is using directly
Nothing against it - but some other mod used it's ID before and it's caused headaches and I've ran into a few mods with a copy of it sitting in their mod (???)
You ever just implement a try catch block, and then think.. Nah, it's not that much more work to code something properly
My code may blind any competent programmer, but I'd rather it not kill them
heya, where are the global xp multiplier settings accessible via lua
I presume this is referring to mods that have had a copy of Item Tweaker in their mod
You should be able to modify them through sandbox settings
i just need to retrieve them
Item tweaker is grabbing the internal api for scriptmanager and using doparam() on scripts
it's just a friendlier wrapper for it
I think Dark actually returned recently to update it, unclear if he moved the contents to shared or server from client (as it being in client means only client's scripts change -- very minor issue) - or if the other mod is still causing problems.
Oh like the code. I think most of the multipliers are in media\NPCs. But I could be wrong.
I mean I just saw how I could do simple changes with simple mods that utilized ItemTweaker API and I figured it was simple enough for me to take a crack at it
instead of just doing the txt file replacement/override/whateveryoucallit mod like I did with my first mod lol
It is simple and easy to use - I'm probably using old information / being overly cautious
and thus having it be compatible with other mods that modify item stats
Also any issues you find with IT is because of the other mods - not itself
other mods that use IT?
or not necessarily ig
but yea hopefully my mod concept works well
wait a second I'm stupid
This is the entirety of IT:
if not ItemTweaker then ItemTweaker = {} end
if not TweakItem then TweakItem = {} end
if not TweakItemData then TweakItemData = {} end
--Prep code to make the changes to all item in the TweakItemData table.
function ItemTweaker.tweakItems()
local item;
for k,v in pairs(TweakItemData) do
for t,y in pairs(v) do
item = ScriptManager.instance:getItem(k);
if item ~= nil then
item:DoParam(t.." = "..y);
print(k..": "..t..", "..y);
end
end
end
end
function TweakItem(itemName, itemProperty, propertyValue)
if not TweakItemData[itemName] then
TweakItemData[itemName] = {};
end
TweakItemData[itemName][itemProperty] = propertyValue;
end
Events.OnGameBoot.Add(ItemTweaker.tweakItems)
My earlier point is that you can just use scriptmanager yourself
Also the code is still in the client folder
it might've just been easier to create a mod that created a Trait that reduced player damage rather than using IT to change the damage of every single vanilla weapon 🤦♂️
and it would be future proof
how have I not thought of this
You can also use scriptmanager to parse all weapons - but yeah using a trait I guess would make more sense there
except for the fact I don't think there's an event to change damage output
so you'd need to heal zombies onhit
I guess that's why something like Anti-Gun Activist from More Traits never actually impacts gun damage directly
it just reduces a ton of other stats
also this wouldn't work for changing other stats like weapon range
welp that's how it goes
gonna continue on
why wouldnt this work for range?
yeah
eventually you can come back to it to improve your mod
I'm doing item tweaker
And for anyone reading and is curious what issues can stem from having script changes in /client/ - server distros account for weight in their loot placement -- having the scripts changed in client code means the changes don't occur on server and the item will be using the vanilla weight.
On top of trying to compare script values between clients/server -- I also ran into an issue with shops not being able to match categories with BetterSorting
I had to write a silly workaround for that where the client sends their script values over
I suppose I just gotta get this mod done first
Optimizations in code can happen later, but get the base concept done first
now that I think about it I'm making this purely for my own playthrough lmao
That some weirdfuckness over here, just listen.
sendClientCommand(player, "IShops", "locateShops", {}); -- First call
sendClientCommand(player, "IShops", "requestShopTable", {}); -- Second call
Server has one function attached to event for both cases. Both client commands are called from addOption of context and literally is a copypaste of each other in context of code. First one trigger event, second one doesn't (not even print in first line shows up). But when I run this manually it works.
I'm an idiot, rubber duck thank you.

What I wish I could see is all mods that have a certain dependency
Like if I could see all dependents of ItemTweakerAPI, then I could learn how they use it
I’ve got one that uses it to increase the encumbrance reduction on Arsenal weapon slings if that seems like it’d help.
hm
what's the ID of modded items? Uh, for example...
Vanilla game items are like Base.Katana
The heck do I put for "Base." in a mod like Four Color Bic Pen's Bic Pen?
(The ID name for that item is "BicPen" but idk what to put as the "Base.")
What determines that/where to find that?
Does anyone know where the controller tester UI is in the game classes?
I need an example I can look at for using the general input wrapper rather than the xinput one, since I need LT and RT treated as axis
I think I figured it out
Anyone else have an issue with recipes that require a lot of resources not consuming resources periodically? For example, 100 planks, 200 nails, etc,.
Ah, nevermind. JoypadManager creates the UI elements
I think (Even if it doesn't it has the information I need)
Pickup and grab mod has a controller configuration
I think I've got it working, but cheers for the suggestion 👍
Looking for testers for gamenight 😄
Hey all, I'm having the weirdest issue. I have been creating custom weapons, and did so a few times successfully. Yet the last two items I made cannot use custom SFX, they just use basic rifle sound. They are both based on the vanilla template though, just like my other guns, and I'm pretty sure I did everything exactly the same. How would I investigate this? Any ideas?
Anyone knows?
is there a mod that disables skill books all together?
I don't think there is, but it's becoming hard to find anything in the workshop
i know right!
too bad we can't "hide" any mods from our view on the steam workshop
Too many server config ‘mods’
Can this be an extent problem???
for example ?
Hi, is there a list of all the Events that I can register callbacks to?
Just mods intended for private use on servers, mostly tweaks and repacks of other mods all compiled into a single file. The kind of stuff that should be unlisted and only serves to clutter the workshop page.
Think it might be possible to modify the number of zombies that spawn in a building?
I would prefer it to be modifiable by the zombie population multiplier but I feel that isn’t gonna be possible…
There's this on the wiki : https://pzwiki.net/wiki/Lua_Events
That's cause the authors of the original mods didn't leave their template to unlisted afaik.
And I believe mod options had issues integrating their settings into MP
I also keep seeing general server settings too - but idk what that's about
I know, I said that these things should be unlisted.
Can ssomeone explain why,after chganging the offset of the car ig and spawning it again it resets???
I wanted to create my own mod for Zomboid. I just want to add a peace of food. What should i know about modding in generel and what do i need to do for my own mod. I already have the code for the food done and i have a picture of it ready to. Do i only need to just add it to the code or what do i need to do taht it works fine?
And sry for my bad english
1:11 Step 1 - Know your file locations
4:06 Step 2 - Storyboard your ideas out
9:03 Step 3 - Get your files from the game or other mods
11:47 Step 4 - Build your mod files
1:01:54 Step 5 - Create the textures (mislabeled in the video, oops)
1:19:45 Step 6 - Put your mod files in the right structure
1:30:37 Step 7 - Test your mod (please back up ...
Just follow this tutorial and you good to go. He explain how to add items , recipes and their images and coding part.
thx
100 planks💀
https://steamcommunity.com/sharedfiles/filedetails/?id=3006109377 can also use this for reference.
alright thx guys
lol, yah. Im gonna be asking this question until someone else answers. It cannot just be a me issue. Seems to be a vanilla issue.
Try to be more specific around it, someone might be able to help out
Specific? I thought that was pretty clear.
Idk could add more details what's the issue, wym by periodically? As much as details you can add are usually better otherwise others may or may not be able to recognize the exact issue. Sometimes it's just people who are not around who faced a similar issue.
Anyone else have an issue with recipes that require a lot of resources not consuming resources periodically? For example, 100 planks, 200 nails, etc,.
Periodically as in unpredictably. I wouldn't say randomly because there has to be be an underlying issue. I say ANY recipe because it doesnt matter what the end product is or what the ingredients are as long as there are a lot.
I'm assuming you already tried other in-game items, different recipes?
yup, I suppose one thing I did not mention is that I am testing on a dedicated server. A beastlty one at that.
Where in the decompiled Java code would I find a piece of code that gets executed when player loads into a game from the main menu?
There's Lua triggers for OnLoad
Can I add custom data to traits?
not really
traits have essentially no functionality of their own
they're simply something for the rest of the game to check for
I see...
I guess to have my traits do a similar thing with a different system, I want to hard-code a table then
Also... A wild guess, but comparing two strings is faster than checking if a character has a trait, right?
how do I access all worn containers on a player? (such as a backpacks etc)
anyone know how to make this display the correct name rather then the itemID?
getText(string) translates a string from stringtable in Translation files.
would you possibly have a repo with something like that being done because that's a little too vague for me to follow
imma see how VFE did it and hopefully that sheds some light
Set item module to Base and then created a ItemName_EN file and put in ItemName_Base.RareRepairKit1 = "Katana Cleaning Kit", and that worked.
Hi, does anyone know if there's a way to run Lua clientside only? I've been working on a mod that isn't server reliant, it's mostly java but I'm using ModOptions for the settings, but if I connect to a server it seems the server requires the lua for the menu to show
All lua is run client sided
You have 3 folders for lua
Client, server and shared are run by client. Server and shared are run by server
Ahhhh, I must've just screwed up my code then
Thank you 👍
Actually, I wonder if it could be something in ModOptions itself telling it to shut itself off for a mod if the server doesn't have it installed, I haven't actually looked
The issue I'm having is that the ModOptions menu works great in a single player world, it shows all of my options and they work. The controller switching mod also works, double taping w swaps to keyboard and double clicking A swaps to controller. But then when I join a server, my ModOptions menu for my mod disappears, and the controller switching mod also breaks. When they work fine if I'm not on a server
no, you can't, the server and client are forced to use the same mod list
with how pz has client authority on nearly everything there would never be a safe way of allowing the client to use different mods
Actually, there's a setup to do just that
the mods are whitelisted
I'm fairly certain the server needs to use a modified java tho
is there a checksum involved?
Yes
that's good
It's kind of ingenious - there's a whitelist for mods - so as long as you have the required set and some of the whitelisted ones you're good
sounds like a security nightmare but the idea had crossed my mind
i can't imagine how you'd do it cleanly without a java mod though yeah
Ahh, I thought that might be the case. That's what I meant to ask
But if I was to use Java to load Lua, it'd get around that, right?
I should prefix this by saying I have explicit permission from the server owner of the server I'm playing on. They just don't want to force everyone to do any sort of manual mod installation, which would be required since I had to write the mod in java. (My mod just allows more precise throttle and brake control by allowing them to be bound to controller axis. As well as manual gear shifts to specific gears depending on button. Something that simply isn't useful to the other people on the server)
So I suppose I'm wondering if the Java and Lua interaction can work in reverse, running lua from java. My other option is to implement the settings I need in my own ui but I'm just not keen to put that extra work in
I don't know if this is allowed under the tos though, as it could be said it's deliberately subverting a protection mechanic for online play 😅
Today in "Throwing everything at the wall in the hopes at least one of em will stick"
Finally understood how to use the Xinput system through experimenting, just to find it doesn't treat LT and RT as axis, and I'm struggling to figure out how to get those values
I've been at this mod a week and a half because I've got one brain cel andcan't figure out how to print to the console from java, so I can't test anything without loading into the game and just hoping it works
How are you modding the java? are you compiling it everytime? I always wanted to know 😆
This is the main way as i know, but-
I've been working on a thingi to run project zomboid with a Fabric mod loader, still very WIP tho, and not even on github rn
Dont think I'm going to release it until I finish working on a Lua mixins, because this is important thing for modding too
Modding for Java is not something really useful unless you are going to make something really new, because the most of a game logic as i understood is writen in Lua
Thats why releasing modding toolkit supporting fabric without a lua mixins would be a bit dumb :p
I've got a copy of the game decompiled. I grab the file I want to work with from there, chuck it in a folder equating to the original .class's location in the game files, and use the game's install directory as a library. Then, yeah, I compile the files, slap them over the game's files, and run it. Then repeat for each change I make 😅
The bytecode decompile works really well almost entirely as is, just the variable names are still obfuscated
I'm modding java because what I need to do involves overwriting parts of the car controller and base vehicle classes, which is something that can't be done in lua (As far as I'm aware)
I'm calling it. I give up. This is beyond me. If I can't manage it in 50 hours, I just can't manage it. I'm gonna head on to other things
i am not any familiar to programming but is there any video to watch if i want to create a safezone custom building in map?
so player can start there i can also want to add a admin player shop
Yes, I found that. What I need is a mod that will connect to an API through websocket. I was not sure how to include all the packages supporting websockets in Lua, so I thought it might be easier to decompile the Java and compile the dependencies together with the game code.
So i made a remodel for all moodles in project zomboid but I kinda dont know how to mod them into the game. PZ modding tools is kinda hard so if someone knows how to do this, maybe we could work on this mod together?
I'm having a hard time finding a car battery charger, I have actually searched every vehicle and vehicle maintenance areas
so if I made a mod that allows you to craft a car battery charger, is this fair?
please @ me if I should increase, decrease, remove or add something to the crafting recipe requirements
it seems very expensive, battery chargers really aren't that helpful
you only need one once you have obtained one
you rarely even need one
well... I need one, thus why I made this mod, and perhaps other people out there may need one too
it's a while since i've interacted with metalworking/electronics so maybe that's not as harsh as it looks to me
the recipe I have right now is your character making a car battery charger from scratch
if you're taking mechanics seriously at that time in your gameplay (like 2 months) you would have likely had an abundance of these materials laying around
thus why its expensive since its not too hard to find... but its not easy to come across either
I havent found one yet, and I CANT SEEM TO FIND ONE
debug/cheat one in 
i'm a little dutiful with turning off car lights/engine so i guess it might be more common of an issue for other people than it is for me
im gonna release "Craft Car Battery Charger" onto the workshop, but I am unsure if its too expensive/electrical 4 is too high
so wanted to get some feedback before I do
Honestly I’d say that’s reasonable, though maybe remove the propane torch and have screws instead, or alternatively make it 3 electrical and 1-2 metalworking to justify the propane torch.
Can sommeone tell me where i need to check in the pz files the xp reward when
cooking something on a campfire?
Hey y'all. I would like to commission a mod. Let me know if you're a dev and would like to discuss, happy to talk budget, timeline etc
I made a small mod, How do I upload it to the workshop for my friends?
I checked pins, couldn't figure it out myseld
found a guide on the workshop
Does anyone know how to fight with z indexes of UI's?
Hey hope everyone is doing well, I’m looking to commission a mod for some armor and possibly weapons
Modelling question that extends to scripting:
I have custom zombies wearing "full body costume". I set their hair to "none" yet occasionally I'm getting this piece that looks like it's a hair base.
Am I missing something?
Just FYI: ISUIElement:bringToTop()
Where can I find out what arguments are being passed onto the function OnCreate?
Something like Recipe.OnCreate.TorchBatteryRemoval uses items,result, and player, but nothing in recipes.txt mentions anything about a player variable getting passed.
https://www.reddit.com/r/projectzomboid/comments/16nuh2u/comment/k1gxt5f/?context=3
Left a short description of the mod I'm hoping to commission. If anyone's interested in taking up the challenge, just DM me
WAS THAT IMAGE INTENTIONAL?
LOL no
Question for the more experienced modders, would it be much of a challenge to try and make a "dynamic" version of this mod?
https://steamcommunity.com/sharedfiles/filedetails/?id=2814896298&searchtext=legend+craft
I love this mod for a variety of reasons, mainly that it makes any weapon viable if you focus on it enough, but it always annoys me that it doesn't work with modded weapons, I'd love to try my hand at reworking this to do such a thing without the manual process of making patches for every melee weapon mod I can find, or at least to float the idea for anyone else who might be interested in giving it a swing.
What you would need to do is take the names of the items from the other mods you want it to be compatible with and simply add them to the recipe list.
sounds like a big undertaking, and I wish you luck
That's what I was worried about, like I said I was hoping to try and make it dynamic, so that anything that can be used as a melee weapon is subject to it. There's another mod that does something similar but for backpack upgrades, not quite the same process but it works for basically all modded backpacks/containers without needing to be patched for every single one individually.
This one
i think it can be done
didn't look too closely at the specifics of this mod but as long as it can be implemented by editing the stats of an inventory item instance it should be doable
Might give it a shot then, see what I can accomplish on my own...
🧐 is it possible to make an item "cookable" but not able to be eaten/consumed?
Presumably since it's possible to make ones that can be frozen but not eaten.
Hmm... fair point.
Delayed aswer, but I appreciate your response! I'll try messing with it a few later.
For what I want, I need to mess with Java, because the IsoGenerator functionality is all hardcoded in Java, and I want to polish stuff that don't work very well (specially calculations and power usage when reloaded)
Again, thanks for the explanation!
Anyway, a mod loader can help a lot when using Java mods like Zombie fix, or Better Car Mechanics, as you can enable/disable them very easily.
Looking forward for that project! Share here when you have it released 😉
Sure!
Copied "Young" code from the default clothing.xml, renamed "Young" to "grunttesting" in my own mod's clothing.xml
When I spawn the grunttesting zombies, none of the young clothing shows up despite having the same item GUIDs as the default zomboid clothing.xml.
Is there something I'm missing here? this is my first time messing with clothing.xml :0
how does PZ like distribute different items? Like how does it make items spawn in police lockers for example?
and how could I do that so it does the same to clothes of my mod?
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...
function ISInventoryPage:onSearchButtonPress()
-- create a modal dialog box with a text input field
local modal = ISTextBox:new(0, 0, 280, 180, getText("ContextMenu_searchTip"), "", self, ISInventoryPage.onSearchSuccessful)
modal:initialise()
modal:addToUIManager()
-- set the focus to the text input field so the player can start typing right away
modal.entry:focus()
end
function ISInventoryPage:onSearchSuccessful(button)
-- Check if the OK button was clicked
if button.internal == "OK" then
-- Check if the textbox input is not empty
if button.parent.entry:getText() and button.parent.entry:getText() ~= "" then
searchString = button.parent.entry:getText()
self:onSearchContainer(searchString)
end
end
end```
This is part of my code for a mod I've created a while back. Was wondering if its possible to have the "enter" key pressable to do the same result of ``if button.internal == "OK" then``
hey, I want to make a mod that makes a animal.
But I have a problem when I try to make a butcher recipe.
Basicly the animal has a age value of 12 (when rotten) but the meat one of 4 (bacon).
if I do :
local porkChop1 = InventoryItemFactory.CreateItem("Base.PorkChop")
local rotten = animal:isRotten()
porkChop1:setRotten(rotten)
inv:AddItem(porkChop1)
this will not give me a rotten meat but instead a fresh one since the newly spawned meat has a age value of 0.
If I do setAge instead, the problem is that the meat can be bad before the animal is.
I can lower the rotten value, but I would like to not do it. Any suggestions?
Does the size look wrong??
kinda
hmm,so gotta go smaller I guess
Any UI enthusiasts?
Why in the world ISUIElement scroll might not be rendered right? It doesn't visually scroll. The actual list is scrollable, you can even scroll the scroll manually with cursor to get the results but once is scroll it with mouse scroll its just static.
Is there something besides setYScroll(number) to make it move in onMouseWheel event?
can someone tell me where lua local AuthenticPrisonerClassic2 = { name="AuthenticPrisonerClassic", gender="male", chance=0.5, }; ZombiesZoneDefinition.Prison[AuthenticPrisonerClassic2] = AuthenticPrisonerClassic2; The outfits to these special zombies are saved? I don't need the one from authentic just overall where such outfits are saved
Youd need something like the scrolling list box
I'm deriving from ISPanel that inherits ISUIElement and I checked it and it does seem to have all events to work and render the scroll.
hm, deriving from ISScrollingListBox didn't change much.
Why not just put in an instance of it?
UI is a bit more complex
but I found out
in case setScrollWidth(number) is mandatory to make scroll to work visually.
It does seem ISUIElement doesn't have this setup proceduraly when its object is created.
Hi
I wanted to retrieve the Steam ID,
local getSteamID = IsoPlayer:getInstance():getSteamID()
print(getSteamID)
but the result is this 7.5561195083547136E16, not that 75561195083547135 ( correct )
7.5xxxx7136E16 ( not correct ) < 75xxxx7135 ( correct )
Bye
I'm starting my fun with Tails. In the foreground, I decided to prepare a package containing road signs. Here are some examples of speed limits. What do you think?
very nice
Does anyone know if it's possible to add entries into the translator from Lua?
I'd like to rename a bunch of recipes without writing a Translate.txt file manually
Is there anyone who knows what value among a weapon's parameters is related to stamina consumption
it's encumbrance
So if I get this right...
This is the ProceduralDistributions.lua, if I now take my mod and slap it in there with a number (which is the chance of the item spawning) it should show up, right?
just as an example
You can BUT i advise you to do table.insert for mod compatibility
whats that
Table.insert inserts value into a lua table
So you dont need to write out the whole list or the whole file
But just require the distro file and then table.insert(your list, your value)
are they in the game root?
Game root?
Oh i think they are in shared
shared?
Hi
If I write a mod data, turn off and on the game, the mod data is retrieved correctly.
However, if I write mod data, but for some reason the client crashes before the client is closed properly,
the mod data is lost. What can I do?
bye
Is it possible to add Lua packages via Luarocks to a mod?
Depends if the translators parser is exposed
I think not
You could use Google sheets to automate much of it
Also Poltergeist has something of an automated translation thing
I assume by the way you typed it you're looking to avoid having to enter multiple repeated lines?
We have a whole system to delete recipes, by making them uncraftable
Issue is, they show up in craft helper even if hiden
Hello there, do you know an exemple of modded sandboxoption string variable
You.need to specify a default. Even if it's just a single whitespace character
do you have an exemple of string variable ?
One sec
I am not looking for integer, double, enum, boolean, only string
option DaikonMorePerishables.OverrideList
{
type = string, default = ,
page = DaikonMorePerishables, translation = DPF_OverrideList,
}
Thanx a lot !
the space in the default is the most important part
Are you removing recipes in shared or server?
I think shared
Yeah, shared
it's done like this
recipe:setIsHidden(true)
recipe:setCanPerform("nope")
the "nope" function just returns false
Sadly Craft Helper shows hidden recipes regardless
try this
Thx, Daikon exemple did the trick
This used to work with Craft Helper Continued. However it's commonly reported to have issues, some people have said their sandbox options were changing unexpectedly. Some have reported being able to fix it but not sure what exactly the issue was.
Weird...
if you find something please post update 🙂
Our sandbox settings don't change unexpectedly anymore because of my mod to sync them over Lua
Eve wanted to patch Craft Helper Continued a while ago...
But our list of to-do stuff is bigger than B42 patch notes
I'm trying to import another Lua file into here, but this isn't working. Could anyone tell me what should I fix here? ```---MainTest.lua
require "ZamazonWeapon"
local foodprice = foodpricezand---ZamazonWeapon.lua
local foodpricez = {
4,
9,
8,
1,
2
}
return foodpricez```
I assumed they changed the sandbox option because it is checked OnPerform but this issue is reported too often.
Just checked and the recipe is hidden with these two conditions. Although I do the reverse, it's hidden by default and I unhide it.
Maybe Craft Helper has an internal list of the recipes and we just need to... remove them earlier?
Don't remember when the deleter code runs exactly
local foodpricez = require "ZamazonWeapon"
Thank you very much. I'll try it out now!
Still need help about that if anyone got any idea ^
Excited about the cache'd textures - will this come with different coloring methods? The current one is multiplicative I believe - I wanted to make outlines using 4 drawn images and I wasn't able to get a solid white using the current methods.
Would also be neat to merge a shading overlay onto a solid base for color variants rather than the usual recolor
how to make a crafting recipe?
isKeyPressed(getCore():getKey(Keyboard.KEY_RETURN))
Thanks!
hmm it doesn't seem to have any effect
if button.internal == "OK" or isKeyPressed(getCore():getKey(Keyboard.KEY_RETURN))```
~~I assume that's the correct way to implement it~~ actually nvm this function is called when player clicks a button with mouse so obv pressing enter won't have an effect
Don’t make errors
That’s the only way
Or go back to the menu and reblog
it keeps saying I am returning nil, I do not know why if getPlayer():getPrimaryHandItem():getAmmoType().isInPlayerInventory() == true then
getAmmoType returns a string, getAmmoType().isInPlayerInventory() isn't valid
What does it need to be valid?
what do SendClientCommand?
share info on the server for other players?
it's same if i just throw func in server folder? without SendClientCommand on client side func?
Gotta love it to read PZ source code and just 
From what i understood is that first method does... some kind of preparations ig? Creates item objects and puts... scripts in map i guess??
Im not sure, it is a bit hard to read decompiled code of pz 
how so? why do you think that?
The cost may be fine... Maybe not enough wire
But skill seems too low
Also remember to mark the tools as "keep"
how much wire should be required? yeah I checked to make sure to keep the aforementioned items in the recipe hahahaha after wondering why it consumed the tools
interesting.... engine parts makes sense
It does consume petrol and spit out electricity
It's a gas engine connected to an electric turbine after all
oh.. apparently theres "wire" and "electric wire"...
wire is used for something else 
perhaps I should remove "wire"
Also don't forget to lock them behind magazines
Normal wire is for fencing
I suppose, electric wire is next to useless
ah yes, my favorite sport
Where would I find the ripped clothes overlay?
hm... good point.
though I dont know which magazine I could put the car battery behind
Make your own
Electrical magazine
I dunno how to do such a thing, thus why its just a recipe thats already available
If you're lazy
I found 'em, but... I got nothing to compare them to.
If I'm right, it should be here...? E:\SteamLibrary\steamapps\common\ProjectZomboid\media\textures\HoleTextures
I need some assistance on how to do this, so far I have only found "NeedToBeLearn:true,"
unsure of where to link a recipe magazine to this
thanks, im not really a programmer...
just looking at exsiting code(zomboid\media\scripts) and mods people have made and replicating what I see
Look at Udderly Ammo Crafting
alright, thanks for the tip. ill be right back
alternaticely, ZAP Glass Molding
how can I save progress or reduce time of timed action? For example, if I have a very long timed action, and the player has already waited half the time and canceled the action, then if he starts the action again, he will either have saved progress, or the required time will decrease to what he did not have the last time end of action?
Anyone knows if there is a way to make Result in recipes to be empty?
P.S I only need resulting items related to what I do in a function
RemoveResultItem:true,
Is there a red rain mod?
is there anyone knows zpop_x_y.bin, x and y meaning?
is getPlayer() a valid IsoGameCharacter ? trying to force player to sit and prevent movement
player.setSitOnGround(true);```
it is, right? 
am I missing something?
Yea, I know that one
I'm more interested why can't block movement 
Oh, something else was interfering

I did dot
instead of :
player:setBlockMovement(true);```
this works
I constantly mess those 2 up
too used to working with moddata tables and you use . there

now it works, however still can't force player to sit, any ideas
hah
thanks god for decompiled pz code
yoinked this by looking up sit in libs
player:reportEvent("EventSitOnGround");
another question though, block movement prevents moving altogether, including rotating character to look around. any way to be able to rotate while preventing movement?
Would anyone happen to know in what part the UI tooltips for weapon attachments are displayed? I may have done a ctrl+f on all the LUA files, but I couldn't find it- figured if it was hardcoded.
Trying to see if I can change the name of the weapon attachment type when looking at specific weapon, to go around the whole 'can't make new weapon part types' problem
Same way as when sitting presumably
yes but if I use player:setBlockMovement(true);, which i want to, it won't allow any movement, including rotating character
Odd, because you should still be able to turn in place if that’s the case
I need help with getting a custom recipe skillbook to spawn in game. I've made a custom item in this same mod that spawns just fine, but for the recipe book (which I just copied from the game's code and renamed it as a test) it doesn't show up in crates.
I'm using (in the lua/distributions folder)```require 'Items/ProceduralDistributions'
table.insert(ProceduralDistributions["list"]["BookstoreMisc"].items, "EnginePartsMag");
table.insert(ProceduralDistributions["list"]["BookstoreMisc"].items, 2);```
I've noticed that it does show up in LootZed but the actual item looks blank
Reposting this for the funny, definitely relevant though.
here's a pic of the LootZed, again I simply copied the same code for another recipe magazine but renamed it, I guess I'd have to go about fully making a custom item to see it appear? edit: even after making my own icons and textures it still shows up blank in the LootZed and doesn't appear (even at higher spawn rates)
https://steamcommunity.com/sharedfiles/filedetails/?id=3039363240
Polish survivors, rejoice!
Does anyone know what is the problem?
local function firstaidboredomheal()
local player = getPlayer()
local stats = player:getStats()
local boredom = stats:getBoredom()
local bodyDamage = player:getBodyDamage();
if boredom >= 99 then
bodyDamage:AddGeneralHealth(100)
stats:setBoredom(0)
end
end
Events.EveryOneMinute.Add(firstaidboredomheal);
To mój czas.
Looks incredible, how is it done?
Ah, probably something to do with this. I'll keep combing the channel
Hey hey, I have a question.
I'm currently doing a addon for Hydrocraft in wich you can craft Mags for Arsenal gunfighter.
My problem is that somehow the 9mm and the 5.56 mags do not work.
Other Vanililla mags work and the VSS recipe dose.
Did I do anything wrong ?
recipe Make VSS Magazine
{
HCSmallMagazineCase=1,
HCSteelspring=1,
keep HCSmithyhammersteel/HCSmithyhammertitanium,
keep HCAnvil2/HCAnvillead2,
CanBeDoneFromFloor:true,
Result:VSSClip,
Time:150.0,
Category:Smithing,
OnGiveXP:HCWelding_OnGiveXP,
}
recipe Make 5.56x45mm STANAG Magazin
{
HCMediumMagazineCase=1,
HCSteelspring=1,
keep HCSmithyhammersteel/HCSmithyhammertitanium,
keep HCAnvil2/HCAnvillead2,
CanBeDoneFromFloor:true,
Result:556Clip,
Time:150.0,
Category:Smithing,
OnGiveXP:HCWelding_OnGiveXP,
}
And how will the event be after eating a certain food? Event.eating(smth food).add?
second recipe not work?
i think it problem in "." in recipe id
Make 556x45mm STANAG Magazine
just do "." in localisation file
Sure, thanks for the tip. I will try it out once I got the time for it
Hello there, fellow modders. I am looking for the frames of the Fire01 animation (this is the default/small size fire tile animation pictures used by IsoFire in its small state). Do you have any idea where I can find those frames ?
okey so this did not fix it.
There are other recipes that work that have a . in them. After removing the dot the recipe still dose not work.
I also double checked the mediumcase Item. This also works with other recipes
is this exactly how the script is written or are there more recipes between them?
a syntax error in one recipe will cause it to refuse to load the remainder of the file
so if there's other recipes between them i would look at the one before the one that isn't appearing
Alright, quick question, I am fairly new/Basic to modding in project zomboid and I got below basic experience in lua, but how would one add a cooldown between doing recipes? So one you've done it, you gotta wait until you can do it again?
i figured it out.
I try to "comment" inbetween recipes. The Recipes that had the comment above them did not work.
Everything is fine now, but I still have a question.
How can I comment in the recipes? I would realldy like to
Hey, i have a model for a weapon. how would i go to adding it ingame with the item i created?
looking at the vanilla files, the models seem to be in an x file format? what is that?
The .x file extension was introduced with DirectX 2.0 to contain files of the X file format; and DirectX 6.0 introduced methods that enable reading from and writing to .x files.It is a simple file containing geometry meshes and material information that can be viewed in the DirectX Viewer, a program available with the 2008 DirectX June SDK (Soft...
shrug Models and file formatting isn’t really my area, I’m not really the person to ask. You might have more luck in #modeling tbh.
Alright i will go there
Does anyone know when IsoObject#update is called in Java?
Is it called every tick?
/*
comment part of code
*/
using fbx is fine, i like how you can scale an object in the game in real time using blender
Do you know the formula for calculating weapon damage in Project Zomboid? Also, does anyone know if the critical hit chance is the chance for the zombie to be instantly killed?
Finally, I was able to finish the design of the signs with the speed limit. Many thanks to @drifting ore for your help 🙂 Soon I will start creating more signs, and not only road signs. I plan to prepare information signs, posters with missing people, etc. Here is a link to the mod. I hope that maybe someone will like it.
https://steamcommunity.com/sharedfiles/filedetails/?id=3039610045
how does one upload a mod to workshop
Gotta do it from in-game
tiles2x pack, top page
top result from google
https://steamcommunity.com/sharedfiles/filedetails/?id=534034411
thankyou, i figured it out believe it or not 😂
recipes have names and they can be same names for multiple recipes.
I don't use the override but I have the impression it doesn't work well when multiple recipes use the same name?
not sure, just i want remove vanilla recipes like create sheet rope from SOCKS RLY?! GOD DAMN!
i want do step by step thing for this.
like:
Rip clothes => Ripped Sheets + Thread
Ripped Sheets + Thread + k: Needle => Sheet
Sheet => Sheet Rope
Sheet Rope => Sheet
Rip Sheet => Ripped Sheets + Thread (but low then before)
M1 FREEBRUMS
@mellow frigate got a quick question about your mod Moodle Framework. I faced an issue where the moodle is being shown for all players online on a server. I am using it for one of my mods in a function as follows:
--The following function is called for the event onPlayerTakeDamage
function Knockout.onPlayerTakeDamage(character, damageType, damage)
if isServer() then return end --If the code is running on serverside, don't execute the code (tried with and without this line, still same result)
if character:getModData().Knockout_isKnockedout then return end --Ensure that the player can only get knocked out if he's not already knocked out
if instanceof(character, "IsoPlayer") then --Check if the damaged character is a player and not a zombie
--More code that executes the function *Knockout.setUnconscious(character)* based on certain requirements
end
end
--Knockout.setUnconscious(character)
function Knockout.setUnconscious(character)
local playerIndex = character:getPlayerNum() --Get player num
ISTimedActionQueue.clear(character)
ISTimedActionQueue.add(Knockout_TimedAction:new(character, playerIndex))
end
--Timed Action
function Knockout_TimedAction:start() -- Trigger when the action starts
self.action:setBlockMovementEtc(true)
Knockout.disabler(self.character, true) --Disable player controls
self.character:getModData().Knockout_isKnockedout = true
UIManager.setFadeBeforeUI(self.playerIndex, true)
UIManager.FadeOut(self.playerIndex, 1) --Show black screen
local moodle = MF.getMoodle("Knockedout");
if moodle then
moodle:setValue(0)
end
end```
if you (or anyone else) got a solution about this, would be lovely
unless you changed from default thresholds, moodle:setValue(0) is activating the moodle Bad 4 and you show no code deactivating it.
under my eyes all along and I failed to see it, Thanx again !
its deactivated at:
function Knockout_TimedAction:perform() -- Trigger when the action is complete
self.character:setBlockMovement(false)
Knockout.disabler(self.character, false) --Enable player controls
UIManager.FadeIn(self.playerIndex, 1)
self.character:getModData().Knockout_isKnockedout = false
local moodle = MF.getMoodle("Knockedout");
if moodle then
moodle:setValue(0.5)
end
if self.sound then
self.character:stopOrTriggerSound(self.sound);
end
end```
but I am not sure how is that relevant to making the moodle show for all players instead of only the target player
I fully agree on that, it could be a clue that start is called for every player. hidden is supposed to be the default state for any moodle
maybe ensure the stop action deactivates the moodle too
you'll still have the "bugged action, clear queue" inconsistency but considering you also block movements, the moodle would be the last of your problems
you could remove all moodle interaction from the timed action and do OnPlayerUpdate: ```lua
function knockedout.OnPlayerUpdate(isoPlayer)
local moodle = MF.getMoodle("Knockedout");
if not moodle then return end
if isoPlayer:isBlockMovement() then
moodle:setValue(0)
else
moodle:setValue(0.5)
end
end
I will try that, will also try different stuff with the onPlayerTakeDamage to see if the issue roots from there. Thanks!
Also, MoodleFramework is not splitscreen compatible
oh. Any way around it?
not really: 1/ not using Moodle Framework 2/ not using splitscreen 3/ giving me the evolution
Will see if I can figure something out
Here’s an idea
Diabetes trait (Hardcore Mod)
A trait that forces u to actually look out for what u eat.
No more chugging ice cream tubs, maybe now the nutrition trait will be useful so u can see what has what.
Insulin could be added in the game as to something to worry about, so look for it in stores or clinics/hospitals.
Thats my idea hopefully someone tries it out
Diabetes first type dying in apoc xD
Lmao yeah
It’s not that I’m a fan of negative traits and that I’m so immersed in RP...
The idea itself is interesting, make a list of foods based on carbohydrates and assign them “bread units” (I don’t know how it is in English) in order to suppress the new scale of “sugar in blood” needs.
From all my experience communicating with people with diabetes, I remember that insulin should be kept refrigerated.
It's basically just another story about how you die.
Depending on how complex the build 42 crafting system is it might be viable to implement some sort of insulin synthesis as well, it would take a very high medical level though.
build New world with blackjack, Guns and Insuline
with fitozombies (10 years edition) and zombodrugs...
I have the black jack covered
Nice, take brita guns with improved projectile
need slu....ops! insulin i wanna say
New world done on 66,6%
And it would be a good challenge mod, makes u a bigger chad if u survive long enough
or loldie from icecream
mmm, yumme 
long insulin every day
portion normal insulin after eating
Eat qiwi and sport for reduce insulin resistent
start with one long insulin and one normal (~15 days)
shuga-meter with tests or just pee and try lick it if not have tests
Oh shit this all coming together now ain’t it
when realism goes too far
I wouldn’t say it’s too far, it’s an interesting way to spice up long term survival and give it a unique challenge that would be pretty tough to overcome IRL
hey quick question.
When I use special characters in for translation it gets bugged ingame.
The Translation file dose not have those errors.
It looks like this:
code file in ansi
or... check original pz de localisation with notepad++
I can do that
Original txt file for referance
this show u encoding info
use same
or just copy original file and rename it and change content in them
or ask in #translations
use these encodings
Is there any way (Server setting etc.) to set-up sleep recovery modifactor? Like when I lay down, that I recover more. Actually I would really need to lay for 10 hours to recover, which is not my intention. Is there a sleep-length modifier or something I can work on?
okay so quick question
this is my (test) version of the distribution system
to make my item spawn I need to replace the "TUT.Someitem" with the name of my item
for example "Hat_monky_black"
is that correct?
the space after ArmyHangarOutfit will cause issues
what do you mean with module name?
Like Base
Everytime you declare a new item in the script file you write what module its in
Like
Module Base{
…
}
You need smtj like Base.BaseballBat
If you put just BaseballBat it will not spawn it probs
it will assume base when the module isn't specified
but mods should avoid using base
Is there a load issue associated with putting stuff into base or is it purely to categorise modded and unmodded stuff?
it should make it faster to find stuff and improve compatibility
So the latter
how? I'm new to modding
it's a text editor thing, search based on the program of your preference and when you are editing the file use the appropriate encoding.
not 'categorise' specifically though this is a benefit of it, the main reason is to avoid clashes
https://github.com/TheIndieStone/ProjectZomboidTranslations/blob/master/.gitattributes
DE/*.txt text working-tree-encoding=cp1252 encoding=utf-8,
windows 1252 for german for example
https://pzwiki.net/wiki/Modding#Localization
DE Deutsch - German Cp1252 Western
there can only be one Base.Apple, there can be a hundred MyMod.Apples so long as each mod has a different module
But where do I need to add this?
At the beginning of each tranlation txt or in a seperate file? And in wich folder location?
It's your program's setting. Most programs show you the encoding at the bottom right of the editor and you can change it from there.
ah I see! Thanks very much I will try this then now
Updating conditional speech a bit
DrunkSlurring: {"o:uh","s:ch","s:sh","a:ah","u:oo","c:sch","tion:shun","i:ii"}
Results: (1-4 = moodle intensity)
1 yesh, siir.
2 yes, sir.
3 yesh, sir.
4 yesh, shiir.
1 must be nice having a vacation
2 musht be nice having a vacation
3 musht be nice hahving ah vaschahtion
4 moosht be niice hahviing a vahschatiiuhn
1 suh mahny dead
2 shuh many dead
3 so many deahd
4 shuh mahny deahd
1 i'm nuht drunk you're drunk!
2 ii'm not drunk you're drunk!
3 i'm nuht droonk yuhu're droonk!
4 ii'm nuht droonk yuhu're droonk!
1 Thish is an example of the drunk filter in action.
2 This iis ahn example uhf the drunk filter in action.
3 Thish iish ahn exahmple of the droonk filter in action.
4 Thiish iish ahn example uhf the droonk fiilter in aschtiion.
seems to not be scaling too well though lol
Yo, I have a question but not regarding mods. Is it easy to make a town / add stuff to the map. If someone got spare time to help me start it up? Like do I need to download any programs and such?
Would like to try and maybe stream while doing it
Try #mapping
Ahh 😄 dumb me
i'm diabetic type 1, and trust me having to measure your blood sugar, know amount of carbohydrates, administer the correct amount of fast reacting insulin and then check it again 2 hours later, administed long acting either once a day or twice depends from person to person would seeem haaaaaaaaaaard asf in game lol
is there any known solution the fact that sandboxvars load after the distribution event for items fires?
yeah, you can just get the itempicker to reparse the distributions
ItemPickerJava.Parse()?
i don't know if that helps with the use case of trying to make a mod's item distribution configurable with sandboxvars
it does
just wait for sandbox options to become available, edit the distributions accordingly, and then parse them again
that feels, not very peformant
it feels mandatory 🤷
it's all going to happen at load time anyway
it's a bit of a shame that every mod has to do this individually but it's not really a big deal
well, in that case, would I just be avoiding changing the distribution tables until the sandbox vars are available? wouldn't i have to wipe any changes i made on previous boot or does the game only build item distribution tables on startup?
it's lua, it resets when lua does
OnInitGlobalModData is the event for this
it's the first event to fire after sandbox options load
hmmm, wouldn't it be easier to hook into OnFillContainer and modify the outputs based on your sandbox vars, like the vanilla game supposedly does?
would that be easier? 😅
hmmm probably not
i've done something similar for some non-vanilla spawning logic and it's definitely the more complicated way of doing it
and less performant
for some reason, all my lua callbacks stopped working suddenly without changing anything
function OnPlayerAttackFinished (playerObj, currentGun)
print ("fired!")
end
Events.OnPlayerAttackFinished.Add(OnPlayerAttackFinished)
does not print anything when attacking, even though it worked fine just a couple days ago
https://i.gyazo.com/8bd7e4e914709301a9272139990eec3b.png
Has anyone met this before (client-side)?
Just to understand context: I have no idea what is that square location and why is looking up for generator there.
the game is attempting to sync the generator but the generator isn't actually added to the square
I found out why its happening
Its happening because I issue generator from server.
-- Create gen
local item = InventoryItemFactory.CreateItem("Base.Generator");
local object = IsoGenerator.new(item, cell, square);
object:getModData().isProp = true;
object:transmitModData();
object:transmitCompleteItemToClients();
object:transmitCompleteItemToServer();
However it has nothing to do with specified square location.
Found sympthoms: if square is unloaded (player leave elsewhere) it also starts spamming this on server-side
How creating a new IsoGenerator object causing such a meltdown is not something I'm able to grasp.
Nevermind, update: if you do any of
gen:setFuel(100);
gen:setActivated(true);
gen:setCondition(100);
Without transmitting it on server side it starts to do something weird and lookup some unknown gens in uncertain squares.
Might be some networking bug with updating IsoObjects since I don't either create or lookup gen at that square and basically coordinates are different everytime as player moves around the map, looks like just any random existing generator found in currently loaded cell.
Is there an event or anything similar for when a player reads a book, magazine, etc?
the Read timed action
I saw that but can you hook a timed action without overriding it?
they're just a bunch of functions, you can hook them like anything else
How do you get rid of the fake infection?
This right here dosen't seem to work.
playerObj:getBodyDamage():setIsFakeInfected(false);
check mods already curing the infection
Any references? I'm trying to set the fake infection to false not the infection.
i think you need to set their fake infection level to 0 in addition to disabling their fake infection
my bad
Well I fixed one issue but somehow managed to create an infinite loop -_-
no that easy to do !
Hah! 😂
So this is creating the infinite loop.
As long as the ReduceFakeInfection is TRUE the section get's skipped, as soon as the timer runs out it starts increasing the timer again and so on...
Anyone got any tutorials for adding custom hats? I'm loosing my mind 😭
-- Server
local object = IsoGenerator.new(item, cell, square);
object:transmitCompleteItemToClients();
Creates two IsoGenerator objects on client side,
1: Object not being networked (cannot update without exceptions thrown on both sides)
2: Object that is networked
How to deal with that madness, I can't not instantiate and instantiate object of IsoGenerator to transmit it...
do you have a client check in your code? i would immediately suspect that the code is running on the client as well as the server
i commented the check out (hosted game)
3 hours of my life gone due to one missing return
😔

Happens to the best of us. Poor albion saved me days of banging my head against a wall at the cost of her sanity 😦
So I figured out the issue, but I can't think of a way to fix it...
Once yellow is TRUE it ends on red. Once yellow is FALSE it continues on green. Even though fake Infection should be set to FALSE, one line above yellow.
What the hell am I missing here?
Nvmd. Figured it out... Has to do with the bite itself -_- Urgh.
Guys, who can help me write injection?
Copied "Young" code from the default clothing.xml, renamed "Young" to "grunttesting" in my own mod's clothing.xml
When I spawn the grunttesting zombies, none of the young clothing shows up despite having the same item GUIDs as the default zomboid clothing.xml.
Is there something I'm missing here? this is my first time messing with clothing.xml
how about personal zombie preset guid?
I was adding a new GUID. I'll try keeping it the same.
<m_Name>GruntTesting</m_Name>
<m_Guid>f75f1a6a-3d09-45d1-aeac-4d55524cb2a2</m_Guid>
<m_items>
<itemGUID>8973893f-f324-4cdb-a32b-43cd0378174f</itemGUID>
<subItems>
<itemGUID>229b23f6-8e8f-4f16-837b-4fe950c48bfc</itemGUID>
</subItems>
<subItems>
<itemGUID>06b8adc1-ef58-4545-a30a-6ca9920c1b82</itemGUID>
</subItems>
</m_items>
<m_items>
<probability>0.3</probability>
<itemGUID>8fc17470-453b-4ed0-945d-c20ba6f5af59</itemGUID>
</m_items>
<m_items>
<itemGUID>903c06ea-78e7-4f42-a3da-768be61f216f</itemGUID>
</m_items>
<m_items>
<probability>0.3</probability>
<itemGUID>4b278ded-d489-4b64-b457-e059a9963beb</itemGUID>
</m_items>
<m_items>
<probability>0.2</probability>
<itemGUID>7b339ad5-da2e-42a5-8a51-ee87239a943c</itemGUID>
<subItems>
<itemGUID>d90d4976-d993-4fae-ad78-f5a4fcf05366</itemGUID>
</subItems>
</m_items>
<m_items>
<probability>0.1</probability>
<itemGUID>825f5380-d6ef-4cf8-8d77-d3a115724f4a</itemGUID>
</m_items>
<m_items>
<probability>0.2</probability>
<itemGUID>cba6763a-6897-4631-8748-0c15f5450c93</itemGUID>
</m_items>
<m_items>
<itemGUID>6fed6e2b-3a72-4bac-aac5-09585984493d</itemGUID>
</m_items>
<m_items>
<itemGUID>ebea15c8-99b3-4e20-905b-d22cf82b8217</itemGUID>
</m_items>
</m_FemaleOutfits>```
same as the young outfit type
I'll give it a shot
if ItemPickerJava.doParse then
ItemPickerJava.doParse = nil
ItemPickerJava.Parse()
end
this is added to the lua table, have that in mind if you do java mod. You should add this to an event after OnInitGlobalModData and before the cell is loaded.
OU!
I know its problem
all clothes items u use in mod for zombie preset should be duplicated in this file
like this
for example
our new preset has only vanilla clothes, but fileGuidTable not contain this info
oh
yea I've been trying to make them wear vanilla clothes, that makes a lot of sense
thank you
Tip: it is not necessary to copy all vanilla file. This file not overwritten another file.
Just add info about vanilla clothes if u use them.
Guuuys, how to write injection?
or why global func not overwrite another global func with same name?
never mind, i'm complete another way
anyone have any tutorials on custom ISTTakePillAction code
Anyone know where I can find the jumpscare sounds in the game files?
@bronze yoke hello, you suggested to me before the usage of online id instead of player name for sending server/client commands. apparently it returns player as nil when I tried it the way you suggested, however, when I used names, it works fine (which isn't optimal considering the problems you mentioned)
--Function gets called from onWeaponHitCharacter event. I am trying to add a timed action to the target player, but a bug happens where the timed action is applied for both attacked player and target player (possibly all other players online too), and the only way I found that fixes it, is sending the target player's username to to a client command, then sending it to a server command to apply the timed action.
function Knockout.onWeaponHitCharacter(attacker, target, weapon, damage)
if target:getModData().Knockout_isKnockedout then return end --Ensure that the player can only get knocked out if he's not already knocked out
if instanceof(target, "IsoPlayer") then
--lots of irrelevant stuff here
local onlineID = target:getOnlineID()
print("ONLINE ID FROM _DAMAGES IS: " .. onlineID)
sendClientCommand('RealKnockouts', 'knockPlayerOutByID', {onlineID})
end
end```
Client Command:
```lua
function Commands.knockPlayerOutByID(onlineID)
local player = getPlayerByOnlineID(onlineID)
sendServerCommand(player, 'RealKnockouts', 'knockPlayerOutByObject', {player})
end```
Server Command:
```lua
--This is where the error happens, player being detected as nil
function Commands.knockPlayerOutByObject(player)
local playerIndex = player:getPlayerNum()
ISTimedActionQueue.clear(player)
ISTimedActionQueue.add(Knockout_TimedAction:new(player, playerIndex))
end```
I noticed that player object is fetched from the client command and sent to the server command according to the code snippet you sent as well. Wouldn't they be different clientside/serverside?
.
If OnWeaponHitCharacter is called on the target Client side, you do not need all that network stuff: just apply the stun locally. If it is called on server side, you only need one message from server to client. ```lua
--also this is invalid because you cannot serialise the player into the args for network transmition:
function Commands.knockPlayerOutByID(onlineID)
local player = getPlayerByOnlineID(onlineID)
sendServerCommand(player, 'RealKnockouts', 'knockPlayerOutByObject', {player})
end
--replace by:
function Commands.knockPlayerOutByID(onlineID)
local player = getPlayerByOnlineID(onlineID)
sendServerCommand(player, 'RealKnockouts', 'knockPlayerOutByObject', {onlineID})--you also can just remove any args, because the client called already can find getPlayer()
end
you may wanna use isoPlayer:isLocalPlayer()
That's what I tried initially, doing the stun directly without usage of client/server commands, but it was acting weird because it was being applied for both attacker and target (remember that moodle thing I discussed with you yd? turns out it's not just a moodle framwork problem)
I will try sending the server command directly, or doing an if condition for isLocalPlayer()
if doing it locally does too much, using network cannot be the solution, filtering locally can. ```lua
--client side
function Knockout.onWeaponHitCharacter(attacker, target, weapon, damage)
if not instanceof(target, "IsoPlayer") or not target:isLocalPlayer() then return end
if target:getModData().Knockout_isKnockedout then return end --Ensure that the player can only get knocked out if he's not already knocked out
Commands.knockPlayerOutByObject(target)
end
looks a lot like what I did for AutoEat mod
hmm I never actually tried isLocalPlayer() or messed with it. Fingers crossed it'll be the solution. Thanks for your help!
I have to find what item to patch by crawling recipes... Have to go two levels to make a loop
what's your FPS ? (without the print statements)
Oh, it's done once on startup
Didn't profile it for basegame
Is the mod's name gonna be kill_me? 👀
Nice job though. Always nice to spend hours on something to have it eventually work out
No, tI named the file that way because I have spent 4 hours on it that I wanted to play Minecraft during instead
It's in a file because of Discord message length limit
Remember
haha yea
GetAllRecipesFor doesn't like items with modules
Recipe result is an item without the module
At least in my testing it was
if it turns out it can be both I will run into Louisville naked
If you ever feel like your loading time is degraded, you may wanna get a look at: https://discord.com/channels/136501320340209664/1085414352271716402
I think it won't help much considering there's 5 loops
There are a few spots I can apply those, yes...
I have switched from writing good code to writing working code
the lua cost of java loop array management can be mitigated. but that's only if you need it. you'll see
That doesn't mean I don't want to learn it... is it in the thread you mentioned?
yes
Then I will check... might improve the code a bit
Gotta ask
Caching class functions only works if I work on the same item, right?
Or rather instance
no it works for instances, that's the point 😄
Really?
that Includes ArrayList
I thought it would save a reference to the object's function, not the class'
the method definition is not duplicated with each instance or it would take so much more space.
So it's kind of like... The reference is static?
Or rather... To lua, all methods are static?
I do not know for lua, but for c++ (and I guess for java it is approx the same) methods are defined once per type, with a virtual table for indirection in case of inheritance & override.
Uh huh...
If I cache my method... how do I use it then? Let's say, I cache item:getFullName() into scriptItem_fullName
you do not cache instance stuff in file scope, you cache only type stuff at this level. instance stuff remains cached inside your lua functions ```lua
local item_base = __classmetatables[InventoryItem.class].__index
local item_getFullName = item_base.getFullname
function myluadFunction(params)
--..
local instancefullname = item_getFullName(item)
--..
end
I see some Poltergeist around there. that's good. he knows better than I do and I got to go.
Okay
do not forget your minecraft session 😄
there is a mod that changes ISReloadWeaponAction.attackHook on onGameBoot, how can I override that with my mod's custom attackHook? I am kinda confused how game manages onGameBoot's load order. maybe I should change my modID/filename to make it last?
FileName
As in the file you do the overwrite with
You can also do a Require on the file you're patching
I got a good idea, a negative trait where you start off extremely fatigued on day 1 because your character did an all nighter the night before the apocalypse began, ig like 4 points would be good
Very realistic to literally every person ever 💀
So you just... lose a few hours of the first day?
Hey hi, is there a way to show things depending on a condition, for only a single player?
For example, a floating piece of text, an area marking, etc...?
Also, what the relevant method to check a player's current tile?
where (if anywhere visible) can I find the item definitions for refrigerators? Or even any furniture object that is also a container?
Moveables are in scripts. For tiles themselves you will want to download Zomboid Modding tools from Steam and launch TileZed to open vanilla's tilepack
I found a few (such as the ovens) in the newMoveables file but the capacity is not defined there
Is it in the tiles?
it's because your server command tries to send a player object to the client, you can't send most types of objects as arguments, hence the need for online ids to uniquely identify players
the process is: 1) the first client selects the player and sends the online id 2) the server uses the online id to get the player object, sends the online id to the client with that player 3) the second client uses the online id to identify that player and run whatever code
you need the player object on the server side so you can send the server command to that specific client but you can't actually send it along
Hey hi, where can I find the documentation related to the addOption method for right click context menus?
I can't seem to find it anywhere online in the javadocs, nor in the LUA docs.
it's not in the javadocs, it's pure lua
Can't seem to pinpoint where in the luadocs it is
I'm hooking into OnFillWorldObjectContextMenu, and would like to use its context to add some options. However, I'm not sure what the 4 fields mean. The first one is the text, I'm assuming. The other 3 seem unclear, however.
_context:addOption("text goes here", nil, nil, nil)
The nills over there ^
iirc it's text, first argument, function, second argument, third argument, etc
Question, is there a way to replace music files using scripts rather than just replacing the .bank file?
First argument for what?
the function
So
when you click the option it'll call that function with those arguments
First, second, etc... arguments are passed onto the function?
That's an odd order 
Why not have method go first, and then all arguments
yeah i imagine they only needed one at first and didn't plan ahead
Still, if that's it, that's good to know
Thanks a lot!
Another question, while I have you in here 😅
- How do I store & load mod data for a save
- How do I store & load mod data for a square/tile
for a save, ModData.getOrCreate("unique string key") returns a table that saves with the save
for a square/tile, most objects have a :getModData() table which saves when the object does
Gotcha, thanks a ton!
Hey hi, is there a way to delete a weapon once it breaks? I mean, immediately
By chance, is anyone aware of the event OnObjectAdded Event and it's exact usage? does it trigger when a user places the IsoObject at the world level? like placing any of the known IsoObjects?
it says added to map, but wasn't sure if that meant just placement in general
iirc it was whenever a object was added by any method other than just loading in
perfect tytyty
my documentation on it is a bit lacklustre but the last part might be relevant to you
Fires when an object is added to the world. Note: usually not called on the client, but is in some cases.
The Sims : Zomboid
Oh hell yeah
give me two!
- live styles + mods from Birget = rly The Sims
Is there a tutorial on how to make a specific amount of objects spawn in a container? Like if I wanted 4 forks to spawn would I have to copy paste the whole fork with a weigh of 100 four times?
check the cigarettes code, they always spawn in multiples of 20.
Hi guys I'm a mapper and I'm currently creating 2 maps (Irvington and Shepherdsville) for my RP server. We are desperately looking for a modder. Is anybody available here? We could even pay the work. Please🥵🫡
Hey hi, what would be the most performant way of checking what tile the player is on? Is there an event for entering a new tile?
onPlayerMove it is
Still messing with game night - and getting desync. Do floor tiles not actualy count as containers? I'm wondering if the issue is due to that.
Does anyone know how to check if there's anything solid in a tile? As in something you could collide with like a crate or something
Hey @sour island, sorry to bother but I'm just curious why you used ISPanelJoypad instead of just ISPanel for Game Night, specifically for the window code
Game Night has been a massive source of inspiration for me, so I've been poking around at it trying to figure out your secrets lol
I don't think there's an impact to use joypad - but I know there's people who prefer to use controllers - hoping this allows for a patch/update later
Okay, thanks!
Are you working on an add-on?
No, I've been trying to make Nonograms!
But it was Game Night that sorta gave me the idea for it and let me know it was (hopefully) possible
I don't wanna get too into it to not spam the chat about my weird stuff, but I wanted to make a stupid research minigame to gatekeep progression in my mod and I settled on nonograms
mainly IsoGridSquare.isBlockedTo(IsoGridSquare), you can have more details in TchernoLib media/shared/Movement/MovePlayer.lua (testCollideSpecialObjects etc..)
Does transmitModData not work on squares?
Exception thrown java.lang.RuntimeException: Object tried to call nil in saveTileData at KahluaUtil.fail line:82..
I wanted it while I was in a vehicle sadly
WarpTiles.saveTileData = function(_tile, _thisLink, _otherLink)
local tileData = _tile:getModData().WarpTiles
if not tileData then
tileData = {}
end
if _thisLink.tileType == WarpTiles.tileType.source then
tileData = {
destination = _otherLink[1]
}
end
_tile:transmitModData()
end
I assume it doesn't work while on a vehicle
_tile being an IsoObject
I don't wanna be checking against a list. Would kill performance in my case
Unless tiles/squares aren't IsoObjects, and I've taken a wrong turn somewhere 
transmitModdata 
it is capitalised on isoobject 
It is capitalised in my code
oh. I get it now, thanks for the clarification!
@mellow frigate just wanted to let you know that your solution of IsLocalPlayer() did solve me the issue which I spent days trying to fix, hats off, thanks so much 🤝
Anyone got a clue as to why this would error out?
local function foo(_player)
-- ...
end
Events.OnPlayerMove.Add(foo)
Specifically, the adding of the foo method hook on the OnPlayerMove event.
Did that event change? Is it not subscribeable?
what error are you getting?
Exception thrown java.lang.RuntimeException: attempted index: Add of non-table: null at KahluaThread.tableget line:1689..
My other event hooks work fine
So I'm kind of puzzled
that would imply the event doesn't exist (usually as result of a typo) but that's accurate to my documentation
I'm going off of this as reference: https://pzwiki.net/wiki/Lua_Events/OnPlayerMove
Any chance you're redefining Events somewhere?
Not as far as I'm aware
I have other event hooks in the mod as well
local function init()
Events.OnTick.Remove(init)
Events.OnFillWorldObjectContextMenu.Add(contextMenuHook)
Events.OnPlayerMove.Add(checkForWarp)
WarpTiles.getModData()
print(WarpTiles.modName .. " " .. WarpTiles.modVersion .. " initialized.")
end
-- Event hooks
Events.OnTick.Add(init)
This is all relevant code regarding Events
I've tried commenting out the body of the checkForWarp method, in case it's somehow causing problems with the Add, to no avail.
Seems like it resolved itself. Not entirely sure what I did there. Might have just been something that didn't overwrite properly when I updated things.
Sorry y'all!
Glad it worked itself out
is there some sort of a guide that explains setting up mods in a github repo and getting them to update automatically on the workshop when a change is done to the main branch? (if at all possible)
if you want automatic updates you'll need a second steam account with a copy of the game
and i think you need to emulate the authenticator too...? not sure about that, just remember the authenticator being a hinderance when chuck was trying to do the same thing
Sounds like a hassle. Any idea if he was able achieve the desired result?
i think so
I see. Will try to do more research into it, ty
https://steamcommunity.com/sharedfiles/filedetails/?id=3040894629
I shed blood and tears.. but its finally done
What do you think about my map? I'm still working on it but I want some feedback of what i've already done
give the rich people a dock
so that they can dunk on the poor people better from across the water
where do you define new values for WeaponSprite=? in items
it seems this one is the reason my model isn't showing-up in-game
Does anyone know what the name of this icon is in the game files?
there a function to disallow player's interaction with inventory/containers?
Solved
or if whole UI can be hidden, it'd be better since I also want to disallow interaction with health panel/crafting menu/etc (maybe selective if possible since I wanna keep chat panel?)
Solved
actually i just realised those are timed actions, which shouldn't execute until an active timed action is over.. yet they do?
Solved
Players can queue timed actions, and some take so little time they finish instantly too
is it possible to change whats on the screen? i would like to play around with implementing night vision goggles, or infared