#mod_development
1 messages · Page 354 of 1
||Almost leaked some very demanded documents here||
||documents you wouldn't believe||
:o
MMMMM
ho do u not make ur guy point a reolver at his head
been trying to fix CJ firearm since 25 hours ago
Read the firearm making guide
Has anyone made a cooking use for animal blood yet? Blood sausage, blood bread, the sorts? This is such a random ask, but I just had some blood bread (which I haven't in a while) and I thought about how PZ blood has no use.
Or does anyone know if blood is getting an update in B42 to have some use at all lol
presumably it exists for a reason but i haven't heard anything
Oh man I could go for some blood pudding with lingonberry jam and bacon right about now, haven't had it in like a decade but that shit slaps
I feel like sapph's cooking had some blood sausages or something? im sure some mod has a use for em
(feel like = 50/50 chance my memory is incorrect)
ive just had a crazy idea for if engines using different fuel types gets figured out for b42
I don't think there is anything stopping a LUA mod from doing that, other then all the context/radial menu overrides would be a little annoying.
i think it wouldnt be too difficult if ill be honest, id like to figure it out sometime but not today
There's a mod for it in 41 I think. Treads Fuel Types or something
yeah but it was a bit outdated by the time b41 was done, my idea is pretty similar to that though
how difficult would it be to make a mod that hides items that are attached on the player's hotbar from showing on their in-game playermodel?
or allows players to hide specific hotbar slots?
There's a transMog mod that does that already
does it work for modded items? and where can i find that mod
like what's it called
Transmog
i have transmog but I've tried hiding attached items and it doesn't work
But it only allows you to hide clothing, not attached items ?
True, but that mod could help
so there isn't a mod that does that
Not exactly
It's not the same system
Pretty sure attached items don't use item visuals
I worked on transMog, worn items and attached item visuals are independent lists but identical in function
You should be able to do the same remove - update - add (don't update) trick
?
The visuals for items are held in a list - for transMog you remove a visual and call the update - but the systems needs to still functionally have the visual present so it's readded but not updated
so I could just edit the code of transMog just a little bit to include the attached item visuals list in the list of groups it can be used for and that would work?
If you publish it just give credit
sick
and the mods are in what language?
this'd be my first time doing any sort of modding for any game
Lua
such a warm welcome!
Does anyone know of a simple OnTest or OnCanPerform function that checks if the recipe item is on the ground?
I've used this to make it work
function OnCanPerform_ItemOnGround(recipe, player, item)
if not item:isInPlayerInventory() then
if item:getType() == "CustomBox" then
print("Found Custom Box")
return true
end
end
end
But this spams the check non-stop across the debug console. Is there a way to check for the item once and not constantly re-check?
Right clicking on another item in the recipe then throws an error if it's in my inventory.
because you don't return anything if it's in your inventory
Ahh.. Stupid oversight.. lol
I accidently removed that line once I got it working, forgot to re-add it.
I'm basically trying to 'box up' some simple items in the game with this code. I just want to check that a box is on the ground near the player instead of their inventory, solely for visual reasons.
OnCanPerform seems to cause Crafting Menu / CraftHelper to fail as well. Maybe I'm not doing things right.
It still constantly checks during the entire action, spamming print statements hundreds of times. Is that how OnCanPerform works?
Maybe OnTest would be better to use? Do I have to iterate through all items, and just check if that box item is found and then do a check for it prior to doing the action?
I seemed to have figured it out. OnTest works much better for this, and functions like I'd expect.
But, when using debug print statements, during the entire Timed Action/Recipe, it spams that debug constantly. Is this normal behavior for all recipes? I'm just wanting to be sure it doesn't lag or cause issues.
yeah that's normal
Yea it tests every frame in ontimed actions so it can cancel ASAP if the action becomes invalid
But thankfully people can only do 1 ontimed action at a time, and they are generally very busy doing them so controls/FPS don't matter so much
Thank you! Glad to know it's working as intended. Appreciate the help!
Hi everyone. I’m new to this server so I’m not sure if this is the right place to post it, but I’ve been working on a mod for PZ and have been tracking the progress through videos.
The TLDR is I use some of the event hooks to track the characters actions, feed it to a local LLM which generates a diary entry through the survivors lens, then add the note to the inventory.
If this is something that interests you all, and it’s not against the rules, I’d be happy to post a link to the channel
It's not against the rules no
Sounds cool and a useful use of LLM's, iv tried to keep a diary of my characters actions before but its often hard to remember what happened after the fact, especially if you play a few days in a row, or go back to a save if you unexpectly die (from bug or BS or just wanna savescum, something I love games for)
AWARE - Project Zomboid AI Mod
https://youtu.be/ZmwgJQmCqfc
here is the link for those interested.
The purpose of this video is to showcase the initial inception and playthrough of AWARE.
AWARE is a Project Zomboid mod intended to give the player insight into the characters thoughts and feelings. The characters actions are logged throughout the day, and upon awaking the character recollects the previous day.
I will try to post at least once...
Thanks! Honestly I didn’t even think of it being useful in that way. My main goal was to create a way to see the world and experience as if the character wrote it, but having the entries as a way for us to remember what we did is a nice side effect haha
It’s definitely in a very early stage, as you’ll see there’s a lot of tweaking to be done and I’m already started to build out a separate UI for it. But the point of the channel is to track the process
👀
how do I get specifically this parameter of a HandWeapon in lua? the javadocs tell me I can check the AmmoBox parameter with getAmmoBox() but I couldn't find an equivalent for AmmoType
Escape from kentucky is using
local looseAmmo = instanceItem(weapon:getAmmoType())
interesting, alright
it's funny there's not just a normal way to do that but there is for the AmmoBox lol
AmmoBox seems like it would be used way less often
nevermind actually, seems like you can just use weapon:getAmmoType() because HandWeapon inherits it from InventoryItem
You can also check the Java decompile
Yea inheritance is important to check too
Do a ctrl + F search of keywords on the JavaDocs pages
Hey, please i have a question... i want to start a world sound using an emitter created with world:getFreeEmitter(x,y,z) (play sound is ok for all players around).
When i call emitter:stopSound(soundID) the sound stops correctly client-side, but other nearby players still hear it.
What is the correct way to start and stop sound on x,y,z ? 😢
should i :
[Client UI] sendClientCommand >> [Server] stop sound, then broadcast Stop command >> [Clients] stop the sound locally
does anyone know of somewhere i could see a list of the current timed actions?
from what i can see they seem to be scattered among the game's lua
I'm pretty sure they're all in folders named TimedActions, so a bunch are in lua\shared\TimedActions, some are in lua\shared\BuildingObjects\TimedActions etc.
So just do a search for folders named TimedActions and you should find at least like 99% of them. I don't think there's like a compiled list of them all anywhere, but maybe @bright fog would know if something like that is on the wiki somewhere?
gotcha, thanks 👍
You could also try using vscode and search for :start() as that's something all timedactions have and I don't think anything else uses it
oh yeah that's probably a good way to do it
I think so yea
I could look into making a list of every timed actions in the game
I'll work on that like the UI guide once I finish work on the horse mod 
You are the best Sim 🫶
It would get outdated as updates add more, unless you made an automated tool to convert the lua into a useful list.
you could scan for calls to ISBaseTimedAction:derive()
What do you guys think, improvement over vanilla engine sounds?
Thanks. It should also support mods adding their own vehicle sounds without .bank files
yea i wanna learn how to do sound stuffs one of these days for airbrakes
We got fire trucks !!!
The longer ones are new, shorted ones are the old ones
That was my plan yes
Yup that's my plan
I have a mod called WikiTools
yes me too, but the stop action no longer works as soon as another player joins the game, disappointed :x
Wdym ?
Just had an idea for a mod. It could be done in b41, and in b42 when multiplayer releases:
Being close to another player who is dirty or bloody increases your unhappiness.
Incentivize bathing!
functional ladders to enter the upper floors of high rise buildings? 😄
that would be awesome but thats def not in my skill set lol
the one with ladders isnt really a ladder truck it just has ladders on it lol
pumper truck that lets you knockback zombie hordes with the water cannon would be cool too
once
this is possible but im not sure how to do it
Apply the push mechanic to all the zombies it hits, perhaps. Wouldn't kill them but it might make handling a horde easier in MP if someone used a water cannon while others used melee weapons.
of course, useless in single player
player:PerformAnimAction(IsoAnim.Loot)
this animation is correct or i am wrong? didn't know how to execute animation on vanilla game
mod idea! change floors with sheet rope. like scaling a skyscraper from the outside by going from floor to floor using sheet rope, where you need to escape a situation without going to the ground
Where did you find that function ?
From a wrapper lmao
A wrapper ?
I must say what I think it is bcs I'm fairly certain this is what it is, but that's just AI code
Yea, it's from a wrapper from ai
Do you know what a wrapper is ?
AI cannot generate Project Zomboid mods. There is, to my knowledge, no AI out there that will generate a correctly working Project Zomboid mod (using an LLM or otherwise). Use AI if you want, I do not care, but bear in mind that if you use it for PZ modding you'll be generating worse than useless code
yep, i know what it is. AI generated that like "tryin' to guess" or explain to me. That's why im asking here because i feel ignorant about how to make execute animations on vanilla. Not sure if this the correct thread to talk about this too, i already check that url to gettin' start at modding
totally agree, that's why im trying to learn. Not only from AI or trusting on it at all
What animation are you trying to trigger exactly ?
like the reading one
when you took a book
or the one when you loot on the floor
When do you want to trigger it ?
when someone try to search into scrap. Like reaching from something lost
So a timed action ?
yes
If you check some of the vanilla animations, you'll see functions used to set the timed action animation
Takes a string in input which refers to a timed action scripts
Does anyone know where I can locate the files/scripts for items that are built with the Masonry, Metalworking, or Carpentry modes? Trying to change some of them is possible, and cannot find where they are located at.
Also, does anyone know where to find the 'Dissassemble' recipes/result items for the same items, or other moveables?
Thanks!
if i remember right most of the crafting station recipes are handled in a single timed action function which i think then jumps over to java
can someone show me the way to remove bits from item code without overriding it completely?
i know how to edit stuff via lua but id like to remove the durability mechanics from the homemade metal helmets
dunno how to properly remove the ConditionMax and ConditionLowerChanceOneIn
Your goal is to make it not being able to be destroyed?
uhuh
i want it to work the same way other 100/100 helms work
as far as i know, the helmets in general cant be damaged (at least in b41, didnt have a head wound in b42 yet)
worst case scenario some helmets can fall off exposing you
the metal and scrap metal helmets however have durability mechanics and will get damaged every time they block a hit and can eventually break
In b41 helmet took one bite and that was it, it was unequiped and while you could wear it again, it no longer protected you
Or it could fall of depending on helmet
B42 armor however has protection BUT also conditon and as long as it has condition it will keep protecting you
So it can take multiple bites, i assume even in same area, where B41 if you got bit in lets say Upper chest having bulletproof vest, it made hole there and next bite in that area would go through
I haven't yet tested fully B42 armor as i'm not really armor user myself, but i belive thats how it works
Overall armor is alot better in 42 than in 41
So overall Helmets can be damaged, but you can do them Not Damagable in B41 by adding "CanHaveHoles = False," or something like that
It will keep protecting head and if you remove chance to fall, that should make it so head is always protected
If defense is set to 100 though
most helmets have the CanHaveHoles = False by default, but homemade metal ones dont
i can add this code but i dont know how to remove the durability mechanic from the helmets without overriding the entire code bit
So you're talking about B42 then. I don't think you can remove it, but just give it 1 condition and 1 condition lowerchance one in and it should work.
i cannot count the amount of times i've spent like a full hour or two trying to figure out what could possibly be causing errors and it turns out a function i thought returned an array was actually giving me an ArrayList
it's like TIS has an obsession with them 😭
the differences are subtle enough that you can get away with not noticing for a while but then you try to set a specific position of the array or find its length
and your console fills with errors in practically unrelated parts of the code
anyways i don't like ArrayLists that's my tedtalk
what do you mean when you say 'array'? lua can't even interact with java arrays
i keep expecting the lua-exposed functions to be returning lua arrays but they return ArrayLists instead
which honestly i don't even know how they've done that because i don't think lua has ArrayLists
but they're definitely returning them
and i have to use :toArray() to convert them to normal arrays
you need to keep in mind that this game doesn't have much 'lua api', it has java api that lua can access
they use arraylists because that's what makes sense to use in java
makes sense then i suppose
if you use umbrella, you'll usually get warnings when you try to use an arraylist like a table https://pz-umbrella.github.io/wiki/installation.html
i'm basically using slightly more advanced notepad++ lol
i get zero warnings or anything for my code i've just been going by the ingame console and error thing
i really ought to install a proper IDE
hah i think i fixed it with some shenanigans
Thank you, I'll see if I can track that down.
Definitely
does anyone know what this weapon parameter (found it on a gun, but maybe it's compatible with melee as well) does? it doesn't seem to be listed on the wiki
B42 ?
yes
Possibly a new parameter then
Im making a mod
Ever get tired when you make a 2nd character on solo play your 1rst character is nowhere to be found?
Well im making a mod where when you make a new chracter
It gets tomeet and team up with your first or other characters in game.
You're making a NPC mod ?
More like your newly made character gets to meet your previous character...assuming theyre not dead yet
You need NPCs for that
Im using bandits and supereb
I was afraid of that...ok thanks
Why would you use both ?
One friendly the other hostile
I did not know that
Didi forget to mention im a dumbass?🤣
Btw which u prefer i shud use?
Which one I prefer you'd use ?
I mean that's your choice, i'm personally of the thought that Bandits is way better and way more up to date
Then ill use tht
That's your first mod ?
This is not to discourage, but so you can temper your expectations for your first modding experience: currently, since NPCs are not in vanilla, mod implementations are necessarily complex (clunky might be an appropriate descriptor, too). It will likely not be a very straightforward experience
Anyone know how I can change the damage dealt to zombies, as it's being dealt?
You can't, you always have to do some weird cheese
Intercept with onweaponswing, change weapon damage, then revert it back on one of the final weaponswing or player attack event

Actually
That even doesn't give the target ?
That means you can't adjust to per target
So nevermind that doesn't sound like a decent cheese
Usually you want to do that for custom zombies
Suppose that is true
does anyone know how to upload files to workshop? like, i know to set up the Contents/ folder in the workshop folder, but after stuffing my mods in it's still having error
what am i doing wrong
I invite you to read two documentation
already fixed and it's still saying unreconized files in content folder
This one you might know about:
https://pzwiki.net/wiki/Mod_structure#Workshop_folder
-> more specifically on storing your extra files in the Workshop folder of your mod and properly using it
And then this one:
https://pzwiki.net/wiki/Uploading_mods
Your additionnals folder should not be in your mod folder
It's easy to fix, just put it in your cj_vfe folder
The problem is that this folder where it's placed currently will get uploaded in your mod, and you really don't want that
Also that's a cool folder view, is that Mac or Linux ?
I'd say mac ?
mac
a
also it's still giving me error
keep saying that there are unrecognizable files in contents
Can you show the error ? And where does it say that ?
Make sure you don't have hidden files in the Contents folder
You have an invisible file in there most likely
idk how it works on Mac tho to show invisible files
Try CTRL + H or whatever the equivalent could be
should i purge the entire content folder then?
Nah
Just show invisible files
that just hide all of my windows lol
yeah mac adds some stupid invisible crap to every folder
i don't remember how to get rid of it
command + shift + .
also i am just gonna nuke the content folder and redo it
Don't delete your mod 
i am gonna temperarly replace the mod in there to somewhere else lol
the game still think that i am doing something illegal
and giving me the unreconizeable content thing
Look into what albion said
Mac adds invisible files in every folders
So you need to look into deleting those
i already run the commands, and there is abselutely nothing in there
like, also used termnial to check as well
There is tho, the game doesn't lie
i did the termnial command that allows me to see the invisable files, all the invisables files showed up on my desk top but the folder
litterary nothing in there
makes me wonder if pz just doesn't like mac os uploads
Do a Discord search to find if others got the problem
If that's the case then results will show up about this exact issue
it appears that it's only mac os's inablity to upload mods, asked a friend of my to try upload mods and he has no problem uploading the same file that i got.
Hmm weird
Did you search here for messages on the subject
i did and nothing has came up
already reported this as a bug, let's see what indie stone gotta say
probabbly because no one is coding + modding on a mac
I have an uploader that's external to PZ but it's not built on Mac currently (and I probably won't bother with it)
again, i have sent the same file to a friend and he opened up with no weird problem, and he shipped me back the same stuff to test out. still doesn't work on my end
i am going to try sending the file to my window laptop, hopefully that thing opens up
The exact files ?
yup
And he doesn't see invisible files in the Contents folder ?
nothing, and i just managed to send the file to my windows laptop as well
hiya! to fix this, it will require a very specific command in your terminal. Mac creates these files whenever you view a folder’s contents in Finder.
… I do my dev work primarily on mac and this is one of its annoying quirks 😭
find /Users/YOURNAME/Zomboid/Workshop/YOURMODFOLDER -name '.DS_Store' -type f -delete
^^ be sure to replace “YOURNAME” with your username & “YOURMODFOLDER” w/your mod folder.
… keep in mind, if you run the command and then go and make edits to the mod, you’ll likely need to run it again before being able to publish. I hope this helps! 🙂
OMG YOU ARE AN ANGEL
THANK YOU
happy to help! i’m glad it worked for you 🥳
i just put the commands in, i hope it did the thing
although, my friend said that he did not see any of the .DS_store files on his end when i sent him the mod
so long as the output didn’t return anything like “no files found at this path”, it should’ve cleared them up. but yeah, this is one of the weird things about mac Xd
hmm, the issue is that somehow my debug file doesn't reconize the mod at all, if this doesn't work, i am going to try doing it on my windows laptop
😲 OKAY IT WORKED
THANK YOU
btw, what mod do you mainly work on with Mac os? i am currently working on a modular firearm mod that might require a dev team lol
ooh, that sounds super interesting! I’d totally be down to collab, feel free to shoot me a dm 😄
as for me, my main focus has been on animals. i’m about 500 hours into my current project. developing my own custom api for animals from the ground up, and a few mods to go with it xd
OwO very cute, omg you added cats to the game as well!
Chat, what is this guy talking about 
yee! we have things fren shaped and also things not fren shaped 😂
all of these are possible because of @sonic needle ! they’re an absolute wizard with blender Xd
Ash does the modeling/animating, whereas i do all the code stuffs 
very cool stuff :D, btw shot you a friend request and dm
OMG one of the fallout robots (forgot the name) would be so sick!
his name is Muggy and he wants your coffee cups 😆
lol. imagine if you could give him a gun or somethin
it’s possible ngl 😂
lol couild you make the librety prime bot? lollll
gosh this games modding scene is so awesomeee
chances are we’ll be focusing on the earlier fallout games first
oh yea- sounds right
but tbh so much is possible with the animals system
fr
our api also fills in a lot of the gaps where they’re missing stuff at the moment. once it’s to a point where we like it, planning on releasing it to the community so folks can go wild with their own custom animals 😆
lol. wait are there like hostile animals? because that could be great
im not that up to date on b42
there aren't
awwww
there actually are 😉
it’s not a part of the base game, however i was able to get it working with code
custom animals can spawn naturally in the wild as well
is that a deathclaw? i cant tell with the old models
yee!
we’re planning on having them be extremely rare just like fallout… but like the older games if you see one you’re pretty much dead lol😭
can u kill em? lol
they are indeed killable, extremely tanky though 😆
guns are probably the only way you’d survive that encounter Xd
or if you have a car mayhaps
lol. ooo how easy do you think Rads would be to mod in?
hm in theory, it shouldn’t be too insanely difficult to implement. I’ve played a few mp servers back in b41 which had rads systems. for pre-defined zones it would be easier to make I think.
however if we’re talking more explorative modding, it would be super cool to see dynamic weather using a rads system
like random radiation storms for example xd
REAL like the rainwater you collect in buckets being radiation filled because the storm was a rad storm
fr fr!!
that would really give another layer of depth to longterm survival playthroughs
or if its a radstorm you cant go out into wet areas without mustiple layers on
reallll
and then youd have to try like cure your radiation poisoning?
or suffer the effects?
sorry im excited at the idea, it sounds so sickkkk
it sounds like absolute cinema, lol😆
what’s so much fun with lua is it’s super flexible with what we can create modding-wise. anything which isn’t privated in the java code is accessible xd
im not really a maker of mods but i love hearin concepts lol
Since you've been working with animals, how customizable are genes? Can I add new traits and affect drops via those traits? Like different color wools?
I've been thinking about a fun/silly mod for a few months and just haven't found the time to explore the javadocs in depth. But it's looking promising from a brief glance.
you can add new genes, but any effects will have to be implemented by you, there isn't a system for them
B42, why my items with Type = Normal, has a weight of 0.0 and has no condition, although I added it
you need a name translation
thanks
I think thats the 2nd time this week its come up lol
I hate 'hidden' flags...
That's not how it works
Private fields are accessible, and a class needs to be manually exposed to be usage Lua side
I've just made a video about the suggest, I suggest you go watch it
This guide explains how the Lua is able to communicate with the Java, how to use this behavior for your mods, and how to set up a basic Lua mod structure. It will also teach you how to use the JavaDocs, LuaDocs, how to search the game files and decompiled code to find what you're looking for, and also searching Lua events to implement specific b...
Extremely easy to do, there's already a bunch of mods that do that
I worked on addons for such a mod, check out Hazardous Zones
A crackhead, ignore it
I suggest joining the modding Discord, you can propose collabs there to other modders and there's a few active firearm modders there too, notably Marz who just made Hot Brass
I'll add that to the wiki thx
who can create a mod for me (i pay)
The modding community discord has a job board.
Yeah hes in my team already
Hey y'all, does anyone know how to parse and modify apop data? Not much info on it, but I figured out the files are separated into chunks and found the chunk with my animal. I can see most of the data in plain-readable text, but I'm unsure how the file is actually structured. My goal is to transfer one animal to another save.
What's apop data ?
Idk what that is then sry 
Has anyone any idea why no models are shown for my two new items when placed on the ground?
This is from the console.txt:
ModelScript.check > no such model "SurvivalFix.model_IronKnuckle" for SurvivalFix.IronKnuckle```
This is my model skript:
```module SurvivalFix
{
imports
{
Base
}
model model_IronKnuckle {
mesh = WorldItems/mesh_IronKnuckle,
texture WorldItems/texture_IronKnuckle,
scale = 0.5,
}
model model_FlintAndSteel {
mesh = WorldItems/mesh_FlintAndSteel,
texture = WorldItems/texture_FlintAndSteel,
scale = 0.6,
}
} ```
What are the model file paths and what is your item script ?
Item skript:```
module SurvivalFix
{
imports
{
Base
}
item IronKnuckle
{
DisplayCategory = Material,
Type = Normal,
Weight = 0.4,
Icon = IronKnuckle,
StaticModel = SurvivalFix.model_IronKnuckle,
WorldStaticModel = SurvivalFix.model_IronKnuckle,
SurvivalGear = true,
}
item FlintAndSteel
{
DisplayCategory = FireSource,
Type = Drainable,
Weight = 1.0,
WeightEmpty = 0.2,
Icon = FlintAndSteel,
UseDelta = 0.25,
ReplaceOnDeplete = SurvivalFix.IronKnuckle,
//ReplaceOnDeplete = Base.SharpedStone,
StaticModel = SurvivalFix.model_FlintAndSteel,
WorldStaticModel = SurvivalFix.model_FlintAndSteel,
Tags = StartFire;LessFull;Lighter,
SurvivalGear = true,
}
}```
The textures are in common/media/teaxtures/WorldItems
The meshs are in common/media/models_X/WorldItems
All scripts are in 42/media/scripts
What are the file names ? Also you said "teaxtures" for the folder, is that a typo ?
Yes that is a typo, the folder is of course named "textures"
this //ReplaceOnDeplete = Base.SharpedStone, comment is not valid
/* comment */ block comments only
The file names are texture_FlintAndSteel.png, texture_IronKnuckle.png and mesh_FlintAndSteel.FBX, mesh_IronKnuckle.FBX
Thank you! Will fix that and give you an update in a minute
Update: it sadly didn't change anything. Both models of both items are still not displayed correctly.
(Also there is another issue with the flint and steel having 0 encumbrance, that sadly also didn't change. And yes I do have translations for both items. That at least fixed the 0 encumbrance for the fire striker (iron knuckle))
How do i get the simplest mod possible that i am trying to test show up in game? The mod.info is right but nothing shows up
Hi! I'm working on a mod for Build 42 and need to check if global electricity is shut off in the world.
In Build 41, I could use world:isElecShutOff(), but this method doesn't exist in Build 42
I've tried square:isNoPower() and square:haveElectricity(), but these conspicuously only check local electricity (generators), not global state.
I need to know when the global power grid shuts down .
What's the best way to check if global electricity is currently shut off in Build 42? Is there a new API method, or should I use a different approach (like checking active appliances, time-based checks, etc.)?
Thanks in advance!
Maybe look towards the black out mods ?
Tho I've got a feeling they change local electricity ?
Im seeing stuff like carBatteryCharger:getSquare():hasGridPower()
(in vanilla source)
note its paired like carBatteryCharger:getSquare():hasGridPower() and carBatteryCharger:getSquare():getRoom()) so it doesn't check if the square is in a room and should actually have electrical outlets/etc available, it likely just checks if the shutoff date has been reached or not.
You can get it via getWorld():isHydroPowerOn()
small question, i'm looking to change a recipe ingame, specifically the "cast ingot" recipe. where would i find the data for it?
i'd also like to know how i would go about overriding default recipes in a mod, as i don't like just tweaking lol
i've done modding before so i'm fairly familiar with the scene, just need pointers
It's in this file media\scripts\generated\entities\blacksmith\craftRecipes\recipes_blacksmith_furnaces_i.txt
To override it you would put a file named exactly the same in the same location in your mod files.
So you should have like MyMod\42\media\scripts\generated\entities\blacksmith\craftRecipes\recipes_blacksmith_furnaces_i.txt
It will then load your file instead of the vanilla one
Is there a flag to specify a craftrecipe input has to be stale?
(Or is there a complete list of flags somewhere?)
So i kinda need help since i ran out of stuff to try, How can i get my mod to either communicate with the outside world(http or websocket or just sockets) and for info, im on the latest build of version 41.
For more context, im trying to develop a archipelago mod for pz, but i tried stuff that was on stack overflow, and more but to no avail, there was simply no way that i found to get the mod to talk to the outside world or just a socket.
In case someone ends up replying to me, just ping me since i dont always have notifications turned on
the typical solution is to write commands to a file and have an external program read these files and do whatever networking stuff you need
Alrighty thanks ill try working with that
ive been meditating on a more indepth health system. specifically i don't like how it's HP-based. i was considering what i'd term "humors" as an implementation strategy; an underlying measurement of certain things that, in composite, creates neat emergent behaviours
specifically those "humors" would be extrapolated to outward vitality markers like blood pressure, pulse, oxygen saturation... stuff in that vein. not necessarily tracked, but just invisible stats that go on to determine those things. so if you have high weight that'll be correlated with high bp and high heart rate, for example
i'd probably select stats that already exist in the game and just kinda bolt this stuff on top
So i found a Java public object that id like to be able to use, but i dont know how i can interect with java code using lua. That function being zombie.network.RCONClient
a class has to be exposed to be interacted with by lua, anything to do with networking definitely won't be
Hello everyone! I am making a mod that does these:
- Double-click a corpse icon in the loot window to mark or unmark it with a yellow tint.
- Automatically reorder loot window icons for clarity:
- Unmarked corpses (normal) appear at the top, sorted by ID (last killed on top, usually).
- Non-corpse items remain in the middle, preserving their natural order.
- Marked corpses (tinted) move to the bottom, sorted by ID (last killed on top, usually).
- Marked state for each corpse persists across game sessions.
I already have a working script. I just want to make sure that the mod hooks to the most appropriate function and is efficient. The function it hooks to right now is ISInventoryPage:refreshBackpacks(). Here is a pseudo version of the script:
local ISInventoryPage_pre_refreshBackpacks = ISInventoryPage.refreshBackpacks
function ISInventoryPage:refreshBackpacks()
ISInventoryPage_pre_refreshBackpacks(self)
if self.onCharacter then return end -- skip player inventory
for _, button in ipairs(self.backpacks) do
-- Create overlay once if not exist
-- Set overlay invisible (handled by refreshAndReorderButtons later)
-- Hook double-click once
if not button._dblClickMarkCorpseHooked then
local origOnMouseDoubleClick = button.onMouseDoubleClick
button.onMouseDoubleClick = function(selfBtn, x, y)
-- if it is a corpse and a double click, toggle tinted flag
end
button._dblClickMarkCorpseHooked = true
end
end
-- Reorder and refresh overlays on every refresh
refreshAndReorderButtons(self)
end
function refreshAndReorderButtons() {
for each button:
-- Set visibility according to tinted flag
-- add button to a group
-- sort the group in order of unmarked / non-corpse / mark
-- stack buttons vertically in this order
}
Please have a look and let me know if anything can be improved, flow-wise. Thank you so much in advance!
oh
i'm not sure if we have a public list anywhere of what classes are exposed?
well just found it while i was waiting for an awnser
Hello, As title says, is there some sort of API to detail what Java classes and methods are accessible via mod scripts ? I suppose all java public classes and methods are not accessible so i'm left thinking a specific javadoc or sth may prevent from relying too much on other people's scripts, to ...
its the second post
marked as a spoiler
this is twelve years old 😅
oh
i didnt check the age
welp
i think i ended up in the far far end of the forums
most modding information you find by google or the forums is going to be older since unfortunately most modding discussion happens on discord these days
yeah thats fair
the only online source i'd say is pretty reliable is the wiki and anything it links to
if you have a decompile you can see the classes being exposed in LuaManager.Exposer.exposeAll()
Also check out my Lua API video guide, I explain the Lua API concept
This guide explains how the Lua is able to communicate with the Java, how to use this behavior for your mods, and how to set up a basic Lua mod structure. It will also teach you how to use the JavaDocs, LuaDocs, how to search the game files and decompiled code to find what you're looking for, and also searching Lua events to implement specific b...
yup found it
alrighty ill go watch that, since all networking is disabled sadly, ill just rely on files to transmit data, since archipelago being a multiworld randomiser, it relies on networking, since this didnt have networking id have to make a client that would interact with zomboid. its possible, just not viable by times since id need to do communications between python and pz
what exactly are you planning to randomise? i've definitely considered APing various games i like but i couldn't really imagine it'd work great for zomboid
well its one of my brother who proposed the idea where you would be limited on the points, like you would read books or watch vhs tapes, and by doing that, it would be a check, as per victory, it would be probably like zombie kill count which is not too hard, maybe also adding items, but as he said, its kinda a stretch.
Since we love to randomize games between us, but he also thought of zomboid and gave me some idea, so i wanted to try some stuff
thats pretty much why im trying this in the first place since he kinda would appreciate if it were to be possible
but the real restriciton which i find a bit disappointing is the communications part, sure doing it by files is not that hard but its still an issue for me in my opinion
sorry for this, i just am asking since i kinda also wanted to do that, it would be nice if id work, so ill go back on working on it while watching the video
i'd love to see how it turns out
yeah, i do kinda hope that it ends up working
i do seem to have encountered an issue, i tried some io stuff to write to files but seemed to have failed to just use io since it doesnt exist, i dont know if it is possible but i couldnt find anything in the java code. did you manage to ever write or read to a file for modding in pz?
I may be blind. But I looked there before and now again and there is a list of parameters for the recipe itself, but I can't find a list of flags for the inputs of the recipes.
I think you’d need an OnTest function for what you wanna do
Here are all of the flags though
Thank you a lot, it seems like I truly am blind
Read the inputs page
I missed the existence of hat one, thank you again
I just noticed I said and posted OnCreate instead of OnTest yesterday 
I updated those messages if you still need
Is there a respectable place to find vanilla map exports? Or do I have to trust one of these random uploads on one of these various forums?
Sorry this feels like such a dumb question but I'm very new to this, and can't find any info.
not really
ah rip, alright.
Only a single one exists to my knowledge
Or at least that's the last one available
Else ask in #mapping
And that's onky for B41
tools to create these exports aren't publicly available so there's limited sources to get them from
heard, my bad. Thank you
and that makes total sense. Thanks a bunch
Yea the tools the mapping community has are private because they don't want to see their maps stolen from the Workshop to be forcefully updated to B42
Hello everyone,
I was wondering if there is an event or a hook I can use to determine when someone dismantles a tile/moveable item? Trying to run some code when someone performs that action. Been digging and looking for something that work from but not having much luck.
@rich reef I don't know either. But if I were you, I will have look at the mods that allow dismantling containers even with items inside to find something relevant.
I've found most of the code regarding dismantling containers, including the moveabledefinitions, return item types, etc. Just can't figure out how to hook into the action itself so I can run code before/afterwards without having to override entire chunks of base game code.
Anyone know how I can satisfy alcoholic trait ?
can be done for smoker via character:getStats():setStressFromCigarettes(0);
Couldn't find an equivelent for boozers 
or even if there's way to trigger more than one function from item script when consumed?? hoping not at dead end here 😂
OnEat = OnEat_Cigarettes;exampleFunction ??
thanks albion
Have your onEat call function A, function A calls function B and C
How to add items to the created container? getOutermostContainer() and getContainer() returns player's inventory
Hello, can someone tell me where the code for recipes related to blacksmithing is stored? I didn't find anything related to this in the recipe folder. Thanks!
scripts\generated\entities\blacksmith\craftRecipes
Oh, I was looking for them in the wrong folder. Thanks you!
you're welcome :3
getContainer on the created item
It returns player inventory
local toolbox = inventory:AddItem("Base.Toolbox")
toolbox:getContainer():AddItems("Base.TirePiece", 8)
It adds tire pieces in the player's inventory, not in the toolbox
Hmm nope I use vehiclepart containers and they are different.
ah k nm it is the same
getItemContainer()
you'll also ideally want to check IsInventoryContainer() before if your not 100% sure if its a container
toolbox:getItemContainer():AddItems(...)
declaration: package: zombie.inventory.types, class: InventoryContainer
What your actually looking for, is that your inventoryItem is actually the derived type, InventoryContainer and has the above API
that shows you all the extra functions you can access when it is ( IsInventoryContainer() == true)
yeah, it works, thanks!
np
Hi good day! Is there any other way to empty out a lua file through a mod without having to copy paste (override) the lua file and just empty out its content?
So basically you have a mod (mod A) from the workshop downloaded, and you want to make a new mod (mod B) that deletes the contents of a Lua file in mod A?
That would not be possible without an override no
Yeah basically. Just the override is so messy with several files but if there's no other way, then I guess I'll have to stick with it
Thanks man
an override IS possible, but its the dirty method...
file naming Override,
Filename in mod A example
AwesomeGunAddon.txt
Filename in mod B example ( your new override with changes )
AwesomeGunAddon.txt <---
copy theirs 1 to 1, and then adjust inside as needed.
keep in mind doing this with code will net you bad karma & hate without perms,
but txt is fine
Nah, not really. Unless you wanna release it as a standalone, but there really nothing that can be done as far as you making a mod that modifies someone elses
Same with dependencies.
the override is usually standalone with these
Modifications of code generally are accepted as modifying the mod itself and releasing a modified version
Exterior mods changing something isn't the same
Depends what code you mod and how much you take,
someone not asking and doing it that way with my code, Nets you DMCA without hesitation.
If I make a mod that requires your mod as a dependant and change one value, it's not going to net you a dmca strike against me
I'm not redistributing YOUR code
that is usually fine for example yeah
Obvious copy and paste of code is a completely different matter and doesn't seem to be what they are discussing
it basically comes down to 'does what you're uploading contain something not made by you'
But the argument could be made both yes and no
if it does and you don't have a license to redistribute/modify it, that could be risky, if it doesn't you're probably fine even if your mod does heavily interact with another mod
indeed, some modders dont mind, Others Hate even Small edits
Yes it does because it's a modification you're making, but no because it uses another mods functions
This is the same argument that's been around at least the last 20 years I've been modding games
you're saying that calling a function from another mod could be a violation of copyright?
If you're modifying the functionality someone could push that
this one gets laughed at alot xD
Modifying the intended functionality of a mod could and has made people mad enough to push copyright
Whether it's a standalone mod making the changes or not
well to me that's less about copyright and more about the secret we all have to ignore which is 'actual copyright law does not really apply to mods because nobody making mods has the resources to get a lawyer over it/if they did it wouldn't be worth it'
Depends on what game we are talking
There are 100% modders who make enough to both afford and use a lawyer
true, but for zomboid steam deciding to honour a DMCA is basically the extent of copyright law
True
DMCA strikes stack permanently, Net too many, and Bye Bye Steam account / File posting, for workshop globally. for good.
Unless you get a lawyer and try to overturn them
But then, we are back to the modders not affording an attorney thing
Though, I know of a lawyer that plays pz... Soo hmmm
someday, when someone does, i wish to watch, and laugh
The thing that always make me laugh is when someone says "no backwards engineering my mod/code" yeah, try stopping me. If my code in no way reflects yours, you can't do anything
from what i've heard you can dispute a dmca through steam and valve basically just gives up and drops it and tells everyone to lawyer up if they care that much
but i've only really heard of cases where they were obviously fraudulent so maybe it's taken more seriously when it's not
I'd imagine steam and valve take things seriously pretty quickly once a lawyers involved
real ones are solved damn quick, depends on overwhelming evidence, credibility, previous infractions, past mods made/uploaded/popularity
That's a terrible metric to use really. I've seen people with hundreds of mods with a few thousand subs each, and people with one mod with 500k+
Like the newest gun mod released, dudes mod has 400+ guns, but his last mod had like 12, and the works definitely far different qualities and styles, but no one's called him out for it yet
Pirulin's?
Starts with a g I think, maybe it idk
considering i helped the lad dev that, questions / info etc, ( gael gun store )
yeah its real
That's the one. It looks like ai slop
how many mods have... you made?
For pz, none, for many other games, hundreds
i didn't really look at it with much suspicion since this kind of just happens with gun mods, gun nerds are crazy
PZ < 0 means you dont really understand the effort people go to
But I do. I've been developing a mod
feel free to... showcase this monumentus singular mod
The only difficulty in modding pz is the required file structure which is arguably one of the most horrendous modding requirements I've ever seen
I've never modded a game that requires you to follow a strict, dev decided file/folder structure like pz has. With really, pretty shitty documentation
I showcase nothing until a mod is completed, because I've had ideas stolen, and good luck with intellectual property arguments
if someone mods it better, faster, then they have motivation, thats about it
Nah, not true. Intellectual property laws exist for a reason
If I have a years worth of proof that the idea was mine, and haphazardly make mention of it, and someone develops it sloppily in a week, I can fight that with intellectual property laws
unless you are nintendo, with evilness by default, i dont think you can IP Motivation
You're apparently not accustomed to US IP laws
Or haven't been in the modding scene long
Or both
my guy, you got some PFP steam perusing to do.
it depends on the mod, most mods aren't really eligible but some would be
Small scale mods no, but full scale overhauls, yes
if it's something that takes a year to make then it probably is eligible
I'm not wasting my time scouring steam to see what you've done for pz
It's irrelevant to the conversation, much like saying "just Google it"
doubt you would defend stuff either, with that motivation level
I'll defend plenty. But scouring a site and taking that time, takes away from actual productive conversation.
If it's something important, typically someone would provide that information themselves, not leaving it to the one they are speaking to to find it
This is general debate 101
Though, I believe debating is gradually being taught less and less, so it doesn't surprise me much when people fail to remember that
I don't know if most modders are interested in debating copyright law
Usually they like talking about modding
i think this is #mod_development looking at it... hard to say
Typical "this is blah and I have nothing else productive to say" shenanigans.
You can have productivity or you can have discord (pick one)
You can have both, they are not mutually exclusive
i get... so little done reading discord
I've been painting my kitchen this entire time
I should clarify I'm partially poking fun, but just saying it's not a conversation most would probably want to engage w/ here
Also, same 😅
It's a conversation everyone that mods should be prepared to have, as there's been numerous cases of both stolen IP and copyright infringements in the past
Maybe not with pz yet
go type "Casette" in steam, its like IP hell
Well when that day comes I'll point to the modding policy, point to the relevant licenses, and move on
I'm moderately surprised steam allows all the music mods it does, that are direct game rips
recently somebody copy pasted a mod i was working on's entire source code and called it their own so it's not like it never comes up 😅
I think for most people who aren't doing clearly not okay stuff like that it's not something to worry about
I suppose I wasn't thinking about the other end of it, but again that's what licenses are for so 🤷
You say that, until the point it's necessary. Over the two decades of modding, I've seen numerous cases of someone with the same mindset getting the shaft. Since then I've taken the CMA standpoint
To the extent that I keep timestamped documents for proof of IP anymore
Quick question:
If I make a global table/module, does it require a return at the end of the file, or just when making the table local? Any advantage to that, other than making a local copy?
it is better to keep it local and return it because globals are globals and could be accidentally interfered with by another mod
also if local it has to be explicitly required which prevents load order issues and many would say is clearer code
I am one of the many who would say that, but to answer the question about a global table: no it does not require that
The advantage would be not having to worry about requires, but the disadvantages outweigh that advantage (and you'd have to worry about load order instead anyway, like albion said)
Alright, just wanted to confirm. Also, specifically I am trying to run script functions from a table, and it doesn't seem to work with a locally returned table/module. Thats when I would need it to be global, right?
I'm working on cleaning up a lot of my code and using modules whenever I can, so just trying to figure some things out and when using a module is good and when its a waste of time.
how might i go about replacing or modifying an item in scripts/generated without completely overriding other parts of the item? would be nice if there was something like a .patch extension that just lets you soft-override for definitions you changed while leaving other things alone. i ask because i'm thinking about cross-compatibility
You simply create diffrent txt file , make it module Base and use this item ID and make it however you want, If both module and ID's are the same compared to vanila, you effectively overriden whole item, you do not have to copy every item from there or whole txt file
so for a list of recipes, i would use the same name, i.e. recipes_blacksmith_woodcharcoal, make it module Base, and just selectively override its craftRecipe defs?
so like:
module Base
{
craftRecipe MakeCoolCharcoal
{
...
}
}
wouldn't completely override recipes_blacksmith_woodcharcoal, it'd just add onto it?
Name your files differently than vanila
But in case of recipes... i don't think overriding like that work
Recipes are unique in this kind that i myself don't know a way to override or disable vanila recipe, at laest not in easy way
i managed to by replacing the .txt in a mod
But i honestly never had reason to do so, so maybe someone else can help with that
You don't really want to replace WHOLE vanila file, as it can cause issues with other mods
i'll poke around but i think i'm starting to understand the structure here
when i declare module Base, i'm effectively ringing it up and saying "hey, i'm about to make some definitions here"
when i declare craftRecipe MakeCoolCharcoal i'm defining Base.MakeCoolCharcoal with my definition
i imagine doing something like craftRecipe MakeWoodCharcoal might cause a problem because i'm defining something that already exists, like adding a key that already exists to a dictionary; instead i might want to do MakeWoodCharcoal = new craftRecipe or something akin to that
my lua is very very rusty
if you return the table, you can retrieve it from another file using require
sorry for the interjection, by the by
---lua/shared/MyModule.lua
local MyModule = {}
function MyModule.foo()
print("bar")
end
return MyModule
---lua/shared/SomeOtherFile.lua
-- the argument is the path to the file with the module in it, starting after shared/client/server (you cannot specify which, game will scan each in order until it finds a file), not including the .lua extension
local MyModule = require("MyModule")
MyModule.foo()
It might be the way the models look. They don't seem to be made with Zomboid in mind and instead the amount of details would suggest other games. It's just my assumption when i loaded some of those guns into blender. If people like it, thats great for them, but for me personally its a bit too much and doesn't fit the game.
I understand both sides, some people like high details, some like closer to vanila like VFE/B41/B42 Firearms
What i learned though is that you can apparently have multiple models in FBX file and they're perfectly usable separetly. Thought it's only the case for cars. I had a feeling it might be the case, but never really tried it. I feel like having every gun/model separetly is better in case you want to override single model
also keep in mind that steam's smallest download unit is a file: when you update, if you have multiple smaller files the user will only have to redownload the ones that have changed, if everything is one file then they have to redownload that entire file even if you only changed (or added) one model
So not much really changes for me as I prefer it that way, but it's good to know for the future
how can i make a mod tha lets me change the face of my character mid game?
So to use a global script function from another file, say I want to make a library of server specific onGiveXP/OnCreate functions, can the script pull from those if the tables are global? Or do I have to import that entire module in the recipe script for it to be found?
scripts can only read globals unfortunately
they're the one exception to the 'never use globals' rule because you have to 😅
Gotcha! So the script from another mod should be able to call a global recipe script from another mods global script table?
yeah, globals are global, the game doesn't know or care where they come from
The textures kinda look like they were taken from actual firearm pictures and used as a texture
Try https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/core/skinnedmodel/visual/HumanVisual.html#setSkinTextureName(java.lang.String)
(player:getHumanVisual() to get it)
I know that the same setter on the AnimalVisual works, but haven't tried on the player.
So you'd basically just have several different faces as skin textures and use that to apply them whenever you want.
If it works and actually changes the texture that is
Awesome, thanks!
Hi everyone!
An comic book during OnBoot has type Literature (itens = getAllItems(), then loop through items).
But during OnFillInventoryObjectContextMenu, the same comic book has type ComicBook. The type is changed somehow, I believe.
If I want to detect all items that has type ComicBook to change their display categories, which is the best event to hook to, after type already changes to ComicBook from Literature?
Or is there a way to detect ComicBook instead of Literature early on?
you're getting confused by two different things called 'type'
on the item script, type refers to the class of inventory item as set in the script with Type = Literature
on the item instance it refers to the name of the script
Thank you for your answer @bronze yoke !
So I guess I can use Icon then.
Another question, if I may! How can I see debug print during onBoot phase?
I meant OnGameBoot phase
so i pulled myself into something that might take me a while to figure out on sapphs cooking mod with the conversion recipe, (specifically turning juice bottles back into base water bottles) its in the game and obviously "works" but when i search throught the mods files and scripts it seems to just not exist there, not sure what to do there yet
like i dont understand how theres a recipe to convert the bottle yet i cant find its line of code anywhere in the files
other than that 4 other recipe issues have been fixed and i found a 5th one recently but that one makes me wanna really figure out whats wrong and if i have to simply make a new recipe for the conversion of juice bottles back into regular water bottles
or if its something deeper
that might take a while though
Hey, @bronze yoke
Just following up about what I was talking about earlier:
If I create a global table for re-using Script Functions (OnGiveXp, OnCanPerform, OnTest, OnCreate), do I need to make those script functions global within that table, or do they need to be declared as local? For instance:
myTable = {}
myTable.Recipes = {}
local myTable.Recipes.OnTestSomeThing(item, result)
-- Do Stuff
end
-- OR
myTable.Recipes.OnTestSomeThing(item, result)
-- Do Stuff Again
end
Which of these is the correct method? I am not returning this table as a module, as much as using it as a global table for my constantly re-used recipe functions. Trying to figure out all this stuff. So many layers of complexity trying to convert my mod/code over to this structure and want to start off with a good footing. Thanks for your time!
should be function myTable.Recipes.OnTestSomeThing(item, result)
you can't have locals inside a table
Just if it's a global table? Or even if it's a local table, you can't do so?
either way, no
Alright. So if this was a local table / module, you'd be declaring a local variable to store the table, which would make everything inside local, correct? So the scope doesn't need declared in that case?
yeah
Interesting
I've come to the point where I've re-used a bunch of small bits of code constantly and it's been annoying to have to re-write them in any mod I make. So I've been wanting to convert over to this module pattern to make things sustainable and easier to deal with.
I was looking into making some functions to use for events that could be called from a table, but most of those run some local function in that specific mod, so I wasn't sure how or if I could pass that function reference into the module's event function.
For instance:
-------------------------------
-- Module Code myModuleCode.lua
-------------------------------
local myModule = {}
local someFunction(_somePassedFunction)
-- Do module Stuff then
-- Run Passed Function from Mod
_somePassedFunction()
end
return myModule
-------------
-- Mod's Code
-------------
local myModule = require("myModuleCode")
local thePassedFunction()
-- Do Things
end
Events.OnZombieKill.add(myModule.someFunction(thePassedFunction))
I believe you cannot pass parameters/functions this way, is that correct?
Not sure if this is a good use case for re-using this type of code in a library, since the function I'd run with that would need to run from the Mod's own code.
you can always do this to capture arguments for use in an event callback:
Events.OnZombieKill.add(function()
myModule.someFunction(thePassedFunction)
end)
Alright. Kind of like how you forward declare a variable/function using that syntax?
Didn't know that worked that way.
local TinCan = ScriptManager.instance:getItem("Base.TinCanEmpty")
if TinCan then
TinCan:getTags():add("SmeltableIronSmall")
end```
Hello, has anyone an idea why this doesn't make tin can smeltable in a furnace? I followed along with this indie stone post: https://theindiestone.com/forums/index.php?/topic/53019-details-on-the-improved-modding-tag-system-in-4169/
New Tag Info! - Several new Tags were added to the item scripts, and their functionality added to the lua code. - This allows for modders to add new items that seamlessly work with the game in several places, such as adding new fully-functional Sledgehammer items, or adding new Gasoline container...
literally, you're just creating a new function that doesn't take any arguments that calls the other function with those arguments baked in
Ahh, I see it now. So, is there anything needed to pass a function as a parameter correctly?
nah, functions are first class in lua so they just act like any other variable
Okay, well that makes things convenient. This module pattern stuff is really cool, but not sure how to implement everything quite yet. Any tips or things to look out for? I've kind of browsed at your Starlit Library a bit to see what you've got going, but trying to figure out best use cases and all of that still.
This worked great for what I wast trying, thanks! But how would I go about removing that event afterwards?
if you need to remove it later then just define it as a function in a variable the normal way
Alright, I'll try that.
Hmm.. Not sure if I'm doing it right. This seems like it may me more complex doing this as a Utility Function than it's worth. May just leave the Event stuff to each file and just deal with some code re-use.
I'm actually testing this out with some code that you helped me with a while back, an event that delays the game by one tick to then run code that wouldn't load normally.
Trying this to see if I can remove the event, but it doesn't seem to work.
-- Module Code
local testModule = {}
local delayed = false
function testModule.sendCommandWhenReady(_functionToRun, _eventCallerFunction)
if not delayed then
delayed = true
return
end
_functionToRun()
Events.OnTick.Remove(_eventCallerFunction)
end
return testModule
-- Mod Test Code
local testModule = require("testModule")
local codeLoader = testModule.sendCommandWhenReady
local function testFunction()
print("Testing 1 2 3")
end
Events.OnTick.Add(function()
codeLoader(testFunction, self)
end)
This runs the Event from the Module, and then runs the correct code that is passed as _functionToRun, but it doesn't remove the Event afterwards. I must be missing something.
im trying to do a recipe for sapphs cooking in attempts to fix something
and im clearly doing something wrong
has to be with the item mapping
i presume
We can't help you if you don't give more detail
What exactly are you trying to achieve by doing this exactly ?
Also your module needs to be local not global
Yes, that was just a typo while copying code over to the Discord. It was set to a local module. Fixed the code here.
For now, just testing this code to see if I can re-use this type of event code in multiple files, but still pass a function to them.
Usually this would be hardcoded to run a function from within the mod itself to load it on game start.
But in this case, using it as a module function, I'd need to pass the function to run to make this module event function generic and open ended. But trying to remove the event handler afterwards is what I'm trying to figure out now. I've tried a few different things, but it continues to run after firing the function for the mod.
I'm not sure if this is really a good use case at all for a module function, with how much extra complexity it adds, but just trying to figure out what's possible at the moment. Been trying to learn as much as I can about Lua and improving my mods so it's been a fun journey so far. You all are a wealth of knowledge, so trying to pick everyone's brains and improve my abilities.
But yeah, any ideas on how to properly remove that event in that code I posted?
Because self isn't what you think it is here
Self refers to the table the function is part of, more commonly used to have access to the class instance that function is part of
In this case, self is in a simple function you define directly in the event add
It's not part of a module, its table
Ahh, alright. That was just one thing I tried that didn't work. I also tried passing the local function codeLoader, and that didn't work either.
local mdl = {}
function mdl:testFct()
self -- referd to mdl here
end
Here you're trying to run a timer on tick number 1
Within the module Event function code I tried Events.OnTick.Remove(self), and that didn't work either. Same issue?
self isn't the function
Like I just said
You can just use the tick event
It returns the number of ticks
This number of tick increments, so you could just have a fct in an event, and from within it call remove on the variable it's stored in, when checking if tick = 1 or 2 whatever you need, after running the code you want to run at that specific tick
So the code that Albion sent me works great as is, I'm just trying to convert it to be used to run a passed function from any mod that I try to use the module in. In this case, I have to run the Events.OnTick.add in a different way to pass that parameter. And that's what I'm trying to figure out, is how to remove the reference to that event. If that makes sense.
local function test()
Events.OnTick.Remove(test)
end
Events.OnTick.Add(test)
You might want to look into Lua timers for PZ
Yes, this is the original code that I usually use. Which I was trying to adapt.
local function sendCommandWhenReady()
if not delayed then
delayed = true
return
end
-- Do Stuff
Events.OnTick.Remove(sendCommandWhenReady)
end
Events.OnTick.Add(sendCommandWhenReady)
This has always worked great. But if I wanted to make this into a module, I needed to pass the function to run at the -- Do stuff portion of the code.
But this means the Events.OnTick.Add function has to be changed.
Events.OnTick.Add(function()
codeLoader(_passedFunction)
end)
It's confusing, but the original function is fine. Just trying to figure out how to get the reference to that event, since isn't it considered an anonymous function when made that way?
Alright. I've got it to work by doing this. But only part way to what I'd like it to do.
-- Code Loader
local codeLoader = function() testModule.sendCommandWhenReady(testFunction) end
local testFunction()
print("Testing 1 2 3")|
Events.OnTick.Remove(codeLoader)
end
Events.OnTick.Add(codeLoader)
This works now, but I was hoping to have the Module Event perform the entire function as before, by removing the reference to the mod's function.
This would let me use the module code anywhere, and just pass a function and it would take care of the entire process. In this case, I have to remember to add the Events.OnTick.Remove call on the mod side of the code, which isn't the end of the world by any means. But trying to figure out how to make the module structure work to my benefit the most.
Again, just tinkering around here and seeing what is possible.
Can a function pass itself as a parameter? For instance:
local testFunction(_functionToBeRan, _thisFunction)
-- Do Stuff
return _thisFunction
-- OR
Events.OnTick.Remove(_thisFunction)
end
testFunction(anotherFunction, testFunction)
Update:
Okay, so this works as I intended, but you have to declare the function as global to pass itself, which kind of defeats the whole purpose.
codeLoader = function() testModule.sendCommandWhenReady(testFunction, codeLoader) end
Working Solution:
Alright, just had to change the style of function declaration, and now it all works as I originally planned.
local function codeLoader()
testModule.sendCommandWhenReady(testFunction, codeLoader)
end
Well, that was a fun experiment! And I'm not entirely sold on whether it would even be worth using this type of thing in a module or not. Saves maybe a few lines of code though per .lua file that uses it, and I suppose it would be less overhead for that one function. But having to create a 'passthrough' function just to call it seems pointless too. Oh well.
Thanks for the help!
Little something I'm working on.
Slight correction/elaboration on the syntactic sugar explained here: self isn't necessarily mdl, it's just the first argument passed to the function. When using the corresponding call syntax on mdl it'll be mdl, otherwise it'll be whatever it's called with. This is how “class” systems tend to work, by using metatables to point to a table for method lookups, which are then called on instances (cc @bright fog, relevant to what you said up there)
e.g.,
local t = {}
local other = {}
function t:method() end
t:method() -- self = t
t.method() -- self = nil (usually not a proper call for functions defined this way)
t.method(other) -- self = other
In other words, the t:method(...) call syntax is effectively t.method(t, ...)
True thx for clarifying it
How to add category text to sandbox settings, like in b42?
What is the issue? I’m pretty sure custom sandbox options didn’t change much, if at all, in b42
you can't without hacking through the ui lua manually
I want to add category to sandbox options, like on the screen
So, it's not possible to add something like this easy way for now?
You have to hack through the UI like albion mentioned
I hope to make a library to do that in the future
No easy way no
Usually people make empty options
got it, thanks
Yeah pretty unfortunate they didn't get no love but vanilla sandbox options did
I've seen at least one person working on an improved version but I'm not sure where that's at
I have a custom event in my lib to hook to the panel UI to modify it
i've been meaning to give mods access to the advanced options toggle but it turned out to be way more of a pain in the ass than i was expecting
I got so tired of working around sandbox options via overrides that I gave up and just made separate configuration stored in a file on the server (with a UI for editing it ingame)
Maybe not applicable for every use case but I do not miss sandbox variables
@sonic needlewhat program do you use for modeling, because .x model files aren't by default supported by blender
.x files are not really used
Ever wanted to shove zombies down stairs?
what file type is recommended?
for original models fbx or glb are greatly preferable, if you need to edit a vanilla model there's a tool that converts them to gltf
gotcha,
i'd recommend going with fbx since glb support was only added recently and you won't find much help if you run into an issue
noted thank you
Why that ?
This guide goes in detail on using the ZomboidAssetConverter tool to import DirectX files from Project Zomboid into modern 3D modeling softwares such as Blender.
Relevant Wiki pages:
https://pzwiki.net/wiki/Game_files#Accessing_the_game_files
https://pzwiki.net/wiki/File_formats#Modeling_and_animation formats
https://pzwiki.net/wiki/ZomboidAsse...
If you need to import them
And like albion said
Appreciate you.
the vanilla game defines this in a lua table, but it's local and not really possible to hook into as far as i tried, so i think you would have to intercept the actual ui creation and mess with the ui elements which would be wayyy more complex
Seems like if you override getSandboxSettingsTable the only UI piece you'd have to touch is Page3:create(), no? Which is also local, but the derive override trick for that
And duplicating the initialization code for new settings, but that wouldn't be as bad as having to do the whole UI
i think i was having some frustrations with overriding getSandboxSettingsTable, don't remember exactly what it was
Oh yea definitely
I mean that was my idea to implement this for modders to use 😅
so i understand that it's now very difficult to modify existing recipes in the vanilla game without completely overriding files
kinda puts a cap on my plans for now
would rather not do something that sweeping
Guess nows a good time to learn modeling xD
Is this guide outdated, or is it still useful for learning how to create maps for PZ?
It was last updated in 2022.
Could someone tell me the event that fires when a container's loot generated for the first time? Is there such an event or "Events.OnContainerUpdated" is used everytime, including loot generation?
blender
i dont use .x either
Yes you can still use this for b41 mapping.
Even that doesn't work bcs having a craftRecipe with the same ID won't overwrite but add to that recipe
You can modify some stuff
Via Lua
An event triggers when loot spawns
Should be up to date it utilizes the last mapping guide version
@bright fog Thank you so much!
Finally. My chance to get rich
Thank ya
@sonic needle question for you, do I actually "need" animations or anything as far as bones and such for firearm models, or will completely static models be fine?
Off top of my head, I've never really noticed actual reloading animations for firearms other than the player model itself, though it could be that I never played zoomed in.
there are no bones on guns
And anims?
thanks for responding. This is a bit of a new journey for me. I'm not used to making something thats not like furniture, or modular building pieces lol
Yeah there's no visual reload on vanilla guns, the character just moves his arm
thats what I thought, so Im going a bit overboard with my model then
I suggest reading the firearm guide
But there is a way to do visual reloads fairly easy, I worked with Nik on a G11 recently, and we added a visual magazine using the attachment system
?
I know all the coding side for the most part as far as adding/creating it in game
the modeling portion's the new part to me
The firearm guide should explain how to do that
What..... firearm guide
I was already looking at this apparently lol
okay so i was muted so im returning with some info, im making a patch for sapphs cooking doing what ever i can find, i got to a part where when you convert a bottle of watermelon juice or any juice bottle from the mod back into a regular water bottle it would do is fill it full of water despite there being no liquid from the juice left, so it should be empty. so i ASSUMED i could just find the recipe in the script files and be able to do something about the liquid amount after its produced, wrong. im assuming it has something also to do with the new liquid system. i couldnt find this recipes script ANYWHERE i literally searched the entire mods files
so i thought i could make a new recipe to convert juice bottles back to water bottles that are empty
obviously im doing something wrong so heres my code
i never finished working on it because i went to bed but heres the in progress code that i was working on for the new recipe
craftRecipe Convert Bottle
{
timeAction = Making,
time = 10,
category = SapphCooking,
Tags = InHandCraft;Cooking;CanBeDoneInDark,
inputs
{
item 1 [SapphCooking.BottleofLemonJuice;SapphCooking.BottleofOrangeJuice;SapphCooking.BottleofAppleJuice;SapphCooking.BottleofWatermelonJuice;SapphCooking.BottleofPeachJuice;SapphCooking.BottleofPineappleJuice;SapphCooking.BottleofGrapeJuice;SapphCooking.BottleofStrawberryJuice] mappers[resultType],
}
outputs
{
item 1 mapper:resultType
}
itemMapper resultType
{
SapphCooking.BottleofLemonJuice
SapphCooking.BottleofOrangeJuice
SapphCooking.BottleofAppleJuice
SapphCooking.BottleofWatermelonJuice
SapphCooking.BottleofPeachJuice
SapphCooking.BottleofPineappleJuice
SapphCooking.BottleofGrapeJuice
SapphCooking.BottleofStrawberryJuice
}
but the mapping is what im mostly confused about
because obivously i need it to be able to take every juice bottle
but now im not sure if thats how this conversion recipe even works
like i said i couldnt even find the original recipe for that
im hoping a new recipe could rectify this but unsure
and ive never done a new recipe yet
been only tweaking things
if you just want to be able to convert any sapph botte to that one bottle you dont need mapping
you dont?
i had to use mapping to fix this recipe so i just assumed
lemme check that out
mappers are used when an input item changes what the output item should be
it maps inputs to outputs
thanks was looking for that
Could someone help me with a map definition question?
On the map at b42map.com, there are the small green squares (which look like 8x8 tiles) and then the big yellow squares. Are the green squares chunks? Are the yellow squares cells?
yes
it may be worth keeping in mind that the IsoCell is not the same thing as a map cell
So a cell is not 256x256 tiles like Google AI tells me, isn't it?
it is correct in this case, 8x8 square chunks, 32x32 chunk cells = 256x256 square cells
IsoCell isn't a 256x256 tho
OKAY so thanks you guys i was able to get the recipe created and i can now start working on what i intended which is making the bottle get returned empty, which appears to be the harder part. i ASSUMED i could just add flags with is empty but im wrong i guess
heres what i did
craftRecipe Convert Bottle Patched
{
timedAction = Making,
time = 10,
category = SapphCooking,
Tags = InHandCraft;CanBeDoneInDark,
inputs
{
item 1 [SapphCooking.BottleofLemonJuice;SapphCooking.BottleofStrawberryJuice] mode:destroy,
}
outputs
{
item 1 Base.WaterBottle flags[IsEmpty], (< doesnt work to make it empty)
}
}
I need to know if a certain area (may it be chunk or cell, whatever is the easiest) is loaded (have loot in it generated) or not? Which one should I use? IsoChunk or the one on the map?
Different methods to achieve that
Usually you just retrieve the square the coordinates you want loaded and check if the square exists
You can also maybe verify that the coordinates are within the player cell
you should use chunks, they are the smallest unit the game loads in
Technically it does load in squares still but loads the squares in the chunk
you can have only part of a cell loaded, but a chunk is either loaded or not
you can't have half a chunk
When you check a chunk load the squares aren't loaded yet if I remember my tests
So you can actually catch a chunk that should technically be loaded but isn't actually fully loaded yet
Thank you! Could you please also point me to the event that fires on chunk load ?🙏
LoadChunk on this page, b42 only https://demiurgequantified.github.io/ProjectZomboidLuaDocs/md_Events.html
i assume you're working in b42 if you're looking at b42map.com of course but to be sure
b41 has slightly different rules about this stuff and no event
Thank you so much @bronze yoke and @bright fog ! The event page is a treasure trove!
I am working on b42 only, btw.
Good choice
I need some more help
Here is my code
-- Triggered when a chunk is loaded
local function onChunkLoad(chunk)
print("=== Chunk Loaded ===")
print(chunk)
end
The info printed is a hex number 8 character long. I am looking for a way to associate the chunk with the coord on b42map (1027, 2460 for example). Is there a way to do this? I have looked through IsoChunk data but found nothing useful. wx and wy is nil when I try to print them out. getLoadID() is also not the right data.
Please point me in the right direction! Thank you!
@bright fog I ended up using Starlit for quick and easy access to wx and wy! Thank you again, good sir/madam! 👍
Np
Totally inexperienced in PZ modding (somewhat familiar with Java)... But structurally speaking, what are the challenges with making a mod multiplayer compliant?
mostly it's working out what this game's weird netcode wants done on the client and what it wants done on the server, and then communicating between client and server when you need to do something on the opposite end
does anyone know how to make the water bottle that i have as an output get returned empty?
its always returning full
and its not what i want
I'm not too smart, and I can almost never hand out advice, but I'm pretty sure returning a WATER bottle will be a bottle with water in it. Surely you've tried an empty bottle?
empty water bottle still has the same base ID as a full one i dont think i can seperate such without fluid nonsense
Good point
so im trying to reduce its fluid to 0 when the recipe is crafted
because its inputs are the sapphs juice bottles
have you tried flags[IsEmpty]
How messy is its system? I'm mostly familiar with protobuff from C#.
it's pretty basic, you send POD-only lua tables between client and server with a 'module' and 'command' which are just arbitrary strings for you to identify what to do with the table, typically module would be named after the mod
@knotty arch Does it need to be a water bottle or can it be just water?
if you want to identify objects for example you'll be sending their pos and index
I think the game just uses liquid + container sperately when it needs to do things like that
i need it to be an empty water bottle because the reason im doing this is when you convert a sapphs juice bottle back to a water bottle if its empty itll give a full water bottle which i think is dumb
so i was trying to fix such
and apparently the fluid system will make me sad
Yeah this sounds like an oversight lol
yeah im making a patch for sapph that fixes a bunch of recipes and then this walked on my plate
prolly gonna regret it
cause it seems like the fluid system is a pain
@knotty arch You should just add a new bottle for this purpose only that is just a near identical copy, but with PickRandomFluid = false instead lol
And obviously all the other necessary changes to take it from full to empty
Did the remove the normal empty bottle? I thought I saw it had its own script...
yeah they did
and i thought about doing that
and meddled with it
but it becomes its own item and that ruins its ability to be used in other recipes unless i add that to every single recipe that uses bottles
Welp, at least there is A way... So strange that they removed it though, at least make sure the flag works before doing that lol
Tedium or acceptance
another issue with the tedious route is that if lets say sapph updated the mod or someone removes my patch and i have all that, and they have MY bottle in their save it breaks the save trying to remove it
soo its best to try and be as vanilla as possible with this
Understandable
Wait so... This must mean it's impossible to spawn in an empty bottle?
Like, in the debug items list
Since the beginning of B42 I'm assuming, that's kind of insane. But I guess it goes unnoticed until it's needed for a vanilla recipe.
yeah idk what to do yet
What's the difference between PopBottle and PopBottleRare?
@knotty arch BottleCrafted is used in recipes (obviously, it's player made) and comes empty, try that? Obviously it's a slightly different looking, glass container, but still, it's pretty close functionally.
well what i CAN do
it kind of allows what i want
but i DO have to remove the fluids from the vanilla water bottle
youll never be able to spawn a water bottle with water anymore
but it does what i need in the conversion aspect of the mod
I wonder how that would affect other things though like spawning in water and seltzer
My seltzer!
ah shit random spawns
what im thinking is what if zomboid devs removing the ID for the empty water bottle is an actual issue
and it might not be possible to do what i want without either breaking random spawns as they would now spawn empty
or i look into fluid mechanics more
which not much info on it
recipes can still have oncreate functions right
you can just drain the bottle if you have to
OnCreate will never let ya down
Would it be fair to say the PZ infrastructure is utterly incapable of supporting multiple body models simultaneously?
it's less 'utterly incapable' and more 'one really specific bottleneck that prevents mods from doing this even though the engine is absolutely capable of it'
Huh, are you able to elaborate on the bottleneck? (I am in no way going to be "The Guy ™") but I'm interested in it from a technical standpoint.
there's just nothing to set the model a character should use
there is a method that looks like it should do that, but it's ignored
by java modding it's been confirmed if it wasn't ignored it would just work
no, it returns the internal name of the category
you can get the name in the current language with getText("IGUI_ItemCat_" .. item:getDisplayCategory())
it's probably in english but it's not necessarily the same as the name you would see while playing english
could someone please show me how to edit the workstation recipes please?
trying to make blacksmithing recipes more reasonable skill-wise so i wont have to become a self-taught master blacksmith just to make a steel block on a stick (sledge)
tried doing the basic txt override of the whole recipe but the game just crashes that way
Ragdoll physics have now been added to combat!
Ignore the exaggerated reactions and random fall directions. Just a quick showcase.
- Shoves that stagger zombies but keep them upright still do (vanilla behaviour)
- Shoves that knockdown zombies now ragdoll
- Melee attacks that flinch zombies but keep them upright still do (vanilla behaviour)
- Melee attacks that knockdown zombies now ragdoll
- Ragdolled zombies can get up from the ground
- Zombies can now be injured and killed during ragdoll
- Zombies transition to 2d sprites upon death during ragdoll (allowing them to be looted and will stay dead upon game reload)
- Zombies dynamically ragdoll depending upon the direction you and them are facing
- Zombies can now be thrown off rooftops, down stairs, and collide with objects such as vehicles
Did you even read which line that was happening ?
The error log tells you where it happens
You've got to kidding me lmao
my brain is a bit burnt so sorry
Show the full error
"GetClosestVisibleTarget"
Stop cutting the whole thing, show the whole error log with everything around it
This is the most useless part of the error besides the first line
But there's other stuff, show it
ERROR: General , 1765114059793> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: __sub not defined for operands in unknown at KahluaUtil.fail line:82.
ERROR: General , 1765114059793> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: __sub not defined for operands in unknown
at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:676)
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.pcallvoid(KahluaThread.java:1812)
at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
at zombie.Lua.Event.trigger(Event.java:64)
at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:92)
at zombie.gameStates.IngameState.updateInternal(IngameState.java:1624)
at zombie.gameStates.IngameState.update(IngameState.java:1333)
at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:101)
at zombie.GameWindow.logic(GameWindow.java:298)
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)
this is the whole error no?
this is my first time modding so i apologise
the rest is just this same error being spammed
This is going to be impossible to debug
Right now you need to install VSCode, use that
Install Umbrella
And do proper typings of your code because you are sending wrong types to a function or something like that
its because im subtracting something like a table from a number or smth
just cant find out where
It's not you doing it, that's the thing
That's an internal error of the engine
Bcs somewhere you give the wrong type of variable to something else
huh
And the stracktrace is in the Java
Which doesn't paste the stacktrace for the Lua that triggered that Java
For that check the JavaDocs
If it's a Java function, if it's a Lua function, maybe the LuaDocs but not sure how viable that is
Else search the game files where it is defined or used to see if zombies can be used
ok actually
i narrowed it down i think
local TargetPosition = {NearestTarget:getX(), NearestTarget:getY(), NearestTarget:getZ()}
local Distance = IsoUtils.DistanceTo(NPCObject:getX(), NPCObject:getY(),NPCObject:getZ(), TargetPosition[1],TargetPosition[2], TargetPosition[3])
is this correct?
nearesttarget is
isozombie
npcobject is isoplayer
im using isoplayer for npcs by the way
hopefully that wont cause problems
OOPS
turns out i forgot to send tick
💀
peak ai finished
Nice good start
I take it it's not something that could be monkey patched out/fixed (without extreme effort)
it's not possible to change through lua at all
Ah, so Harmony style patching isn't a thing in PZ modding then?
no, there's some projects like that but it's not possible through the official modding api so they require manual installation
Ahhhh. That makes sense.
does pathfindto2 need something else for it to work?
anims and facing and stuff all work its just that the npc itself doesnt move
Zombies won't react to controls like that if they have a target
Welcome to the hard part of modding zombies: controlling them 
Oh, well idk how IsoPlayer modding works at all
I really don't know a single thing about IsoPlayer modding here so I can't help you more
ah quick question then
is there an easy to way delay something happening?
or do i have to do it with tick
You can create timers using OnTick
You can use timestamps to know how much time passed too
aw more work
You can use delta times to know how much time passed from a tick too
But better to use timestamps overall
how can i use delta times?
i was just using tick difference
but i realised that can cause bugs with different fps i think
Collection of modding guides and documentation. Contribute to demiurgeQuantified/PZModdingGuides development by creating an account on GitHub.
mhh, small question, zombies always target players, never "vehicles" directly hm? zombie:getTarget()
I can probably get the car via the player.
Nop
I mean
Yea they don't target vehicles yea
But if they target a player inside a vehicle, you can check if that player is in a vehicle
yeah thats what I mean. Ok. thx
You can't detect when they attack a vehicle directly, or at least I hadn't found a way back then tho back then I didn't know about anim states and shit like that so you can most likely detect if they are playing an animation related to attacking a vehicle, if there's one

