#mod_development
1 messages ยท Page 199 of 1
because it reduces the chance by 60%?
wait no it wouldn't, because you're decreasing the chance it hits rather than hits
ok yup that makes sense
anyone know where they're pulling the RNG generator?
is it inbuilt to lua or java or are they using another source?
it's just math next and math random
ok I'll dig into a little later...Thanks again @sour island @bronze yoke ๐
Can someone make a wheelchair mod which bounds you to a wheelchair and you cant drive or go up stairs or climb over fences. Just feels like a cool challange. Idk if it's even possible to make but would like to see it lol
possible, difficult ๐ that's a cool idea
who knows where the code of the map with notes is located? I want to create a mod that spawns a container in a random place and marks it on the map
I can set sandbox options for loot tables that just work aside from zeds. This is an example mod to track what that issue is. It has sandbox options for what items should be added to the general zed inventorymale and inventoryfemale tables.
These 2 items in the pic are set in my sandbox options and appear in LootZed but neither of them will spawn.
Here is a snippet: https://hst.sh/nuvaninebi.lua
Also, if it matters, I am testing on a server.
i'm trying to add a second language to the mod i'm making (learning how to...) and i don't know why it doesn't work.
I've added files under media\lua\shared\Translate\ES
Can anyone point me a decent tutorial or something? couldn't find anything not from 2014 xD
to my knowledge by default sandbox options are not loaded early enough in the load process to take effect when processing distribution tables, u have to force them to load. the default values will otherwise always be used.. perhaps you are seeing the others work due to default options and testing this one with edited options?
is there a way to make code not work if mod dependancies are not present? my mod doesn't strictly require them to work but i don't want them to function at all without them
local activatedMods = getActivatedMods()
if activatedMods:contains("DependencyModID") then
end
if the dependent code is in a separate file from other code you could use an early return to be a bit cleaner
so that code prevents the rest of the file from being run? very nice thank you!
thank you both
if you want to prevent the rest of the file you'd use then return end at the end of the if statement (this won't work inside a function as it'll just exit the function instead of the file)
otherwise you put the code you only want to run if the mod is present between the then and end
Any big brainers ๐ง want to help to help me burn some corpses???
(IN-GAME, PLEASE LEAVE ME ALONE FBI)
Trying to use
{
Type = Drainable,
DisplayName = Aluminium Strip Sparker,
UseDelta = 1.0,
DisplayCategory = Survival,
Weight = 0.11,
Icon = ZJStripSparker,
cantBeConsolided = TRUE,
WorldStaticModel = Battery,
Tags = StartFire; Lighter,
ReplaceOnDeplete = Base.Battery,
UseWhileEquipped = TRUE,
StaticModel = Zippo,
ActivatedItem = TRUE,
}
To burn a corpse, but it throws me an error
LOG : General , 1695971729421> ERROR: Missing translation "IGUI_ItemCat_Survival".
Anyone got any idea wtf's going on?
that's a cursed image right there
OK I changed ZJStripLighter to Category = Lightsource and I could burn the corpse again....I'm guessing because the animation has self.lighter (idk what this means) in it, it's trying to point towards the lighter item with the Category = LightSource, which doesn't exist with this thing.....
My test character just starved to death while I was testing stuff and it scared the shit out of me
That aside, does anyone know what the anchor booleans do for UI elements?
I feel like I should know what they do but am having trouble figuring it out
I try to execute code after the following function from ISInventoryTransferAction.lua is called.
function ISInventoryTransferAction:transferItem(item)
My approach is the following
`
SoulMod.ISInventoryTransferAction.transferItem_orig = ISInventoryTransferAction.transferItem
function SoulMod.ISInventoryTransferAction:transferItem(item)
SoulMod.ISInventoryTransferAction:transferItem_orig(item)
-- code goes here
end
ISInventoryTransferAction.transferItem = SoulMod.ISInventoryTransferAction.transferItem
I get the following error
function: transferItem -- file: ISInventoryTransferAction.lua line # 444 | Vanilla
Line 444 --> if self:isAlreadyTransferred(item) then
Error --> attempted index: items of non-table: null.
`
I think something happens with the self variable. When make this call with dot-functions instead of colon-functions I works without problems.
As for my knowledge in LUA goes the following is the same (or maybe not):
function ISInventoryTransferAction:transferItem(item) function ISInventoryTransferAction.transferItem(self, item)
Can someone give me a hint? Or is there a better way?
Hello everyone! I've started modding a couple of days ago and for now i created some items(weapons) and made translation to a second language but i'm missing something with a recipe. The problem is that i can make it require hammer or axe but not saw or canopener for example... Any thing am i missing? Thanks!
In the example basically i want players to turn a stop sign into the weapon i've created, but i want them to need saw for the process
keep [Recipe.GetItemTypes.Base.Saw doesn't work, keep Saw doesn't work, keep Saw/GardenSaw doesn't work, keep Base.Saw doesn't work, i've tested multiple ways, but doesn't work
recipe Create stop sign weapon
{
Moveables.street_decoration_01_0/Moveables.street_decoration_01_1/Moveables.street_decoration_01_2/Moveables.street_decoration_01_3,
keep [Recipe.GetItemTypes.Base.Saw],
Result:StopSign,
Sound:Sawing,
Time:200.0,
Prop1:Saw,
AnimNode:SawLog,
}
keep [Recipe.GetItemTypes.Saw]
keep [It'sFunctionInLua]
function Recipe.GetItemTypes.Saw(scriptItems)
scriptItems:addAll(getScriptManager():getItemsTag("Saw"))
end```
return scriptItems like all items with tag "Saw"
It works with Hammer, not with Saw ๐
wtf...
keep Saw/GardenSaw,
keep Base.Saw/Base.GardenSaw,
keep Saw,
keep GardenSaw,
it's all work
Not in my script, really
it is possible to create a mod to add an admin command to spawn an item to a specific coordinates?
module Base
{
recipe MyRecipe
{
RecipeStuff,
}
}```
I'm not on pc right now, if i can DM you later i can paste my code cause i'm sure it's like that structure
Still need help regarding this by the way!
omg I finally finished my Hoshino from Blue Archive outfit mod for Zomboid yay!!
i was wondering if it was possible to make a mod that allows zombies to use weapons, but in a way more simple way
my idea was to have it only be visual (at least for now) and just replace the attachment points for "stuck" weapons in zombies to be their hands instead of their bodies, so it looks like they are holding them
mainly, i was just wondering how difficult that would actually be.
i mean, im pretty sure Authentic Zeds did it before on a few zombies, but id like to do that on the vanilla zombies too. i just have to figure out how
visual only attacks? Check out Zombie Attack Variety. It makes them swipe their arms at you
no, what i mean is that i can have zombies hold weapons
Well... Then likely yes
well, would you have any idea how to go about doing this?
because no other mod ive seen has done this yet
Hmm, no, not really
I haven't touched zombies yet
I think you can modify the attachment points for weapons stuck in zombies
Or have them be part of their outfit
that is actually exactly what i was suggesting
i just need to figure out how to do it...
you have the docs, right?
declaration: package: zombie.characters, class: IsoZombie
alright then, im gonna have to check this out
thanks
im assuming im gonna have to decompile these files and edit them somehow
oh god, im really not all that great with coding lol
Hey hi, is there a way to edit existing UI elements through LUA?
I'd like to make some changes to the visuals of the skill overview, for example.
im pretty sure you can! infact, theres a mod on the front page right now that does that! "The Sims: Zomboid Expansion"
i think you should ask the creator of that mod about it
I see
Thanks for the heads-up
I'm trying to find where this menu is created, if you have any idea:
no, sorry, i dont know anything about ui, but as i said, i think you should talk to the mod creator about this
Hook into ui functions
Got a clue where that specific UI panel is made?
I can find the ISHealthPanel, but no link to the Skills/Temperature/Protections/Info tabs.
Think its in the player stats folder
Check: lua/client/XpSystem/ISUI/ISCharacterInfo.lua
when you call SoulMod.ISInventoryTransferAction:transferItem_orig(item) you are passing SoulMod.ISInventoryTransferAction as self, not the ISInventoryTransferAction instance: try ```lua
function SoulMod.ISInventoryTransferAction:transferItem(item)
SoulMod.ISInventoryTransferAction.transferItem_orig(self, item)
My mod is very simple, still makes the game load slow and i have to wait on "this is how you die" as i click and nothing happens, i have to let the screen fade alone so i can join the game. Anyone knows why it takes so long for 2 items and recipes? No code yet
Have you compared with and without the mod?
Is it the only mod enabled?
Have you checked logs?
Yes, obly thing i've seen related to my mod is a "base imports itself" error. Removed th import and still slow. It's like the click to continue screen is behind the "this is how yo died" and until it fades you just can't click. The message doesn't appear
But i got another weird thing... I've created a recipe that allows to require a hammer but doesn't work with a saw
I'm about to suffer a stroke trying to understand what's going on... I'm not new to game dev, but the randomness of this problem is driving me mad
Hello everybody โญ
I would like to make computers in project Zomboid lootable with loot inside.
Do someone knows how to do this ?
Use TileZ to edit the existing computer tiles ?
Use a script to transform this tile on a game start ?
Please let me know ๐
overwrite the computer item making it be a container? i'm not sure but i think it's the way, just create a new container with computer script and make a placeable object (i'm telling you this as if i know how to do it xD)
Can anyone explain me this please? Why saw is not required? It works with the hammer and axe but not with saws and canopener for example... Tried different ways like Base.Saw, Saw/GardenSaw, etc. For me it's totally random, am i missing something?
I assume you dont want hammer and saw to be consumed when crafting it so you could go with
keep [Recipe.GetItemTypes.Saw],
keep [Recipe.GetItemTypes.Hammer],
i don't mind at this point if it's consumed or not, as it never appear on the list. The reference to saw is broken somehow and i don't understand why
Its used in vanila, it should work with any saw/hammer that is added by other mods that are tagged properly.
if i do keep [Recipe.GetItemTypes.Saw], it will not work...
Saw is like an item that doesn't exist... Why? i don't know but i'm finding this the second day of modding
any example with hammer works, any example with saws or other tools (some of them) not
didn't touch any original script or files from the game so... Why is this happening? xD
recipe Create shovel
{
Plank,
keep [Recipe.GetItemTypes.Saw],
keep [Recipe.GetItemTypes.Hammer],
Result:Shovel,
Time:100,
}
can you try this?
also the game is starting pretty slow with just 2 recipes and items... i don't understand Let me try this
remember " , " as it will break the recipe
if its missing, aswell as big or small letters do matter aswell.
doing the keep [Recipe.GetItemTypes.Hammer], accepts all kinds of hammer, but it's ignoring the F* saw ๐ญ
And that's the result, as you can see it just ignores saws
using this code
Would be funny if it wouldn't be taking all my patience ๐
Do you use any other mods?
no, i'm testing only with mine
but maybe i should delete them all in case they're cause some conflict
i just used that code and it works
Do you perhaps override saws in your mod aswell?
nope i just use them as a tool to craft weapons from urban props, like a stop sign xD
i don't plan to change any vanilla stuff, just require them to craft my recipes to get my items, it's a very simple mod, nothing fancy
cause i'm trying to learn, specially why this is happening right now? xD
Just to be sure, you dont have your mod uploaded and subscribed and then changing things in your local files?
I remember i was trying to fix bug for a few hours only to realize i had my mod subbed on steam ,so changes in local files did not work untill i unsubbed
yes i'm changing it locally and the changes take effect as i can tweak the recipe and see the changes, but again... No saws on recipe with only your recipe on the script
so... i think i've somehow break the game, reinstall may help
ok, unsubbing xD
if that's the solution i owe you a beer
it's fucked up, going to reinstall
i checked and it doesn't
my recipe script only contains your code, and it shows the same, no saw required so i'm reinstalling
but i'm gonna make sure it removes all the files before reinstall
asking for a fren -- is there a way to add our own shader to the game similar to water for a different tile?
you can add your own shaders, but i don't know anything about tiles, so i can't promise you can do anything with them specifically
but there is modded shader support for models at least
Yeah, what's the process like for adding my own shader?
ok, reinstalled, checked without mods and some recipes required saw,ok all fine.
Added my mod tested and it's the same, so it's 100% my mod (good to know)
Without mods, after fresh reinstall the game still makes me wait until the "this is how your died" screen fades, as clicking doesn't do anything...
WTF did i write to mess it all up? Gonna be more careful ๐ฌ
you just need to drop a fragment and vertex shader in the shaders folder with matching names
GLSL shaders
Interesting. So for instance
lets say I got a lava tile.
I wanna do exactly the same thing as the water shader, and draw it on top of the lava tile
but with different shader more optimized for that lava look
just had a quick look and it looks like only vehicle shaders have _static versions, so it's probably specific to vehicles
the limitation would be if tiles let you set a shader for them, i have no idea
but i do know that custom shaders will be loaded by the game, basically
Hmm yeah I'm doing lots of searchin' but I can't find where the logic of it being applied to just the blends_natural_02 tiles
Ok thank you for your answer, which soft shoul i use to do this ?
and by editing which file ?
Not sure, but try to find the computer if here: https://pzwiki.net/wiki/Appliances#Communication I've checked and the computer isn't implemented so you can write you own instance of a container, with the computer sprite, there's a variation with the screen turned on, so you can develop a whole system on that
ok After a reinstall and some tests it all works fine. Thanks!
The game still makes me wait until "this is how you die" screen fades on the first play don't know why
Is there any way to refer to a broken tool? I wanted to use an axe with 0 durability as an ingredient for a recipe but can't find how
IsoWater class, applyWaterQuality, etc...
yeah no i looked at that , but there's no indication of how it decides what tiles count as a spot for a water shader
water tiles, those are set as IsoWater type
IsoFlagType.water
Update:
I forgot water is abnormal. Besides the water flag, the game also uses the IsoWaterGeometry which disables normal sprite rendering for "blends_natural_02" among other things.
You think you're being helpful, but what I'm saying is I can't find the code that STATES that, where it's decided in lua, if it is. It doesn't seem to be, no indication. Just cuz it says IsoWater doesn't automagically make the logic for things that are water to be water, the code probably assigns that value somewhere and that's what I can't find.
i would doubt it would be in lua, rendering stuff is generally totally locked off
and at that I'll stop looking
yeah that was my worry.
Look, I was responding off of your energy -- typically just posting something that's crossed out without explanation could be misconstrued as sarcasm or something
I went back to working on a mod after a few weeks break
and the error bar isnt showing errors
but my mod isnt working
sorry for looking
Oh it's a tileproperties thing
๐ค Which would mean, I'd need to set up a custom tile property somehow if I wanted to do the lava shader hmmmmmmmmMMMMm ๐ค
sup people
yo
actually I don't think it's set on tileproperties
I just opened up the blends_natural_02 tile properties and this is all it has
I'm still dumb and can't seem to figure out what the anchor params do for UI Elements, does anyone know what they do?
I'm messing around with UI stuff and I feel like I should know what they do
when the parent changes size, it will move along with that edge
And the resize widget in the collapsablewindow class is anchored both the right and left, so does it stretch to both sides when that happens?
or well, when the edge changes
yep! it stretches so that the gap between it and the edges stays the same as it was before
Cool! Thank you! Using anchors seems like a far smarter way of doing things than the way I've been doing it lol
Ive just been constantly resizing things to the parent dimensions
I'm gonna have to keep doing that for some things, because I'm trying to render things that follow an element but are outside or stretch beyond that element, and I dont think there's a way to make a child able to ignore a parent's bounds so they have to not be parented
Is there any way to insert a little wait/delay between steps in a recipe while being crafted? I would love to use different props and sounds during the crafting
improved card controls https://imgur.com/a/jaBLHhy
Awesome
Ty
Is this open source? Would love to learn from this tbh.
why the sound loops when crafting a vanilla recipe but not when i'm crafting mine?
Still working on it, not ready for official release
I completely would not have been able to learn how to use the UI system without this, it's been so insanely insightful even if it's a work in progress
aw, thank you ๐
Incase you haven't looked at it recently, I redid the UI window to use textures rather than UI elements for each item
Ooo, will do! Thanks for letting me know!
This was super satisfying to make
All using textures - it identifies which card or which spot inbetween cards is being moused over using math
Even supports scrolling - although seems like the name plate is in need of a tweak lol
@sour island I'm wondering why you have some objects defined as globals, and some as locals? I'm not super familiar with LUA beyond scripting (I come from C++ & Python, for frame of reference). Example being gameNight - window.lua having gameNightWindow be global, while for example deckActionHandler in gameNight - deckActionHandler.lua is defined as local.
The UI in vanilla is global
I could probably make those local to make them more safe to use
Ah, it's purely because you're subclassing?
But I honestly didn't want to shake out bugs with unforseen issues
Gotcha, okay. Thanks for the insight!
np
This is some dang impressive work.
TY, I hope it's easy to follow ๐
I'm hoping people pick it up and run with it to add various games
I'm wondering what your development method is? Did you pre-plan this / make some architectural designs? Or did you just throw yourself at it?
A little bit of everything
I knew I wanted to make the vanilla game items supported - while also keeping it being a framework in mind
I haven't taken a deep dive into the games yet, but are they properly scripted? Or are they "just" functional in a way that allows players to enforce the rules manually?
Like, are game rules tracked and enforced by the scripts, is basically my question.
The latter, it would be alot more work for myself, and anyone trying to build on it otherwise
Fair enough
I figured
It'd be low key insane to program Catan / Monopoly in LUA tbh
It's basically tabletop simulator - I added hooks to allow for adding more functions to items like flipping pieces and such
Very nice
The 3 add-ons I'm working on will also showcase how to make one's own add-on
Might have to pivot some mechanics to handle money better - as it would be a giant pile of items otherwise
I already have a mechanic for money with my shops mod
That's basically my workflow - build something with expansion in mind, then expand it lol
I didn't even realize UI could be local LOL I just assumed because all the vanilla stuff was global mine had to be too
I'm not sure if it can be local, might be worth a try
I'm definitely gonna be studying how you do this when I get around to the actual minigame coding for my thing, my original plan was to just have an array of buttons for the nonogram but it would be so much easier if I didnt have to work with actual UI elements for each and every spot
Looking at it, you grab textures based on the card names?
Or, well, items in a "deck"
Yes for cards/decks
Definitely makes it simple for modders to add stuff tbh
The other game pieces are standard items outside of some script manipulation
Tedious copy pasting is something I try to avoid lol
It seems, at its core, to create a new minigame you really only need a list of strings representing a standard deck, and then add it to the deck cataloger?
And then the textures, of course
Yes, for decks
Otherwise you just provide some item scripts, textures, and register the items for game pieces
Card games are much easier to implement
Beyond this, you can add some additional logic for sound, special cards that can be rotated (and possibly have other actions?), and game boards?
Yes, cards are their own type of system but they can utilize the game piece systems
Is there any sort of event which lets you get and modify any sounds a player makes? (for instance, when a player generates sound check to see if they're swinging a weapon and reduce the amount of sound)
This could be done by hooking to the craft action.
Actually, it probably would be best to make a derived custom one, you probably would need more than a few changes.
Or make it multi-stage.
Well, thank you but as i'm starting i think i will let it for later. Or maybe i should jump into lua so i can start doing more complex stuff, where should i start?
oh my lord anchors are such a better method than whatever the heck i was doing
See what interests you more and learn / work on that.
could somebody please help me with this?
How do i refer to an item with 0 durability in a recipe?
https://partner.steamgames.com/doc/api/steam_api#EResult
#selfpins, upload, fail result, error
seems like you're not logged
maybe i will restart my steam
yup for some reason steam logged me out
thanks a lot
I'm on the wiki checking yes, but didn't find the way to require a broken axe for a recipe instead of an axe with durability
i can allow broken items, but i want to allow only broken items
you could add a test function
don't know how to add functions ><
I mean like this one.
https://pzwiki.net/wiki/Scripts_guide/Recipe_Script_Guide#OnTest
The thing is that i'm a bit lost on that, let me ask a couple of dumb questions first xD
I place the functions in files on the lua folder right? client/server/shared depending on something i ignore for now.
So then i can call those function through recipes?
that's right. That's where lua files go. You will need to make a global function with that name. Often those are added to the Recipe table, this means the lua file should be in the server folder.
Ok thank you very much, i'm starting to understand. I know C# and i've been developing with Unity 6 years but i'm totally new to lua and modding this xD
I'll try some stuff tomorrow and see if i can start learning the way to communicate with Zomboid as i've done with Unity so i can create an awesome mod
tyvm
{
EmptyLighter = 1, [Recipe.GetItemTypes.Petrol],
Result:Lighter,
Time:75.0,
Category:Cooking, //Changed to "cooking" for test, should be "survival"
StopOnWalk:false,
StopOnRun:true,
sound:EmptyPan, //want this to be "PourLiquidOnGround"
AnimNode:Pour, //This is actually a weird animation for it, because it pours on the ground. Test for now, delete later.
}```
Sound and animation aren't playing for this custom recipe...Straight copypastes from other recipes.....Any ideas?
NVM, syntax error on the param "sound"...Should be "Sound"
anyone know how the update process works for a pre-existing steam item?
Hi everyone, anyone has a tips of advice on making "composter" thumpable ?
or a simple way to delete/prevent players from making them
I tried to find info on forum and finding a mod on steam
but I wasn't successful
god damn....
I want do thing with character invenory, like:
Inventory not show, but if u push "i" your character sit, take backpack on the ground, after this u can see your inventory
or like tarp, if u without backpack
Does anyone know why the player character lua code, like traits and professions, is stored in the file labeled "NPC" ie non-player character?
I've been curious about this for a while now
oh wait
is it not?
have i been mistaken
No it is
MainCreationMethods.lua is where its at
It doesn't, like, change anything obviously, its just the folder name
im just curious
Also, I have a very vague memory of reading somewhere that instead of making a bunch of global variables for a mod, you should instead make one single global variable that's a table that you put all your other intended global variables into for optimization reasons/not cluttering the global variable pool
Is this, like, a real thing or is my brain making this up? Like should I be doing this?
Anyone have any tips for getting into making mods
I know the bare minimum of programming and somewhat of how it works I just don't know how to apply it and how to use it in the game code
I've only just gotten into modding, but the first and, in my opinion, most important part is having a strong idea of what you actually want to make
Once you've done that, look up tutorials for things that are close enough to your mod, like for example if you wanna make a new hat item, look up how to make zomboid hat mod and if you dont find anything try searching zomboid clothing mod, so on and so on
once you find the closest guide for your mod, follow it up until it no longer works for your idea and figure out why it doesn't work for your idea and dig deeper into more resources or references
By the time you've followed one guide, you probably have learned enough during that journey to find tools or resources for whatever else you need to work on
Obviously, it depends on your idea and the scope of that idea, this is just the path that I took (and the path I'm still currently taking lol)
if your idea has a really large scope, you may one to single out what you think is the easiest element or sub-idea of your main idea
https://youtu.be/-yrmCAwzTbY?si=jmIaFk0PcGog4z-h This tutorial specifically is what got me started on my path
1:11 Step 1 - Know your file locations
4:06 Step 2 - Storyboard your ideas out
9:03 Step 3 - Get your files from the game or other mods
11:47 Step 4 - Build your mod files
1:01:54 Step 5 - Create the textures (mislabeled in the video, oops)
1:19:45 Step 6 - Put your mod files in the right structure
1:30:37 Step 7 - Test your mod (please back up ...
it by no means teaches you everything you'll need to know for something really complicated, but it got me on the right path for understanding the basics of how zedscript and lua works and what keywords to search or look for
Heard I appreciate it I don't know exactly what I wanna do but I know I wanna do a sort of crafting overhaul I think
Or something to emphasize the crafting in the game
Well I'd certainly look into the recipe system then! The tutorial I posted actually goes into the basics of creating a recipe script as well as making a lua file to program more advanced recipe code!
Oh! Also I'd recommend downloading mods that work with similar concepts and looking through their file structure and code to get an idea of the solutions or ideas other people have found
Oh sick I'll take a look into the video and I was just thinking about how I should mess around with some mods and possibly see if I could get inspiration on what I'd like to do
I can't remember if the video goes into looking at other mods or if they just look at their own past mods, but if it doesn't you'll find mods you install from the workshop in your Steam folder under "steamapps\workshop\content\108600" and they'll be listed according to their workshop ID
this is a real thing, but i'd say it's still bad practice
using one global instead of many is good, but you can just use none instead
keeping things completely local and modular makes things much less tangled and avoids both name conflicts and the performance cost of the global namespace
globals are slow, messy and there's almost never a reason to use them
only case i can think of is for functions referenced by scripts, they can't interact with modules so those functions do need to be global
I suppose I should be looking more into lua modules! Thank you for the info!
the basic idea is to put everything you want to be accessible in a local table, and then return the table at the end of the file
other files can use require(filename) to grab a reference to that table
Fascinating! I've been wondering why I've been seeing return functions like that at the bottom of files but didn't know how to look up why!
yeah, files are essentially functions and require grabs the return value
minor note is that pz has a custom implementation of require that doesn't support multiple return but that's niche
I'm looking at an online thing explaining lua modules and it gives the example of:
function mymath.add(a,b)
print(a+b)
end
-- Other stuff
return mymath
is the function mymath.add also local because its apart of a local table?
yeah! it only exists as part of that table
Alright great!
Now knowing this has probably saved me from a loooot of mistakes and optimization work in the future
yeah, unfortunately the pz code never does this so it's something most modders don't learn until much later
Yeah, my reference for what I've been working on was the "forageDefinitions" file and it stores its forageDefaultDefs table globally despite the fact that files that utilize it usually have to require forageDefinitions anyway for the functions to actually use those default defs
though I suppose I dont know enough about lua to say that for certain
i often think about the utopia we would live in if lua defaulted variables to being local and instead had a global keyword
Thank you for all the insights! I'll see if I can put them to good use!
Anyone know the media lua folder location for Plumbing sink to water barrel is?
@bronze yoke This seems to work. Thank you ๐
Thank you, one last question. Do you know a method for retrieving a user/client ID?
still looking for a way to disable composter from server
there must be a easy way...
will deleting -- compost local compostOption = subMenu:addOption(getText("ContextMenu_Compost"), worldobjects, ISBuildMenu.onCompost, player, "camping_01_19"); local tooltip4 = ISBuildMenu.canBuild(5,4,0,0,0,2,compostOption, player); tooltip4:setName(getText("ContextMenu_Compost")); tooltip4.description = getText("Tooltip_craft_compostDesc") .. tooltip4.description; tooltip4:setTexture("camping_01_19"); ISBuildMenu.requireHammer(compostOption)
from ISBuildMenu.lua
do the trick?
hmm, need to do it for my mods...
every day I learn something new
any idea how do you make an animation loop from a certain point instead from the beginning?
or keep the player stuck on the last frame of the animation
Not really unless you transition to a looping animation at the end?
not really sure about that, this is about my first time messing with an animation file's xml, doing it blindly cause no guides xd
<?xml version="1.0" encoding="utf-8"?>
<animNode>
<m_Name>KnockedOut</m_Name>
<m_AnimName>Zombie_Death</m_AnimName>
<!--<m_Looped>true</m_Looped>-->
<m_SyncTrackingEnabled>false</m_SyncTrackingEnabled>
<m_SpeedScale>0.70</m_SpeedScale>
<!--<m_BlendTime>0.80</m_BlendTime>-->
<m_Scalar></m_Scalar>
<m_Scalar2></m_Scalar2>
<m_SubStateBoneWeights>
<boneName>Dummy01</boneName>
</m_SubStateBoneWeights>
<m_SubStateBoneWeights>
<boneName>Translation_Data</boneName>
</m_SubStateBoneWeights>
</animNode>```
the intended result is to have the player stuck on othe last frame of the Zombie_Death animation (i.e. stay laying on the floor)
Bro, anyone ever managed to create a completely working IsoMannequin so far?
looks like that deletes the carpentry option to build a compost, but there will still be composts in the world that spawn....I think what you would need to do is actually find the tile model for the compost and find whatever handles it and point it towards something else
hmm yea u r correct but my plan was to disable compost being used as invincible wall for players, getting it from the world by moving the movables would b acceptable
since moving them makes them vulnarable to zombies thumping
would be happier if there was a way to make them thumpable though...
Probably not the best way, but back up whatever lua script that handles that, cut out that portion, test it and see what happens.....
yea i've tested and it completely disables the building option itself.. crashing with morebuilds mod.. so trying to find a better way xD
what errors are getting thrown?
don't remember but instead of deleting i changed its needed materials
local compost = ISCompost:new(player, sprite);
compost.modData["need:Base.Plank"] = "5";
compost.modData["need:WURO_items.Composter"] = "1";
compost.modData["need:Base.Nails"] = "200";
compost.modData["need:WURO_items.Composter"] = "1";
compost.modData["xp:Woodwork"] = 5;
compost.player = player
compost.notExterior = true;
compost.completionSound = "BuildWoodenStructureMedium";
getCell():setDrag(compost, player);
end```
as so, the problem is
it's not showing correctly on the game
still telling me it only need 5 planks, 4 nails, and level 2 carpentary
i guess the text is handled in some other place?
oh, it stops me from making the compost as it should
just shows its craftable
but not placeable
so i guess it only worked half way...
sorry the language is in korean
was too lazy to change to english just for screenshot ๐
with some research
i found that necessary material indication is handled in other snippet
local compostOption = subMenu:addOption(getText("ContextMenu_Compost"), worldobjects, ISBuildMenu.onCompost, player, "camping_01_19");
local tooltip4 = ISBuildMenu.canBuild(5,4,0,0,0,2,compostOption, player);
\
tooltip4:setName(getText("ContextMenu_Compost"));
tooltip4.description = getText("Tooltip_craft_compostDesc") .. tooltip4.description;
tooltip4:setTexture("camping_01_19");
ISBuildMenu.requireHammer(compostOption)```
after canBuild(5,4,0,0,0,2)
i wonder if it is possible to manually change them by just typing "string" instead of those 0s or would that give off error...
Hello there, has anyone an example of mod using looping sound ?
if not self.sound or not self.sound:isPlaying() then
self.sound = getSoundManager():PlayWorldSound("zReBL_crowbarSound", self.character:getCurrentSquare(), 1, 25, 2, true)
end
getSoundManager():StopSound(self.sound)
I don't know if it will fit. But the method for loop sound and stop it
Thanx a lot.
if i'm not wrong, it's can be another way just
getSoundManager():PlayWorldSound("zReBL_crowbarSound", self.character:getCurrentSquare(), 1, 25, 2, true)
and loop = true
loop This parameter determines whether the sound will be looped. (Will play until the sound is turned off with Lua code)
Thanx works like a charm in solo mode. Any idea if it works also in MP ?
not tested. first method work 100%
Was there 2 methods ? I do not understand, I see one method.
firts - loop from lua code with condition like if not self.sound or not self.sound:isPlaying() then play this sound end, second -> set in sound script loop = true and just play sound without any condition.
Ok, I wrote both so I guess only the second will be effective. When applying the same algo as the first method for isoPlayer:getEmitter():playSound(), I could hear the cuts in between the loop calls.
local vehicle = playerObj:getVehicle();
local trunkdoor = vehicle:getPartById("TrunkDoor");
local trunkdoor2 = vehicle:getPartById("DoorRear");
if not vehicle then return end
------ zRe FIX for Vanilla: -----------------------------------------
if trunkdoor then
if trunkdoor:getDoor():isLockBroken() then
playerObj:Say(getText("IGUI_PlayerText_VehicleLockIsBroken"))
return
end
elseif trunkdoor2 then
if trunkdoor2:getDoor():isLockBroken() then
playerObj:Say(getText("IGUI_PlayerText_VehicleLockIsBroken"))
return
end
end
---------------------------------------------------------------------
Why does it seem to me that the fix code looks like complete ass?

pz supports conditions like nand, nor?
move if not vehicle to before getPart
still facing problems with this if anyone got an idea!
if you want to see if player is in area there is vehicle function for that
there is also function to get closest part to interact with
it's... not easy...
it's button from inside vehicle on UI
turn on/off trunk door
on lock
code work fine, just... look's like spaghetti...
lol, you can make it prettier by making it a loop or call another function
I'm all ears.
for _,i in ipairs{"a","b"} do
or
doSomething("a")
doSomething("b")
or
local parts = {}
table insert(parts,get("a"))
table insert(parts,get("b"))
I don't understand, did you mean something else? What exactly troubles you about your snippet?
- rough overwriting of a vanilla function (I don't know how to do injections like old_func = new_func bla bla bla)
ifonif, I always thought multi-lineifwere kind of... stupid... (whenifinifinifetc)
https://pzwiki.net/wiki/Lua_Functions
this has some hook examples
Yes, I read this, but my perception of the examples is as dead as possible...
I literally don't understand how to put this knowledge into practice. What value should be returned when, in fact, you are checking on parts of cars, and in the function only (PlayerObj)
hm, go wild
vanilla doesn't return anything so you can return anything you want without breaking anything
how hook that fix into vanilla func?
function ISVehicleMenu.onToggleTrunkLocked(playerObj)
local vehicle = playerObj:getVehicle();
if not vehicle then return end
------ zRe FIX for Vanilla: -----------------------------------------
local trunkdoor = vehicle:getPartById("TrunkDoor");
if trunkdoor then
if trunkdoor:getDoor():isLockBroken() then
playerObj:Say(getText("IGUI_PlayerText_VehicleLockIsBroken"))
return
end
end
local trunkdoor2 = vehicle:getPartById("DoorRear");
if trunkdoor2 then
if trunkdoor2:getDoor():isLockBroken() then
playerObj:Say(getText("IGUI_PlayerText_VehicleLockIsBroken"))
return
end
end
---------------------------------------------------------------------
sendClientCommand(playerObj, 'vehicle', 'setTrunkLocked', { locked = not vehicle:isTrunkLocked() });
end
I'm not at pc to check, but what is the main purpose of this, just to trigger the say lines? I thought door would stay locked in vanilla if the lock is broken.
nope, not for trunk door.
If lock on trunk door broken - u can use button from UI inside vehicle
button up this script:
function ISVehicleMenu.onToggleTrunkLocked(playerObj)
local vehicle = playerObj:getVehicle();
if not vehicle then return end
sendClientCommand(playerObj, 'vehicle', 'setTrunkLocked', { locked = not vehicle:isTrunkLocked() });
end
Basically, there are no methods in the game to break the lock on the trunk door.
another door's - yep
When they are broken - the door widget turns yellow when some door cannot be closed (because the lock is broken)
standart doors have check for lock state:
function Commands.setDoorLocked(player, args)
local vehicle = getVehicleById(args.vehicle)
if vehicle then
local part = vehicle:getPartById(args.part)
if not part then
noise('no such part '..tostring(args.part))
return
end
if not part:getDoor() then
noise('part ' .. args.part .. ' has no door')
return
end
if not part:getDoor():isLockBroken() then
part:getDoor():setLocked(args.locked)
end
--vehicle:toggleLockedDoor(part, player, args.locked)
vehicle:transmitPartDoor(part)
else
noise('no such vehicle id='..tostring(args.vehicle))
end
end
but not trunk:
function Commands.setTrunkLocked(player, args)
local vehicle = player:getVehicle()
if vehicle then
vehicle:setTrunkLocked(args.locked)
else
noise('player not in vehicle')
end
end
@verbal yew
This look ok?
https://github.com/kERHUS/zRe-Better-Lockpicking/pull/2/files
not sure... need to try
Hi! I'm working on a small mod and I'm trying to differentiate zombie types I have in my mod by assigning them outfit.
Now, everything works completely fine in singleplayer (as I can easily set them and refresh them every hour to make sure all the outfits are correct) but this starts to give problems in MP, rightfully so, as I know nothing about networking. May I ask any of you kind souls to give me some advice on how to sync these? Zombie types and all of that syncs well as I'm testing on some already-working code (in private) but I can't manage to make outfits work together. Thank you.
mp zombies changes ain't no small mod. maybe check other existing mods on the workshop attempting similar things. If you ever succeed, please share your knowledge ๐
Yeah
I'm working with CDDA Zomboids as a base code to learn about it really and get something to work. Zombie stats syncing works fine in MP (even if I still have some issues understanding some parts of it), outfits work fine in SP but I Just Need to get them to work to Sync in MP. As of now, stuff works fine but clients get different outfits while they should load the same (I have different outfits for different zombie types based on their stats and skills)
for stfr we just change the outfits on the client, didn't seem possible from the server side
it sort of seems like it *should* cause issues but i've never heard anything come up from it, they started doing it before i started helping out so i wasn't part of the initital testing
SprintOutfits = {
"ArmyCamoDesert",
"ArmyServiceUniform",
"ArmyCamoGreen",
"ArmyInstructor",
"ArmyServiceUniform"
}
JogOutfits = {
"AuthenticClown",
"AuthenticClownParty",
"AuthenticClownObese",
"AuthenticClownBarotrauma",
"AuthenticClownMime",
"AuthenticClownMime",
"AuthenticClownPennywise",
"AuthenticClownWrinkles"
}
TRektZombieAI = {}
function TRektZombieAI.isSprinter(zombie)
local zombieOutfit = zombie:getOutfitName()
for _, v in pairs(SprintOutfits) do
if v == zombieOutfit then return true end
end
return false
end
function TRektZombieAI.isJogger(zombie)
local zombieOutfit = zombie:getOutfitName()
for _, v in pairs(JogOutfits) do
if v == zombieOutfit then return true end
end
return false
end
function TRektZombieAI.onUpdate(zombie, apply)
if not zombie or zombie:isDead() then
return
end
if TRektZombieAI.isSprinter(zombie) then
zombie:setWalkType("sprint1")
elseif TRektZombieAI.isJogger(zombie) then
zombie:setWalkType("sprint5")
end
end
Events.OnZombieUpdate.Add(TRektZombieAI.onUpdate)
server side LUA, not remember mod
have sync in MP
The idea behind the code is to make all army zombie is running, but thereโs a lot that can be crammed in here.
With this garbage, I made a burning zombie that does not take damage from burning.
I believe that it is possible to adapt Braven's code from Zomboss to make zombie juggernaut with big hp
Not just a zombie in some kind of heavy armor, but one that actually protects him from attacks
SprintOutfits = {
"FireProof",
}
TRektZombieAI = {}
function TRektZombieAI.isSprinter(zombie)
local zombieOutfit = zombie:getOutfitName()
for _, v in pairs(SprintOutfits) do
if v == zombieOutfit then return true end
end
return false
end
function TRektZombieAI.onUpdate(zombie, apply)
if not zombie or zombie:isDead() then
return
end
if TRektZombieAI.isSprinter(zombie) then
zombie:setFireKillRate(0)
zombie:setWalkType("sprint1") -- 1-5
if not zombie:isOnFire() then
zombie:setOnFire()
end
end
Events.OnZombieUpdate.Add(TRektZombieAI.onUpdate)
For example
Not die from fire and burning :3
It can be done simpler, not through costumes, but through a GetModData(), with a chance.
like:
function zReBURNINGCHAOS.onUpdate(zombie, apply)
local zReFLAG = zombie:getModData().zReBC_EXCLUDE
if not zombie or zombie:isDead() or zombie:isCrawling() or zReFLAG == 1 then
return
end
local chance = ZombRand(1, 100)
if chance < 5 then
zombie:setFireKillRate(0)
zombie:setWalkType("sprint1") -- 1-5
if not zombie:isOnFire() then
zombie:setOnFire()
end
zombie:getModData().zReBC_EXCLUDE = 1
else
zombie:getModData().zReBC_EXCLUDE = 1
end
end
Events.OnZombieUpdate.Add(zReBURNINGCHAOS.onUpdate)
I've always wondered why Random Zombie works through such a huge array of code...
function zReRandomZombies.onUpdate(zombie, apply)
local zReFLAG = zombie:getModData().zReRZ_EXCLUDE
if not zombie or zombie:isDead() or zombie:isCrawling() or zReFLAG == 1 then
return
end
local chance = ZombRand(1, 100)
if chance < 5 then
zombie:setWalkType("sprint1") -- 1-5 slow1-3 sprint1-5
zombie:getModData().zReRZ_EXCLUDE = 1
elseif chance < 10
zombie:setWalkType("sprint2") -- 1-5
zombie:getModData().zReRZ_EXCLUDE = 1
elseif chance < 15
blablabla
end
end
Events.OnZombieUpdate.Add(zReRandomZombies.onUpdate)
all code of Random Zombies in one func
smol :D
Hello, can I make dynamic recipes using the "IconsForTexture" to make texture combinations?
Or do I have to make the item with each combination style to put together 2 items with different camouflages?
hi all, im trying to make a mod that adds a wearable mask, but doesn't show up in the hat section where it should allegedly go (while making character. i do have the option where i have access to all clothing while making character)... any ideas why that is? i should preface in saying it shows up in the mod list and is enabled
in the start function the flag is set to true so that the action cannot be performed again, but this flag is set only for the player who performs the action, and not for all players, please tell me how this can be fixed?
self.corpse:getModData().Autopsy = true
if corpse is an isoboject just self.corpse:transmitModData()
IsoDeadBody
might still work, doesn't work for all subclasses but most
Hi, thank you! I gave a look at the code that you're mentioning and is indeed similar in function to what I currently have, that's why it definitely is odd. I wonder it could be some underlying functions used such as "dressInPersistentOutfit()" instead of "dressInNamedOutfit()" (which I use). I'll make some tests and update on my results.
oh we used to use named iirc, i think the change to persistent was after the last time i touched things so i have no idea what the practical difference is
@verbal yew Thank you a lot! It is indeed what I'm trying to work on right now and I must say your method is probably what would work best.
Currently your method revolves around "use whatever zombie distribution the server has done about outfit and then set zombie types on that", while mine works the other way around "take whatever zombie types the server has set and dress the zombies". Yours probably works better as it leaves outfit syncing to the server, I'll see what I can manage to do and let you know, thanks!
Yeah no clue, I found no info. I guess I'll experiment.
As you do:
zombie:dressInPersistentOutfit(outfit)
zombie:resetModel()
While I do:
z:dressInNamedOutfit(outfitName)
z:reloadOutfit()
really no clue about the methods difference
Time to boot the second client and test I guess lol.
I must say after testing I found no difference between
zombie:dressInPersistentOutfit(outfit)
zombie:resetModel()
and
z:dressInNamedOutfit(outfit)
z:reloadOutfit()
No clue.
What do i have to take into account when creating a new movable object?
I've written a recipe and an item as result. Copying the structure of a mod that places stuff. Anything that i'm missing? does it have to be in a .pack file?
I can craft the item, but game doesn't let me place it, it tell me "Moveable not valid" and "Cannot create recipe for this movable object: X"
Does it need a "placing" recipe?
you need tiles that are moveable
https://pzwiki.net/wiki/New_Tiles
tyvm
Well i'm using a tile from vanilla, but reading this will clarify stuff for sure
oh, if it exists already then you can use it's name in the recipe
I want to create a campfire with another sprite basically
tried to copy from original files but didn't find the campfire so... i don't know xD
campfires are a special case
too complex to make a new instance with other settings?
if you're not adding new features it shouldn't be too complex
i want to create a new campfire with other sprite variation (on/off) and if possible to adjust temperature. That way i can create a recipe that is cooked above certain heat only achievable(?) through this new campfire
and the recipe would require proximity to this movable object, so it's the only way to prepare some stuff
sounds factible?
good, so i'll keep researching ๐ค Thanks!
Would be good to find the campfire to study it xD
most of these are relevant
thanks
as for placing your item, you either need to make the sprite moveable or copy / use the build cursor of the campfire and make a different item for it.
I've read all those scripts and more or less i understand the functions and the behaviours but now i don't know if i should call those functions from my own "campfire-oven" script, how many of them do i need for my item and how all of this work. I want to keep trying to learn but somehow it's frustating as i know how to do it all in Unity with C# and it's like going back in time 8 years pffff
Don't want to bother, but i have to ask for a little help so i can start propperly modding by myself
Oh, I wish I saw this sooner - I think SuperWeirdHelis and SoulFilcher's TurningTime could have saved you time ๐
Is it possible to change generator's range?
Generator's are pretty javasided as far as the isoObjects go - so probably not.
If you have decompiled code you can check the java file for IsoGenerator
Looks like the range is in java and not even as a field
it is +/-20 outside, and the building/lot it is on
Thank you for answering in such detail
Oh that would be great
there is a java mod in steam
You just need to understand the PZ systems and learn lua. Some things accept scripts, other parts can be easily customized with lua and other parts are so hard coded they can not be changed without java.
Campfire uses global objects so that it can change data for all objects on the whole map even when they are not loaded.
Unfortunately most systems need you to overcome hardcoded code. Best you can do is hook or inherit with lua. Depending how many parts you need to change you will choose one or the other way.
For inheriting lua uses metatables, PZ has a shortcut called derive for lua classes.
ouuu
I was driving around in my 1+ year old world earlier this week and trying to burglar a car. Every car I came to had 0% battery charge. Then i realized its 1993 and WHERE TEH FUK R MY JUMPER CABLES. I looked around. I couldn't find a mod for them. So here you go. I made one. ๐
Scott's Jumper Cables is a Mod for Project Zomboid.\
Park your vehicles front to front and connect the jumper cables. Start the engine and you're good to go!
Check out the mod here:
https://steamcommunity.com/sharedfiles/filedetails/?id=2990322197
Check my other zomboid mod "Point Blank" here:
https://youtu.be/bnbjy8FDgCo
#projectzomboid #mods
Anyone know of an extension for visual code that'd help out with coding in lua? Like snippets and stuff.
The Game in the Game thing got you pretty far ๐
It was a good idea to implement monopoly, I had to refactor the card system to allow for cards to share visuals/names but operate differently
Now people can use shared textures or names
So something like yugioh can just use the type colors
You look a bit like John Wick 
if I start executing a timed action and while the character is walking, that is, the action has not yet started, I can call the context menu again, and then, if I do not remove this context menu, start the action again if I try to call the context menu after the beginning of the action, then it will not appear as intended, but how can I implement it so that the context menu does not appear or it cannot be used more than once before the start of the action, while the character is walking?
There are 2 points where you always check if it's valid, first when they click and the other one during the action, action.isValid. There is also another one less used for when the actions is not added as first in line, it's action.isValidStart.
Another solution is to use luautils.walkAdj(playerObj, square, keepActions) on context click, when keepActions is false or nil then the actions queue is reset.
ะฟะตัะตะฝะตัะธ ะฟัะพะฒะตัะบั ะฝะฐ ะฒัะบัััะพััั ะฒ ะฒะฐะปะธะดะฐัะธั
ะตัะปะธ ะฒัะบัััะพ return false
ะธะฝะฐัะต true
thanks
ัะดะฐะปะธ ะตั ะฒ ะดััะณะธั ะผะตััะฐั , ัะพะปัะบะพ ะฟะพ ะพะบะพะฝัะฐะฝะธั ะดะตะนััะฒะธั (ะฟะตััะพัะผ ะตัะปะธ ะฝะต ะพัะธะฑะฐััั) ะฟะพะผะตะฝัะน ัััะฟั ะฒัะบัััะพััั ะฝะฐ true
ะฟะพ ัััะธ ะฟะพัะธะณ ะตัะปะธ ะผะตะฝั ะฑัะดะตั ะฒัะทัะฒะฐัััั ะฟะพะฒัะพัะฝะพ, ะดะตะนััะฒะธะต ะฒะฐะปะธะดะฐัะธั ะฝะต ะฟัะพะนะดัั
can somebody figure out why this error pops up? the syntax is the same as vanilla
local shortbladefan = TraitFactory.addTrait("Shortbladefan", getText("UI_trait_aptshortblade"), 3, getText("UI_trait_aptshortbladedesc"), false);
local shortbluntfan = TraitFactory.addTrait("Shortbluntfan", getText("UI_trait_aptshortblunt"), 3, getText("UI_trait_aptshortbluntdesc"), false);
shortbluntfan:addXPBoost(Perks.SmallBlunt, 1)
--ERROR COMES FROM HERE
TraitFactory.setMutualExclusive("shortbladefan", "shortbluntfan");```
```lua
Caused by: java.lang.NullPointerException: Cannot read field "MutuallyExclusive" because the return value of "java.util.LinkedHashMap.get(Object)" is null
S? S what?
just a guess but check the S capitaization
in setMutualExclusive? thats the correct method according to documentation
He means in the names that you pass to setMutualExclusive
Short Short
short short
How about this, when i create this traits, if i try to add them to a profession, i get this error attempted index: getLabel of non-table: null
local foresthike = TraitFactory.addTrait("foresthike", getText("UI_trait_foresthike"), 0, getText("UI_trait_foresthikedesc"), true);
local forestwalk = TraitFactory.addTrait("forestwalk", getText("UI_trait_forestwalk"), 0, getText("UI_trait_forestwalkdesc"), true);
i have UI text as well
UI_trait_foresthike = "Test1",
UI_trait_foresthikedesc = "Test12",
UI_trait_forestwalk = "Test123",
UI_trait_forestwalkdesc = "Test12",
im not sure if im missing anything, the way i understand, it can't find my trait, but it should. the syntax is correct. it works with other traits but not this one
What line does this point to
it doesnt point to anything sadly
function: onSelectProf -- file: CharacterCreationProfession.lua line # 540 | Vanilla
function: onMouseDown -- file: ISScrollingListBox.lua line # 491 | Vanilla
ERROR: General , 1696249971911> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getLabel of non-table: null at KahluaThread.tableget line:1689.
ERROR: General , 1696249971911> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: getLabel of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:641)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallBoolean(KahluaThread.java:1924)
at se.krka.kahlua.integration.LuaCaller.protectedCallBoolean(LuaCaller.java:104)
at zombie.ui.UIElement.onMouseDown(UIElement.java:996)
at zombie.ui.UIElement.onMouseDown(UIElement.java:959)
at zombie.ui.UIElement.onMouseDown(UIElement.java:959)
at zombie.ui.UIElement.onMouseDown(UIElement.java:959)
at zombie.ui.UIManager.update(UIManager.java:755)
at zombie.GameWindow.logic(GameWindow.java:262)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:765)
at zombie.GameWindow.run_ez(GameWindow.java:681)
at zombie.GameWindow.mainThread(GameWindow.java:495)
at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1696249971912> -----------------------------------------
STACK TRACE
The top of the error is what's wrong with it
My guess is you're missing something from the arguments in addTrait
Go back and compare it to how vanilla adds them
Guys I have an idea ,to make a fan copy of Project zomboid in Unreal Engine 5 .Who is interested DM me
hey hoomans, do u know if there's any way to create hair models without blender?
check for typos where you add free traits...
exclusive should be not for local, but for trait id
TraitFactory.setMutualExclusive("Shortbladefan", "Shortbluntfan"); for u
require('NPCs/MainCreationMethods');
local function initzReBLTraits()
local nimblefingers = TraitFactory.addTrait("nimblefingers", getText("UI_trait_nimblefingers"), 0, getText("UI_trait_nimblefingersDesc"), true);
nimblefingers:addXPBoost(Perks.Lockpicking, 2)
nimblefingers:getFreeRecipes():add("Lockpicking");
nimblefingers:getFreeRecipes():add("Alarm check");
nimblefingers:getFreeRecipes():add("Create BobbyPin");
nimblefingers:getFreeRecipes():add("Create BobbyPin2");
local nimblefingers2 = TraitFactory.addTrait("nimblefingers2", getText("UI_trait_nimblefingers"), 3, getText("UI_trait_nimblefingersDesc"), false);
nimblefingers2:addXPBoost(Perks.Lockpicking, 2)
nimblefingers2:getFreeRecipes():add("Lockpicking");
nimblefingers2:getFreeRecipes():add("Alarm check");
nimblefingers2:getFreeRecipes():add("Create BobbyPin");
nimblefingers2:getFreeRecipes():add("Create BobbyPin2");
TraitFactory.setMutualExclusive("nimblefingers", "nimblefingers2");
local traitList = TraitFactory.getTraits()
for i = 1, traitList:size() do
local trait = traitList:get(i - 1)
BaseGameCharacterDetails.SetTraitDescription(trait)
end
end
local function initzReBLProfession()
local burglar = ProfessionFactory.addProfession("burglar", getText("UI_prof_Burglar"), "profession_burglar2", -4);
burglar:addXPBoost(Perks.Nimble, 2)
burglar:addXPBoost(Perks.Sneak, 2)
burglar:addXPBoost(Perks.Lightfoot, 2)
burglar:addFreeTrait("Burglar")
burglar:addFreeTrait("nimblefingers");
local profList = ProfessionFactory.getProfessions()
for i = 1, profList:size() do
local prof = profList:get(i - 1)
BaseGameCharacterDetails.SetProfessionDescription(prof)
end
end
Events.OnGameBoot.Add(initzReBLTraits);
Events.OnGameBoot.Add(initzReBLProfession);
Events.OnCreateLivingCharacter.Add(initzReBLProfession);
it's how structure for moded trait/profession look like
does anyone know how to limit 'moderators' from accessing specific server commands?
Hello guys,
real head scratcher here, if I could get some advice it would be greatly appreciated, I've really exhausted options and been struggling with grasping this for a good week..
I've been attempting to add some client-server communication to prevent a context option from being available if a flag is set to true, here is the relevant code.
Client Context triggers a function that is stored in the shared space
if TerritoryWarfareCapture.IsInProgress(controlPointID) then
player:Say("A Territory War Event is in progress here.")
elseif hasOwnFlagOnCorner then
player:Say("We already control this territory")
elseif playerFaction == winnerFaction then
context:addOption("Start Territory War Event", worldObjects, function() startTerritoryWarEvent(controlPointID) end)
else
player:Say("It seems a little... too quiet here")
end
end
When the "startTerritoryWarEvent" is triggered we send the command to the server
function startTerritoryWarEvent(controlPointID)
local args = {
controlPointID = controlPointID,
capturing = true -- Yes this is reduntant now
}
sendClientCommand("TerritoryWarfare", "CaptureStarted", args)
-- rest of the code
A timer completes and then we declare the winner
function declareWinner(controlPointID, winnerFaction)
local args = {
controlPointID = controlPointID,
capturing = false -- Yes this is reduntant now
}
sendClientCommand("TerritoryWarfare", "CaptureCompleted", args)
-- rest of the code
This is the client command receiver which is running on the server side
-- Register server command receiver --server
function receiveClientCommandForTerritory(module, command, args)
if module ~= "TerritoryWarfare" then return; end
if command == "CaptureStarted" then
sendServerCommand("TerritoryWarfare", "CaptureStarted", args)
end
if command == "CaptureCompleted" then
sendServerCommand("TerritoryWarfare", "CaptureCompleted", args)
end
end
Events.OnClientCommand.Add(receiveClientCommandForTerritory)
The command should then be passed back to all clients and is handled in a client script like so
-- Register client command receiver --client
function receiveServerCommandForTerritory(module, command, args)
if module ~= "TerritoryWarfare" then return; end
if command == "CaptureStarted" then
print("Received Command Capture Started!")
TerritoryWarfareCapture.CapturingControlPoints[args.controlPointID] = true
end
if command == "CaptureCompleted" then
TerritoryWarfareCapture.CapturingControlPoints[args.controlPointID] = nil
print("Received Command Capture Finished")
end
end
Events.OnServerCommand.Add(receiveServerCommandForTerritory)
As shown in the first code block during the context we run this utility return function from the shared space to see if the event is in progress to prevent overlapping events on the same control point
TerritoryWarfareCapture = {}
TerritoryWarfareCapture.CapturingControlPoints = {} -- Table to track ongoing capture events
--shared
function TerritoryWarfareCapture.IsInProgress(controlPointID)
return TerritoryWarfareCapture.CapturingControlPoints[controlPointID] == true
end
Any hints at what might be going wrong here would be much appreciated, I've gone through some debug print statements to see if my commands are being received, no luck, can't make it passed the module check on either server nor client side. 
if you aren't getting past the module check this won't be the cause of your issue, but receiveClientCommandForTerritory's signature is incorrect (module, command, args when it will be passed module, command, player, args) which will break a lot of this code
Player parameter is required for this function?
yeah, remember arguments are passed by order not name so your code assumes args is the argument table when it's actually a player object
You're the best
Idk anything about coding this shit looking like harry potter spells or smth

Totally agree. :p
Well, I have a question -- Looking to adjust "ZombieZoneDefinition" To only have a specific type of zombie with a specific type of outfit spawn. I attempted to only have
in the file (Along with ZombiesZoneDefinition.Default = {}; of course) , but that didn't work.
Any advice?
Anyone know how to create a randomized tile blend for replacing concrete?
If thats possible
you could see what beds have blankets does.
hm ill check it out, ty
how to get character temperature?
Should I work on each body part separately or can it be one param for all?
you could use the Moodle level?
i want do func for clothes, if u wear that, they change your temperature (high then X -> down. Low then Y -> up)
not want work with Moodle lvl
roughly know how to do this, but I donโt know what is responsible for the temperature (itโs when the character is active in heavy clothes that he starts to get very hot)
Anyone know how to change ownership of map tile objects so they're not thumpable?
I'm trying to paste the tall wall fences they use in some neighbourhoods, they as soon as I do, they get broken by a horde
I created a drainable oil lamp which can be used as a lightsource. This works so far so I can hold and light it. I created a visible model etc.
What I like to do now is to make it placeable like normal lamp (or campfire) and being able to light it.
But I have no clue where to start. I assume that I have to create something like an IsoThumpable or something like this... Is there a tutorial for something similar?
Have a look at the "Lantern" mod, it has what your looking for
Thx. I'll check that.
ISLanternLightObject.lua and Events.lua should be what your looking for
Hello everybody ๐ Hope you're fine
Does someone know a table command to remove a clothe from vanilla Zombies ?
I want to remove the vanilla PoliceBulletVest and replace with a modded one
u should find in clothes.xml guid of Police Vest and take preset of zombies where this guid to be.
create your clothes preset and copy this zombie
change guid of Vest on your Vest.
your zombie preset override vanilla preset with same guid and preset name
Easy way - change Police Vest in script - use parameter from mod with Vest, but item ID stay old
Easy way 2 -
use adjuster in client side lua for change Police Vest (better compatibility)
Hey ๐ Do you know the way to do this clean ?
yep, find adjuster into "zRe mod server"
and with this stuff change parameters on moded vest
for Police vest
stuff like item do param
Gonna take a look ๐
Sometimes, just sometimes I want to kill people when coding in lua
Apparently doing ipairs with table will silently fail if there is any nil value, even if you check it conditionally
local a = { 0, nil, 1};
for i,v in ipairs(a) do
if v then print(v) end -- No 1 for you, poopoo
end
hello lads, i have made a more occupations mod, i have done all the images, some of the ''coding'' but now i want to figure out how to test the mod? can someone help pls
Place your mod folder in C:/User/Zomboid/Workshop and activate it on the PZ menu. I suggest to activate debug mode: right click on PZ on steam, launch properties "-debug" go!
and it just says its missing mod.info file
can i dm someone and tell them of my situation ? its a bit silly lol
There's a stat check for this - it's it's own object
Thermoregulator
Is it possible somehow easier?
Just count the current body temperature, if it is higher, lower it, if lower, increase it (on tick) 
or body part
The thermoregulator might be feeding the temp to the body damage
keep in mind that in a table, nil is not a value, but the lack of a value - ipairs loops through consecutive numeric keys, when it reaches 2 it sees there is no entry for 2 and stops looping
this is literally necessary for the language to function, as otherwise ipairs would be an infinite loop as all unassigned keys are nil
yo anyone knows where equip function located is (the one that fires when player equips an item, i want to catch which item player equips)? talking about hooking up to in-game triggers, something like this: (pic attached)
tried looking up in lua files, thought it's ISWorldObjectContextMenu.equip but doesnt look like it cuz this print ain't firing
local original_equip = ISWorldObjectContextMenu.equip
ISWorldObjectContextMenu.equip = function(playerObj, handItem, item, primary, twoHands)
print("equipped an item");
return original_equip(playerObj, handItem, item, primary, twoHands);
end```
different parts of code are used for equipping (in hand) and wearing (clothes). the former is ISEquipWeaponAction:perform() for ALL items in hand (except heavy items, maybe except bags). check ISEquipWeaponAction.lua / ISEquipHeavyItem.lua / ISWearClothing.lua. There are also plenty of action that automatically equips tools and I am not sure they all unequip at the end.
ISWearClothing.lua is what i want, ty
only want specifically clothes
cheers
another way could be to subscribe to OnClothingUpdated and parse all worn clothes. It may look like overkill but OnClothingUpdated is pretty consistently called by vanilla (even though some parameters would have been welcome, wink! wink!) and may handle cases that are not otherwise (like Java calls you cannot hook). Else, there is always the OnPlayerUpdate if your algo is lightweight.
Been itching to get back to my vehicle mods, but I wonder: Has anyone found a workaround for the the vehicle java only using the vehicle's script engine power instead of the vehicle's instance engine power?
I had a couple ideas before I ran out of free time for modding, but I'm curious if its a solved issue now
Hi I'm trying to get zombie's outfit/type/name that something special to a zombie. For example, if I added a new zombie, how can I find out if I hit this zombie when I hit it? Can someone help me?
local function onWeaponHitChar(attacker, target, weapon, damage)
if not target:isZombie() then return end
-- check zombie outfit?
-- add pain
end
Events.OnWeaponHitCharacter.Add(onWeaponHitChar)
zombie:getOutfitName()
is calling dressInPersistentOutfit from a client enough to make everyone see the outfit on a zed?
is calling it from the server enough?
the way my mod works it should get called on all clients and the server
atm
i dont have access to a decompile atm
so i cant check how it works
could someone help me with an more occupations mod i am making?
i dont understand where the issue is, the occupations dont even want to show up
before, they did show up but they had UI_ prof _ xxx as names
so then i changed the translate file, made sure it would correctly show shit, and now im stuck? idk where to go from now
I really wanna learn this modding API, its just so confusing xD trying to make a woodland 3x3 cell map, and a collection of mods to allow for crafting essential materials like nails and stuff and basically creating a survival overhaul for PZ in preperation for agressive animals when the update drops. Ive made a few attempts at a map, kinda getting it, but idk where to even start with essentials crafting like a mod that lets you forage for "scrap metal" that you can then make metal stuff with or having seeds appear in foraging, or craftable clothes/guns/furniture etc and maybe even an ATV or somm
Idk it feels like this stuff should be simple but idk where to even start with the actual mods stuff
nothing is simple in PZ
abandon that idea immediately
recommend looking at mods that do similar things to what u want
study those
hello, im trying to upload my mod but it gives me result 9 error?
its like file path is wrong or something, but i dont get it? i didnt change the file path at all
Have an way with lua for send logs ?
To the server
Posting half to show off my current progress and also because I'm wondering if there's a good way of drawing, like, a line between two points?
there's the debug LineDrawing class with the drawLine and drawArc functions but I dont know if those are only visible in debug mode
question aside, I'm really happy with how things are progressing! I've been working on this mod on and off for about a month now and I'm so excited that I have a working method of setting up the node structure
Hi everyone! I need help with that.
Why do so many mods package ItemTweaker? Seems be asking for problems with so many versions floating around.
it comes with instructions and people follow the trends
I think one person started repacking it as is with same ID and all and it caused issues, so many people started repacking it to avoid those issues but changed the ID slightly.
Hi, I pay for someone repair an mod. Contact in private message.
wop wop wop
"Better Towing"
Can anyone tell me if I can override existing lua with sub-mod?
Aka I have a mod with distribution table, I want to create a patch mod that will replace the .lua from original one.
Will that work at all?
Can someone recommend me a royalty-free audio databse site for mod usage? (DM me please, it may not be allowed to share such sites in this channel)
Btw, what does weapon's sound volume represent exactly? Does it effect how far one can hear other's gunshots?
same folder and lua name
Your mod in priority
incompetence
on all sides
Priority means what exactly?
Because the only load order that mods have is through require chain.
My wild guess is that mod that requires other mod overwrites its content if overlaps?
load priority.
down in list has high priority
I can't help but keep finding myself back here time after time - even after burnouts.
Always neat to see what people are cooking up, plus it motivates me to actually work on my own stuff.
I've found myself wanting to make a tropical modpack but the lack of many sea-worthy mods makes it difficult - and that's where making your own mods comes in!1
@fast galleon It was there this whole time, it just was "hidden", I unlocked it. You were correct that it's a tile property.
I'm not sure if you saw it but I added the IsoFlagType.water note right after I crossed out the IsoWater object.
it's what the water= is converted to.
Do you think if I make a chair have water = true it'll make the chair water shaded?

ope, no I didn't see that
A: Only works for floor tiles, shader doesn't render ontop of the tile
B: If there's a floor tile there, you can't see it, but you can see the edges
c: Doesn't work inside for some reason
Is this still the case?
-- Steam cannot delete files from the upload/download process only update them.
-- Even verifying the cache will miss deleted files due to them not being on the manifest.
never heard the second one, but the first one yes
the second one seems consistent with how verifying tends to work though
If I were to use an item version of a tile in a recipe, would I have to import the Moveable module, like how one must import the Base?
I'm looking to use Movables.trash_01_29 as one of the examples.
you only need to import a module if you want to refer to it by its short type (e.g. trash_01_29 instead of Movables.trash_01_29)
personally i wouldn't
Been working on a simple mod, adds a drink. The textures for the drink are not showing up, it appears as a question mark in a bubble icon. Secondly it does not replace itself on use with the empty version of the item that I made. Anyone have any idea why this could be?
Thank you in advance
Best of luck to my fellow modders
the most common reason for the icon not showing up is because of the Item_ prefix in the file name
this prefix is mandatory and automatically added
e.g. a texture Item_MyItem.png would be referenced as just MyItem in the script
i can't say what your issue is for sure without seeing anything but that one comes up here constantly
Thank you for getting back to me quickly, will go back and see if that could be it
This is what I had last time I played and when I had the issues
This is how they are named in my files
This is the directory that it uses
Both textures are 32x32
Looking through another mods files I think perhaps the way it is written is entirely wrong
Sorry to bother, thank you for the help
@winged hollow folder name typo : media\texture -> media\textures
Ah! Thank you
I was really losing my hope
I did indeed change it, but something still must be wrong with my code
But thank you lots, I'm narrowing down what it could be
What's the best place to research PZ modding? Is there some kind of documentation?
Thank you
Has anyone made a mod for Rick's jacket from TWD?
Hi, how can I add 3 extra options to wear a clothing?
ClothingItemExtra = Type1, ClothingItemExtraOption = Wear_1, clothingExtraSubmenu = Wear_2,
is there any moders?im not. what if you guys add a new ocupation that its a pizza delivery.and you have orgnized runner and you know all the map.20 points?
ClothingItemExtraOption = Wear_1;Wear_2;Wear_3,
clothingExtraSubmenu = Wear,```
include all the items you want available separated by ;
"clothingExtraSubmenu" is the one for the current item when you right click to equip it
New day, new good info
yo guys how can I get in touch with @heady crystal รจ_รฉ
@low yarrow If you set to spawn a zombie in ZombieZoneDefinitions.lua and it is a sex exclusive outfit (Male or Female only), You got to state it as such or else the game will try to spawn the other sex, realize that it doesn't exist, then choose to spawn a random outfit from its clothing.xml list.
Could someone help me why the code in the below does not work on MP? and only work in SP client side??
-- Define the luautils table locally
local luautils = {}
-- Define the stringStarts function
function luautils.stringStarts(str, start)
return str:sub(1, #start) == start
end
-- Define a function to check if a proposed safe zone overlaps with a road
local function isSafeZoneOnRoad(x1, y1, x2, y2)
for i = x1, x2 do
for j = y1, y2 do
local checkSquare = getCell():getGridSquare(i, j, 0)
if checkSquare then
for k = 1, checkSquare:getObjects():size() do
local obj = checkSquare:getObjects():get(k-1)
local oTN = obj:getTextureName()
if oTN ~= nil and luautils.stringStarts(oTN, "blends_street") then
return true
end
end
end
end
end
return false
end
local function chk4item(player,item)
local player = getPlayer()
local inv = player:getInventory()
if inv:contains("WURO_items.???") then
return true
end
end
-- Function to create a safe zone of a given size
local function createSafeZone(worldobjects, square, playerss, size)
local player = getPlayer()
local inv = player:getInventory()
local x1 = square:getX() - size / 2
local y1 = square:getY() - size / 2
local x2 = x1 + size
local y2 = y1 + size
if isSafeZoneOnRoad(x1, y1, x2, y2) then
return
end
if chk4item() == true then
SafeHouse.addSafeHouse(x1, y1, size, size, playerss:getUsername(), true)
inv:RemoveOneOf("WURO_items.???")
else
player:Say("You don't have required item")
return
end
end
local function Context_safezone(player, context, worldobjects, test)
local playerss = getSpecificPlayer(player)
local square = clickedSquare
local submenu2 = context:addOption(getText("Set Safehouse"), worldobjects, nil)
local houselists = SafeHouse.getSafehouseList()
for i=1,houselists:size() do
if houselists:get(i-1):getOwner() == playerss:getUsername() then
local toolTip = ISWorldObjectContextMenu.addToolTip();
toolTip:setVisible(false);
toolTip.description = getText("You can only own one Safe house");
submenu2.notAvailable = true;
submenu2.toolTip = toolTip;
return
end
end
local subMenu3 = ISContextMenu:getNew(context)
context:addSubMenu(submenu2, subMenu3)
for size = 5, 20, 5 do -- Sizes from 5 to 20, in steps of 5
local sizeKey = "Zone" .. size
subMenu3:addOption(getText(sizeKey), worldobjects, createSafeZone, square, playerss, size)
end
end
Events.OnFillWorldObjectContextMenu.Add(Context_safezone)
@open drum try : SafeHouse.addSafeHouse(x1, y1, size, size, playerss:getUsername(), true) -> SafeHouse.addSafeHouse(x1, y1, size, size, playerss:getUsername(), false)
nope.. same i dont think that was the problem
Which part don't work on MP?
the whole code works up to serting up the safezone but when i log off and back online it is gone. also safezone is not seen by other players
so basically it is o ly applied on my client temporarily
Check DM
@median mantle
why are there so many trajectory mods? Is there a central GitHub for bugfix / improvements?
@fast galleon Idk since I'm not the author of original Adv Trajectory mod.
But you have the best version, judging the comments.
yep, its true
Thanks guys 
Is it possible to set a character to can't be knocked down without giving god mod?
Hi! How can i change or add the stacking count of an item ? I created an item for my mod and I would like it to stack in groups of 10. ๐
that's just not really a thing in zomboid
there are no stack limits, the inventory doesn't work like that
works with weight?
To add clothing items to a vanilla outfit (or completely overwrite it), do you simply add the same vanilla guid to your clothing.xml?
Also, how does probability work in the case of subitems? I know it gives probability for the initial itemGUID, but how does it impact the subItems? Can you set a probability for each subItem?
<m_items>
<probability>0.3</probability>
<itemGUID>5fc22466-2942-4ba1-8c33-2a8528b73021</itemGUID>
<subItems>
<itemGUID>ce1a8520-7120-432e-8a3a-aa7b3094f0bb</itemGUID>
</subItems>
<subItems>
<itemGUID>c7cc655b-284a-4087-85a6-d7c116385fb0</itemGUID>
</subItems>
<subItems>
<itemGUID>0383956a-3fbd-4001-9749-69e2ba70b134</itemGUID>
</subItems>
</m_items>
My assumption is that probability determines the chance for an item to be a slot in general then it rolls for the initial itemGUID and SubItems equally.
Now that I think about it, this would break other mods that add items to outfits. hrmmmmm
Attempting to overwrite a vanilla outfit breaks the outfit completely. Only the items you add work, even when leaving the entire outfit the same aside from the added items. Zed will spawn nude with only the new items.
There has to be another method todo this aside from overwriting the vanilla entry.
is it possible to change generator's efficiency?
Yes
Like, not from sandbox. i'm trying to make a custom generator with high efficiency
i'm trying to find the file where their fuel consumption is listed, but i'm having trouble
You want the fuel to last even longer?
This may help, but if you want the fuel to last longer just use the sandbox option:
https://steamcommunity.com/sharedfiles/filedetails/?id=3022147060
Mod works as intended now, thank you for the help
Thank you for the help mod works as intended now
The issue was embarrassing, because of this I will not specify what went wrong, but I really do appreciate the help I was given
Hello everyone, I faced an issue, when I'm trying to add new clothing Item and for some reason, It just shows this screenshot. I have no clue what in the hell I have to do to fix this issue. Also, the clothing item Itself doesn't appear on the character.
**Tags for future users with the same issue: ** Blank clothes ; Blank ; Clothes
Fix: Just checked the path in file "fileGUIDTable" and rewrote It to the proper one.
It means smtj is broken in your item script
Okay, I got one more question. How to make this screenshot2 out of this screenshot1
What's up with proc distros having more than one entry for the same item?
CampingStoreBackpacks = {
rolls = 4,
items = {
"Bag_ALICEpack", 0.5,
"Bag_ALICEpack", 0.5,
"Bag_BigHikingBag", 2,
"Bag_BigHikingBag", 2,
"Bag_DuffelBag", 6,
"Bag_DuffelBag", 6,
"Bag_NormalHikingBag", 4,
"Bag_NormalHikingBag", 4,
"Bag_Schoolbag", 10,
"Bag_Schoolbag", 10,
},
When the loot for this proc spawns it rolls 4 times. So each roll the item that's chosen cannot be chosen in subsequent rolls?
Answering my own question for people, who may find themselves in the same situation.
Tags: Clothing ; Broken model ; Rig clothes ; Weight map
Fix: I had to manually assign parts of my model to PZ character rig to make the model work (Manual Weight Painting)
P.S. ty pz modding community for being so helpful ๐ฅฐ ||You're useless||
I will learn two coding languages before I ever touch 3d modelling
Im scared of it
Hey buddy, I think you've got the wrong door, the #modeling club's one block down
what's the best way to transmit mod data from one client (player) to another? I was thinking about using a combination of server and client commands but can that even return values?
you can't 'return' something with a command, you have to send a response command with the values to 'return'
lua being single-threaded, waiting for a command to return something would freeze the game for at least twice as long as your ping is ๐
was hoping I could avoid the response command approach but guess it's the optimal way to go
thanks!
Yep, the amazona outfit has half the spawnrate then the other ones.
It doesnt felt right to make a male version of the dress ๐
Hey man ๐
With your adjust parameter, can't find a way to replace an object by another.
Can you send me an example where Base.Vest_BulletPolice will be replaced by Base.EFK_PACA please ? ๐ ๐
what do you guys do to test your mods before updating them? Improved Hair Menu is up to almost 700K subs so I feel like I should be testing things first๐
I still have nightmares about that time I broke the whole main menu
local function zReAdjustItem(Name, Property, Value)
local Item = ScriptManager.instance:getItem(Name)
if Item then
Item:DoParam(Property.." = "..Value)
end
end
zReAdjustItem("Base.Vest_BulletPolice", "ClothingItem", "Look ClothingItem in script EFK_PACA");
zReAdjustItem("Base.Vest_BulletPolice", "WorldStaticModel", "Look WorldStaticModel in script EFK_PACA");
zReAdjustItem("Base.Vest_BulletPolice", "Icon", "Look Icon in script EFK_PACA");
zReAdjustItem("Base.Vest_BulletPolice", "DisplayName", "Look DisplayName in script EFK_PACA");
Thank you again my God ๐คฉ
that is, in essence, you simply rewrite the parameters for a vanilla item, without completely rewriting the item itself.
As for me, this is the most adequate way to replace body armor in zombie clothing presets
Can you "add" property into an item with your function ?
Because i'm just discorvering that vanilla bullet vest have no weight ๐ณ ๐ฌ ๐ฑ
function testFunc(player, context, worldobjects)
local playerObj = getSpecificPlayer(player)
local clickedPlayer = nil;
for _ ,v in ipairs(worldobjects) do
if instanceof(v, "IsoPlayer") and (v ~= playerObj) then
clickedPlayer = v;
end
end
end```
function is called ``OnFillWorldObjectContextMenu``, trying to add a context menu when you right click another player. There are no isoplayers at all being detected in worldobjects. Any idea why is that?
Solved
Hello... i dont know this is the right channel or not. but, i have question. is it possible to modding "loot respawn" sandbox option, so whenever its time to respawn, instead of respawn in the exact time it respawn in range between x to y day. thanks.
it is very simple once you get the basics of it, especially since for zomboid you'd most likely do low poly models
Blender is free so no need to worry about software to do it
Plenty of tutorials too
Hallo, I wrote a script for my server to Automatically restart every 2 Hours because I didn't like my providers solution. For some reason it doesn't seem to work or even show up in the console when I yeet it into the scripts folder. Anyone know why?
First time i try to do this btw
1, what is the "scripts" folder? 2, did you write this code yourself?
funcCache.ScriptItem = __classmetatables[Item.class].__index
Anybody know why this would ever return null form __classmetatables?
It works when I test it in singleplayer and multiplayer myself, but not on the test server
does the test server use the same mods?
Are you testing it in isolation on the test server? & have you confirmed that the problem is that __classmetatables[Item.class] is nil?
The test server is stuffed with mods
very specifically there are a couple mods that are known to overwrite Item
at which point Item.class is null and won't return anything in the classmetatables
... I did a folder-wide search and found only my mod do it
Well, access that class I mean
Folder-wide search for "Item.class", or "Item"?
Item.class
yeah
the offending mods were using an item tweaking function which used a non-local Item to store the script item
I see
...Then maybe I can access the class in a different wat
...Oh you fucker Better Flashlight
from inside a local function
if you can ensure your file runs first you can save Item to a local variable before they ruin things
so what is the best way to instantiate an items such as VHS or CDs?
Maybe I can access the class in a different way? I saw going from _G[]
_G["Item"] is the same thing as Item
So that's overwritten as well
_G is just a way of explicitly referencing the global namespace
What if I try to access it with the full path?
function Exports.global(id) return _G[id] end
zombie.scripting.objects.Item
Uh, which Ryan do I poke for More Smokes issues
...Okay, somehow I managed to make the game have a stroke
Then It didn't happen
[07-10-23 19:49:17.052] LOG : General , 1696700957052> 0> STATE: exit zombie.gameStates.GameLoadingState.
[07-10-23 19:49:17.117] ERROR: General , 1696700957117> 0> ExceptionLogger.logException> Exception thrown java.lang.NullPointerException: Cannot invoke "zombie.core.textures.Texture.getWidth()" because "this.texture" is null at HUDButton.<init> line:94..
[07-10-23 19:49:17.117] ERROR: General , 1696700957117> 0> DebugLogStream.printException> Stack trace:.
Where do I put a test mod? (Specifically for the Steam Workshop.)
C:\Users\{Your Username}\Zomboid\Workshop\{Your mod's folder}
Do I need to assign it the numbers like other workshop mods?
No, a mod's workshop ID is automatically assigned to it when you publish it to the workshop
How do I test without publishing?
You can find the mod in your in-game's mods menu after properly placing it locally
Like so.
โโ testMod/
โ โโ preview.png
โ โโ Contents/
โ โ โโ mods/
โ โ โ โโ testMod/
โ โ โ โ โโ media/
โ โ โ โ โ โโ lua/
โ โ โ โ โ โ โโ client/
โ โ โ โ โ โ โ โโ yourScript.lua
โ โ โ โ โ โ โโ server/
โ โ โ โ โ โ โโ shared/
โ โ โ โ โโ mod.info
โ โ โ โ โโ poster.png
Hi, can someone explain me why player is always nil ?
Is your file running in the client folder or server/shared?
yeah if I try to mess things up on purpose the game lets me know
More and Better "whatever" series were involved. Some of them have been patched. https://steamcommunity.com/workshop/discussions/18446744073709551615/3812908758675356532/?appid=108600
nvm it's working now lol
So do I need a workshop.txt or no, I can't seem to get it to work regardless.
No you don't need it pre-publishing. The file will be created automatically for you when you publish the mod
What is not working exactly?
It's not showing up in any menu I can find for mods.
Did you write anything in mod.info?
name=transScribe
id=transScribe
description=This is an example mod containing two maps.
poster=poster.png
Not all has been alterd from the base template.
In facct.
I'll change description now.
even yet, having written in mod.info, it should be appearing in your mods menu in-game. Assuming you did the file/folder structure correctly
I think I did.
Are there any naming conventions I should be aware of, because I've managed to mess everything up with stuff like that prior.
Not that I am aware of. Not sure if capitalisation matters here but make sure everything matches. Only thing I can think of
|--Workshop
| |--transScribe
| | |--preview.png
| | |--Contents
| | | |--Mods
| | | | |--transScribe
| | | | | |--poster.png
| | | | | |--mod.info
| | | | | |--media
| | | | | | |--scripts
| | | | | | | |--transScribe.txt
Looks correct to me
It should display INFO file
if not, I'd assume its saved as a .txt extension file, and the name is just "mod.info"
--Mods
try to rename folder to mods
lowercase m
Though not sure if it matters
Sorry, that's my bad on spelling, it is undercase in my files.
ah
It should load in with other mods you said?
Yea it should be in the mods menu in-game
Well I'd just duplicate the ModTemplate folder and go from there
try to duplicate it, and change things slowly in it and see how the changes for it are reflected in-game. Probably start with changing the mod.info
Thank you.
Sure!
:|
I just realised why.
Why does zoomboid have like, four different places to put in third-party content.
I only know of Workshop and Mods folders. I don't use the latter. Not sure what the other 2 are
There are now three different workshop ones I know of , and one mod one I can recall.
that's weird
This is everything I have in my Zomboid folder. I use the Workshop one for mods i create
They're all in different directories, there the one where workshop stuff is actually downloaded too, one in users, and one that shops when you right-click browse files in steam.
That is where I went wrong.
Well good thing you got it sorted out now!
Yeah, I realised from looking at the directory here.
It works now, thanks for the help.
My pleasure!
Hi! How do I put my mod in the Steam Workshop nowadays?
This workshop button doesnt appear for me, any ideas why? 
-nosteam ?
yes
Thank you very much sir, you are a gentleman and a scholar
Guys hi hello
@median mantle hello friend, how about making the bullets fly out from where the muzzle flash is coming from?
like position for attachment muzzle
As far as I know, it's hard to get the actual position coords where the muzzle flash is coming from whereas it's easy to get player's bone position.
(Can easily get the world coords of player's bone position by getBoneWorldPos function in SwipeStatePlayer)
If you know proper function for it, let me know.
can u send name of lua file and number of string, where create start pos coordinate for projectile?
It just adds constant value to the player's current coords.
like, projectile initial pos X = player X + cos(player looking angle in rads) * 0.6
- I think that it's not good to discuss something about my mod in here. So, if you have anything to ask me about my mod, plz DM.
but I can move them along their axes (XYZ)?
hi
why doesnt this script work?
imports {
Base
},
recipe Make Wooden Nails
{
Plank=1
Result : NailsBox,
Time : 100.0,
}
i think it should work..
module Base
{
recipe Make Wooden Nails
{
Plank=1,
Result : NailsBox,
Time : 100.0,
}
}
.
,?
could anyone direct me to a right path in allowing
players to make more than one safezone?
just like admins?
i made a mod that allows players set safezones anywhere they desire
but when they set more than one
everything except the first one they set are gone once they re login
i know multiple safezones r possible since admins can do it... but cant figure out how to unlimit the normal players..
I think we should have more npc mod or framework like pzns one's
since its stable and user friendly
Not buggy like that of super survior
which npc mod is pzns??
is there a way to get the zombies in lua without relying on OnZombieUpdate?
is their a mod for deaf players... I want to know if theirs a house alarm or if zombies are attacking something
Like an Red ! Over the players head if they hear an House alarm like if they started it or not
@muted garnet https://youtu.be/4HyagA12WIk
๐
Hello! I'm sorry to bother you guys--new to the server here (and also to modding!) If I wanted to add a custom sprite to cars, is there a way to accomplish that?
I have 16 years of Photoshop experience, but not so much Lua...
๐ ๐
Any advice would be much appreciated. And thank you!
Hello guys! I'm starting now and I'm a little lost, is there any newbie friendly tutorials on how to put my first map in a dedicated server me and my homies rented?
Every other mods seems to be working fine, but the the map I created doesn't. I can even spawn in the location where the buildings and everything else suposed to be but there nothing there but woods ๐
Sorry for the really bad english
GD, I have a mod where I combine two bags to make one, but I have the problem that when I separate them, one of the bags has more space than it should since it is smaller.
I tried to make a script so that when the big bag has a weight greater than 5, I can't do the crafting to separate them, but I can't, can anyone help me on how I could do it? ๐ฅฒ
so essientally i found a mod that has everything i want but missing one thing i was wondering if there's a crash course/ beginners guide because i'd like to add to the mod and want to use this an excuse to mod
so any tips for a beginner?
thank
Are there any medicine/dru-g overhaul mods?
I've found a lot of small, specific and focused mods but I'm looking for a full overhaul
I try to add my own perk to the Survivalist group. Technically it works but when I host a game or using the my dedicated server I get the following error in the server console / log when I add XP to the perk.
self.character:getXp():AddXP(Perks.PrimitiveCrafting, calculatedXP)
-->
ERROR: General , 1696789161083> 1,393,673,521> java.lang.NullPointerException: Cannot invoke "zombie.characters.skills.PerkFactory$Perk.getType()" because "<local6>" is null
ERROR: General , 1696789161083> 1,393,673,521> at zombie.characters.IsoGameCharacter$XP.AddXP(IsoGameCharacter.java:14848)
ERROR: General , 1696789161083> 1,393,673,521> at zombie.network.packets.AddXp.process(AddXp.java:52)
ERROR: General , 1696789161083> 1,393,673,521> at zombie.network.GameServer.receiveAddXp(GameServer.java:1276)
ERROR: General , 1696789161083> 1,393,673,521> at zombie.network.PacketTypes$PacketType.onServerPacket(PacketTypes.java:1022)
ERROR: General , 1696789161083> 1,393,673,521> at zombie.network.GameServer.mainLoopDealWithNetData(GameServer.java:1532)
ERROR: General , 1696789161083> 1,393,673,521> at zombie.network.GameServer.main(GameServer
I did several tests and it seems to happen when I use the "Survivalist" category but not when I create my own category. So when the perks.txt looks like below the error don't appear.
perk Primitive
{
parent = None,
translation = Primitive,
passive = false,
xp1 = 0,
...
perk PrimitiveCrafting
{
parent = Primitive,
name = PrimitiveCrafting,
translation = PrimitiveCrafting,
passive = false,
xp1 = 50,
...
But what I wanted to do is:
perk PrimitiveCrafting
{
parent = Survivalist,
The code seems to work even with the error on serverside (xp is added and the perk is shown under Survivalist).
Can I do something about the error? I don't know what I'm doing wrong...
Is there any reason you want it that specific way? I think your error is literally just your survivalist parent doesnt exist. But if it aint broke dont fix it
I want the Perk to appear along with Fishing, Trapping and Foraging in the Survivalist Group. So I assume the category exists. And like expected the Skill appears at the expected place but the server throws the error.
exist like string for translate
try check where it all start (use notepad and find this string in media/lua folder)
That string probably only exists in the locale tho
I would do what kERHUS said and go through the media folder looking for the group, you might be able to use the jdoc to help you as well https://zomboid-javadoc.com/41.78/
Javadoc Project Zomboid Modding API package index
Actually this is starting to make sense, the game probably doesnt call it the Survivalist class. You need to find what the code is calling that โSurvivalistโ class
I can find it in the translation files like I translate my perk/perk cat:
IGUI_perks_Survivalist = "๏ฟฝberlebenskunst",
So I assume "Survivalist" is correct. For tests I tripled the Skill and I can add them where I want.
I just get the error on server side when Hosting or use my dedicated server (every time I add xp; but it works). In solo I get no error message. So it's kind of strange. I couldn't find any categories in the code except in some comments where all perks are listed.
I have no GUI on server. So I think I can't use this. I just have the console on my dedicated server or the log files.
Have you tried setting the parent to IGUI_perks_Survivalist
oh, I see
didnt notice
error on java
local6 null
declaration: package: zombie.characters.skills, class: PerkFactory, class: Perk
im not sure
but i think this should be string with type.
not passive = false
but type =
need stuff for getType from another existing vanilla perks and tostring it or print for look on it
try put in code random name for type =
its should be string
not sure if this affects anything
โ
in the perks.txt file? I add it and see what happens.
Wow, this fixed the error.
type = teststring,
But is this a bug? I didn't read anything about a needed type in the perks.txt.
perks factory trying call getType
getType is local6 and local6 is null
its your error
and it should be Type
as I say: not sure if this affects anything
โ
I'm still confused. Is there an official documentation how the perks.txt should look like?
I used this tutorial to start:
https://github.com/MrBounty/PZ-Mod---Doc/blob/main/Make a custom skill or perk.md
need a better modmaker than me, who can tell about java doc
I'll check what other mods with custom perks have in perks.txt
try find here
So far I couldn't find anything about a needed type = xy for perks.txt. But I think when a game is hosted the server tries to get the type (like you mentioned). So for the moment I just add a pseudo string. Maybe once a day I look into the java code what it does with the type...
Thx for the help.
Hey! What file/s would one need to tinker with to change how barricading with planks works? Just trying to make a simple thing that makes barricading require 4 nails per plank
I think you have to mess with these two files:
media\lua\client\ISUI\ISWorldObjectContextMenu.lua
media\lua\client\TimedActions\ISBarricadeAction.lua
Thanks! I actually have looked through those, and the changes I made to ISBarricadeAction.lua seem to work. Meaning, I now need to have 4 nails available to start barricading. The action itself still seems to take only 2 though
In ISWorldObjectsContextMenu.lua I changed all instances of nails needed in barricading from 2 to 4, but that didn't seem to do anything. Will have to dive back in and see what's up
@tame mulch Hi there, have a question around brush tool
local props = ISMoveableSpriteProps.new(IsoObject.new(square, sprite):getSprite())
props.rawWeight = 10
props:placeMoveableInternal(square, InventoryItemFactory.CreateItem("Base.Plank"), sprite)
Is that viable in multiplayer (aka persistent)? Seen there are some transmit* commands in ISMoveableSpriteProps class.
My point is to create a fully intact sprite object (with all sprite properties) in multiplayer from a server side.
The ISWorldObjectsContextMenu.lua should have the conditions to show the menu entry or not. So if you have less than the needed amount of nails the menu entry should not appear.
Ahh then I got the two files mixed! That is exactly what happens now, but even then barricading only reduces the number of my nails by two.
I digged a little further. On line 105 in the action file a client command is called:
sendClientCommand(self.character, 'object', 'barricade', args)
-->
media\lua\server\ClientCommands.lua
--> line 391
player:sendObjectChange('removeItemType', { type = 'Base.Nails', count = 2 })
hope this helps... have to go afk...
Amazing, thanks man! I'm sure this is what I was looking for.
Edit: It works now! Thanks again โค๏ธ
How possible is messing around with how health and the health ui, i want to make a mod that converts it to be a lot more like mechanics, where you can install and uninstall parts
For the UI, very possible. See ISHealthPanel.lua; you'd need to override/overwrite the relevant functions
For the more general โhealthโ part, I guess it depends on the amount of control you need, since some stuff is hardcoded. Generally, though, that sounds like it'd be feasible
Hmm, thank you. Ill look more into it when i get home
I had an idea for a mod, like an endgame mod, mainly that leads up to a server wipe where you have to find certain things in game (like keycards etc), go to a military facility, and use the items (as well as your weapons) to activate a nuclear device that would cause everyones screens to go white and kicks everyone until the server is wiped. Is this possible?
Hey, ppl! How it's goin'?
Hi! I'm new to modding and looking for guides and resources. I found this and thought I'd send update PRs as I learned stuff:
https://github.com/FWolfe/Zomboid-Modding-Guide
Thing is, the last update was about 10 months ago. Is this still relevant? Is there a better place to send contributions?
it's still pretty reliable
the game itself hasn't been updated in ten months so i wouldn't worry too much about anything in it being outright outdated
ty! I'll continue keeping notes and sending them over
im still working on this, and now ive managed to get it to kinda work, but i guess the models are a bit screwed
guess i'll have to tweak the attachment points somehow
is there a version/variant of Events.OnGameBoot that fires after lua files in server folder are loaded?
and whats the ideal event to load mod's sandbox vars?
@drifting ore For the question about how to get rid of Destroy option with sledgehammer. There is a scripted answer for that
local function addContext(player, context, worldobjects, test)
-- whatever you need, then this
context:removeOptionByName(getText("ContextMenu_Destroy"));
end
Events.OnFillWorldObjectContextMenu.Add(addContext);
Simply removes option from menu.
You should be able to crawl in Zomboid. If zombies can do it, you should be able to do it as well
This looks really cool, id love seeing a zombie holding a gun like day of the dead lol
Already modded.
questions, is it possible to edit the colors of skill levels?
to idk red or something rather then yellow
or how do I open a pack file
or the files in the texturepack folder
is there any specific tool for that?
OnInitGlobalModData is the first event that fires after sandbox options load, so it's generally the best
later events can be too late to change certain systems
What's going wrong? I have it typed the same as other mods that actually work.
Example of something that works.
Is it the spaces in the module name?
it's probably the . in the module name
spaces do work iirc, though i would say they're probably bad practice
items/recipes/etc in modules are represented as Module.Name so having an extra . in there is going to confuse a lot of things
also comments should be marked like /* comment */, these /RECIPES/ comments are probably breaking it too
could I put at /comment/ or do I need the spaces?
you don't need the spaces
Ok
So looking at Hydrocraft's recipes, which is what I'm basing off of, do I need to have something besides just this:
.../media/scripts/Trading_Recipes.txt
Because all I have is the recipes file as I am not making new items
Also from what I have play tested, when I load up my mod and Hydrocraft/Tsar's Common Library 2.0, it breaks those two mods
nah, just the one file should be good
Ok, next up..
Well now that I started PZ, it took away the logs, but I'll try to find it again
but when my mod was loading up after this line in the logs
finding..
This
so I am trying to find out if the new hydrocraft changed the trading post name, but what I find curious is it stopped trying after going to the Heavy Vehicle parts. This was before I fixed the comments, so would that be why it gave up?
because I have more recipes after the heavy parts recipes
If anything, im gonna load up those 3 mods and see how it goes now
Hello, I'm trying to make zeds outfits for a mod but when I want to try it with the "spawn horde" from the debug but it appears without clothes, any advice?
Try this simple test but it doesn't work:
`<?xml version="1.0" encoding="utf-8"?>
<outfitManager>
<!--Test-->
<m_MaleOutfits>
<m_Name>AP_Test</m_Name>
<m_Guid>9377b3a8-5548-43be-8c34-5e2c69901128</m_Guid>
<m_Pants>false</m_Pants>
<m_AllowPantsHue>false</m_AllowPantsHue>
<m_items> <!-- Hunting Vest Camo -->
<itemGUID>c9381d1c-2d50-4bd0-9d38-076314141a34</itemGUID>
</m_items>
<m_items> <!-- Dog Tag -->
<itemGUID>88321000-2b08-4537-9c51-4b5eca360c92</itemGUID>
</m_items>
</m_MaleOutfits>
</outfitManager>`
did you import the hydrocraft module?
you either need to import it or reference it as Hydrocraft.HCTradingpost
So if I import, I can keep it how it is which is this?
yeah
and Importing would look like this?
Ok, so game has loaded up, now I need to fix the import beccause it seems to break crafting
Searching through to see what went wrong..
how do i mod project zomboid i want to make an mod?
like to start off
its for an occupation mod
so ive got a good map that is functional and everything, im basically creating a full pure survival experience like the game "green hell" in preperation for wildlife in the next update, does anyone know the basics on adding custom recipes like being able to forage for "metal scraps" then using them to forge nails or being able to rip up plant fibers for rags?
i know how to add custom items i just dont know how to modify custom recipes
Found the issue, Hydrocraft Continued removed the trading post
Do you have the latest hydrocraft?