#mod_development
1 messages · Page 326 of 1
a texture is a texture, it just happens to match up with their model
Maybe in America, not how it works in the EU
what are the basic things I need for a mod to appear in the UI? I can't get it to show up
too fast this morning albion
modname/42/mod.info
also for b42 you need a modname/common folder for no reason (it can be empty)
right okay sorry, 42 is what I had mb
hmm
It still doesn't show up. Wierd.
I must have misconfigured smth but idk what
is your mod folder in %UserProfile%/Zomboid/mods/?
the one in steamapps/common/ProjectZomboid/ doesn't work, it exists for no reason
Check the wiki page
Would be nice if a Lua API is added to check if ANSI is supported in the terminal of the game server. It's literally the most background and non-priority item of suggestion but gosh darnit I need this.
Update mod structure to have a full example at the bottom
I would add a note that you have to use the userprofile/zomboid/... folder for things, as the installation directory is a red herring
yeah i can't even count how many people i've had to correct on that
Wait really ?
Alright I'll see to add that then
it's natural to just open up the game files when you're looking to start modding, it's the first thing i'd do
and then you see a mods/ folder with a mod template in it and everything, obviously you'd assume you can put mods there
workshop is there too
hi, i started dabling into creating my first mini mod, just making the sitting action bindable to a key. I managed to fix the new b42 mod structure and vibe coded the lua with chatgpt but for some reason it isnt working :p
anyone care to have a look?
it doesn't work because chatgpt is useless for modding
vibe coding will not work for pz
:p
it worked great in browser games for javascript
and i just wanted to have one tiny feature
binding the sit / stand action
the ai has a better understanding of those things because they're more general, it doesn't know how to do anything in pz's environment
setting up a keybind is pretty simple
smth like this
- func to setup the key handler
- event to hook in
- func to call when key is pressed
but yeah chatgpt probably doesn't have the api info needed to provide the code
its too obscure
i actually understood most of the words you used :p
so basicly LUA has been around for ages but it changes depending on the api used by the game?
hence the AI doesnt know what to do with it?
yeah, the devs of the game change their code every so often to provide new features, but it breaks old mod content (and makes AI knowledge of the code outdated)
and the documentation isn't very good as they are a small team with limited resources
its kind of a battle to understand things/learn to mod this game
i just need to find a mod which already binds something to a key
and find the name of the sit action
not even sure why nobody has ever made such a mod, right clicking to sit is ... too much work
doing a cryogenic run, its pretty rough living in the wilderniss
they did
need to sit a lot at the campfire to stay alive
aw, i love you
nice
aw this is so much better
is there an NPC mod that works in b42? Im curious, for reference
Hello, good afternoon. Would it be possible for a player to have more than one safehouse? I've been making some modifications with a mod, but I'm getting anticheat 19. Checking the information, I saw it's related to the number of safehouses. I don't know if anyone has ever reviewed any of that. I'll leave the repository, although I'm still working on changes... even if I'm not finished, but just in case, if anyone sees something I haven't seen yet...
https://github.com/pangolp/safetogether/
Just to clarify, I'm on build 41.78.16
To summarize, what I did was use the code the administrator has to add secure areas. I set up some points and used the code at those points. If the owner changes, there's no problem; the person can have more than two, and the anti-cheat won't be triggered. But if they want to claim one, having another one previously, or being part of one, then the anti-cheat will be triggered.
In the end, I solved it by creating a fake owner and then deleting the safehouse. Later, I updated the repository and added the missing translations, in case anyone wants to see or use it later. Although I mix two themes in that mod—on the one hand, the safehouse together, and on the other, taking over empty land—I'll have to split it up or make a modpack.
In the first one, I had commented on the deletion, to see if it was added, then, as I saw that it was added, I ended up deleting it.
I’ve been fiddling with worlded and tiled and I’m having a bit of difficulty understanding what exactly worlded is for
If I was trying to replace a single cell on the map, would I even need a world?
The idea is to "reclaim a plot of land that has no houses." So people can build without having to, and even if the house is torn down, they'll still have shade.
The red area is calculated from the point where I specify that the script can be used.
I also ask for money or an item in return, because in reality, it can be customized.
Within that area, everyone builds their house as they wish.
It's part of another mod, of plots that I made.
The idea is that they can claim those plots of land, instead of the houses in the game.
They have more space, they don't depend on the admin for expansions, they're independent, in short... many factors.
I'll try to explain it, in the repository anyway.
That's the mod for the old plots.
The only downside is that what a player builds will never be a room, so it will never have a light switch.
They'll have to put in nightstands to illuminate the area.
i like how you just eat cigarettes
taking a break from mapping because i am getting nowhere and need to watch tutorials or something
yum yum eat up
i made a pack file yay
With practice, things work out, not always at first, but little by little they do. There are some very good tutorials on the internet.
I am incredibly stubborn
I sort of just learn by messing with stuff ngl
but thank you for the encouragement
kinda goofy but retextured the pack
good enough of a spoof for me
i must be doing something wrong though cause my mod doesn't appear in the stupid list no matter how much i sit here and try to reconfigure the directory
either the wiki post about b42 mods is wrong or i'm missing something
Not all of us are "good" at the same things. In fact, I'm a total disaster at design. I prefer coding a thousand times over to design, but sometimes, you have to design too. You can always improve, you can always do something better. I watched design videos, and at first, I didn't understand anything, but one day, things start to come together, and then you get the hang of it. Although, later, you might encounter mistakes. So if you keep practicing, you'll probably get it.
Regarding your particular error, I don't know the structure of b42, at the moment, I'm still on 41.
I just copied and pasted an existing mod and changed the files. that's how I solved it.
after enough fiddling around i just solved the issue right now
there has to be a common folder for the mod to load
but there has to be a 42 folder for the mod to load in b42
you can't have just one or the other, it seems
yeah that just fully works other than the assets themselves not having loaded, i might've referenced the names wrong
I wonder if the assets that are graphical need to be in common with the scripting portion inside the 42 folder
closer! It loads a model file now but it's a garbled mess with the incorrect texture, probably incorrect export settings
50,000 cigarettes
eat up yum yum
Can someone point me pls to where the game handles voice over ip for ham radios? As always, im blindly poking in the dark and not finding what im looking for... XD
It should be in the java
Huh? No interaction then? Thx, i guess i could have looked then forever. I thought because there was a 'mute microphone' there it was handled at least in partly by lua. XD
Thanks for saving me from hours of combing through the code for nothing. 🙂
Oh boy, jup, handled in java all right. Now thats a bummer.
that's not the kind of thing you can handle in a scripting language
I guess thats true, but i thought there would be some interaction you might be able to play around with.
Like mixing some gun fire into a transmission or stuff. ^^ Eh, guess that would have been asking for to much.
Hey everyone, hope you are all well! I had an idea for a mod recently while playing that is pretty simple. I would like to add a hotkey that can be set in the options menu. When that key is pressed, it would toggle the "Pan While Driving" setting. - I haven't modded any existing interface windows - any idea where to get started here? I would really just need to know how to add a variable to the options menu, and then access that existing bool. Any pointers to get me started are appreciated. 
For b41 or b42, or both?
Prefer B41 for MP, but would likely have it support B42 as well. B41 is priority though here.
how are people releasing map mods for B42? i thought we were still waiting for tilezed n all that
there's forked tools that work for b42
can you send me a link?
It's in the mapping Discord
Annoying to link bcs I don't think we can send server invites
And it's not linked anywhere properly around here I think
i found it via google
i'm trying to add an item to the procedural distribution table, and it's iterating over them all properly in the logfile, or at least seems to be, but the distribution tables don't have the new entries when i look in lootzed
figured it out, i was not referencing the global table properly c:
I'm looking for some direction of existing mods that add functionality to an existing item without replacing the base functionality. Some possible examples, making non-weapons usable as weapons (hitting zombie with a bucket), making a water container work as a normal container as well if there is no water (empty water barrel being able to store items).
Any existing mods or references are appreciated. Thanks!
fundamentally you can replace the base game content entirely with your modded one and mimick the original functionality as well as what you wanted
i think naming it the same thing works, i kept doing that by accident i think
You can't change the existing tooltips because they are created entirely in java with no way to access the content between creation and rendering, but you can add extra bits to the bottom. Starlit library has a function for this.
this was what i was fearing after i started looking at the decompilation, that is quite unfortunate really
is it possible to run native java code? I didn't see anything immediately that stood out that would allow me to just completely bypass the tooltip render either, which would let me just implement a deep copy of the function
I saw a comment a while back that mentioned a debug tool to hot reload Zomboid and apply changes to scripts and code but I can't find it again. Is there such a tool or am I hallucinating?
from what i've noticed thus far if you need to reload lua scripts you can do that ingame, actually
if you go back to the main menu and hit "reload lua" or just otherwise load back in all your server lua scripts will run again for like distributions and stuff
if you get an error and it brings up a stack trace you can actually edit the file and reload it right then and there before continuing too, which is just such an icing feature i can hardly believe they bothered
I didn't realize that actually works. Thanks for the info.
someone in the modelling channel pointed out to me that this also applies to textures and models, if you save changes they'll reflect ingame pretty quick if you don't have any huge library mods on
Does Events.OnThunderEvent trigger every time the thunder and lightning effects happen or does it just trigger when the storm begins?
if the item has a static model (used to make the item showup ehenever character is holding them)
then you can just add another version of that item instead
esp for stuff like bucker since they are drainable item then you cant turn it into weapon
you can then just make an oncreate to swap between weapon and the original version
1st one
You can also bring that up with I think F11 - or rebind it to any other key if you want. It is important to note that this re-runs the lua file but doesn't "clean" the old one out, so depending on what is in the lua it may not work or may behave oddly.
Every item has to be exactly one java Class, so some things can not be combined. Also, if you change the class of an item then when the game is loaded every existing instance of that item will be removed; I had that issue when working on Underpants Storage where enabling or disabling the mod would delete all existing underpants.
The new fluid system is an exception; it's nice and modular so you can add a FluidContainer to anything.
So if you want to make it possible to carry water in your hat, that can work.
And of course you can add a new, identical looking item that is a different type and let the player convert back & forth with a recipe (convert barrel to item storage, convert barrel to liquid stroage)
I think someone did that already no lol ?
Like those beer hat
Interesting. Whats the jist of your mod goals?
Does any1 know if there is a way to "overwrite" or redefine a building recipe
for example the Door.
Yes in B42 at least, I haven't checked the building structures for B41, but in B42 the building recipes are in their respective entity scripts. So for doors you have ..\ProjectZomboid\media\scripts\entities\walls\ entity_woodendoorlvl1.txt, entity_woodendoorlvl2.txt, entity_woodendoorlvl3.txt and the craft recipe for each is found at the bottom of their file:
module Base
{
... all other stuff
component CraftRecipe
{
OnAddToMenu = woodenDoorLvl1Test,
timedAction = BuildWallHammer,
time = 200,
category = Carpentry,
SkillRequired = Woodwork:3,
xpAward = Woodwork:30,
ToolTip = Tooltip_craft_woodenDoorDesc,
inputs
{
item 1 tags[Hammer] mode:keep flags[Prop1;MayDegradeLight],
item 4 [Base.Plank],
item 4 [Base.Nails],
item 2 [Base.Hinge],
item 1 [Base.Doorknob],
}
}
}
}
So to make a new recipe you just make a new entity file where you change the CraftRecipe stuff around
Hmm just realized these have an OnAddToMenu function, is there maybe something similar for items/weapons when being added to inventory UI 🤔
I doubt it honestly
no
Would have been too easy
I want to change how I remove my bike containers from rendering in the inventory UI, it's causing a few compatibility with UI mods because I gotta add a check to the ISInventoryPane:renderdetails
Does anyone know where the Melee Aim Outline is located in the game's files? Build 42 changed the outline from green to red and I would like to change it back to green in my mod
My last try was replacing my item with the vanilla one when opening the build menu, but that only works semi good
It's probably a shader:
I expect that either one of those has the color in the shader definition, or the color is provided by java when it invokes the shader.
Alright thanks 👍
If you use the same name for your file and place it in the same folder location (scripts\entities\walls) and you copy-paste the vanilla .txt file and just adjust the craft recipe, it should just replace the vanilla recipe straight up and not cause any issues, unless you're using other mods that use/need that file.
What type of problems were you having with it?
Where do i find the vanilla files
The doors are in ..\Steam\steamapps\common\ProjectZomboid\media\scripts\entities\walls
Wow, Thank you ! i was under the impression i need to inject me in somehow
works like a charm.
@thin swan Do you know if i can do something like : item 1 [Base.Nail;tags[Nail]] . - to make it base works and all with nail tag
item 1 [Base.Item] tags[ItemTag], works
This has probably been asked before but Discord search sucks and I can't find the info I need.
I'm trying to load a mod for testing. I'm using B42 and have configured launch options as "-debug -cachedir="C:/Users/User/ZomboidDebug" -modfolders mods,workshop".
I've followed the new folder structure for B42 but have no luck no matter which folder the mods are put in (mods or Workshop).
I'm sure I'm missing something simple but just failing to find it. I've been using the ModTemplate as a base and just adding a simple script to see if it works but no luck.
logs have seemed unhelpful as I don't see anything related to even attempting to load mods.
Any guidance or suggestions appreciated.
What folder is the template mod in, does it show up in the game if it’s in the default folder?
Do you have mod.info in your b42 folder, as well as a common folder (can be empty)?
Check the wiki page
Make sure to have a common folder
Appreciate the feedback, in order,
ModTemplate is in Workshop folder of cache dir.
Yep, duplicate the mod.info in into 42 folder.
I've reviewed the structure and I believe I've recreated it correctly.
I've also tried just manually installing a known working B42 mod from the workshop but no luck
For Build 42 can we still write Recipe.OnCreate functions ? I've noticed that the recipes that employ that call to OnCreate have "NOTES: FIX IN PROGRES" comment. Does that mean that I should avoid using that?
yes, their signature is a little different though
the parameters change?
Is there any mods that add in gun parts?
I had an idea but I want to see if anyone has done it before, I kind of figured it would just involve some convoluted evolved recipes
The game code isn’t too complicated I might actually be able to copy the vanilla implementation
Check this vehicle pack that i made. For now it’s only for b41, and under testing & development. I’m planning make b42 version and then upload to workshop. It’s not animated, but brings good variety of accurate time period cars to the game✌🏻
Would it happend to be that the guy creating Project AVA is around here ?
Im especially interested in those box trucks
Wait that's a lot of functions I didn't document
Bcs they aren't used in vanilla most likely
Also you started documenting every script entry types ?
another reason it's easier to just read the recipe code than try to guess based on recipes 😅
started? i finished like two years ago 😅
Bruh
Also, someone contacted me about parsing the game files to create a Lua doc, and possibly a script doc later
They didn't contact you yet tho ?
i think they did
i didn't really have much to say about it though, would be a cool idea but not the first time i've heard it and then seen nothing happen 😅
Told them they should contact you, because you're currently managing most auto docs and so working together would be best
parsed script docs are impossible, the game just doesn't define script parameters, it's all hardcoded: you can do some very basic extraction with regex but it won't give you any useful information
lua docs are something i want to do eventually, 99% of the work is actually building a website though and that's not really my favourite thing
if that guy actually does do it i'll be happy
Yea, I discussed with them to have a singular website to host all the java, lua and possibly script docs in the future
I myself don't know jaxkshit about websites so can't do much on that part
So you got a json file scripts too ?
We might have already discussed that anyway
yeah, i don't have that finished, lost a lot of steam halfway
it's a brutal amount of data to collect
i think i got to around half item parameters documented after a few days of multiple hours a day working at it
Who is jason and why is he in my files
Nice
It can be spread in time that's okay
Can you send me the link of the file ? I'll note it to go and document it
Also one issue I mentioned with that person who's parsing the Lua, is that documenting some parameters can't really be done with a simple description thing. The reason being that some parameters have specific details, like I did for craftRecipe
And so we might need to find a uniform method to document them in a file to automatically use
yeah, that's what i was working on
this was meant to be used for a language server so it needed all the information necessary to error check a script
Hmm, I meant like the description here can't just be that simple. Some parameters need detailing
For a language server sure
some descriptions are fairly long
Tho they don't use sectioning do they ?
I'd have to get familiar with the documenting format on the potential script doc to know what's possible I guess
Tho it's probably just html I guess
Like adding code blocks and shit is problematic if you see what I mean, bcs that can't be used in the same way in a language server
Unless it does accept html ?
it actually can, at least vscode will render quite a lot of things
Idk, that's what I mean by a uniform way of documenting these
So we're not limiting the usage to just the website doc possibly
i didn't settle on anything like that because i didn't need it but i'd imagine it'd use markdown tags since that's what vscode prefers
generally markdown is pretty universally supported these days
at worst it's not that hard to parse and convert to a different format
I guess that's a good idea yea, so that can be used in the doc too
Depends 😅
If you do some weird shit with formating maybe not that easy lol
Admirable. But that's a lot of work.
Is there a proper format for trailer attachments? I'm trying to set another type similar to trailerTruck
I thought as long as the lead and towed car had matching names it worked but that doesnt seem to be the case tonight.
It's possible yeah, and it's not very difficult, at least not in B42, I haven't tried in B41.
For my bicycle mod I made it a weapon, and the different parts like the wheels, lamp, containers, etc. are custom weapon attachments.
So you could make a mod where a gun requires a bunch of different small parts to be usable if you want to make a realistic gun assemble/disassemble mod
I could help with that, I'm a fullstack web dev
Yeah the idea was to basically break down the three different gun types into their constituent parts
So like a barrel, upper and lower, grip and trigger, stock, that kinda thing
You could switch them out for different permutations of the same weapon part like an economy one and a military grade one, plus an enthusiast grade maybe
Glad to know it should work, thanks
That's a great idea for a mod, go for it!
If you're making/using custom models I'd suggest you check out this guide by Nik https://steamcommunity.com/sharedfiles/filedetails/?id=3060255898
No help on the trailer issues eh? frustrating that trailerTruck works and I cant get anything else to do so
Very useful guide thank you
Should speed up the process for cutting up the model n stuff
Does anybody happen to know how the recipe Mappers work?
I haven't seen a reference to this anywhere thus far
Effectively, what I'm attempting to do is take the base game weapons, (The desert eagle in this case) and create an instance of that item using the recipe, but each item in the recipe can be one of three tiers, and the tier of the item contributes to the weight of the weapon and applies a modifier to the base stats depending on the category (military grade is lighter, enthusiast gives a durability boost but is normal weight)
I'm assuming I don't need to map the item out like this, but applying modifiers to specific instances of items doesn't seem like something that's really intended, unless I attach invisible attachments to the gun that aren't removable in nonexistent slots that give a stat boost, which could work
evolved recipes handle this really elegantly because the resulting item takes into account the stats of all the components, but i want the resulting item to be entirely compatible with anything that modifies guns, so it should only multiply base stats
It seems like the mapper does not do this, I may have to hook the craft function?
Some item properties are saved with each individual item, while others will always use the value in the item script.
Luckily most of the weapon parametrs get saved with the item.
i figured, because of the existing attachment system
For what you're decribing could you use the existing attachments system? Attach a military grade barrel, it modifies weapon weight and range.
theoretically i could, i think
the idea was to make the guns craftable using some amount of input parts
but i suppose i could find a way to attach each part to the end result gun
you can still make guns craftable, but you'll need a lua script
so recipe is [oneof: heavy barrel, light barrel, normal barrel,] lower reciver, upper reciever
and then the lua script will modify the result as needed.
so it's possible to run a function right after a craft? what hook is it that does that? can I specify which recipe I want it to hook?
And the recipe has OnCreate = Niko_OnCreate_M4
ah nice
oooh there's a lot of OnCreate functions to reference in the base code
thank you
this should be easy
There is an example, showing how to get the list of consumed and created items
plenty more in media/lua/server/recipecode.lua
The recipe mapper is good if you have a simple relationshop using one input, e.g. open box of 100 things, map [Box of Nails -> Nails], [Box of screws -> screws], [Box of paperclips -> paperclips]
i see
i am learning
There should be a mod that puts you into a little basement when you enter a tent in b42
Like more immersive
Like RV interiors but cooler!
Call it Tent Interiors
My new vehicle mod, the IKA Torino, is now live. I hope you like it and enjoy it!!! 😁
https://steamcommunity.com/sharedfiles/filedetails/?id=3483506049
Haio you chill if I dm you for some advice for a sec (i need a wee hand regarding the blood overlay and damage textures not showing)
Mod looks good btw!
Unfortunately, at least for B42, weapon weights can not be dynamically adjusted during runtime. There's a setter for it and everything, but it just doesn't do anything. I peeked at the Java code for it, and from what I can tell it will take the weight from the item script and that's it, nothing else will affect it. Adding weapon parts doesn't contribute to total weight either I'm afraid.
If any of you modders are as insane as I am, you'd probably be interested in a translation and improvement of the LWJGL vector math library I translated to Lua. I even added swizzle notation support + dynamic constructors that fill just like GLSL vec and mat objects.
Swizzle notation from GLSL + power of LWJGL transformation and calculation methods.
🧮
I'm preparing the necessary tools for writing a new UI system in the game using shaders.
=)
Tech demos prior to writing a full framework.
Hell yeah, can't wait for your framework!
Been following your progress, you're doing great work and I have so many ideas for how to use it
This is the magic vector library I translated from the game's 3rd party OpenGL library + additional helper code for making it easier to use:
The UI library I am planning to write will apply transformations using this library when calculating things like position on the screen, scale, rotation, etc.
margin spacing, padding, borders, etc.
Hi, I have decided to create a mod for PZ. This is my first steps, so I'm just learning so far. I would like to make a menu in the left button UI. Who knows how to do it?
Can you attach stuff to non-weapon items btw.?
No, only weapons support attachments.
And I guess vehicle parts, but that's not helpful if you don't want a vehicle.
I see a https://harrypotter.fandom.com/wiki/Perkins's_tent 😄
However, needs hearing zombies, animals and ripping-through-assults for immersion
is there a way to fetch all the skill books i have already read?
my current code:
local inventory = player:getInventory()
local items = inventory:getItems()
local readBooks = {}
for i = 0, items:size() - 1 do
local item = items:get(i)
if item:getCategory() == "Literature" then
local modData = item:getModData()
if modData and modData.read then
table.insert(readBooks, item:getDisplayName())
end
end
end
local bookName = "lorem";
if #readBooks > 0 then
print("has been already read:")
for _, bookName in ipairs(readBooks) do
print("- " .. bookName)
end
else
print("nothing read yet.")
end
soooo could this render, like ... html ......
We could call it ZedKit
Hey there Snow, The.
"in the left button UI". What UI is that? People here are quite familiar with all the ISUI-Stuff.
Me I am just a learner myself but here is the example of a single button on the lower left corner of the regular ingame view. Ignore the namespacing:
require "ISUI/ISButton"
StoryModeMod = StoryModeMod or {}
StoryModeMod.UI = StoryModeMod.UI or {}
StoryModeMod.UI.activeBottomPanel = nil
StoryModeMod.UI.BottomPanel = ISPanel:derive("BottomPanel")
function StoryModeMod.UI.BottomPanel:new()
if StoryModeMod.UI.activeBottomPanel and StoryModeMod.UI.activeBottomPanel:isVisible() then
return -- Already exists and shown
end
local screenH = getCore():getScreenHeight()
local panelW, panelH = 300, 60
local panelX, panelY = 0, screenH - panelH
local o = ISPanel.new(self, panelX, panelY, panelW, panelH)
o:setAnchorLeft(true)
o:setAnchorBottom(true)
o:setAnchorRight(false)
o:setAnchorTop(false)
o.background = false
o.border = false
return o
end
function StoryModeMod.UI.BottomPanel:initialisePanel()
self:initialise()
self:addToUIManager()
self:setVisible(true)
StoryModeMod.UI.activeBottomPanel = self
end
function StoryModeMod.UI.BottomPanel:createChildren()
ISPanel.createChildren(self)
local buttonW, buttonH = 240, 40
local buttonX, buttonY = 10, 10
self.toggleButton = ISButton:new(
buttonX, buttonY, buttonW, buttonH,
"Story Mode Mod",
self,
someCallbackFunction
)
self.toggleButton.backgroundColor = { r = 0.2, g = 0, b = 0.2, a = 1.0 }
self.toggleButton:initialise()
self.toggleButton:instantiate()
self:addChild(self.toggleButton)
end
To make it appear you need to somewhere call new and then call initialisePanel. You can probably bind that to the game start, or a player action.
To add, melee weapons can also take attachments
Probably a legacy of pre-B42 "guns are melee weapons with a long range" design.
That's already a thing in B41
The mod would just need updating
DnD taught me that everything is a melee weapon if you have the strength
hi guys, when i have timedaction with a book, can i get the itemname of the book?
Anyone know how creating a submod works? Tried but it doesnt seem to be working
I didn't know that is even a thing. Can you describe?
A mod inside of a mod basically, I want to have two options when it comes to enabling it on a server (Basically I want to give server owners an option on a modern music option or an old music option)
Well, I wouldn't add an extra "mod" to subscribe and enable for that but probably go with a mod-option. See https://pzwiki.net/wiki/Mod_Options (b42)
Yes, you can hook to the timed action and you most likely access the item the player is reading
Check the mod structure wiki page, it mentions how to have extra mods
Mod options SHOULD NOT BE USED FOR GAMEPLAY MODIFICATIONS
If the mod involves modifying the gameplay specifics of your mod, you need to use sandbox options !
I guess I need to add a massive huge note on that wiki page so people understand it
They should be used for USER SPECIFIC STUFF like UI options for example
Fair point. I have a quite single-player-focus-mindset in my modding. By choice 😄
That's fair, but doesn't change that fact, even for singleplayer
build 42 doesn't have multiplayer so there's no difference 🤔
How so? If there is a thing that "affects the world" and there is only one player in the world?
I agree we should educate the right knowledge and mindset though.
it's not really a strict rule that it shouldn't affect the world/gameplay, it moreso depends on what you think server admins would want to enforce
what is part of the 'rules' of the game depends on the mod
So, if server admins want players to select their private sound stuff -> mod-options
If server admins want to enforce player-base-wide stuff -> sandbox
?
Do you mean subscribe to one item on steam workshop/get two mods to choose from in the in-game mod selector?
Ye!
Super easy
you just put two (or more) mods in the Zomboid\workshop<anme\Contents\mods\ folder
Optional: set up the mod.info file so they are mutually exclusive and you can only subscribe to one of them.
Weird, mine wasn't showing up in the mods section
😃
Hmm... Can you trigger vanilla keybindings, like for example if I want to simulate holding W (or whatever the user has set as their walk button) with just Lua, is it possible?
Bcs players associated mod options to user options, and sandbox options to gameplay options. Yes you should teach the right usage of the options and I will stand firmly on this that YOU SHOULD FOLLOW THAT. "Multiplayer is not out", ok and when it comes out, even simple mods that could be by default compatible with MP will not be, and you end up with every modders having to relearn everything regarding modding options
I will not teach bad usage of modding tools in a wiki which should teach the best ways to handle stuff to reduce modding mistakes, I will defend this to my death, bcs that's the goal of the modding wiki, to get modders properly into modding, and not teach wrong doings
And I generalize that to gameplay stuff
hush my dear. Not asking you to reduce standards. In-fact I applaud it. I learned something Today.
Anyone know how to make your character walk as if you're pressing WASD? Seems trickier than I thought, or I'm missing something
Check walk to
The timed action of walk to
Yeah I tried looking at that to see how they do it, but it doesn't seem to do what I need. I'm basically trying to make an auto-walk mod where you press a key to toggle walk and then use mouse for direction, and I have it working fairly well using setIgnoreMovement but I want to be able to go from idle to walk when pressing my auto-walk key, but I need to trigger the regular movement for it to work
I haven't used it myself, but it seems like the global queueKeyEvent (see LuaManager) may be what you're looking for
Although it looks like that's a press & not a hold
Ah nice, thanks! It looks promising, I'll test it out and see how it behaves 😄
That's fine, I just need it to start moving before the ignore kicks in
Interesting
Doesn't seem to work :/ tried calling it in a few different ways but no luck. Since it seems only to be used in the context of joypad, maybe it needs gamepad to be enabled for it to work or something?
I love seeing stuff like this in the vanilla files 😄 Makes me feel better when I resort to hacky solutions
Can't they literally just use some system variables or some shit ?
Damn the SetWeightModifier field was looking promising on the WeaponPart, too
Couldn't you make a custom attachment, that does lower weapons weight?
Then modify said attachment's weight reduction to achieve something similar
ZomboidDecompiler v0.2.0 released
https://github.com/demiurgeQuantified/ZomboidDecompiler/releases/latest
it now supports remote debugging! this allows you to set breakpoints in the game's engine, analyse variables, and anything else a debugger would normally allow. i added a brief explanation on how to do this to the wiki page, but feel free to ask here if you're having any trouble with it!
https://pzwiki.net/wiki/Decompiling_game_code#Remote_debugging
pinging @true plinth as this was your suggestion initially
Does any1 know how i can edit a zombie.scripting.entity.components.crafting.InputScript@26cf08d9 class, i wanna add tags
Making an attachment that can’t be removed and reduces the weight or durability loss chance is what I’m aiming for yeah
Making it a negative number I thought would have that effect as well
I mean, thats exacly what Sling does in B41. Though why vanila B42 does no longer have Sling is strange, all the things that made it work do work. Unles by making it reduce more that its weapons weight so it goes in negative is your goal, im not sure if it will work like that
No I just want each military grade part attached to the weapon to reduce the weight very slightly, like a deagle would weigh about 1.2 instead of 1.5
Actual attaching them seems simple enough funnily enough, except for the ones that spawn at worldgen but I’ll deal with that later
So yeah, weight is easy, about durability thing at least for b41 was easy enough with some lua, but im not sure if b42 changed it much.
Hopefully not, it sounded like the weapon itself would just not allow you to change the durability at all so I’m glad I misunderstood what they were saying
When I get home from work I’ll try to put some stuff together and see if it works :D
I think what would’ve been the coolest way to implement this is if the frame part was actually just the gun, and you made it functional by attaching additional parts, but that seems a bit out of the realm of possibility with this implementation of weapons
May I ask you folks how the hell do you tag your mods propperly ? When i go to upload them on Steam the available mod tags do not include B42 and other useful tags.
are you in build 41...? build 42's uploader should have all the tags
Check the java doc
Search for InputScript
No it should be doable, you just have to hook into ISEquipWeaponAction:isValid() and add a check when your weapon is being equipped to see if it has all the attachments needed.
You can do weapon:getDetachableWeaponParts(player) and if it doesn't have all the parts then just return false and the gun won't be equipped
Oh shit
That’s simpler than it looked in the decomp then
I should really learn more Java lmao
Thank you!
No problem! Yeah fortunately equipping/transferring/dropping is all available in Lua, so it's easy to hook into and manipulate as needed
I had to do a lot of fuckery to make my bike work with attachments, so you could download it and poke around to see how I did certain stuff.
Just uh... Don't look too close at some stuff lol, I still need to do some refactoring 😅
Noted! I will take a look at it if I run into any road blocks 
Been thinking about it while I was changing oil and possibly a solution using that is to change the model reference for the deagle to be an incomplete version (frame), then make the slide and barrel both attachments
Vanilla spawns I’ll replace the deagle with one complete with parts, and the other two versions can be found as incomplete only
Individual part durability could also be cool but first i think this is enough for a complete game mechanic
i got it open Link but i cannot find any setters, only checks and getters
declaration: package: zombie.scripting.entity.components.crafting, class: InputScript
getPossibleInputItems
And add your own item to the ArrayList
If I remember right
I might need to make a wiki page about that
so you get a pointer back in lua
A pointer ? I think I see what you mean, yea
It's a direct reference to the ArrayList Java side
That's how almost every single Lua-Java interfaces work
In PZ at least
yeah, everything acts more or less like a pointer in java
other than some primitive types
a getter generally returns the original object, it *can* deliberately make and return a copy to stop you from accessing the original but that's very rarely done
the new craftrecipes don't support that much runtime modification though so mileage may vary
recipes were much easier to mess with through code, with the drawback of being a far crappier system in general 😅
I forget pointers are a thing in Java cause you kind of just expect everything to return a reference unless you specifically want a memory copy
It seems like this can only be achieved via Java modding
I’m not at my computer to check atm but I was trying to find the documentation section for ISEquipWeaponAction on my smoke break and I’m not seeing anything in the documentation that matches that name, did you mean I’ll have to implement a custom hook?
The only way I know to hook into existing game code atm besides at load time is via the Events global
No it can be done with just Lua, you can check squares for doors and all doors open on the square they are on, so just hook into ISOpenCloseDoor:isValid() and add a check to see if the square that the door is on also has a body, and if it does, return false and you won't be able to open the door.
Ah yeah it's not actual hooks, you're basically overriding the function you want to "hook" into and adding your own code that runs before the original function.
It looks like this:
local originalIsEquipValid = ISEquipWeaponAction.isValid
function ISEquipWeaponAction:isValid()
-- your code here
return originalIsEquipValid(self)
end
Interesting, this is sort of an equivalent for calling base in C#, good to know 
Kind of crazy that any mods can work together at all, if two mods both hooked the same function I feel like there would be some confliction
Well maybe that depends, actually. Hmm
Did you check the timed action some mentioned ?
There's conflicts only for specific types of hooks
Like a hook that doesn't call the original one
You can chain-invoke overridden methods.
-- normal call.
instance:instanceMethod();
-- same call result.
clazz.instanceMethod(self);
Use this method of passing self or instance
if you store the original function and then assign a new function to the Lua class, you can effectively invoke the original method using this.
This means that (provided all mods do this) you can chain-call multiple mods overriding the same function.
Sneaky Peaky: https://www.youtube.com/watch?v=hv0u9myHIVU
Bard-To-The-Bone is a Project Zomboid mod that lets players perform music using ABC notation, with support for all vanilla instruments and custom ones.
Project github: https://github.com/Chuckleberry-Finn/Bard-To-The-Bone
I bet the stack traces for that are a work of art
Really cool idea though, that makes sense
I thought order might’ve been an issue but the way you explained it that seems irrelevant so good to know
i love users posting bug reports and their evidence is a stack trace with 12 different mods overriding the same function and mine isn't even at the top
Oh good so it works exactly like I thought it would after that explanation
Terrifying
…I love it
Hell yeah—I had a similar concept a few years back with MML instead of ABC, but was never satisfied enough with it & eventually moved on. Looks awesome
I only know abc from starbound and ss13-- mml looks pretty similar 😮
and thanks- this was supposed to be a quickie week-long project but I got wrapped up in it lol
How those often go lol, looking forward to checking it out & playing with it
There is some limitations- due to it being technically running ontick-- but I use timestamps for the note timeline
also going over 100 concurrent notes borked FMOD's channel limit so I have something killing earlier sounds -- overall it sounds great if you write the music yourself or find abc songs online-- but midi to abc conversions can sound weird
The slowness of it all (esp. when getting into 32nd notes & such) was the biggest thing I was struggling with—you can hear it stuttering a lot here & I believe this was after optimizing https://www.youtube.com/watch?v=ws1l6TvqDDA
Is this using a 3rd party program?
Or just playing the sound files
And yeah-- pushing the tempo of the song seems to help sort of
I'm not sure how it could be improved outside of implementing a separate thread using os time, perhaps?
Parsing the MML & playing sound files, yeah
I like how everything breaks if you try to refresh a lua script with a function override in it
is it causing a recursion by referencing itself cause that's the only conclusion i could draw
No just it takes the current function and adds a new layer again to it
It's not a recurse, this would mean it would call itself
if i don't call the initial script from the game before i called mine it was just telling me it was corrupt and stopping the function entirely
dunno why
i stopped messing with it for now
probably try something simpler to get the hang of lua and the docs
Don't hot reload decorations of functions without reloading the original one or you get that multiple layer hook
"refresh file" is really "excute this script again"
It doesn't clean up any existing modifications to functions or things getting added to Events
You could code you lua scripts to do that cleanup when they are re-run, but that's a lot more work than just quitting to the menu and running reload lua
Actually apparently in B42 it does clean up events
That's helpful, I was sure it didn't last time I checked but I can't remember how long ago that was
In B41 it wasn't, but Albion mentioned that the interaction is better now
Haven't been able to check myself tbh
Especially as I never hot reload my events because they in separate files
What event is the closest to "You can play now", i mean in like joining a world and you cant controll your char, and the first event that i can trigger my Script.
OnLoad, OnGameBoot, OnGameStart, OnInitGlobalModData triggers at some wired time
OnInitGlobal...
If I remember right
It seems to be the usual go to at the very least
i will try
I need to make that timegraph showing the triggers lol
Yeah i mean the names are good but in what order comes what is confusing
Yea that's fair
I had done some tests regarding that, and I need to write them down on a time graph
Which was my goal
sounds nice
oh finaly ı made it

