#mod_development
1 messages · Page 335 of 1
if you want the fluid's script you'd be wanting getScriptManager():getFluidDefinitionScript(name)
Ah I see why I didn't find that lol
I didn't check in the script manager class and instead searched in GlobalObject 
The way Fluid definitions are handled is so weird.
only vanilla fluids
mods can use strings
it's more of a convenience than hardcoding
Modded is FluidType.Modded I guess
i wonder what happened to fluids 25-63
Maybe mixes ?
Also there's no orange juice but I remember some fruit juice in a devlog regarding automation
Mixes track each seperate fluid
Yea figured
Yes, any user added fluid falls into modded
I hope they implement a system that gives names to mixes.
If not I'll make a mod that will name fluid combos that match coktails.
item:getFluidContainer():getPrimaryFluid():getFluidTypeString() through this you get its string name
(from a container)
primary fluid == the fluid type there is the most of, from memory
It should
Isn't that what @old ginkgo does with his mod ?
Mixology
Good, I don't have to make the mod. 🙂
Yup. Its got an API too so you can easily make addons for it.
Just gotta insert the ratios to a global table.
remember that we're currently missing an entire brewing skill so these things may come later
It’s such an easy thing it might be something TiS makes themselves.
the fluid system is a little weird and limited because TIS haven't even added the main thing they wanted it for yet
fluid = getScriptManager():getFluidDefinitionScript(fluid) apparently this worked
though i'm not flabbergasted at all that fluid:setAlcohol(proof) does not LOL
Should fluid be Base.XXX or just XXX
not very intuitive this stuff
for base usually both work, but better to be explicit
you can see all the methods available on that object here https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/scripting/objects/FluidDefinitionScript.html, doesn't seem like there's many setters
a lot (all?) of the new script types are like that unfortunately
you might be able to use Load if it doesn't reset the object or do anything else strange like that
ooooooooofff
Modding stuff at lua level is such a PITA
i'll leave it to TXT
thanks for the help
What did you end up doing instead? I also need to trigger something when manually placing a tile with place item
OnObjectAdded is best for this
How do you deal with the output of an API call that returns an Array? (NOT an ArrayList)
Function def/javadocs: public float[] getPolygonTriangles()
get the output: triangles=getWorld():getMetaGrid().Zones:get(2190):getPolylineOutlineTriangles()
stick it into print(triangles): [F@242bdf40
It's as if [F is the object class. Which might be some weird Kahlua name for an array of floats? Except I can't do anything with it. It's not a table so no lua-table style commands work, :size() :length() :get() all fail.
are you in b42?
Even weirder: there's a public float[] I can access directly: triangles2=getWorld():getMetaGrid().Zones:get(2190).points
if I print that I can see the data: {13835, 1847, 13846, 1847, 13856, 1852, 13859, 1855, 13864, 1865, 13864, 1875}
But again, I can't figure out any way to access the data
Startlit's Reflection.getClassName says triangles is a [F and triangles2 is a nil
yes.
Array.new(getWorld():getMetaGrid().Zones:get(2190).points) https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/entity/util/Array.html
basically, when you get an array, all you can do with it is pass it around
b42 added this utility class that you can construct from it and use to read from the array
hos do you read from it?
a=Array.new(getWorld():getMetaGrid().Zones:get(2190).points)
then print(a:get(0)) throw an error
oh, that's not an array
ah, should have been getWorld():getMetaGrid().Zones:get(2190).polylineOutlinePoints
that makes it behave the same as :getPolylineOutlineTriangles()
so a=Array.new(getWorld():getMetaGrid().Zones:get(2190).polylineOutlinePoints)
so a is a Class Array<T>, that utility class you mentioned
yeah
OK, with that I can get... empty arrays. lol
but they are working empty arrays
So I'm guessing the raw data gets processed as-needed into polylineOutlinePoints[] and triangles[]
And I will need to deal with the TIntArrayList that is points
which is likely the same as the raw numbers in the map zone data, e.g.:
{ name = "", type = "Nav", z = 0, geometry = "polygon", points = { 8100, 14253, 8100, 14264, 8221, 14143, 8215, 14138 } },
so if I can't figure it out from the TIntArrayList because that class isn't working with Kahlua I can copy-paste the map's data into a lua file and so my own processing on it.
what abt b41?
you're fucked

You make a java mod to convert float[] to ArrayList<float>
its fine if its all string or numbers i guess
i can parse it
but if its objects then im stuck
raw arrays aren't used very commonly anyway
so none of the TIntArrayList methods work, but print(tinta) works, so I can convert the integers to a string with tostring(tinta) and then process that string back into ints.
tint for clothing?
no, TIntArrayList
it's an array of integers but special.
It's used within the java, but it seems nothing about it gets exposed through Kahlua.
I might spend some time and fiddle with Suno and make a True Music pack that's themed around fighting and apocalyptic music.
🤔
Would be a lot of bluegrass and rock.
I'd add this experiment in the list: https://suno.com/s/IbaOegxNQLLPFmif
Is there a way to tell VSCode/Umbrella(unstable) that a specific thing is actually a legit global? I don't want to disable the "unknown variable" detection altogether because it picks up my typos.
Yea
I think so
@bronze yoke should know but it's some special typings
--@global perhaps ?
you can add it in the extension settings i think
that's weird, i haven't had to use it personally
is that a vanilla global missing from umbrella?
I see the issue, the settings json is missing a comma
VSCode can't even write it's own settings lol
the notoriously difficult to parse json
I had a co-worker give me a json config file this week
full of C style comments
WTF
No
that's like something TIS would do in their "lua" config files.
json is intended 100% for computers, 0% for humans and does not support comments. Which makes it a bad choice for config files humans are supposed to configure.
Zombie sonar?
ye ZedScanner
Start Knowing Roads progress.
whats this
You know how you normally wake up a complete amnesiac who doesn't know anything about their local town?
The goal is to let you start with map knowledge of the roads, at least the major ones.
Alternative use: a Kentucky Road Atlas item that reveals roads, instead of of 100% revealing a rectangle.
probably sandbox options for always start knowing roads/enable a trait to start knowing roads/enable road atlas spawns.
What jsonc does to a person
how did you pull this off? thats amazing. map api is hard to deal with
ive only manage to Add and remove symbol for my enclosure mod
It's not the MapAPI, it's the forage zone data
It's not meant to be used like this, but all zones of type "Nav" are roads
But the map knowledge function only accepts a rectangle, and the data is a mix of rectangle/polyline/polygon so there is some horrible hackery going on
Especially since it's impossible to access the actual methods of the Zone object because they don't covert the list of points into triangles or anything until they are accessed, and the functions are all about "what zones is this square in?" or "draw on a map that supports lines and polygons"
Dawg that sounds like rocket science
guys i got a question about key binding and how they work in lua , for exemple i want to make a console test about the keybinds to be printed whenever i click one
i will use this function , but the issue idk how the keys are called in lua is it by numbers or by something else
local function OnKeyKeepPressed(key)
-- your code here
end
Events.OnKeyKeepPressed.Add(OnKeyKeepPressed)
I've been waiting something like this for a long time
You should start with some basic map knowledge
appreciate it man
The key is an index
A sort of index
It's a number associated to a key
Which you can retrieve with the keyboard class
oh thank you i searched in pz about keys and keyboard and i got nothing
is there any documentation about how to convert a mod from b41 to 42? I've got a custom player model I'm trying to port over. The fact I can't use it is like half the reason I still play b41 single player.
Yes, check pinned messages
Regarding mod structure
ty!!! <3
hey guys, what's up?
i'm a filmmaker, i work with audiovisuals, but every time i try to play with code i fail. even so, i wanted to throw an idea out here, maybe someone will come up with it.
i do zomboid livestreams, and in a livestream everything happens very quickly. there's no time to clip the right moments.
so i thought, what if there was a mod that identified critical events and automatically sent a !clip in the chat? something like: being bitten, catching fire, dying, setting off an alarm, crashing the car, collapsing from hunger or sleep?
those things that mark the gameplay and would make great clips if they were recorded on the spot.
i don't know how to program, but if anyone likes the idea and wants to try creating it, i'm here. it would be great to see it working
There is a mod that adds twitch integration, but it doesn't do exactly what you want (but can be a good point to start from to know how to do it) and it requires you to be in a server I believe, local server being enough I think
yes, I tried to use it with a lot of patience and vibe coding, but without success 😂
I'm playing on b42 to try to bring the new generation hype to the community, so I believe that running ISOs locally wouldn't be a problem. I just don't really know how to do it, in fact I have no idea.
A potential roadblock would be the changes to the web request capabilities of the game—as of b42 (unless something has changed in recent updates) requests can only be made to a few hardcoded domains. This could be bypassed with a Java mod, though. The rest would just be a matter of hooking into events and checking for those criteria
May be worth throwing it in the mod ideas thread, although I've no idea whether people really pick up ideas from there
I thought about this more for content production.
In the end, any detail can become an engagement and attract attention.
With automatic capture of critical moments, we would practically have an infinite number of possibilities in this regard.
Would be nice if devs integrated leaf once it is ready
But they probably won't, since Java code is unsafe
(Can't be read without external tools, has no sandbox to protect system)
Anyone know if it’s plausible to get a weapon to be considered two classes? So one weapon would give say both short blade and axe skills?
Nah I don't think so
Is there any way to turn a vanilla tile into a container without overwriting the tile
You can't make a weapon two types, but you may be able to code a mod that gives extra experience in a different skill when you use it.
Start by identifying where the xp gain is, if that's in Lua you can modify it. Otherwise attach an event to the EveryMinute function that checks if a player is using the weapon, checks if the weapon skill has increased, and if it has increases the other skill too.
Do you know if tiles with a container are a different java class too one without? That's what stops you converting a normal InventoryItem into an InventoryContainer without making a completely new item
And why changing underpants to a container let's you store stuff in your undies but also deletes all existing underpants in the world.
I figured it was just a property in tilezed. No idea how it works
What matters is how the backend works, if you want to change existing tiles and not break things badly. But I don't know the classes involved.
And I'm in bed and it's nice and warm so I can't check 🙂
. hm
True Music has a guide to making add-ons on its mod page somewhere. You should follow it, but set the mod page to be unlisted if it's just for personal use
If a mod is for personal use in single player you don't even need to upload to steam
Decided to learn some lua "object oriented" stuff to clean up the mess of code going into converting piles of numbers to map revealing data.
I would like to add a setting of type string in sandbox-options.txt and specify “comma delimited string” as the default value.
However, if I do the following, “only up to the first comma is displayed” (and double quotes are also treated as strings) as shown in the attached image, is there any better way?
option P4SeesawGame.ExcludedSkillCap
{
type = string,
default = "Fitness,Strength,Lightfoot,Nimble,Sprinting,Sneak",
page = P4SeesawGame,
translation = P4SeesawGame_ExcludedSkillCap,
}
what's a good simple project to start with if i'm trying to get into modding? adding an item or something like that?
also what software do I need to open the model files?? i've never seen ".x" before
guess i'll try blender
no... blender doesnt recognize it
.x is an directX image file for rederning 3d graphics
you can use it with blender with custom exporters
or with directX SDK plugins
this isnt really a question for developing mods but a technical question
what are the colors for moodles in b42? i need to get the hex color codes but i dont know where the game handles it
I bet the parser is programmed to ignore quotes and stop at the first comma.
Yes, that is my guess as well. If so, I plan to make it a semicolon delimited setting, although the format will be different from other settings in vanilla.
Fixed up the implementation of polygons/polylines, added a probability-per-map-unit so it's not overly filled in around cities/the disjointed bits don't stand out.
And a circle of knowledge intended to be around your starting location, on the basis that you know where you live/work.
I used a sandbox string parameter for Architect mod that does the same + a key:value association. option Architect.ItemCostPerSquare { type = string, default = Base.Plank:0.25;Base.Nails:1.0001, page = Architect, translation = Architect_ItemCostPerSquare, } ```lua
function Arc.extractAssociationListFromString(sandboxAssociationString)
local associationList = {}
for association in string.gmatch(sandboxAssociationString, "[^;]+") do
if association then
local key = nil
local value = nil
for result in string.gmatch(association, "[^:]+") do
if key == nil then
key = result
elseif value == nil then
value = result
break;
end
end
if key ~= nil and value ~= nil then
associationList[key] = value
--todo else log error
end
end
end
return associationList
end
The reason commas don't work is that the parser for mod options looks for a comma to get the next parameter & doesn't actually read strings with quotes (i.e., the quotes are considered part of the value for the default)
I've done similar with semicolons. The default just can't have commas, unless there's some hacky solution but it'd likely still involve a comma placeholder
Comma will screw up the string. You need to use some other delimiter
If only there were well documented file formats with pre-existing libraries for every major programming language that could be used instead of custom coding something unique every time you want a new type of thing in a config file.
local function splitString(sandboxvar, delimiter)
local ztable = {}
for match in sandboxvar:gmatch(delimiter) do
table.insert(ztable, match)
end
return ztable
end
Use the appropriate delimiter based on what you like
Why is the range of component CraftBench so big, is there a way to set the range down (screen is range)
Hey everyone!
I try to add a new box of ammo (7.62x49mm). So far everything works great, the item appears in the inventory.
The only issue is: I can’t get it to open like regular vanilla ammo boxes (with the “Open Box” context menu option).
I’m wondering: do I actually need a custom Lua script to make the box open, or is there a base-game system that handles that automatically if set up correctly?
Thanks
Everything is a recipe now smh
yeah like these guys said, you need to create a recipe that just turns the box of ammo into a certain amount of individual bullets
Oh ok thanks !
Hello again ! 👋
I'm working on a custom weapon mod that uses 7.62x39mm ammo, and I'm trying to make multiple types of bullets for it (standard, FMJ, HP).
I managed to create different items and boxes for each type, and I can open/close the boxes just fine.
But here's the issue:
I want my magazines to accept all three types of bullets, but currently, it only accepts the standard ones. FMJ and HP bullets won’t load into the magazine.
Any ideas ? I can give more infos if it's not enough.
Thanks
Natively, you can't use different ammo for a gun
It would require some more complexe Lua codes to handle it
oh ok...i'll try the more complexe Lua code...but Thanks
At minimum you need to patch:
Puting bullets into a magazine
Removing bullets from a magazine
Loading magazine into gun
Unloading magazine from gun
Racking gun
If a magazine can have mixed bullets, it's even more work. If you care about the bullet in the chamber being different to the ones in the magazine after a change of mags, more work. You also need an interface for the user to select what they want to do.
To be honest, the gun fighting in Zomboid is so simplified that I don't think it's worth having multiple bullet types.
If you're on B41 if consider making Britas guns/gunfighter mod dependencies and using their code, which does have multiple ammo types per calibre implemented.
Guys, I created some great builds on my server. Is there a way to take the local files and turn them into a map mod?
@silent zealot Thank you!
Mirror Mirror on the wall....which mod has broken my game after all?
No
You could perhaps create a tool that output a file which is formated for building mapping
@slim swan Hey do you have a git of your NeatUI lib ?
Also do you have a github wiki for it ?
Or an equivalent
not yep,still studying the XUI,and working on a doc to explain how the ui or texture work in pz
Alright because I'll document your library on the wiki
So having links to every resources your mod gives available online can help me document it even better, but that can be added later
but maybe later? cas this library still got so many things needs to do ,the only thing u can do is use the ScrollView for now
Alright np
heyo!
if i wanted to make a mod
that adds a new foragable item and some crafting recipes
how would i do that?
https://pzwiki.net/wiki/Modding has lots of resources!
Including recipes (note that B42 craftrecipes are very different to B41 recipes)
For adding items to foraging tables, have a look at media/lua/shared/Foraging/forageSystem.lua
I wouldn't 100% trust instructions in a vanilla lua file, but the comments at the top shoudl help you get started
Ive changed the file stucture to try to make my mod work on b42 and now when i try to start a save in debug i get this, b42.9.0
Did you do what the message tells you ?
looking at the console.txt but ngl idk what half this stuff means
just want my silly potions on b42 x3
You should get an error message of some kind in your console
Start from the bottom going up
does anyone know of a way to detect whether you're in the character customization menu? (specifically the appearance/clothing one)
i think it might be possible to check if the menu object is enabled but im not sure
CharacterCreationMain.instance and CharacterCreationMain.instance:isVisible()
thank you!
Do your options have recipes? They changed syntax in B42 and the game does not handle incorrect recipes well. (Or it could be a bunch of other things)
Otherwise, like Sir Doggy said look at console.txt starting from the bottom and going up, looking for problems (with the caveat that there are plenty of error messages when Zomboid does work properly!)
The word "exception" is usually a good search term, it picks up places where lua breaks.
Hello Madams/Sirs. If there is no trunk capacity in the script of the car it means its vanilla? and If I want to increase the capacity I should add new script line to increase the capacity?
If the trunk is from a template, the capacity is defined there. You can change values of the used template for the script it's included in by creating a part with the same name and defining just the values you want to edit```template = Trunk/part/TruckBed,
part TruckBed
{
...
container
{
capacity = 100,```
Thanks ive got it there are other cars with the same script line and some doesnt have
This new XUI debug window already seems to include many features that make customization easier, but for some reason, it was never completed.
Bcs it's still wip
Greetings everyone. Friends, I have a question: how do I configure the map so that it has a thumbnail view at the bottom and so that it focuses on the space where my map is located?
Sorry if you see the message repeated. But I asked on another channel and they told me it's more likely to receive help this way.
Check it out
Recently someone has asked me on one of my moodle mods if I could make a mod that adds moodles dependent on the severity of the stats (e.g., as pain stat increases to a threshold, a different sprite for a pain moodle shows, in which there is more wincing). The user didn't specify B41 or B42. As someone with basically no coding experience, I was wondering if this is even feasible? This sounds like a really cool idea I would like to pursue, but I don't know how and even if this is something that could be made. Theoretically, if this was possible, I would most likely need someone with experience in coding in order to make this a possibility.
In short, this seems like a cool idea, but I want to know if this is something that could even be made, and work in-game.
Just to be sure, you mean showing basically which direction the stat evolves ? If it's increasing or decreasing ?
Yeah, variable sprites for moodles which activate when a stat increases/decreases to it's next or previous level. An example, which the original commenter used, would be the different levels panic, and at each different level a new sprite would show.
But that's already the case
No ?
There's already a different sprite at the different levels ?
Level 1 to 4 usually ?
I don't think so, it's usually the same moodle for every level, and a modder sometimes includes different colored backgrounds representing each level
Oh no you're right it doesn't change
Well that's probably doable with the moodle framework
you'd have to replace the moodles with a custom implementation, there's a few mods that do that
moodles aren't really moddable at all
moodle framework wouldn't be good as afaik it can't replace vanilla moodles
that lua moodles mod probably can do this
Maybe I could check that mod out, see what its capable of. Thanks
i think so
i don't know much about it, the only reason i know about this mod is i worried they'd stolen my code since i'd done this already 😅 but they didn't, completely different codebase
Yea I remember that mod
I feel like it's not enough used
Might be a better alternative than the moodle framework from tcherno, tho I guess both do different things in a way
Also both might be incompatible ?
Moodles framework mods
https://pzwiki.net/wiki/Moodle_Framework
https://pzwiki.net/wiki/Moodles_in_lua
Thanks for the help, guys. Both of you
What about in ki5 I want the capacity to be change in a specifc car only and not affecting the other one like porsche911 mod by ki5 I want to change the capacity for porsche911rwb and not porsche911turbo.. I did some name changing like adding "custom" in script like template and part and txt but doest seem to be working
#1070852229654917180 message
can someone explain to me from where keyNum came from?
i am blind i got it 🙃
Hey everyone! I recently made a mod that allows you to attach bags to a sheet rope to lift them up afterward, I'm using the setters from the extended 3D placement (setWorldX/Y/ZRotation and setOffX/Y/Z) to create attachment slots for the bags. I'd love to port it to build 41 but the extended 3D placement is from build 42. Is there any way to reproduce a similar behavior in build 41? (ideally setters for translations / rotations)
Do you want to make a mod, or just adjust it for personal use?
adjsut it for personal use
It's been a while since I've done it but you should be able to add capacity = 300 to a specific car's trunk, which overrides the template
Just be aware some KI5 vehicles have a trunk which is normally hidden and a special K15trunk with nicer graphics on the UI that is the actual one to edit.
Otherwise you end up with two trunks.
so I just need to copy the trunk.txt file and just change the capacity?
no, don't copy any files
just edit the one you want changed
This will get overwritten if the mod is updated, but KI5 does not update often (at all?) once released
they have the same part the rwb and turbo wouldnt it also change the turbo?
they have one specific script which is the
that is the template
that gets used here
I think you can override settings under that, or just change the template so both 911s get the change, or you could make a new template PRS82TrunkCompartmentBig in the template file and change one of the cars to use that.
You may also find you need to spawn a new car or repair the trunk to update capacity before the change takes effect
ah Ill try
at least the tiny capacity makes sense for a 911
If you've ever looked at the storage space it's tiny. Unlike, say, a full sized station wagon (100 units) or pickup truck (110)
Like this?
Might be limited to 500
but give it a go
Zomboid has really wierd ideas on limiting container sizes
The trunk disappears
This what I did
oh I didnt change the template txt file
I did it but the other parts gone missing lol
is that template file all you changed? looks like something else was altered by accident, check the timestamps on the files.
Not sure which file you changes there - my suggestion is copy the PRS82TrunkCompartment as PRS82TrunkCompartmentBig in the template_PRS82_trunk.txt
then in 82porsche911rwb.txt change line 238, template = PRS82TrunkCompartment, -> template = PRS82TrunkCompartmentBig,
And then hope the part models aren't tied to the template names somehow
apparently theres an extra bracket and ive removed it and its working perfectly fine now thanks
Hi, I'm new to modding and Blender. I took the pouch legs from the Scrap Armor mod (2658619264). I respected the position and size to change the image to a plushie, but when I equipped it, the texture covers the entire screen. Do you have a guide to verify where the error might be?
I don't have any error messages in the game. As a container, it's working fine; it's just the texture that's failing.
OOOh forget it, I replace de .FBX files with .X files and now its working
Probably an issue with the item scale - Zomboid has weird quirks about how the model needs to be set up in terms of both size AND the scale parameters.
.fbx will work, but if export to .x hides the issue - that's easy.
That's absolutely not a solution
.fbx >>>> .x
And I can bet you just did a mistake somewhere
Jesus why do the devs keep using this freaking format, modders keep thinking they need to use it 
Of course, I could have made a mistake. I have less than 10 hours of experience with Blender. Where do you recommend I start looking? Because I don't want to have to export to OBJ and then export with FragMotion to X. It would be much easier to export directly from Blender to FBX.
Just remove the .x format from your brain, do not approach it
Hi was wondering if someone could help me out? for some reason I cannot get the jacket and my pants to appear in my mod - I tested them and it worked fine but for some reason now that im getting ready for release its not showing up 😩
First thing to check:
Blender has a concept of transforming an object (rotate, scale, location) that doesnt' actually change the object - just where it is/what size it is in the scene.
Zomboid has... lets say "quirky" interactions with this.
I'm not certain what the values need to be for clothing meshes, but it's worth applying any the transformations (Ctrl-A Apply all/apply scale/etc) and re-exporting the fbx.
Also, make sure you select the mech to export and then click "only selected" when exporting since you can really confuse Zomboid if there are other meshes/other items included.
Well, Im sure the issue is in other place, I left one X (working, right leg) and the other FBX (non working, left leg)
What's the function for adding item into inventory?
declaration: package: zombie.inventory, class: ItemContainer
addItem, AddItem, AddItems, AddItems or AddItems.
Depends if you are adding an InventoryItem, giving the name of the object and a new one will be created, or giving an arrayList of InventoryItems,
If you need to get the player inventory, something like getPlayer():getInventory():AddItem(...)
inv:AddItem(flashlight)```
OnNewGame only fires once per character, so the getHoursSurvived check isn;t needed.
Unless there is wierdness with that event and multiplayer.
Or B41 is different to B42.
I was curious how DoAddItem and DoAddItemBlind differed from AddItem so I looked them up.
- Doesn't works
- It also broke mod that used the same function lol
inv:AddItem("Base.HandTorch")``` works for me. What function?
does anyone know if the devs are planning to expand upon explosives and bombs in PZ? i've started planning out a mod but i don't want to dedicate myself to this if its all going to be added anyway before i finish
My mod
Mod I ripped code from
When my mode is activated, NoStarterPistol ceases to work
but functions and variables are local, so they shoudn't conflict, I think
Maybe the earlier function in the event is replaced with the new. I'm not sure how they are saved, but maybe worth testing renaming OnNewGame
Could use a hand with a trait check. I cant find "Angler" in https://projectzomboid.com/modding/zombie/characters/IsoGameCharacter.CharacterTraits.html or in https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/characters/traits/CharacterTraits.html#
I'm trying to have my fishing UI check for the trait to know how much info to display.
Hope to release this fishing rebuild soon. Any help would be great, thanks all!
declaration: package: zombie.characters, class: IsoGameCharacter, class: CharacterTraits
declaration: package: zombie.characters.traits, class: CharacterTraits
You're mistake here is assuming the module + item ID is referenced to in Lua like that but that's different
Module.ItemID needs to be a string
And you need to instanciate an InventoryItem which then gets added to the inventory
So, just writing out item id isn't enough?
No that's just not a thing
can someone explain to me what is "derive" used for in lua coding?
This will create a subclass to the one you call derive on with the name you've put as the argument of derive
Which is usually the same name as the variable you associate it to
So basically the new class will inherit the methods from the parent and create a whole new class that you can add other extra stuff to
And classes in Lua are not exactly classes but they are tables
I just dip when I see parenting lol
so if we have a base game function and make a derive for it ,it less ass add other lines of code without screwing the parent function code right?
I'm wondering if "Angler" does have a different name and that's why it's not in the github or triggering for me >_>
I just want to be finished with this mod and I think Im close lol. My poor players Im sure want me to move on.
fwiw it's not necessary to instantiate an item before adding it to a container, you can just pass the item id to the container and that will instantiate it for you, saving a java call
this code is old, traits don't have to be registered here and newer ones generally aren't
traits just use string identifiers, you can see traits being created in the vanilla lua
hmm so using "angler" in the string should work then yeah? was running with local hasAnglerTrait = self.player:HasTrait("Angler")
local hasAnglerTrait = self.player:HasTrait("Angler")
if hasAnglerTrait then
panel.height = 120 -- Full height with all details
else
panel.height = 45 -- Shorter height with just basic conditions
end
probably, they don't always line up with the translated name though
Ahh gotcha, I'll go digging
the file they're created in is called something like MainCreationMethods
Good memory thats exactly it
local fisher = TraitFactory.addTrait("Fishing", getText("UI_trait_Fishing"), 4, getText("UI_trait_FishingDesc"), false);
fisher:addXPBoost(Perks.Fishing, 1)
fisher:getFreeRecipes():add("Make Fishing Rod");
fisher:getFreeRecipes():add("Fix Fishing Rod");```
Thanks albion!
I'm ready to be done with this rebuild... now my players remind me that they cant do anything with a 160lb paddlefish in their inventory lol
Time to build a fishing journal that adds the fish and removes the item.
Works like a charm! Woo
No that's two different things
True, I think you're right actually
Derive is not a generic Lua thing, it's defined by PZ Lua
And it derives classes NOT functions
Basically it derives tables in a way
So it sort of makes a copy of the table which holds functions
As for modifying existing functions without overriding it, see decorations
tbh i think we should give up the 'fake classes' pedantry - i think it's confusing for newcomers, and there isn't really anything special about lua's classes that really lets you definitively call them not 'real classes'
I guess, tho I thought you thought the inverse lol ?
metatables are obviously directly designed to allow you to implement OOP with them and the way lua classes typically end up working is fairly similar to how compilers actually implement classes
So we offficially call them classes ?
i don't see any reason not to basically
the only real distinction between lua and 'OOP languages' is that lua doesn't have a language level concept of classes, but you absolutely can create classes in it
I think a lot of people would benefit from a deeper understanding of metatables, esp. if the PZAPI.UI pattern is used more—better to know what's happening imo
But I agree that it isn't all that useful for newcomers. I guess this is just me wishing metatables didn't seem like dark magic to everyone lol
yeah people are really scared of them 😅
I understand now i will do more research so i understand more thank you
Well, I’ve tried my best to find something but couldn’t, best I’ve found it the regular placement methods :/
ScrapCases (2).zip
You'll get a better response if you describe the problem in more detail - "there's no button to open the case" isn't very clear.
There isn't anything in vanilla zomboid I'd describe as "you press a button and a case opens." This may be a language barrier, but it's not practical to look at a mod without any idea of what it is meant to do or how it is broken.
About my vehicle collision destruction mod, been a little busy lately... But anyways i don't think i want to predict vehicile collision using raycast anymore, I've been wondering if it's possible to simply create an Object the size of the car and Position that object ahead of time according to the vehicle velocity, and using that new Object to detect what other objects intersected with it... I don't want to use raycasts because they get terribly laggy and am having a lot of difficulties with using it.
What I used in one of my mods to detect a crash was to check for vehicle parts damages on playerUpdate. I don't know how much it impact FPS but I haven't got a single comment regarding lag.
You'll have to search through the worldobjects in front of the car and guess which one you hit tho.
For some reason I cannot get my clothing icons to appear. I have all of the icons in the texture dirrectory and they are properly named in the script.
nepenthe i see the easy distributions mod is doing well
@agile nacelle do you need to know before the crash happens, or just that a collision of sonem type did happen?
i havent updated box more in a while but im happy i helped you
nvm ffs I think I figured it out.
survival rifle is also cool but after the great plane crash into my house it was the only thing left
miraculously
(one of the week one events is a plane crash)
Sorry but am trying to predict a crash, not when it actually happens
Yes
Great advertising material there - a photo of the plane crash devastation with you standing out the front holding the rifle. "Folding Survival Rifle: The Ultimate Survivor!"
yes to before, or that it happened lol?
well now let me show you
Before
i didnt have the survivor rifle equipped at the time and by that point i put it in my car
The dashboard flickering effect on damage in cars is just a check every 10 ticks to see if the condition has gone down.
The reason why i need to predict a crash is to prevent the vehicle from coming to a full stop because of an actual collision
Good luck; I think most of what you'd ideally use is hidden away in the java bullet physics libraries.
I looked at the decompiled pz code how it detects a collision and i didn't really get far to find out how it detects object intersecting
Noted
But i also would like to know if it's possible to create an invisible object just for checking intersections
https://github.com/bulletphysics/bullet3 <-- I expect it will be of zero help, but that's the physics library used for cars (before modified for Zomboid)
are those corpses all naked?
What sort fo plane was that!
wait really? jesus christ
them not using events for stuff is not a first tho
yeah, I was sad when I discovered that.
no i take all of their loot and drop it on the ground incase i need it later on
i do it for all zombies on singleplayer at least because my PC can handle it
multiplayer it depends
if i like the loot i drop it
if i dont i leave it
Fair enough
no more hoarding 
last save i spent hours putting shit in warehouses by myself
next time its gonna be on multiplayer with new players
tell them "this is how you play" and see how long it takes for them to figure it out
while im in the dev channel so i gotta get on topic
what stuff do yall think should be boxable?
i know liquids and stuff like colas or water should be boxable
but thats tricky
i asked that here before and there wasnt anything conclusive
and on my own efforts it didnt work out
A modder told me that the library that i was using the raycast for, creates an object to check for intersections for the raycast... So i assume it's possible to create an invisible object
Full bottles only?
The mod should work like this:
I find or receive this item (the case) in some way.
When I open the case, a loot table with item drop chances should be triggered.
After that, the item is given to the player, and a chat message appears saying what item or weapon dropped.
yes
problem: the liquid water counts as both seltzer water and just water
so when i tried to make a box of water it spat out 6 seltzer 6 regular
How do you open the case?
SpecialLootSpawns.lua
savior
The code is written in Lua.
You could hack that, or just set all bottle back to water after it is done.
I'm just a beginner modder and I wanted to create this mod for myself.
Please let me know what I did wrong or what needs to be fixed.
well the fluidtype when applied as "fluid[Water]" spits that out anyway
And the item name is generated dynamically based on the contained fluid.
i'll have to figure both methods out and see what the pros and cons of each are
that function is actually disabled
it's a property of the Base.WaterBottle's FluidContainer
so i just need a function to change the fluidcontainer upon it opening the box
yes, let it make 12 bottle/for each get the fluidcontainer, set it to be full of water.
using an OnCreate in the recipe
How is it supposed to work? Right click -> context menu or something else?
+🤣
makes sense
Post the function that adds the context menu option
I already realized that I made some mistakes in the code.
That's a lot easier to help with than "here's a mod, fix it"
I'm gonna go explore the internet and learn a bit more
My big oops for the week: despite deliberately checking to make sure I didn't have an accidental dependency on Starlit, I uploaded a mod with an accidental dependency on Starlit.
Either Starlit's field exposing feature keeps working after reloading lua, or (more likely) I screwed up when testing the mod without starlit active.
But on the plus side I learned more about metables fixing it so it works without starlit!
My summary of lua metatables: "What if anything could be anything? That's a great feature that I'm sure users will not cause loads of confusion with!"
it probably isn't possible for anything i do to persist after lua reload
Events.OnFillInventoryObjectContextMenu.Add(function(player, context, items)
...
end).
Is it not a menu call?
OnFillInventoryObjectContextMenu is the correct event, what is the code in that function?
Usual approach is get the "primary item" in case items is a table of items, check if it's your item type, and if it iss use context:addOption() to add the context menu
local doDIYContextMenu = function(playerNum, context, items)
local primaryItem = items[1]
if not instanceof(primaryItem, "InventoryItem") then
primaryItem = primaryItem.items[1]
end
if primaryItem:hasTag("DIYSchematic") then
local playerObj = getSpecificPlayer(playerNum)
readOption = context:addOption(getText("ContextMenu_ReadDIY"), items, DIYonLiteratureItems, playerObj);
end
end
Events.OnFillInventoryObjectContextMenu.Add(doDIYContextMenu)
anyone know where is the loading screen script
i want to know how to make this apng work
so how this ^ works, is using PZ's new state Engine.
IE, its always "Moving" just PZ itself controls it, sort of like how keyframe's are controlled in animations > FBX
TL:DR, you might succeed in playing one, but you wont have control over it, fine tuning wise
how am i supposed to... get a class in lua???
What are you trying to do ?
trying to look for a way to check for intersecting objects
^
but how am i supposed to use CollisionManager class when am in lua and theres no methods for aquiring it
in java all you have to do is just import Directory.Goes.Here
import is not a thing in lua so
if this class is exposed you can just access it, no need for anything like importing, kahlua dumps everything in the global namespace
i don't expect something like this to be exposed though
if you have a decompile you can check LuaManager.Exposer#exposeAll
and if it is exposed then you just type its name yeah
You're supposed to optimize the raycast do you don't call it every ticks tbf
And also not casting thousand of rays every tile you raycast
Tho the new method you described looks scuffed
true
i just thought maybe making an invisible object for collision detection would be easier and more efficient... so far it seems like that is far from the truth
collision detection just isn't something we have much access to, so something that should be easier may actually be impossible or more complex 😅
happen to have a replacment update on this? I get really confused when Im using moddata vs global and making sure I dont send the data to a local players files instead of the host files. Mostly I just keep reading MrBounty's page and hoping I get it right
Thanks boss!
Wacky probably stupid question but why do my animsets crash the game?
hello hello
All I did was edit the sprinter animations to use "'bob_sprint" and made them faster
But it no work
i hope u guys dont mind if i share my mod, havent released in a while due to being busy 🙂
B42 ?
Yes
Sorry for the delay
I can send the full anim sets folder if you wabt
he must be a beta tester he leaked it
Hi im new to making mods, is it possible to make a clothing item attachable to the belt? i mean i just managed to do that but the model of the item does not show when worn on the belt, only when i equip it in the face. I made multiple masks and i want them to also be able to hang by the waist.
Also i kinda already did that but only by making a new item that gets worn in the thigh and then adding a context menu to swich between both items. But since i have 9 different masks i dont feel like making 9 extra items and having to edit each one of the models to be at leg height since each mask is different.
https://steamcommunity.com/sharedfiles/filedetails/?id=3508590486
i just finished my first zomboid mod, would really appreciate some testers
I wrote it like this, and it worked for me..
require "ScrapLootTable"
local function getDropResult(caseType)
local lootTable = ScrapLootTable[caseType]
if not lootTable then
print("Нет таблицы лута для кейса: " .. tostring(caseType))
return nil
end
local totalWeight = 0
for _, entry in ipairs(lootTable) do
totalWeight = totalWeight + entry.chance
end
local roll = ZombRand(totalWeight)
local cumulative = 0
for _, entry in ipairs(lootTable) do
cumulative = cumulative + entry.chance
if roll < cumulative then
return entry.item
end
end
return nil
end
local function onOpenScrapCase(player, item)
if not item or not item.getFullType or not player then return end
local caseType = item:getFullType()
print("Открытие кейса: " .. tostring(caseType))
player:Say("Открываю скраб...")
player:playSound("OpenScrap")
local dropItem = getDropResult(caseType)
if dropItem then
print("Выпал предмет: " .. dropItem)
player:getInventory():AddItem(dropItem)
player:Say("Выпал: " .. dropItem)
else
print("Ничего не выпало из кейса.")
player:Say("Ничего не выпало.")
end
player:getInventory():Remove(item)
end
local function buildScrapContextMenu(playerIndex, context, items)
local player = getSpecificPlayer(playerIndex)
if not player then return end
for _, entry in ipairs(items) do
local item = entry
if not instanceof(item, "InventoryItem") and item.items then
item = item.items[1]
end
if item and type(item.getFullType) == "function" then
local fullType = item:getFullType()
if fullType:contains("ScrapCases.Scrap") then
context:addOption("Открыть скраб", nil, onOpenScrapCase, player, item)
end
end
end
end
Events.OnFillInventoryObjectContextMenu.Add(buildScrapContextMenu)
Check the red warning in this wiki page
What does it mean make copies?
Basically you need a copy of your animsets inside the B41 mod structure so B42 can detect your animsets, but the animsets from the the B42 mod structure only are really used
This is a recuring bug which the devs have yet to fix ...
And quite an important one
So it's working now?
Does anyone know if setChance, in relation to Randomized Buildings, controls the chance for a building to appear as certain type? Such as RBLooted. Or is it used to control the chance of a RB's in general?
What's the way to delete all corpses from the save?
Now I'm confused
So would I have two mod folders, one of the b41 file structure and one of the b42 one?
Hmmm I'm having a hard time getting a font color change on ISScrollingListBox, it doesnt seem to work the same as ISLabel?
it's a hashmap, so it's... weird.
But some "random" stories will always trigger when a new chunk is loaded
However I do think the immediate answer is the chance is just the weighting that a specific story will be chosen once the game decided to use a random building story.
But if you change that then you need to also rebuild the hashmap and somewhere else it calculates the totalchance (sum of all chance values) so that needs to be redone too
bonus from my notes: here's how to manually force Kate and Baldspot to show up; just run this when close enough to their house that it is loaded in the active cell.
kb=RBKateAndBaldspot.new()
kb:randomizeBuilding(IsoCell.getInstance():getGridSquare(10744,9409,0):getBuilding():getDef())
in the car script which line is responsible for stronger ramming of zeds.. like number of zeds can stop you before your car stops moving?
It's probably a combination of mass and speed. Do some experimenting - boost a vehicles mass & engine power, see how you do ramming zombies.
It will make a number on how vehicle rides by default tho
hey im checking the hammer item and i have a question, where does it say what model to use? or is it specified somewhere else?
{
DisplayCategory = ToolWeapon,
MaxRange = 1.1,
WeaponSprite = Hammer,
MinAngle = 0.67,
Type = Weapon,
MinimumSwingTime = 3,
KnockBackOnNoDeath = TRUE,
SwingAmountBeforeImpact = 0.02,
Categories = SmallBlunt,
ConditionLowerChanceOneIn = 30,
Weight = 1,
SplatNumber = 1,
PushBackMod = 0.5,
SubCategory = Swinging,
ConditionMax = 10,
MaxHitCount = 1,
DoorDamage = 9,
CanBarricade = TRUE,
SwingAnim = Bat,
DisplayName = Hammer,
MinRange = 0.61,
SwingTime = 3,
KnockdownMod = 0,
SplatBloodOnNoDeath = TRUE,
Icon = Hammer,
RunAnim = Run_Weapon2,
IdleAnim = Idle_Weapon2,
BreakSound = HammerBreak,
DoorHitSound = HammerHit,
HitSound = HammerHit,
HitFloorSound = HammerHit,
SwingSound = HammerSwing,
TreeDamage = 0,
MetalValue = 25,
CriticalChance = 20,
CritDmgMultiplier = 3,
MinDamage = 0.5,
MaxDamage = 1,
BaseSpeed = 1,
WeaponLength = 0.23,
AttachmentType = Hammer,
Tags = Hammer;RemoveBarricade,
}
Trying to upload a mod to steam workshop and it is saying I have no mod.info file when I have one in C:\Users\REDACTED\Zomboid\Workshop\MODNAME\Contents\mods
Mod works in game so must have the file organization wrong
Where is your mod.info at the moment?
well... if youre saying that mod.info is in the mods folder that is incorrect if youre saying its in C:\Users\REDACTED\Zomboid\Workshop\MODNAME\Contents\mods\MODNAME then that is correct
K Ill do that
Worked. Thank you so much
- In this form, yes
WeaponSprite = Hammer
"But a sprite is not a 3D model!" I hear you cry.
we all cry
You are correct.
i am crying
But it's a holdover from Zomboid being a 100% sprite based game.
model Hammer
{
mesh = Weapons/1Handed/Hammer_Forged_Hand,
texture = Weapons/1Handed/Hammer_New,
attachment world
{
offset = 0.0150 0.1100 0.0000,
rotate = 180.0000 0.0000 180.0000,
}
attachment Bip01_Prop2
{
offset = -0.0131 -0.0221 0.0007,
rotate = 0.0000 -86.9102 0.0000,
}
}
``` the model definition then looks like that
Yeah, it's not long-term thing but a "confirm if this affects what we think it will affect" thing.
I dont want to give up on my UI Font color fight but Im not sure what to try next. Does anyone know if you just cannot color ISScrollingListBox font?
me?
Yes, with the hammer - depending on what you're after we may have more specific pointers
oh my bad lol
that look great... gone. It looks gone. lol
i will try to make it short
I can post it later but dont want to spam 32's help
im making a mask mod that adds masks as my first mod, i was able to do everything so far, but i also want them to be attachable to the belt
i was able to do that too, but they look like this
facing down and at knee height
I can think of two approaches:
- make a clothing item of the mask-on-belt, and teh user right-clicks to swap - like hoodie -> hoodie-up.
- use a hotbar slot, which is based on the item having
AttachmentType =in the item definition and the hotbar slot accepting that attachment type
And somwhere in the hotbar slot definiton it defines the transform to use for attaching that type of item to that slot.
You can simply rotate items in blender and export them at the angle you want when its in game. I had to do that a few times with my new fishing rods and my custom mega-wrench for another mod.
The nice part is, if you export/overwrite the item it will update in game live so you can test in blender
unless you 1) want different rotation/locations for different uses (e.g.: worn on head & worn on belt)
i was thinking of doing that but i dont know how it would work when worn on the left and right
Yeah, my method works if you are using the same code for another base item so the bones/model line up.
or 2) it's something zomboid is fussy about, like weapons which have to be done just right or attachments won't work and teh bullets come out of empty space
Getting the fishing rods aligned into the "normal" position also had it correct in hand/back
How are you attaching to the belt? Attachmenttype & hotbar slot?
im doing this
{
DisplayCategory = Clothing,
Type = Clothing,
DisplayName = Orange Korp Mask,
ClothingItem = ElBabiMasks_Orange_Korp_Mask,
Icon = Orange_Korp_Mask,
BodyLocation = MaskEyes,
CanHaveHoles = false,
BloodLocation = Head,
BiteDefense = 10,
ScratchDefense = 20,
BulletDefense = 100,
Insulation = 0.3,
WindResistance = 0.3,
WaterResistance = 0.2,
Weight = 0.1,
WorldStaticModel = Orange_Ground,
StaticModel = Orange_Ground,
AttachmentType = Hammer,
ToolTip = Tooltip_item_MaskOrange,
}
the item is both a clothing and attachable to the belt
try attachment type=Walkie
more likely to work than hammer.
Since that is for walkie-talkies are similar, while a hammer is intended to be held by teh bottom of teh handle but is very different when on a belt
Also has a bit to do with the origin point/0,0,0 position of the model file
almost there, the height is good but still facing down (ignore the texture looking weird, i forgot to fix that)
I got frustrated when testing mine because if I export something in a position I like it would work, but if I "apply all transforms" It locks in the new zero point and the model in game loads differently
i was thinking of making a static model with the rigth rotation, but it would only look good on one side
unless it is posible to only make it so that it can be attached to one side of the belt
scale is fun when you forget you had 3 settings and missed one >_>
yeah, that does look like a custom mega wrench
Knife = "Belt Right Upside",
NotKnife = "Belt Right Upside",
Hammer = "Belt Right",
HammerRotated = "Belt Rotated Right",
Nightstick = "Nightstick Right",
Screwdriver = "Belt Right Screwdriver",
Wrench = "Wrench Right",
MeatCleaver = "MeatCleaver Belt Right",
Walkie = "Walkie Belt Right",
Sword= "Belt Right Upside",
Holster = "Holster Left",
HolsterSmall = "Holster Left",
see if any of those work better than Walkie. for AttachmentType
will do
nope, walkie still looks the best
the others are either too up or too down, also either facing up or down
where are the AttachmentTypes at? maybe i can make a custom one for the mask and tell it the rotations from there? or make it so that it can only be worn on the left side and make a model with the fixed rotation?
errr I thought there was a rotation setting on items attached to zeds like the machete in the gut or screwdriver in the head. I dont remember off hand though sorry
well if it exists then i will start looking for it
So who is our most knowledgeable UI modder?
media/scripts/KS_Attachments.txt has the numbers for the new attachments point offsets/rotations
thanks i will look into that
I'd say Notloc or Rocco.
for now it looks like I can go without the scrollbox and the font color takes.
Quick other question about workshop page. How do I get this image to show that links to the indie stone permisions page?
The link shown is what I have currently
No, in the same mod
You can mix b41 and b42 mod structure
See the Mod structure wiki page
You can't make custom one?
Think I'm just about ready to publish.
You can, but's more effort than finding a default one that works since you need to define the new attachment them programatically update existing hotbar slots to support the new attachment type
That looks great
Also, zombie fish... nasty.
Thanks guys. It's a big rework of fishing in general . Seasons, moon phases, weather and skill can all change catch rates or rod and line breaks. Water tiles are counted in the 40x scan zone to determine how man fish are in the pool 0-40 depending on the setting instead of 25. A fourth size category Legendary which is not only rare but difficult to land. Rod as well as line has a break chance and rods can now be configured with their own stats. Some rods work better on some fish or sizes, bait too can help target a set of fish. I added ten new fish, two new worm types and a plastic lure. Large fish and the trophy fish need a larger size of water and population to catch. Added four rods with different settings but new ones can be configured. The angler trait will show the different fishing condition factors in the casting UI. The Fish journal can be treated a bit like a container of it's own and can be crafted. It can hold up to ten fish per book and removes the fish from your inventory. The fish can be "returned" to your inventory, "Prepared" cut into fillets (some fish can weigh a lot more than your inventory) "Catch and Release" will generate the record of the fish in the Catch Record item.
I hope to tie the items in this mod to Soulfiltchers quest system for tournaments and rod quests.
Hello everyone, i try to create a mod for B42 but i don't see it in my game, are the file paths in my mod correctly set up?
Contents/
└── mods/
└── Escape From Knox County/
├── 42/
│ ├── mod.info
│ └── media/...
└── common/
└── media/...
or is it my mod.info ?
name=Escape From Knox County
id=EscapeFromKnoxCounty
author=Baba Yaga
description=a mod.
any ideas ? thanks.
Looks good but I guess it's missing a poster
I don't think it matters
Which folder did you place your mod in ?
I don't think that's the reason bcs a mod can work without one
This is some mmorpg type of fishing goodness.. 🎣
Yh good job bro that mods going to be top tier and I think it’ll have a lot of people using it lol
@bright fog C user zomboid mods etc
I've redesigned a crafting system with that in mind as well. Failure and critical chances, multiple skills required for some items and skill caps for gains ect,
I wont be bored anymore when camping near bodies of water. 🙂
Would you be mad if I added a rare random chance to spawn a zombie? instead of catching a fish you caught a body?
Something to plague my AFK fishing players hahahah
people hate losing progress bro. if that zombie bites them, I doubt they’d love the mod or fishing for a while after it 😂
Yeah it would be a sandbox setting for sure but Cooterville uses Skill journal with 100% settings
Ah fair enough. Last time I played on a server, they capped it at like 75 or something to keep it entertaining I guess idk 🤷♂️
I want people to be able to PvP if they like and not get set back. Lose your items not your time.. kinda?
Yh that’s fair bro, you seem to have it covered as a toggle setting anyway so it’s choice rather than a default 👌
anyone have tips on how to pull models/textures from the game? I'm trying to rig up my zomboid model as a vtuber, and I need to pull some clothing assets to do it
NEVER tried to do this before so I'm pretty stumped
nope, that's right
without the \ would be for b41
remember that if you used it wrong, the game wouldn't even let you load your mod
Please, for the love of god
I need help to cross the bridges
Those invisible walls are annoying af
thanks, that's what I thought but I haven't fired up PZ in awhile
You need to put it in Workshop, not mods
Yeah i read it and it says go in the c user zomboid mods if you are creating the mod no ?
is this a B42 thing
No you didn't read it ...
You have a whole mod structure example at the bottom of the page too
It's explicitely said in the guide that the workshop folder mod structure should be used bcs it gives more possibility and overall reduce the risk of multiple mod copies
Ok
Yup
Massive bug that makes basically all bridges unusable
Besides the main road ones
Ahh shoot ok sorry, I dont know b42. Good luck!
Sounds like a tile property issue
This is mapping issue when bridge is treated as water tile
DM @silk wren, he had same issue with Raven creek bridges
anyone know how to change the game music,like i want to replace the music when fighting etc.
looking through the plumbing mod and counting up the print statements... thats gotta go.
uh oh, I'm making more notes. I gonna need the "learn how to make isometric pixel art" crash course plugged in to my brain
Guys, do you know all the names of vanilla loot zones? If yes, can you list them?
B42 Soul Filcher Building Time transplant made by me, available here: https://steamcommunity.com/sharedfiles/filedetails/?id=3509299191
Don't let TIS know that furniture can be painted...
If I wanted to create my own custom evolved recipe template how would I go about doing that? Is it as simple as naming a new template and then giving the items I want as options to add that tag in evolvedrecipe = ?
Anyone have tips for adding custom animation clip to either B41 or B42? I keep getting "anim not found" errors. I need to be using a ".x" files placed within "anims_X", correct? Along with a custom new .xml file defined under "AnimSets", right?
I see B41 mods on workshop using .fbx files, which confuses me. I thought only B42 could use .fbx? Maybe neither can? Animation is kicking my butt lol
both can
if you're getting 'anim not found' then the issue is with the animation file
i recommend using fbx since the exporter for that will work more consistently
the name of the animation track in the animation file is what you need to reference, not the name of the file, so if those don't match that could be the cause of the issue
hey does anyone know what is wrong with my model? it looks like it has a bunch of tiny holes all arround it and is invisible in blender if you look it from a certain side
I mean, your screenshots of the model in Blender show the holes too ?
yeah, its like its like its filled with infinite holes
Where did you get this model from ?
Also for modeling specific questions, ask in #modeling or in the case of your issue you can most likely find resources online to fix your problem by just searching your issue on internet
a friend of mine has a friend that makes models for mods, he made a mod and tossed me his files to add more masks
didnt know that channel existed, will go ask there
You need to show better screenshots of the model in Blender
hey guys can anyone tell me how to change the icon? (im new sorry)
Wdym ?
That's an existing item ? Or it's one in your mod ?
does anyone have a mod for scaffold side to make it breakable by zeds?
The Icon = sets the icon for when the item is in your inventory. For Icon = Luger, your mod needs a media\textures\item_Luger.png file.
ok so for my mask mod i managed to do everything, and everything works exept one thing
when i set the blood location to "UpperLeg_L" so that the game gives protection when i have the mask worn on the leg the item refuses to work
item ElBabiMasks_Blue_Korp_Mask_Leg
{
DisplayCategory = Clothing,
Type = Clothing,
DisplayName = Blue Korp Mask,
ClothingItem = ElBabiMasks_Blue_Korp_Mask_Leg,
Icon = Blue_Korp_Mask,
BodyLocation = Mask,
BloodLocation = UpperLeg_L,
BiteDefense = 10,
ScratchDefense = 20,
BulletDefense = 100,
Insulation = 0.3,
WindResistance = 0.3,
WaterResistance = 0.2,
Weight = 0.1,
WorldStaticModel = Blue_Ground,
ClothingItemExtra = ElBabiMasks_Blue_Korp_Mask,
ClothingItemExtraOption = Wearonface,
ClothingExtraSubmenu = Wearonleg,
ToolTip = Tooltip_item_MaskRed,
}
it just wont load in the world, and if i try to spawn it i get an error and nothing happens
You sure that UpperLeg_L is a thing ?
I've placed it in every location that's required in the Build 42 structure, but it still gives the same error. Even the template throws the same error.
Hey, bit of a long explanation and question(s). If this isnt the correct place to post, I will apologize and repost elsewhere.
Hey, I had a question about mods, modding and what is and is not possible to do with mods. I have no real experience modding, but I'm working on creating a server and have some ideas for things I might like to add (either requests or commission) and I want to have an idea of how troublesome it would be to do before I start seeking prices. (mostly so i don't get ripped off or ripping off others. If there is anyone out there who might be able to assist, it would be appreciated.
- With build 42, is it possible to set "zones of effect" for mod activation? Let's say, for instance, I want to have an asset with a right click option to reactivate power or water in an area (not radius).
- Is it possible to set new assets to a specific location, without creating a whole new map? For example, subway entrances, electrical junction boxes, or even add a right click option to hydrants and telephone poles.
- Is it possible to a global replace of all assets meeting a specific name; for example, all bathtub assets on the map are replaced with a new asset image? For stuff like cleaning the bathtub, toilets, sinks, doors and other tiles that should be cleanable with mechanics like clean dirt?
Sorry if the text was long, and I will likely have follow-up questions. Again, if this isnt the right place or if DM is better for this sort of thing, please let me know.
The included template is not updated (last time I checked)
Have you read this? https://pzwiki.net/wiki/Mod_structure
I've never seen coding language based on enchantment table
Copy that whole text you’ve wrote. Download grok on the AppStore. Paste that question in it. Your answer will be long 😂
- I believe some recent changes added that
- Adding right click options to tiles is possible yes, and not hard at all, tho depends what you want too
Adding new tiles without creating a map is possible, you can place sprites on the map via Lua but the area needs to be loaded - you can make texture packs I believe, some mods do that on the workshop, and you can modify tiles from Lua too when doing an action
i did bro and im still getting the error
Your mod throws an error ?
its working fine
Lmao
Doesn't say it's YOUR mod.info
If you remove these from the cache folder, do you still get the problem ?
Are you on Linux ?
Nah
Wibdows
I could have seen that with the screenshots :|
you have no mod folder
yours is Workshop/'94 Honda Civic EX/Contents/mods/42/mod.info, should be Workshop/'94 Honda Civic EX/Contents/mods/YOURMODNAME/42/mod.info
oh man, nice!!!! i'll try that
(B42) If I wanted to create my own custom evolved recipe template how would I go about doing that? Would you think its something that would be too much for a beginner?
Hello, Is there anything about 3D weapon models in the PZ modding wiki?
What do you want to know
You should be fine, try to check vanilla evolved recipes and figure out how these work exactly
Idk if the wiki page regarding these is good enough to understand them
Ill try to explain it, so, i try to create a weapon and everything works properly but until now i was using the assault rifle weapon sprite, but now i want to use another weapon sprite but the gun is now transparent
Im sorry im new so idk if i explain it well
And this part is quite difficult for me
Hi guys, do anybody knows where to find the code part of the zombies logic?
and is it possible to mod it with lua?
on b41 and b42
probably uv
how exactly did you apply the new the texture
zombie is java and xml
yes its possible but its not straight forward
it depends on what you want to do exactly
if you could provide more details
you might be looking at the strings that are specific for lua bot for the item scripts
i could be wrong
you can modify the object by changing it into thumpable
if that doesnt work despawn the object and respawn it as thumpable
name the icon file with prefix Item_
probably normals are flipped or vertex isnt assigned to bone
thanks for the answers, i just made it not give defence when worn on the leg and the model was fixed but i still dont know how
the good thing is that everything works and i will be posting it tomorrow or the day after
Ur the best!!! thx so much
https://pzwiki.net/wiki/Evolvedrecipe_(scripts)
This does a pretty solid job of explaining everything. But because Im trying to use a custom template for the evolved recipe to define my own ingredient list Im running into problems I think? Or should it be that simple
what I want to do is
Set a target
Make it so that the zombie is not able to attack or set the damage to zero
Access the zombie's inventory while the zombie is still alive
inventory spawn when the zed turns to corpse item
you can only fetch visual or add items you wish to spawn when it dies
to set target
you use setTarget()
to prevent damage you use the zombies ln hit event and nullify the damage
to prevent then from attacking its tricky
you can use the cheats but thats not adviseable
or set useless but that has issues too
or you spam setTarget(nil)
Wdym by template ?
Hi, I'm trying to write a mod to spawn my character at specific coordinates. I have gotten it to show up in the world selection and spawn location; but when I use my spawn, my character spawns in seemingly random locations like the prison. My best guess is that it is skipping over my spawn list. I'm not really sure how to remedy this.
Do you teleport the player ?
I don’t think so. How would I do that?
What did you do to add a spawn point ?
Here is the code
I referenced the example mod.
Wrong coordinates ?
If it's a for map spawnpoints, use this system, not a teleport
How do I make them right?
How did you get these coordinates ?
i used another mod,
no
What did you expect exactly ? 😭
That it would put me in a consistant place
But you have multiple coordinates here
Oh
Oh wait no you don't
I'm unsure how these coordinates are used but they don't look like x y coordinates
Check the mapping Discord
They look the same to the ones on the example mod
They should have some resources regarding custom spawn points
I think I forgot to ad a z position
I believe the function name should be SpawnPoints, not Spawnpoint
Not able to double-check at the moment
I’ll check tomorrow, thanks
Map Cell X, Map cell Y, x in Cell, Y in Cell.
In B42 you can do
unemployed = {
{ posX = 3905, posY = 12254, posZ = 0 }
But I'm not sure if that's a N42 change or yo coudl always use both syntaxes
Do I need to add posZ?
First: Are you on B41 or B42
B42
You only need to do unemployed if you don't have profession specific locations, and you can use posX/posY/posZ
function SpawnPoints()
return {
unemployed = {
{ posX = 3905, posY = 12254, posZ = 0 }
}
}
end
replace the co-orinates with where you want to spawn
This mod is also an option: https://steamcommunity.com/sharedfiles/filedetails/?id=3287958074
Okay, I was wondering if I could just put unemployed. Just out of curiosity, could I drop my character if I change the Z position?
No, it triggers an error about not being a valid location if you try to start in the air
You can start on the upper levels of a building though
Okay, thanks
When I try the following, it adds the axe on the tile at the player's feet, but there is no axe sprite visual to indicate an axe is there... I can only tell it is there because it shows up in the world tile's inventory UI box...
local square = player:getCurrentSquare()
square:AddWorldInventoryItem("Base.Axe",playerX,playerY,playerZ)
I also tried instancing the axe using
local axe = instanceItem("Base.Axe")
local square = player:getCurrentSquare()
square:AddWorldInventoryItem(axe,playerX,playerY,playerZ)
and got the same result!
Does anyone know why this may be/how to fix it? I'm on B42.9 and this is in debug mode.
(trying in non-debug now just to see if this issue will duplicate)
Same result!

Don't mind the axe to the left - that was one I picked up from the stack and manually dropped over there
There is probably an extra step to place the world model in the world. Look up the timed action for putting stuff on the floor, or dropping stuff; that should have the steps you need in the complete() step
@ancient grail i put a models file in 42.0.0/media , an fbx file in common/media/model_x and a png image of the weapons 3D texture in media/textures and in the models file i'm lost with this part :
mesh = weapons/firearms/AK47,
texture = weapons/firearms/AK,
i'm sorry if i did wrong i don't really understand this part for the moment
Does anyone know where I would find the base game models for the long gloves and long boots? I'm trying to retexture them for use in another mod
They are not models
Is it just a retexture of the base model?
Some clothings are simply layered on top of the character texture
And do not use models themselves
That's the case of tshirts for example
Or even pants
im not familiar with b42 sorry
What would be the best way to create multiple new boots/gloves if that's the case then? I need custom rainboots looking boots and long gloves
Simply make a new clothing item
Working on a power rangers mod and the gloves/boots are seperate from the jumpsuit
Right, but normally for models that'd use a related fbx and texture and whatnot
What's the problem ?
meh, guess I need to do more digging
No need
Just check how the clothing items that do not use a model work
Go check the scripts of tshirts
@bright fog i im creating a weapon just to do some test and to learn too , but i dont understand how to add a custom 3D model to my weapon
Oh thank you Ill Check that
So each .xml in clothingItems needs to correspond to a matching entry in fileGuidTable?
yeah
no worries, adding each colors power weapon, still plugging away at all of this lol
I retextured the boiler suits though
Does fileGuidTable.xml allow comments? // doesnt seem to work
in XML comments look like this <!-- comment -->
jesus christ am just spending days wasting my time on figuring out how to make the raycast work
am geneuinly pissed off
What's the issue ?
You're trying to use my raycast or you wrote one from scratch ?
well i just
sampled from you
and wrote the rest
basically wrote according to what i understood
_checkForIntersectedObject keeps returning nil
all my problems could probably be solved just by visualizing the raycast ngl
Didn't I leave in stuff like this ?
i didnt notice anything for visualizing the raycast in your code
Sec
Also, you shouldn't copy my code in your own mod, tho I should also probably provide better tools to customize the raycast, more than what I already did
VisualMarkers.AddLine({x=minX,y=minY,z=0}, {x=maxX,y=maxY,z=0}, 1, 1, 0, 0.2)
When you have debug mode activated
And you need to activate a thing in the context menu debug option
Tho you don't have my whole addon
i have no intentions for copying someone's elses code, just investigating how someone else achieved their goal and do the rest on my own no need to worry
So you can't use these tools
👍
I would suggest just making a local copy of my mod framework, and modifying directly the code in this copy if you want to test things
That way you can use the line drawing debug tool to show the ray cast
@bronze yoke is this new to Umbrella ?
noted
yes, we use (exact) classes now - but if you're getting this error that just means you forgot to declare a class
I mean "forgot" 😅
How am I supposed to use ---@class exactly ? I never used it so idk how it works
local MyObject = ISBaseObject:derive("MyObject")
-- error: you are adding a new field to an instance of ISBaseObject returned by derive
function MyObject:myFunc()
...
end
---@class MyObject : ISBaseObject
local MyObject = ISBaseObject:derive("MyObject")
-- no error: you are allowed to modify MyObject, a subclass of ISBaseObject
function MyObject:myFunc()
...
end
There's no way to just detect that automatically ? Bcs derive means we are creating a new class anyway ?
there's no way
it wouldn't give much benefit anyway since you still need to declare things like fields in the class declaration
I hope this doesn't confuse new modders regarding their own use of derive since not adding ---@class should have 0 impact on their code anyway
all type annotations have 0 impact on code 🤷♀️
I mean yea but isn't this one intrusive ? Showing a potential mistake when in reality there isn't ?
What's the reason to having this error in the first place ?
you made a mistake when you forgot to declare a class
But I never declared any class
and that's bad
How is it bad ?
the language server won't understand your class
it thinks RayBeam2D *is* ISBaseObject
prevents accidentally writing to fields that do not exist
Why is it an issue writing to fields that do not exist ?
it's usually a mistake
Eh
there's no point writing to a field that doesn't do anything
I mean that sure okay
if it does do anything, you should have written a field annotation for it
otherwise there is literally no way to give a warning for typos, because any typo could be a new field you're making right now
Like this ?
yeah
So I should declare fields early under the class declaration ? Or when the field gets created ?
in your class declaration you want```lua
---@class RayBeam2D : ISBaseObject
---@field ignoredObjects type description
Bcs for example this field is created in new
But what about fields that are "unique", as in sometimes defined in an instance, sometimes no ?
just add | nil to the type
i advise against having too much variance in types though
Makes sense
however | nil is generally fine
Yea usually means you have to add per type case code
Which is messy overall
I had tried that once and was horrible to handle lol
for that reason i'd prefer to use a null value of the same type when it makes sense to (empty string, -1 or 0), nil usually would take the place of an object
In my case here I don't have a need for |nil bcs I have default values
---Create a new RayBeam2D instance.
---@param startPoint table
---@param vectorBeam Vector2
---@param _ignoredObjects? table|nil
---@param _deltaLength? number|nil
---@return table
function RayBeam2D:new(startPoint, vectorBeam, _ignoredObjects, _deltaLength)
local o = {}
setmetatable(o, self)
self.__index = self
-- parameters
o.deltaLength = _deltaLength or 0.01
o.startPoint = startPoint
o.vectorBeam = vectorBeam
o.ignoredObjects = _ignoredObjects or {}
-- initialize vectors and values used in casting the ray
o:initialize()
return o
end
but you can't always do that because sometimes you want all possible numbers/all strings to be valid values, then | nil makes sense
Doesn't allow you to do a not check tho
Also idk what the typing for that would look like
just string or number
I think I need to make a wiki page explaining the typings
But how do you tell others what the default value should be
for strings it's a safe assumption that it will always be the empty string, for numbers it's usually -1 but you can use a constant if you want it to be clearer
Like ---@param _deltaLength? number|nil
How would I write the typing that the null value should be 0 ?
i just wouldn't try to represent it with annotations, but you could technically do number | 0
Not defining it with annotations sounds cursed as shit bcs it would lack proper indications
then you can put it in the comment
the benefit of a null object is generally that you don't have to check it as often as if it was actually nil though
It's really a per case application tho
Also that sounds like a bad solution to something that should be normalized I feel like
Tho if you can do |0 then that's good
No idea for strings tho ?
string | "" i guess
Does that work ?
yeah?
it's not really meant to be used for this though, to the language server string | "" means literally nothing because "" is already included in string
it's mostly used to annotate when there's a specific set of possible literal values (e.g. 0 | 1 | 2, "one" | "two" | "three")
Like for tables ?
---Returns a wall on a specific side on the square.
---@param square IsoGridSquare The square to search.
---@param side "north" | "west" | "northwest" | "southeast" The side wall to find.
---@return IsoObject? wall The wall, if any.
---@nodiscard
IsoObjectUtils.getWall = function(square, side)
Ah yea
nodiscard, interesting
Lots of typings I'm not familiar with
Also isn't there some typings that are just fake typings ?
Like @private, there's no real way to do that in Lua is there ?
nodiscard basically means 'if you call this function you have to store the result', useful for functions that don't have side effects
Yea I'm on the typing page
it adds a warning if you access it from somewhere you shouldn't
Yea it's just a warning
i don't personally find mimicing accessibility very useful so i don't use it, but i do use the _ prefix as convention for 'things that are not api'
i don't really care if people access internals so i don't want it to give a warning, but i do want them clearly marked so they know i can change them whenever i want and they can't get mad at me for it
Yea if they try to access it it's probably that they know what they are doing I guess
Have something in mind
remember that literally everything type annotations do is 'just a warning'
Of course, but some do base themselves on actual stuff in the Lua
Or at least have a logical sense to be present in a way, like defining types for functions, classes etc it's just warnings sure. But my remark regarding nodiscard was mostly if something like that was actually doable in the Lua language
Also I think I finally understood that I missnamed my mod 
type annotations just describe the way things are, even something like 'this variable can only be this type' is not really doable
Yea I guess
Also see I had properly used it here 
Didn't even remember I had done that
raw table is a bit scary though
For the fields on the bottom ?
yeah, usually you would annotate what is actually in those tables
👍