https://steamcommunity.com/sharedfiles/filedetails/?id=3412682512 (Bandits Extra Options)
https://steamcommunity.com/sharedfiles/filedetails/?id=3268487204 (Bandits V2)
Why is it, when changing Bandits Extra Options mod.info file from
poster=poster.png
id=BanditsAddOptions
description=Add new sandbox options to manage your Bandits experience
require=\Bandits```
to
```name=Bandits Extra Options
poster=poster.png
id=BanditsAddOptions
description=Add new sandbox options to manage your Bandits experience
require=\Bandits2```
it recognizes and accepts the dependency, but at the same time says, that it cannot be enabled at the same time as the very mod, which it is listed as being dependent on?
Just found out, that disabling Bandits V2, then enabling Bandits Extra Options, it also enables Bandits V2 at the same time, while Bandits V2 doesn't have any dependency on Bandits Extra Options. xd
Bcs it's literally in the extra mod as a dependency... ?
I cannot enable the bandits extra options after the bandits v2, thats the problem, I know its a dependency
Wdym after ?
after enabling bandits v2
Have't done much with mod data and attachments till now, so i am a bit confused. I put a 'message' on a knife (in my inventory since i read a comment from chuck that it wont save mod date if not in my inventory), then attached the knife at a zombie. But when i put multiple knifes out there and do a reload of the game, it doesnt remember which zombie 'carried' which message with them. I thought i had read the costume was persistent, so is the attachment not part of the costume or is the problem that the knifes cant 'remember' which mod data belonged to them?
i wouldn't expect that to work with zombies unfortunately, i'm surprised there was anything still there at all
zombies (especially in b41) have persistence issues since they save as little data as possible to avoid save file bloat
Hi albion. Yes it seems the mod data is saved when i move it to the inventory and put the message there. Then i use attach item for zombies. After reload i checked for the 'knife in the back' and it looks like it can still find mod data for the knife, but the knifes seem to be shuffled among the zombies with knifes in the back. Welp, there goes my sticky note at the back idea. ^^
Guess i could see if i can use the costume id in relation to the note? Also i heard if head gear falls of it changes... does that also happens when the cloth get damaged? Like having holes or stuff?
no, it only changes if the hat falls off
Remove the hat before trying to attach a note, gotcha. Thx albion, will try if i can link it somehow. 🙂
Good morning. Does anyone know if it's possible to define rooms within the open world? I've managed to change their IDs, but when I change chunks, that information doesn't persist. I'd like to be able to save that information. My idea is for players to be able to build in the open world and then define rooms once they're closed. Without having to use the map editor, because otherwise, each player would have to give me the house they want.
the region manager will create a new room when you build one, you don't need to create it manually
But it is created with -1
When created with -1, light switches cannot be used for example.
My question is, when I add an object to the world, for example, a floor or a wall, is it saved? Because if I step away long enough to exit the chunk or log out, the building is still there when I come back. So, if I can save that room ID change, I could generate a room as if it were an in-game building, with shadows and lighting.
i know for a fact you can't create a functioning isoroom from lua, you may have some luck manipulating the ones created by the region manager though
Thank you.
if the changes you're already making are enough for it to work but you just can't get it to save, you could save the position of the room + the id to change to in global mod data
then you can just make the change again when it's loaded
It would have to save and load the chunk as the player exits it.
If there is no other option, I will have to do it.
But in the long run, if there are too many rooms, that might be a problem.
I don't know if this works, I'll try it.
public void addSpawnedRoom(int roomID)
From what I'm seeing, in build 42 there is the LoadChunk event, but in 41, that doesn't exist, so I would have to see when it loads it, and ultimately, create a custom event. And even then, I would be overwriting the information every time the player leaves and enters the chunk, which doesn't seem like a good idea to me, but if there's no other way, I'll have to try it that way.
@bronze yoke Sorry, looked like i talked utter nonsense. Turned out i overlooked that i somehow attached new knifes at the game start so ofc there would be mod data... if i dont do that, there are no knifes. 😅
You can't do that, bcs zombies get reloaded
Wouw thx. Seems i can always find stuff on the wiki i cant remember having seen before. XD
just noticed they added a new parameter to OnWeaponHitXP
its value is always 1. always. it's not even a variable
?????
Yeah they make some weird decisions sometimes 😂
i can see how you might need to keep something like that for compatibility reasons, but they specifically added this some time after i collected my data
if (param5 ~= 1) then print ("ERROR: math no longer works correctly!"); return end
Haha daaamn. I hate it already 😅 . Good work
Nice AI pic too. I like the style.
actually it calls for an addition: CorpsesHinderPlayer -> Slow down, stumble etc.
tripping over corpses would be so funny actually
Someone posted a way to make-player-trip earlier, right?
And regarding the blocked door: Also stops the door from opening? oooh the fire safety inspector is gonna be mad. But should make for great emergent gameplay. Gotta hack through that security door 😄
yes
Cool! maybe could add a strength check, at least for opening ... depending how many zombies lie there.
I have to try out your mod later. So good to see small effective things like this vs. mamoth-do-it-all mods.
ı tought about that
ı will try to add
maybe make it a sandbox setting for people to try 🙂
yes
Hilarious idea and probably weird to implement but hear me out .. b42 added "ramps", right? .. You know where I am going with this ....
???????
That's a thing
There's a mod
@bright fog sliding.... zombie.. corpse...
I was thinking rather corpses pile up until they reach a z-level. Form a ramp.
Also new (disgusting) building material unlocked. Think 300
Sorry I @bright fog lol. Fat finger..
Sounds like maybe you could investigate capabilities within https://steamcommunity.com/sharedfiles/filedetails/?id=3409425792
TIL: Starlit has exactly the event system I was fearing does not exist. omg. 🫶
I have recently seen that Project Zomboid is actually written in Java of all things. Considering the huge success of Minecraft modding / plugin development, is there any chance the team would ever consider a Java-side modding solution?
I selfishly ask as Java is my bread and butter, and Lua gives me a headache 😭 😂
no, they've always been strongly against it
using lua makes it easy to ensure mods can't do anything dangerous
they don't really care if you make java mods anyway but there'll likely never be any official support for it
Damn, that's a real shame. Something I, albeit annecdotally, have seen is several "numerical bugs" in a lot of mods and, with the way Lua is syntax / form wise, it does track 😅
There's a current project to get Java modding with a mod loader
Called Leaf
Open source?
Unknown, but knowing the person I doubt it won't get open source at some point if it isn't already
You can find it on the modding Discord
I asked as I'm happy to contribute haha
Yeah that didn't work ahha
Click it
It's a fork of one of the Minecraft loader, I always forget the name of it shit
yea
that one lol
How is it a problem ?
From my understanding of it, the use of it seems properly adapted, especially because this allows mods to be downloaded directly from the Workshop
It just requires users to download Leaf manually, and then download mods from the Workshop
Tho currently it loads every downloaded mods instead of the activated ones which imo it should only load activated ones
But that's something to improve in the future
My problem, to be as respectful to the fabric modding community as possible, is that I was hoping there was a java project that wasnt built on the foundations of a raging, RAM hungry, dumpster fire 😅 🤣
Idk about the details, ask aoqia about it
Aye already moved to the other discord
Yea
nobody's really been able to use it yet so we'd have to see if those issues carry over
For anyone interested about it:
https://pzwiki.net/wiki/Leaf
Updates to some major pages
IDEs:
- Moved some info: https://pzwiki.net/wiki/Visual_Studio_Code
- New: https://pzwiki.net/wiki/IntelliJ_IDEA
Files/folders etc:
- Tiny improvements: https://pzwiki.net/wiki/Mod_structure
- Searching game files is now explained in: https://pzwiki.net/wiki/Game_files
Playing with Suno, trying to generate music that's sort-of PZ-esque in energy and sound.
Tell me this doesn't sound like PZ 2 minutes to the end of the track: https://suno.com/s/lYjfneUaMelviIuT
Tried to make it sound more like STALKER but it went hella hard into that banjo / violin motif.
Could be one way to shift the mood of the game through ambient works if one doesn't have thousands of dollars' worth of sound equipment / software lying around and wants to make a mod.
Is there a mod framework that True Music or others use that I could use to make a Whiskey Blues music mod?
<@&671452400221159444>
Running to safety is a lot easier when the zombies want nothing to do with you.
#keyandpeele #comedycentral #jokes
SUBSCRIBE to Comedy Central Asia for more videos and exclusives: https://www.youtube.com/c/ComedyCentralAsia
Get SOCIAL with Comedy Central Asia:
📸 Instagram: http://www.instagram.com/comedycentralasia
📘 Facebook: https://w...
thats the basic idea, but radomized skin color for all players and more specifically which color attracts the dead. thats it in a nut shell. i think it could be fun in muliplayer.
Oblivion Remastered makes Zomboid mods look sane; there are Unreal .pak modes, Bethesda .esp mods, unreal script extender mods, oblivion script extender mods, magic loader mods, and .ini files in My Documents mods. All of which get installed to different places.
I feel we should be working towards less racism. not more.
"Fun"
Thank god you don't make games
Looking for a dev to help develop a quest line using the Soul Quest System framework (paid)
Wild to ask for racist zombies lmao
https://theindiestone.com/forums/index.php?/topic/83539-build-4280-unstable-released/
Baboom, time to see if it's gonna fuck up my mods
NEW - Introducing ragdoll physics. - Ragdolls are currently enabled for vehicle collisions and gunplay. - Melee ragdolls are planned but are not imminent. - This is the first implementation of a new feature that requires testing, balance feedback, visual feedback, and performance reports. - Disru...
YOOOO!!!
-Introducing ragdoll physics.
- Added "cyclicRateMultiplier" property to HandWeapon scripts and instances.
Hmm, I wonder what this does
Oh there's some goodies in this one, lots of power related stuff, making a mod to restore power to specific areas should be a breeze now
- Fixed M16 full-auto rate of fire being way too high.
Sick
Oh the ragdoll is fuuuuun, guns are so back
Looks like a good patch
I'm too tired to look at it now so I'll sleep and wake up to people asking stupid questions in mod comments tomorrow.
Thats an update and a half.
There's an issue with the ISRichTextPanel.lua if you have VideoEffects set to off, it will cause main menu loading to fail.
Fix is:
- Go to
C:\Users\[YourUsername]\Zomboid - Open
options.ini - Find
doVideoEffectsand change it fromfalsetotrue
Is a joke idea based on a skit
bump
Any major mod breaking issues with the update?
For me it seems to be mainly mods that have to do with the map--
"...\lua\client\ISUI\Maps\ISWorldMap.lua" and the like. Seems like they added a lot of stuff!
function WorldMapOptions:onDarkModeChanged(value, slider) getCore():setOptionWorldMapBrightness(value / 100) local alpha = PZMath.lerp(20, 100, value / 100) self.darkModeLabel:setName(tostring(math.ceil(alpha))) end
MapUtils.renderDarkModeOverlay(self)
etc. dark mode functions added? can't seem to find them on the map tho
So far none for me that I've noticed, but there is something with the ISRichTextPanel that's fucked for a lot of people, not mod related though and TIS is working on a fix
Updated game code decompiling organization
- Reformated a tiny bit the main page
- Created their own pages for:
Remote debugging
New debugging tool to analyse the Java game code by setting up breakpoints in it, modifying values on the fly etc.
https://pzwiki.net/wiki/Remote_debugging
Using:
Why can’t other people have fun just because you don’t like it
:|
saying this about a racism mod is incredibly funny
when the fuck did i call you woke??? im just saying I think it'd be a funny idea and asked you to not try and stop others from having fun. you can hate their kind of fun all you like, not stopping you, but why try to stop them?? will it hurt you?
the idea itself came from a skit, a satrical skit, that has a LOT OF SCENARIOS PERTAINING TO RACISM, and making it into something funny and enjoyable (they made one with aliens that looked like humans, but didn't really understand racism hence they didnt blend in well)
nothing wrong with a new idea, you can not like it, but why immediately put it down and say "you should never make a game" because of ONE IDEA, which a few people might find funny
man you're really mad about this huh
im just mad at that 'how dare woke PZ players touch my racism'
let people have jokes, I didn't even say they were 'woke' or whatever
and so what if they disagree with it, just because you disagree with a person doesnt mean everybody will (though I understand in this case, some will, some may not)
Gonna slip this back in here.. lol
The texture on my new melee weapon freaks out when it has blood on it. Where/how do I correct this?
When it fits it fits
Show your item script
imports{
Base
}
item MegaWrench
{
DisplayName = Mega Wrench,
DisplayCategory = ToolWeapon,
MaxRange = 1.25,
WeaponSprite = Gearhead.MegaWrench,
MinAngle = 0.67,
Type = Weapon,
MinimumSwingTime = 4,
KnockBackOnNoDeath = TRUE,
SwingAmountBeforeImpact = 0.02,
Categories = Blunt,
ConditionLowerChanceOneIn = 70,
Weight = 4,
SplatNumber = 1,
PushBackMod = 0.8,
SubCategory = Swinging,
ConditionMax = 12,
MaxHitCount = 3,
DoorDamage = 15,
SwingAnim = Bat,
MinRange = 0.7,
SwingTime = 4,
KnockdownMod = 2.5,
SplatBloodOnNoDeath = FALSE,
Icon = MegaWrench,
BreakSound = WrenchBreak,
DoorHitSound = WrenchHit,
HitSound = WrenchHit,
HitFloorSound = WrenchHit,
SwingSound = WrenchSwing,
TwoHandWeapon = TRUE,
TreeDamage = 0,
CriticalChance = 30,
CritDmgMultiplier = 1.5,
MinDamage = 0.8,
MaxDamage = 1.3,
BaseSpeed = 1,
WeaponLength = 0.5,
AttachmentType = BigWeapon,
}
}
its a big ugly gold wrench with a black striped handle so the players can see it on the zed but when used by a player the first time it gets dirty...
Uuuh, where is the model defined for weapon items ?
oh sorry
module Gearhead
{
imports{
Base
}
model MegaWrench
{
mesh = weapons/MegaWrench,
texture = weapons/MegaWrench,
}
}
I have a few more items going into this zeds drops so its all in a models file
If I had to guess, I would say a UV that doesn't allow for blood to be well set on the item ?
Does that reuses the in-game wrench model ?
yeah I was trying to be lazy
I just needed something on a zed's back so the players could pick him out of a crowd and it turned into a whole thing and I figured I could use a wrench and let them have a % chance at the drop
Why did you make a new model actually
You can just simply copy pasta the wrench model script, rename the ID
And then if the item in hand is an issue, use the attachment system
This would stop making copies of models that already exist in the game files
Same for textures
Its been a week or two, I think I saw the .x file and said well crap and made it an fbx instead
Idk if that would fix your blood issue tho, most likely unrelated
Yea but you don't have to do that
its a fair point, adjust the scale and target texture and Im good
You can just use the same model, you won't even need the model in your mod files
It'll the vanilla model file
I mean, just keep the wrench texture
No need to change it
Like literally just copy the model script, rename the ID, scale it, set attachment points coordinates and orientations etc
Mostly I wanted it to stand out vs the grey base texture
why its striped and ugly lol
Ah I mean if you really want to change the texture you can do that sure
You kept the same texture size ?
Or did you resize it ?
its the same, just tossed it into PS and adjusted hue and threw some ugly stripes
i don't really understand how it could be the uv
it's not the blood that's messed up, it's the original texture, which is obviously mapped fine before you add blood
No idea how blood is applied to weapons, but I would have guessed an extra texture added on top of the original texture
And if your UV is all over the place, it add the blood in a natural way, like if it's stretched and shit
I assumed overlay but couldnt find any setting
But I don't know the details tbf, trying to throw some ideas here and there
i mean the blood looks okayish, it's the actual base texture that gets messed up
how does the normal wrench look when you get blood on it?
Ah nvm you're right
It's all appreciated, anything I can test or workshop helps. Adjusting the base vanilla will be my next step
retains the image
so I'll see if I can just point to vanilla with a swapped texture target
interesting... the UV for base wrench is not aligned with the texture?
might be a directx import thing though..
something like that could be the cause yeah
I'll keep poking around, if I need to just have a big yellow wrench so be it lol. Thanks y'all!
It's still like that on my fbx though... I'm going to move it up into the proper area and see how it turns out.
This was the problem!
Thanks for the troubleshoot!
Hooray! VehiclePart was not updated so I don't need to update my Java mod!
...probably. I'll have to test anyway.
Hi, Im using "IconsForTexture" for 3 variants of an item, is there a way in Lua to choose the first icon item to spawn?

There might be a better way when you create the item, but if not an OnCreate function can do whatever you want to the item
In clothing XML first texture choice will be tied to first icon you put in icons for texture, but I got a feeling that's not exactly what you ask?
BTW> if you somehow set a texture index for an item that is invalid, the entire chunk will completely reset when loading. https://theindiestone.com/forums/index.php?/topic/82825-4270-rev28118-failure-to-validate-saved-items-texture-index-causes-entire-chunk-to-reset-when-loading-due-to-out-of-bounds-error/
Version: [42.7.0] Mode: [Singleplayer] Server settings: [N/A] Mods: [None] Save: [New Save] Symptom: after loading a game a chunk of the world will have been reset, destroying all items and placables within it and reverting back to the initial world state. It may also spawn zombies, presumably as...
In relation to the update of biomes, how can I get the players current square and check what biome they're in?
No idea, check the cells, chunks etc perhaps
Check in the java doc
No way
Just playing the game instead of modding? That's like playing Skyrim just for the lock picking game, you're missing 99% of the content! 🤣
did they do something to forage defs?
---Generates a list of herb types based on valid categories
local function generateHerbsList()
local validCategories = { WildHerbs = true, WildPlants = true, MedicinalPlants = true };
local filteredTypes = {};
print(forageDefs)
for key, value in pairs(forageDefs or {}) do
if type(value) == "table" and value.type and value.categories then
for _, category in ipairs(value.categories) do
if validCategories[category] then
table.insert(filteredTypes, value.type);
break
end
end
end
end
local filteredTypesMap = {}
for _, herbType in ipairs(filteredTypes) do
filteredTypesMap[herbType] = true;
end
if detailedDebug() then
print("ETW Logger | Filtered Types Map:")
for herbType, _ in pairs(filteredTypesMap) do
print(herbType)
end
end
filteredForageHashMap = filteredTypesMap;
end
Events.onAddForageDefs.Remove(generateHerbsList)
Events.onAddForageDefs.Add(generateHerbsList)
im getting forageDefs = nil
shit used to work before last update 
i see no vanilla variable called forageDefs
now i gotta figure what they did 
k i just gotta parse forageSystems forageDefinitions and filter out things that fit my categories
there used to be forageDefs table before
if somebody wanna screw with foraging later, you can fish out items of categories you need like this:
local filteredForageHashMap;
---Generates a list of herb types based on valid categories
local function generateHerbsList()
local validCategories = { WildHerbs = true, WildPlants = true, MedicinalPlants = true };
local filteredTypesMap = {}
for itemName, defTable in pairs(forageSystem.forageDefinitions or {}) do
if type(defTable) == "table" and defTable.type and defTable.categories then
for _, category in ipairs(defTable.categories) do
if validCategories[category] then
filteredTypesMap[defTable.type] = true
break
end
end
end
end
if detailedDebug() then
print("ETW Logger | Filtered Types Map:")
for herbType, _ in pairs(filteredTypesMap) do
print(herbType)
end
end
filteredForageHashMap = filteredTypesMap
end
Events.onAddForageDefs.Remove(generateHerbsList)
Events.onAddForageDefs.Add(generateHerbsList)
Yes, I wanted to see if there was a function to specify the spawn of a specific texture.
I do some tests, if it doesn't work I'll have to make different items.
I think if I check the MetaGrid it'll work
is there a proper guide on how to update true music addons to b42 anywhere? i know there's a couple of spawn locations you have to remove, gendered wardrobes or something, but it is a pain to dig through endless messages and comments to try to figure out exactly what needs to change
Just start in debug mode, see which lines throw errors Decatur a take did not exist, fix those
WardrobeWomen and WardrobeMen -> WardrobeGeneric is one, at least one other category changed the case of words
i'm seeing that BedroomSideTable might be one as well- for spawn rate issues i figure i just pump the numbers up in general?
Or add the entries back to the closest matching container
Increasing the numbers fucks with the weight of everything else may not have the desired result
Hey all, I'm trying to make a mod that will make zombies pathfind indoors during rain or storms, is there any way of:
- checking the current weather condition
- making zombies pathfind somewhere "indoors"?
idk how to really do either of these things so if anyone could point me in the direction of any documentation on the topic thatd be very helpful
I'm looking at the rain barrel code in particular to try to figure out how that does it, and i'll look at another mod to determine how it can tell that the player is in rain and see if I can work backwards from there, but could someone help me decipher this?
function SRainBarrelSystem:checkRain()
if not RainManager.isRaining() then return end
for i=1,self:getLuaObjectCount() do
local luaObject = self:getLuaObjectByIndex(i)
if luaObject.waterAmount < luaObject.waterMax then
local square = luaObject:getSquare()
if square then
luaObject.exterior = square:isOutside()
end
if luaObject.exterior then
luaObject.waterAmount = math.min(luaObject.waterMax, luaObject.waterAmount + 1 * RainCollectorBarrel.waterScale)
luaObject.taintedWater = true
local isoObject = luaObject:getIsoObject()
if isoObject then -- object might have been destroyed
self:noise('added rain to barrel at '..luaObject.x..","..luaObject.y..","..luaObject.z..' waterAmount='..luaObject.waterAmount)
isoObject:setTaintedWater(true)
isoObject:setWaterAmount(luaObject.waterAmount)
isoObject:transmitModData()
end
end
end
end
end```
i cant find a RainManager in the game files or anything so I'm a bit confused
in season.lua i found a bunch of scripts related to rainmanager but like everything is commented out?
declaration: package: zombie.iso.objects, class: RainManager
it's in the decomp
with the brand new patch you'll have to decomp yourself if you want the most up to date code
rn im making this for my b41 so ill do it for that for now
thank you
all the fields should be accessible on the lua side, functions i think mostly
there's guides on the wiki for how to read these if you aren't familiar with them
So what all generator changes are there code wise I’m curious
Maybe power grid stuff is gonna be easier to mod
is there a way to make a mod that features a new zombie type that makes no sound when he's behind you and only starts to make sound when you can see him?
I haven't checked what the changes added, but before that the whole power system was a confusing mess in terms of the functions needed to say "does this square have powr?"
There's isNoPower and hasGridPower on IsoGridSquare now
I wanna explore the "Added code support for mapper-defined "NoPower", "NoWater" and "NoPowerOrWater" zones"
I'm happy they added dumpContentsInSquare() for ItemContainers, I can now add an option to empty the saddlebags on a bike before detaching it
(Pls Help) Hello everyone, I have a problem I’d like to ask about.
When I right-click and try to use the item, I get an error.
Does anyone know what might be causing this, or how to fix it? I’m making a mod for a custom item — maybe that’s what’s causing the issue.
Hello, it's very hard to tell since the video does not clearly show what the error says. If you are playing on steam you can press F12 to take a screenshot of the error in-game and send that
Nice, saves making a for loop to add to ground & removed from container.
Like this?
What is the actual error? Console.txt will have the full error in easy to copy-paste form.
Your OnFillInventoryObjectContextMenu looks overly complicated; not to say it won't work but I'm not debugging item.items then item = item.items[1].
For reference, this is the context menu function I used:
local doDIYContextMenu = function(playerNum, context, items)
print("##### doDIYContextMenu()")
local primaryItem = items[1]
if not instanceof(primaryItem, "InventoryItem") then
primaryItem = primaryItem.items[1]
end
if primaryItem:hasTag("DIYSchematic") then
print("##### It's a DIY Scematic")
local playerObj = getSpecificPlayer(playerNum)
readOption = context:addOption(getText("ContextMenu_ReadDIY"), items, DIYonLiteratureItems, playerObj);
end
end
Events.OnFillInventoryObjectContextMenu.Add(doDIYContextMenu)
It's throwing the error on a line that is only used in b41, so my initial thought is that the item script is set up for b42, but I don't know the differences in item scripts between b41 and b42
That's a good question to ask - B41 or B42?
do you have any recipes in your mod?
i'm pretty sure this is one of the errors you get when you have a messed up recipe
Thank you, I will try again. B 41
Is there any video that explain how can i make a gun mod ?
If you have model you can follow up my guide, though it would require basic knowledge of blender ( but if you made model of gun, you should be fine)
This my first time lol. Now I'm just trying to texture and putting this model in the game
Thanks
Does anyone know how to detect burn on player body parts. Working on a simple mod to make the player shout when they get wounded but can't figure out how to check if burned. Naming conventions for the other wound types are all over the place. Any help would be welcome
Check BodyPart
Or some shit like that
Q: Why would a mod running on b42 ever want or need to put a mod.info (and poster.png) into the mods root folder and not into common or b42?
You can probably track and periodically compare player:getBodyDamage():getOverallBodyHealth()
That one gets recomputed from various "primary damage sources" each tick it seems. It might also do something with blood level. I didn't test.
When 2 body parts have 100% damage (or 0 health respecively) the OverallBodyHealth() gets low enough to die 😬 it seems
player:getBodyDamage():getBodyPart(BodyPartType.Head)
guys what am i doing wrong here
the descriptions are not showing
the way i used to do descriptions was a single paragraph
and with two paragraphs i can't do it like i used to
so i copied how the vanilla maps does the descriptions
and then the descriptions disappeared
This is a map description? You could ask in the "PZ Modding Community" Discord "mapping" channel (I cannot post the link)
oh, alright
are there any up to date tutorials on new radio channels?
for b41 but if there's one for 42 thats grand as well
I used to maintain a radio mod but it was terrible to make those even with tutorials and it kept consistently breaking with each new b41 update
What tool do you guys recommend to make a Custom "Crafting Station" i mean like the model
Nothing too bulky 😄 - a desk with a 3d printer?
More Like a Industry Rice Cooker looking thing
If you're talking about actually making a 3D model, then blender would be my pick
To add another gun: you don't need to code to make a gun mod, you just need a model and and some script files.
If you're on B42 the weapon script will look different, but that's not a big deal since you just look at the vanilla weapon scripts.
Technically adding the weapon to loot tables involves code, but that's an easy things to do.
B41. Can i ask u where can i find the m9 pistol file
that path is from my B42 install, it's probably the same in B41... if not look for "item Pistol" in a .txt file
b41 has way worse script organisation
almost all of the items are in the same couple files
Useful tip for all modders: install VSCode, open the game's media folder, and use the search feature to quickly search for stuff. I keep a copy of VSCode open as my "reference VScode" seperate to the VScode I'm using to actually write stuff.
As you get better knowing what to search for this makes it very quick to find thing in the various .txt, .lua and .xml files.
anyone know how or what the spawn location would be for lvinternationalairport trying too add a spawn location for a vehicle to spawn there
You mean co-ordinates?
right click on ground in debug mode for co-ordinates, or use B42map.com (note: that site seems to have slightly offset co-ordinates)
What stats should a 570mm handgun have?
Literally lit.
anyone know a way i could make a zombie pathfind indoors? im having trouble figuring out how i could figure out what's "indoors" to make a zombie pathfind to it
if anyone could point me to a script that might know how to handle this itd be nice
by script i mean like, if any base game or mod scripts do a similar thing, so i could reference how they do it
Whao!!! this is so cool.. I would like a Star Trek Theme PZ :D, the spawn point is a crashed spaceship :3
you need to grab the closest buiulding then do the pathfind function you can refer to my vampire mod. not sure which one i got 3 .. tho my pathfind code isnt perfect you might have better output if you try to figure it out
..
my code somehow makes them go there but they wont stop for nothing even if theres a wall. its weird cuz they should pathfind right . but for some reason they get stuck ..
could i have a link to the mod?
this is such a weird error.
i isolated the skatepark mod (with the required tilemods)
and tested it it didnt produce this error
if thats not it on the description it links to the 2 other vampire mods
could your issue maybe have to do with the fact your script is on the client?
random guess, i barely know how this game's code works
I think you mean a 5.7mm ? 😄
IMHO:
- increased magazine capacity (up to 25 rounds)
- ~30% less recoil
- less damage to unarmored targets than 9mm or .45 ACP
- more "penetration" and maybe even damage to armored targets (bullet tumble chance inside flesh after armor slowed it down)
- louder than 9mm
- could use .22LR / .223 silencers if you really want to (we don't have .22 native ammo and guns eh?)
- In theory any larger suppressor doesn't "hurt" but would be less effective
Nice I like it. Achieved how?
It was going to be 5.7 mm but I forgot to rescale to 0.01 before exporting, so 570mm it is.
frame by frame
probably about right for the people who get obsessed with gun mods
It's mainly interesting because the PR57 is a lightweight 20+1 pistol that can use the revolver load type to load rounds 1 by 1
And when you say 'clip' instead of 'magazine' you're actually correct.
(pretty sure adding support for stripper clips will be a pain though)
the complex part is the reload system
1 battery = 10 attack charges (not ammo so i used moddata)
max of 2 batteries which is 20 charges
hooked vanilla reload , rack and shoot
had problems with context menu reload
got stuck with the player animations etc
damn took me 3 days
oh and i wrote a function that prevents the player from being able to shoot on the square if its not being aimed at
since the explosion is triggered on the mouse pointer
(with range limiter so it will explode closer than the max range)
if the mouse is too far away
about guns ? yeah theres min range
i imagine its cuz of the length of the weapon maybe
i love the pointblank mod :D, with it min_range is just a other name for 100%crit_range
i would guess so too, maybe min_range dictates when you do a push instead of shooting.
yea like its impossible for you to shoot from a gun then the bullet would comeout behind the barrel(not unless its made that way i guess)
Maybe i am Blind but In this Doc. i cant find a method that returns something like "Base.Plank"
declaration: package: zombie.inventory, class: InventoryItem
getFullType()
Anyone know an easy way to force aiming?
I've tried player:setIsAiming(true) and player:setForceAim(true) coupled with player:changeState(PlayerAimState.instance()) and it does change the GameState to PlayerAimState, and I get the cursor as if I'm aiming and the camera pans, but the anim node stays on idle and the character doesn't turn when moving the mouse. I can get the character to face the mouse by doing
local vec = player:getAimVector(Vector2.new())
player:faceLocationF(
player:getX() + vec:getX(),
player:getY() + vec:getY()
)
But it doesn't trigger the 2DBlends in the animset.
It seems I have to somehow also change the ActionState, but I just can't find a way to do it.
Am I running into a limitation with the Lua API, or am I missing something?
action state transitions are based on animation variables
<?xml version="1.0" encoding="utf-8"?>
<transition>
<transitionTo>aim</transitionTo>
<conditions>
<isFalse>IsPerformingAnAction</isFalse>
<isTrue>aim</isTrue>
</conditions>
</transition>
so player:setVariable("IsPerformingAnAction", false) player:setVariable("aim", true) should trigger the transition
other states might have slightly different transition conditions, this is just from idle
Doesn't seem to work unfortunately. "aim" is a read-only variable but it changes to true when I do player:setIsAiming(true), but it still doesn't change to player/aim state
Do you happen to know if the 2DBlends stuff is based on the animAngle? Because I got it to track the changes in just angle, but it wasn't doing anything to trigger the 2DBlends changes
i have no idea about that, sorry
All good, you put me on the right track! Adding my own variable to the actiongroups files seems to properly change state. Just gotta see if I can add custom ones to trigger my stuff without fucking up vanilla behaviour
it will just auto remove the aim cuz youre not holding aim
i tried this and failed
maybe set it ontick lol
Haha yeah I tried that as well, doesn't work 😂 It works perfectly if you enable the toggle to aim option, but no one plays with that
So the blends stuff seems to be fully tied to actually holding down the aim button.
I was able to make it so aim variable is true and state is set to PlayerStrafeState and it faces the direction of the mouse, but when I try to walk it doesn't move and it stops following the mouse
I'm just gonna rethink the implementation I think
maybe you can save the option they have set and just revert it , change it while you need to
I was considering that too, but feels so dirty 😅
yeah and it could permanently change it . like a bug, if it desyncs or they disconnct maybe.. but you can just set it back as the reconnect maybe
is there a secret to making getMountOn() work? It's in the javadocs, it's in the javacode, I can see discussions about it calling it for an item, but it refuses to work for me.
Both of these fail:
myItem = InventoryItemFactory.CreateItem("Base.GunLight")
print(myItem:getMountOn())
myScript = ScriptManager.instance:getItem("Base.GunLight")
print(myScript:getMountOn())
The script one I expect to fail, but the item one should work.
I want to add my gun to existing attachments without having to overwrite the entire weaponpart definition.
oh tbh i would have never tryed it cuz of the Name, i expected something like getFullName or getModID.
Thanks!
That's reasonable, because getType() will return "handweapon", "container" etc, and getName() will return "Pistol", "Plank" etc so it makes no sense for getFullType() to return "Base.Pistol", "Base.Plank" etc.
depends on the object 🙃
the script's Name is the InventoryItem's type
all script objects everywhere else refer to that part of the script as 'name' so it's inventoryitem's fault for being different
of course they also have a different definition of type 😅
and of course in the parser the name is called the id... because nothing can ever be simple
DurableFirearms = DurableFirearms or {}
function DurableFirearms.isWeaponPart(part)
return tostring(part:getCategory()) == "WeaponPart"
end
function DurableFirearms.isAlreadyListed(part, fType)
if not (part and fType) then return false end
return string.find(tostring(part:getMountOn()), tostring(fType)) ~= nil
end
function DurableFirearms.getMountList(part)
local arr = {}
if type(part) == "string" then
part = instanceItem(part)
end
if not part then return arr end
local items = part:getMountOn()
if items then
for item in tostring(items):sub(2, -2):gmatch("([^,]+)") do
local acc = item:match("^%s*(.-)%s*$")
table.insert(arr, acc)
end
end
return arr
end
----------------------- ---------------------------
function DurableFirearms.insertMount(part, wpnFType)
if not (part and wpnFType) then return end
if DurableFirearms.isAlreadyListed(part, wpnFType) then
if getCore():getDebug() and isAdmin() then
print("Already listed: ", tostring(part:getFullType()), " --> ", tostring(wpnFType))
end
return
end
local arr = DurableFirearms.getMountList(part)
table.insert(arr, tostring(wpnFType))
local res = "MountOn = "
for _, mount in ipairs(arr) do
res = res .. tostring(mount) .. ";"
end
res = res:sub(1, -2)
local scr = ScriptManager.instance:getItem(part:getFullType())
if scr then
scr:DoParam(res)
if getCore():getDebug() and isAdmin() then
print("Updated MountOn for: ", tostring(part:getFullType()), "->", tostring(res))
end
end
end
function DurableFirearms.addMountToPart(tab)
local items = getScriptManager():getAllItems()
for i = 1, items:size() do
local item = items:get(i - 1)
local part = instanceItem(item)
if part and DurableFirearms.isWeaponPart(part) then
local fType = tab["item"]
if fType and tab[tostring(part:getFullType())] then
DurableFirearms.insertMount(part, fType)
end
end
end
end
thats what i did
Thanks, I'll give that go tomorrow
I didn't try instanceItem(), so hopefully that is the bit I need to change
if you're in b42 that's replaced inventoryitemfactory
btw, with field access you can just add it to the list on the script
local item = ScriptManager.instance:getItem("Base.MyPart")
item.mountOn:add("Base.MyWeapon")
It's 2am, I'm in bed and I feel like I'm going to give up on sleeping at some point and do some 4am coding just to try this. 😂😴
Using Starlit as a dependency?
yeah
I might do that, starlit is a nice library
you can access fields without it obviously but it's a whole mess
The point here is to avoid mess lol
I might make starlit a soft requirement, people without it can live without weapon attachments.
(honestly, no attachments is the best way to use the PR57, it's a 400 gram backup weapon with decent stopping power in the Zomboid world... attachments are just extra weight to lug around)
'decent' stopping power? i guess it's not 570mm anymore 😔
I feel like i'm missing something. What exacly you mean that without Starlit people can live without weapon attachments?
If I use starlit field access to do things the easy way then the code won't work without starlit
It's still better than a .38 snubnose
Okay, but what exacly is what you want to do? If i remember correctly starlit allowed you to easly modify vanila attachments, for them to "work" on modded guns, without conflicts or requiring to override itemscript of that attachment itself?
Yes, or I have to do a convoluted workaround. Which I have most of the code for already, if the instanceItem thing works
The issue is poor support for programmatically changing the list of guns in a WeaponPart script.
I feel like thats the only thing stopping me from doing more guns for PZ. Making vanila attachments work on them is really annoying.
Doparam will let you set it, but getting the existing list is... aaargh
Once you get the lua working once that will be easy to copy. Just like once I finally got the rotation and scaling right in Blender I can export a model reliably.
Then it's just a matter of using the attachment editor and hoping it actually cooperates instead of deciding to randomly flip things between what it shows and what it actually does.
For me, the bigger challenge is thinking of a gun to add that actually adds something a bit different to the game.
If you did it like in my guide then thats not an issue, UNLESS you do use handguns/pistols, which have to be flipped, then it might be annoying.
At least it was in b41, though as far as i know it still works in b42.
Event OnObjectCollide only fires when Object collides with windows/doors... or a few more but it doesnt fire when Object collides with a wall or a fence, are they not supposed to fire when an object collides with walls and fences? and if so is there a way around it such as using raycasts? if pz has raycasts in the first place
Could you give an example of what you want with object collide ?
And regarding ray casting, I personally developed a script for it
destroying walls/fences etc when an object with enough momentum collides with it
or just... damaging them atleast if thats possible
there's a couple mods that accomplish this by tracing a little ahead of the object and destroying objects before it hits them
Yea there's a mod that does that
someone was posting about one here or maybe in the modding discord, but i don't know if that was released or not
i see
It was released, I don't remember the mod name tho
okay but... are raycasts possible?
Nvm
It's not in the game, but I did manage to create raycasting
This is a presentation of an update for my mod Check Around.
Link to the mod:
https://steamcommunity.com/sharedfiles/filedetails/?id=3300688173
PS:
The song in the first clip is FIG - 4 Star Rated (feat. Ivri)
You could easily adapt it to your own usage
Ill see what i can do, thanks!
Currently the ray casting retrieves squares that weren't blocked, but it identifies types of objects to check for blocking so you could use it to easily adapt the object blocking or not, to make a list of tile types that should be affected
Noted
Hey!
Experimenting with a TetriZ mod — open to feedback! 💦
https://www.youtube.com/watch?v=LVjIJGYMNV0
We're working on this TetriZ mod... curious what you think!
Music by GEOD : https://www.youtube.com/channel/UCaJ65qOsH1_CBiiIJ_nJ1oA
👀
Am I allowed to say that anyone who makes an addon of my mod agrees to let me use their code?
Like if someone makes a mod that builds on mine to fix bugs, would I have the right to copy that code (so far I've been asking for permission and everything out of principle) regardless of what they say, or are there any problems with that
Most licenses are like that, google software licensing to see the options
Don't know how much license freedom I have since this is already a mod for Project Zomboid though
Doesn't matter- you wrote it (assuming), then it's yours
There's a lot of willing misinformation about how mods work legally, unfortunately- anything you've heard saying mods aren't yours and belong to steam or the devs is incorrect
4.2. As mentioned in 1.1.2, if you put any third-party property into your mod, then it’s your responsibility to make sure it’s all done in an appropriate, legal fashion, including offering credit within the Workshop description of your mod.
(1.1.2 Modders are solely responsible for obtaining the necessary consents or licences for any third-party materials in the mod. )
Use an existing open source or creative commons licence if you do this target than trying to make your own license
Yeah, there's a few licenses that stipulate any derivative works have to follow your work's licensing too, as in everything is 'open source'.
and all you have to do is include a text file with the license
If I wanted to make the majority of grass tiles be replaced with burnt versions, how would I do it? Through TileZed overlays?
Dont ask why.. I have very sinister plans
Another photo for reference
Maybe the way clay is done will be a hint:
lua\server\Worldgen\biomes\map\clay_shore.lua
that gives the four listed tiles (4 variations of dirt) a chance to be replaced with clay.
the attachment editor works so much better once you realise that the object positions in it have zero relation to the way they show up in game and it's just a bit of trial and error to figure out which arrow moves the attachment in which direction
42.8.1 is out, changing approximately nothing.
smh people whined that hard about the welcome messages lol
except for that teeny-tiny issue where the entire game wouldn't launch
I disable the welcome message with a mod, it never occurred to me I could complain about it instead.
Speaking of complaining... are there any mod framework or helpful template for procedural distribution tables? Instead of coming up with dozens of locations and values I'd like to do something like "put this handgun in places to find handguns, make it 25% as common as an M9"
Currently there's nothing like that, but that wouldn't be hard to do
You could just make a key table of key being the item to use as a reference, and the value being a table of items that should follow the same distribution
Then parse the entire distribution
And add your item whenever the ref item is found, and add the same chance
I was thinking of giving that a go and seeing how long it takes for the parsing.
If it takes too long to do on every game boot, the solution would be to pre-calculate the tabeles for the reference items you want to use.
Not long
You underestimate the power of computers my friend lol
And you can easily optimize a bunch of things
I've added E-Z distribution API to my project list.
And I need to make that before I upload the PR-57 since I want to use the API in my own mod.
No idea what that is
The working name for an API mod to make adding a new item to distribution lists.
For the method you described ?
I never heard about such an API
Yes, because I have not made it yet
Its in my list of projects to do
Which was not really that clear with the way I phrases things
BTW to nitpick only because i see this a lot, 'API mod' is sort of awkward naming: API is something a mod provides, but the mod itself would usually be called a library
i remember the old old community repo had something called distributions api but i wasn't sure what it even did
At least it's not a API Interface.
am thinking of using https://projectzomboid.com/modding/zombie/vehicles/VehiclePart.html#getSquare() instead, but idk if it would actually work out
declaration: package: zombie.vehicles, class: VehiclePart
An API for interfacing with an application, some sort of Application API Interface
Security is important so it will require use of a Application API Interface Personal PIN Number
My eyes are bleeding now.
So the good news is the first draft is putting the item into the loot tables...
That won't really work, because it won't retrieve every squares the vehicle is on
You'd need to access the squares in a different way
Also are you on B41 or B42 ?
B41
@dawn what is your goal? Making a vehicle do something when it runs into world objects?
well... in that case, ill try casting X amount of rays tied to how wide the vehicle is starting from the center of the vehicle towards the direction the vehicile is going
Damage/destroy objects when colliding
So yea
Wrong game
LMAO
Yes that one !
AFAIK that adds "this thing can be damaged" info/world objects and uses the existing "car drives into something" vanilla code.
Super Bulldozer continually checks tiles and destroys any trees it finds.
No need for raycasting, just a bit of math based on vehicle location, size and facing.
Ooooh doesn't the mod set the speed of the vehicle back to what it was before colliding ?
Bcs first off idk if there's a way to get objects vehicles collide with (at least you can't for colliding with zombies), but the vehicle would stop on collide
yeah there isn't any vehicle collision event or anything
I'm not sure, I think it depends on the world object - some stop the car even though they get destroyed, some (like road cones) you just drive over.
But how do you get the tile
Look at the lua for the mod.
It might also change the tile properties tbf
I looked at it long time ago so can't recall the exact details but it wasn't complicated.
Heya guys so I put in "xmx25g" or something to change the ram limit but it is stuck below 3gb of ram usage, anyone that can help me with it?
It might actually do something like setting the tiles to follow the same format as traffic cones yea
Nvm i can just look at the code anyway but thx
That's fairly easy
Just check IsoGridSquare
kk
There's methods to retrieving the tile informations
Not really a modding issue, but: Xmx is the MAXIMUM ram, the game doesn't have to use it all.
normally when I put that in on my old pc it used all of it
- I have about 40 mods enabled
Xms is STARTING ram.
Maybe you used that previously.
40 is low, but also not all mods are equal in terms in load.
My 300+ modlist is probably less resource intensive than installing AuthenticZ and Britas weapons/armor.
Dang
Good enough for tonight - tomorrow I get to make it work with multiple entries for an item in one table and add some safeguards.
NepDistro.AddLoot("Base.NepPR57","Base.Pistol",1) is so much easier than dealing with the loot tables directly.
Third var is the quantity ?
multiplier, so 1 (or leave it out) and it will use the same probabilities as the reference item
NepDistro.AddLoot("Base.NepPR57","Base.Pistol",4) would make it four times as common, NepDistro.AddLoot("Base.NepPR57","Base.Pistol",0.25) a quarter etc
it does,
That way NepDistro.AddLoot("Base.NepPR57","Base.Pistol") is the same as NepDistro.AddLoot("Base.NepPR57","Base.Pistol",1)
true, I do that sytax all the time for tables that might not exist yet
Also using 1 or 1.0 does nothing 
But yea I tend to like this syntax since it makes it shorter than using a whole if statement
Untyped languages are a pile of junk and using 1.0 is easier than remembering where I'll have issues with 1 being treated as an integer
you never will, lua doesn't have more than one number type
Java does though
And we have Lua <-> Java magic happening...
when you pass a number to a java function that expects an integer it will be converted regardless of whether it can be represented exactly as one or not
At least in java you get to choose the type, never any doubt.
a number stored in lua is always internally a double, no matter what
Yeah so if you’re expecting it to be converted to an integer omit the .0 and if it’ll be passed as a float then add .0
ez syntax preference
Just consider using 1.0 a habit I picked up that isn't worth training myself out of.
i don't disagree here



