#mod_development
1 messages · Page 258 of 1
I will see if I can fix it soon, not now though because I really need to get moving on some other stuff
The Bandits mod is adding more and more behaviors - who knows if he'll venture into civilians next.
I implemented this, but the character still stands in place.
This way does not solve the problem of incorrect animation, when trying to use setVariable for vanilla EatingStarted, the character stands still
I don't think I can help any more as I lack a lot of experience in animations
Thanks for your time anyway!
hello everyone. I need some information. How does the game distinguish wounds caused by zombies from other wounds?? I'm making a mod that activates the Zombie infection in a different way: each wound gives "infection points" and once a certain number of infection points is reached the zombification process starts. Now I have to make the mod distinguish the wounds caused by zombies from all the others. Can you give me some directions or a hint???? thanks in advance to whoever answers me
but then why if I fall and scratch myself or get hurt by some glass, the zombie infection doesn't start? at least as far as I know, that's how it works in the vanilla game: a scratch from a zombie can infect you and transform you, but a scratch from a fall will never infect you with the zombie infection.
average zomboid modder
because the zombie attack gives you both a scratch and an infection, not it gives you a special scratch that also gives you an infection
the scratch itself is the same either way and there's no reliable way to determine what a wound came from
albion
is there a way to import a picture when a sound plays for example sound ZomboidSuprisedPlayer
{
category = zombie
image
image.jpg
no, i don't even know what that would be expected to do but there's nothing like that
sadge I didnt wanna make it myself
basically just want an image to flash when the zombie jumpscares the player around a corner
do you know which file the map pulling up comes from? would reverse engineer that
did you also copy the eat animation x file to the bob folder?
Yes, but that wasn't the problem
@grizzled fulcrum @ancient grail
if you are interested, the problem was that you had to add to the xml file this lines:
<m_SubStateBoneWeights>
<boneName>Dummy01</boneName>
<weight>1.0</weight>
</m_SubStateBoneWeights>
<m_SubStateBoneWeights>
<boneName>Translation_Data</boneName>
<weight>1.0</weight>
</m_SubStateBoneWeights>
this wasn't in the original file. Why don't zombies require these lines to play animations correctly?
copy the dig animation x file
copy the shovel timed action
replace variables with the necessary changes based on the eat anim
and try again
the dig timed action is much easier to reverse engineer
btw you csnt rename x files
you have to rename the animation inside of it using 3d apps if you want to rename it
this could also be the reson why it didnt work?
also just replace the <anims_name>
that should be the file name
this controls the bone weights
if you dont want to restrict bones from moving
its used mostly for things related to upper or lower body only animations
like flashlight while aiming
They solved the standing while eating thing I think by adding those, so I'd assume that's why it was fixed 😮
oh that could be the case then
but zombies don't need these values to play this animation correctly, why is that?
Is a zombie any different from a player object in terms of bone structure or something like that?
and also, if you know, please tell me, is it possible to see something like documentation for these values in the animation xml file?
maybe cuz of their model
the way their bones are done.. this is more of a modelling related thing i guess.
does lua code run on a different thread to the java or will all lua code tied to an event fire when triggered by java and be completed before the next java code continues?
the entire game is single threaded
because I swear I notice the java code continuing before the lua code finishes sometimes.. maybe I'm imagining it though
for example I hook into OnPlayerDeath and immediately restore full health. Most of the time this catches it before it transfers all inventory into a IsoDeadBody and makes a recovery but sometimes it seems to not stop it in time
and from what I think, it's doing it because isDead appears true, when it shouldn't after a restore full health
yes that is true
and anything that calls on/triggers lua waits on it
the only notable things that are on separate threads are the lighting (which if it weren't, god only knows what the performance would be), voice chat, world loading stuff (you see World Streamer thread and WorldReuser thread)
I wish they had UI on a separate thread too, it would be very tricky to multithread it but currently my fps halfs (sometimes quarters) when disabling offscreen UI rendering (unless this is already on a separate thread then I have no idea)
my first thought when seeing that was 'oh, so that's why ReuseGridsquare isn't actually triggered'
it's definitely on the main thread, lua can't run in multiple threads
wat
WorldReuserThread.reuseGridSquares
is this not similar?
or can you call reuse gridsquares from lua
it's supposed to be an event but it never actually seems to get called
that makes more sense if it's done in a separate thread, presumably the event is carried over from a time where it happened on the main thread
there's no way to iterate a list of callbacks for events right? Everytime I'm getting somewhere I hit a limitation
you can capture callbacks when they're added to do this
local callbacks = {}
local old_add = Events.EventName.Add
Events.EventName.Add = function(callback)
table.insert(callbacks, callback)
old_add(callback)
end
genius! that would only work for anything loaded after my mod though I guess?
anything loaded after the file that does this, if you put it in shared and start the filename with a bunch of exclamation marks that *probably* won't be something you need to worry about
vanilla files load before mods but you can at least fix that manually if it's relevant
lovely, my hope is renewed,.. thanks
@bronze yoke what do you know about these
poison detection level is what cooking level you need to detect the poison
poison power is a sort of arbitrary poisonousness metric, higher values make you more sick for longer
I need to play one sound for a normal hit and another for a fatal hit, so is it possible to check if the hit was fatal without using OnZombieDead?
By fatal you mean the zombie dying ?
yep
Smthg I'm unsure on is if OnHitCharacter triggers when a zombie dies
You could check that out and see if it triggers before OnZombieDead
Then check HP of zombie
when a fatal hit occurs, OnHitZombie and OnZombieDead are triggered at the same time, because of this I was looking for an opportunity to make a timer for checking the zombie's hp after the hit, but I didn't find how to do it.
I need to ask something. Can anyone help me?
What are the best resources to learn modding & mapping for project zomboid? I'm familiar with many programming languages such as Java, C#, Python... but I just cant seem to find any good resources or docs for project zomboid
Is it possible to add additional filters to inventory UI?
https://projectzomboid.com/modding/ To figure out what/where to access
https://www.lua.org/pil/contents.html General Lua stuff (some differences to Kahlua apply)
https://pzwiki.net/wiki/Modding General infos IIRC.
https://github.com/asledgehammer/Umbrella For auto-completion and such in for example VSCode
https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md Available events you can use
Project Zomboid Modding Tools on steam for map/tileset stuff
And depending on what you want to do exactly, learning from other mods, or specific guides (vehicles, modeling, whatnot)
Additionally some better "getting started" guides or list of guides over on #1125248330595848192 message probably.
There's probably a lot more scattered about or in one of those (ex. the wiki)
So for asking for specifics never hurts if you can't find something 
Thank you very much!
does anyone know how to make a spawn point in a specific building?
I need to explain it throughly to a modder.
By providing enough context and asking the question publicly, those with the experience, time and willingness to help will be able to answer or inquire about more details if necessary - this holds true even if it's a request and not just a question.
(Not everyone's up for anything, be it a question or request or something else - at least the basic information of what you want/expect can be provided even without thorough explanations) 
if only there was a channel where modders talk
if only
clip from the animated tf2 short "Expiration Date"
https://www.youtube.com/watch?v=GLlLQ3LmZWU&t=360s
where can I find API for the context menu? I can't seem to find it on project zomboid modding site
I think most of it is just lua in media\lua\ISUI\ISContextMenu.lua
Okay, sorry... So, er... I have a mod idea -which I was inspired from someone else- I'm trying to make and it's basically a backpack but it's a baby. I'm thinking mechanics such as crying if not fed, etc... This could change gameplay and the noise could draw zombies making it an immersive parent-y kinda start. Makes sense? Is this possible in PZ?
yes
where can I find the item icon ya see in the inventory? Are those some where?
Why... ?
Why a timer ?
Also OnCharacterHit gives the damage, so you can calculate zombie dying or not
there is no onCharacterHit in the wiki.
OnWeaponHitCharacter
function MTDOnWeaponHitCharacterMain(wielder, target, weapon, damage)
if wielder == getPlayer() and target:isZombie() then
end
end
Events.OnWeaponHitCharacter.Add(MTDOnWeaponHitCharacterMain);```
then just check if damage is higher than remaining hp of zombie
err- could be wrong, but are the little icons in inventory actually 3D objects being rendered there?
Eitherway, I grabbed the image from the wiki
having 3d object rendered instead of small 30x30 icon would be really inefficient
i think
I mean- I can't find the image for sledgehammers other then a UV mapped image x3
Yes that
When utilizing the textureChoices prompt for clothing, is there a way to have that transfer to item icons and world models as well? Or is it something exclusive to just the texture being worn
woah what did I do? (edit: fixed but why'd the font get all messed up?)
I understand if no, but might I get some help with setting up a visual studio code workspace? Not really PZ as much as just using VS code it's self rn 😅
I am trying to add a thing that'll exclude any files/folders in a workspace if ".ignore" is at the end of the name.
oh did I jsut get it?
It seems I was using **/?.ignore instead of **/*.ignore
New question. When highlighting an object, do I need to specify to unhighlight it?
I'm seeing something doing setHighlighted(true) but then I can't find anything that is setting to false, so-
oh humm-
So, default is render once. But then- is mouse moved called every frame?
damage and hp numbers don't match🚬
uh
Damage is ignored when pushing, first off
Would like to get the prints instead of a video
Can barely analyse shit with this
I'll go test it too
thx
Can I get all squares between point A and point B?
Small deviation, not sure the reason
The 1 at the end?
No lol
oh ok
No idea, you can most definitely do some sort of loop tho
I wonder if I could grab the code from the fire brush- Not intending on uploading, but I'll do a comment if I do, giving credit. Would that be fine?
No idea what that is
Brush Tool has fire brush, which also has the exact thing I'm looking for, but with a different end result. Start at 1 spot, as ya move the mouse it changes a rectangle between where the start and current mouse is and highlights all tiles in the rectangle
Normally, the fire brush- ya know- sets things on fire xP
I'd just want it to destroy as if it were the sledgehammer.
This is clear, what is not clear is how the damage is applied.
Let me check the java actually
This can be very useful even to me as I work on damages to zombies a bit
If you want to talk/see what I'm doing
https://www.twitch.tv/sirdoggyjvla
(tho idk if I can share that here)
What are the necessities for context menu icons?
resolution? bit depth? name format?
oh-
it might help if I added .png to the end xD
wait- ok new question. How do I change highlight color back after-
sq:getFloor():setHighlightColor(1,0,0,0.5)
sq:getFloor():setHighlighted(true)
they're still red when I go to select them again 😅
I'ma disable the red when it deletes stuff for now. Unless- I set it just the the objects to be removed-
hey there! so i finally opened the pz DEV thingy but the problem is that the mod is not showing up for some reason in my mods list 
any idea what i couldve missed?
my mod is in the mod and workshop folders
mod info?
oh it has its own unique values
no worries! thank you anyway
ooop! okay its fixed
I had too many folders before media, like in the workshop setting
Although, in my own mod progress, I am kinda ashamed and also really happy this works! xD
Ashamed b/c I sorta just "duct taped" it in and was expecting it, code I copied from cheat menu's object deletion, to need some love to work properly, but it seems to work already with my code.
I am not exactly happy with how few changes I made-
Is it possible to interact with zombie movement? Like to make zombies go in a selected direction, for example, to go to a certain square, if there is no movingObject there?
Well, I'm not gonna be posting this anytime soon and if I do post it, I'll rewrite the whole thing if I have to 😅
ah yes. Game crashed and wondered why.
Maybe b/c I was trying to highlight the entire map 🤔
The world mesh will use whatever texture the model thats on your body uses.
Oh yea, would using the sledgehamer image from the wiki be allowed? 😅
yes
look for pathfinding syntax
yeah, those are just ripped from the game anyway
I wanted to have an extra level of accident failsafe by making it instead of being select context menu option, and it chooses that as the start, to waiting for a click input as first point. But it seems to be funny 🤔
oh wait I'm an idiot
thanks
hey, not touched any zomboid modding in ages, tried to add a kiln and pottery to my mod ages ago, using tchernolib I managed to get a version that kind of worked single player, but on a server it kept removing and resetting/desyncing the updated items, so before I jump back in I was wondering how other people would go about adding something similar just so I can hear how more experienced people would approach it
In short it was a container than updated a custom value on an item while it was in it, and on amount reaches 100 (or whatever set value) it replaces with a new item
Any example mods that’s do anything similar would be appreciated
That's amazing
What did you use to make the spikes ?
These zombie animations look clean too
Interesting
You have plans to add multiple custom zombies ?
Weird ass TWD zombies lol
(please don't tell me you're using CDDA Zombies as a base)
Thank god
Hi, I'm trying to create my first easy mod, but its not working, and I don't Know what I'm doing wrong.
This is the code YeastRecipe.lua
function Recipe.OnCreate.MakeYeast(items, result, player)
return;
end
recipe Testing Create Yeast
{
Water;1,
Flour;1,
Sugar;1,
Result:Yeast,
Time:30.0,
Category:Cooking,
OnCreate:Recipe.OnCreate.MakeYeast,
}
Any help would be appreciated, thank you!!
recipes are not put in lua files
They are in script files
/media/scripts/yourScriptFile.txt <- give a unique name
and there goes the object?
Also pretty sure you don't need that OnCreate function, if you don't make it do anything
so I just need to create a .txt file with
recipe Testing Create Yeast
{
Water;1,
Flour;1,
Sugar;1,
Result:Yeast,
Time:30.0,
Category:Cooking,
OnCreate:Recipe.OnCreate.MakeYeast,
}
I want to create a recipe to create Yeast, I think that you can't craft yeast in the game
There's something more you need
I want some items to craft it
module Base {
recipe Testing Create Yeast
{
Water;1,
Flour;1,
Sugar;1,
Result:Yeast,
Time:30.0,
Category:Cooking,
}
}
Remove the OnCreate
You don't need that shit, you're calling a function that returns instantly
Unless that's mandatory but I'd be surprised
So the how is the .txt file linked to the .lua file?
Or I just need the .lua if I need some logic?
If you wanted special functionality, like returning an extra item, or a chance to fail craft etc you would need the lua and the oncreate, if it’s a standard craft it’s not needed
Umm, i created the script, in the scripts folder, and reloaded the lua, but I cant see the recipe.
I need to add something else for example in the mod.info?
don’t think so but not 100%, might not be the issue and not on my computer to double check but I think the semi colons need to be equals signs for the ingredients
damn, still not working, I'm doing something wrong 😦
semicolons are correct
equals sign means x items, semicolon means x uses of that item
wait, i see it now!!!, but I dont see it on the item list while in the debug menu
is there any way to add it there?
btw, thank you all 🙂
wdym the item list? aren't you adding a recipe?
I can see it in the normal recipe list, but not on the debug one
that's the item list, it only has items not recipes
yeah... you are right... 😄
So if I create a new item with the keyword item instead of recipe
Hi, I was messing with the mod shop settings https://steamcommunity.com/sharedfiles/filedetails/?id=2840330802&searchtext=shop
I place the items
Shop.Items["Base.OatsRaw"] = {
tab = Tab.Food, price = 500,
}
Shop.Items["Base.TinnedBeans"] = {
tab = Tab.Food, price = 500,
}
Shop.Items["Base.CannedMilk"] = {
tab = Tab.Food, price = 500,
}
It's not going into the machine, it's like I didn't have it, can you help me with the item?
In this mod, how do I get someone to sell an item at the price I want, like a can for 125 and they receive 125 bonze coins, what is the code?
I'm looking at the mod folder shops, media, lua, shared, shopitems, the folder event, firstaid, food, forsell, vehicles, weapons appears ex: in the food folder I put Shop.Items["Base.OatsRaw" ] = {
tab = Tab.Food, price = 500,
}
Shop.Items["Base.TinnedBeans"] = {
tab = Tab.Food, price = 500,
}
but when I uploaded it to the mod pack already with the config it doesn't stay on the server and as I hadn't done anything
Is there a way to tell if a corpse was a player before it died? The moment the player dies, I know you can create an item in their inventory and then if you go to check the corpse, you can find the item in the corpse container, but that's not what I want. I want to know if you can store a player's information on a corpse.
if you want to store information, all of a player's mod data is transferred to its corpse on death and you can modify the corpse's mod data directly too
I need to retrieve the player name ("player:getFullName()") from a corpse. I don't know how to do it.
Hi, for a new clothing item, it's visible in the character creator as an item that exists, but, if I select it, it'll just set the tab to "none"
Any idea what I've failed to include that can lead to this?
Ok thanks a lot, I'll see if I can find the solution
Can anyone help me even though I sent it above?
how can I set a bowl to be able to empty it in the ground? I can't make it work with drainable and UseDelta
Don't see the option in the context menu
I see it as type "Object" but I set it as Drainable
maybe that the problem...
any mod devs around these parts? I would like to commission a small mod that adds shooting targets players can craft. I see there's similar mods on the workshop but it seems they've deprecated or don't work properly.
I'm sad, the shit id make if I was unemployed and not doing Uni 😭😭
I could've completed like 20 commissions by now and earned more money than my previous jobs in retail
Hey guys, is there anyone here who's worked with wordzed?
Please tell me how I can play the sound only for the client so that other players cannot hear it?
how would I cancel a player animation that's happening? Like the player is in the process of falling down and getting back up and I need it to stop
Saw, but comments on it report the mod does not work/broken.
have you tried contacting the creator?
You can change the speed of animations in media/AnimSets
you can also create a variable to change the speed during the game
that would be changing the animset file itself? I don't want to alter vanilla animsets, I just want to stop the one that's currently playing
Has anyone messed with the mod shop can you help me?
@bright fog I can't find how to decompile the source code to see how OnWeaponHitCharacter works, please help.
recipe TriturarPatatayFabricarLevadura {
keep MortarPestle,
Potato=1,
PolvoParaLevaduraEnCuenco=1,
Result:Yeast,
Time:30.0,
Category:Cooking,
OnCreate:Recipe.OnCreate.CreateSuperYeast,
DisplayName = "Triturar Patata y Fabricar Levadura",
}
Why the displayname property is crashing the game?
Are you sure it's what makes it crash ?
when I remove the property, its working fine
also RequiredSkill:Cooking=3, is not working either, I mean, in the recipelist, there is no limitation at all, I can create the recipe normally
I'm not familiar enough with recipes sry
no worries, thank you 🙂
Why would you have display name in recipe?
Recipe "display name" is actually what you call the recipe afaik, so in this case TriturarPatatayFabricarLevadura
As for translations the spaces in that part would be _ underscores.
so
recipe my super new craft {
/* ... */
}
``` means it'll have the default display name `my super new craft`
To then provide other translations to it, you replace the spaces with `_` and `Recipe_` up front in the `media\lua\shared\Translate\??\Recipes_??.txt`
ex. for `media\lua\shared\Translate\EN\Recipes_EN.txt`
```lua
Recipes_EN = {
Recipe_my_super_new_craft = "My super new craft",
}
-# at least as far as I remember for recipes
I see, thank you!
so what about this then?
Teaches = "Recipe.CrearPolvodeChampiñon,Recipe.TriturarPatatayFabricarLevadura", I have to add underscores?
will be Teaches = "Recipe.Crear_Polvo_de_Champiñon,Recipe.Triturar_Patatay_Fabricar_Levadura" ??
just their name with spacing, and it's TeachedRecipes
so TeachedRecipes = Crear Polvo ... and seperated recipes by semicolons (;) then a comma at the end of it all
although I'm not sure on special characters like that n or similar, hence I would suggest making english the default one, but you can still try it (I just can't promise anything, didn't test anything in that regard myself, so... yeah)
the documentation I'm looking at (chatgpt) is outdated then?
If chatgpt, I'd reckon it's just a guess from it anyway?
where can I check all the parameters for a recipe or an item?
Not sure for all of them, but you can certainly check vanilla items to see how they do it
especially if you know a vanilla item that behaves similar to what you want to do, or a recipe for that matter
I was gonna say something but it seems ya ain't using lua so nvm- 😅
although, I am curious- how does one know when to use : and = for recipes?
You have to see what types are used.
like is it item MyFood { type=.. } or whatever..
The format is so screwed up tbh..
Not sure why they didn't just go with JSON or something.
I had to figure this all out at some point last year when writing a vscode extension to support the format.
I'm using lua, but some recipes have the thing at the bottom cooking 0/5, but I don't know how to do it
Sorry, RequiredSkill:Cooking=3 is lua?
nop, .txt
I use the lua for adding an empty bowl after creating the recipe with a filled bowl
ah ok
Has anyone messed with the mod shop can you help me?
Hi PZ modding community! I would like to make a mod, changing size of the trees. I have extracted the tree sprites from .pack file, but what should be the next step. Is sprite size defined only by the image size or is it resizable somewhere in config files?
resize how?
you want to make trees smaller or sum?
I'd like to make them taller
im not a modder or nothing, but i would try to take the textures you got and edit them with some painting program, then repackaging them and see if that works
I know they're only on the ground floor, not any higher other then visually. I think b/c it's easier to do when the tree is chopped down and stuff.
Idk if it's as simple as just changing the texture, personally, tho.
yeah im not sure at all either, ive never messed with tiles
alright, I think I found a way
will post an update after testing
thanks for the replies!
Hey ^^ I think there is no need to have the pack, just make a script that detects trees in a radius of X around the player and replaces them with a smaller model
The ModData of a player's corpse doesn't have the player's name stored in it. If anyone thinks I'm wrong and proves me wrong, I'd appreciate it.
got access to the images and was able to modify them, the only thing left to understand is how tree collision is set up
There may be a method for this, but I can't really offer much in the way of animation.
haha, it wasn't the JSON lib, it was repeated string concatenation. By switching to building a table and using table.concat at the end, I was able to load 1 milion lines in 32635 ms, which is an absurd amount of data (double than I expect).
How do I make an item not be able to be equipped? Do I use attachmentType?
Specifically melee weapons if that helps
Not including "AttachmentType" in the weapon script.
Hi, I'm looking for someone who is good with mod packs for my online server. It's a big RPG project. I'm also looking for someone that is able to make custom mods for me in exchange for a fee. Feel free to shoot me a PM to discuss specifics.
well thats interesting
to find out where the base is in there you could get an axe and use the chop tree option to see exactly in what tile the tree is
i suppose that if you find the tree its lower than it should be you can just edit the tree image file and just move the tree texture up
where can I find the original *.txt files from the vanilla game? to take a look on how the items are structured
or recipes
Right click on Project Zomboid in Steam > Manage > Browse Local Files.
In that folder, traverse to media\scripts\, that's where it contains items, recipes and such.
to be able to find the recipe book I created I need to create a file called LootDistribution.txt??
this is what i have inside the file, but I don't know if I'm I doing it correctly cause I didn't find any xDD
module VinagreYLevaduraMod
{
// Definición de la distribución del libro en diferentes ubicaciones
procList Books
{
rolls = 4,
items = {
"VinagreYLevaduraMod.VinegarAndYeastRecipeBook", 100,
},
junk = {
rolls = 1,
items = {
"Base.Book", 20,
"Base.Magazine", 20,
}
}
}
// Definición de ubicaciones específicas
table Books = {
shelves = {
rolls = 4,
items = {
"VinagreYLevaduraMod.VinegarAndYeastRecipeBook", 100,
}
},
magazineRack = {
rolls = 2,
items = {
"VinagreYLevaduraMod.VinegarAndYeastRecipeBook", 100,
}
},
library = {
rolls = 6,
items = {
"VinagreYLevaduraMod.VinegarAndYeastRecipeBook", 100,
}
}
}
}```
In xml is in necessary to list all <subItems> Seperately?
<itemGUID>randomguid#</itemGUID>
<subItems><itemGUID>randomguid#</itemGUID></subItems>
<subItems><itemGUID>randomguid#</itemGUID></subItems>
<subItems><itemGUID>randomguid#</itemGUID></subItems>
</m_items>```
Or can I list it as such
```<m_items>
<itemGUID>randomguid#</itemGUID>
<subItems>
<itemGUID>randomguid#</itemGUID>
<itemGUID>randomguid#</itemGUID>
<itemGUID>randomguid#</itemGUID>
<itemGUID>randomguid#</itemGUID>
</subItems>
</m_items>```
How I can play the sound only for the client so that other players cannot hear it?
if you're using an emitter use playSoundImpl instead of playSound
so the implementation will look like this, right?:
BaseCharacterSoundEmitter:playSoundImpl("SoundName", playerObj)
Does anyone know how to calculate the angle of vehicles in relation to the world?
vehicle:getAngleX() vehicle:getAngleY() vehicle:getAngleZ()
Does not show cohesive values.
the grass is on top of the tree
try
or if youre player is driving
try getForwardDirection()
you only need x and y btw
getPlayer():playSoundLocal("MapClose")
or
getSoundManager():playUISound("UIToggleTickBox")
these are what i use
hola
anyone got any idea why my map crashes?
ive set the foraging zones and stuff
set up all the lua and all that correctly
supposed to be a practice map
the whole thing shits itself when i try to make a new world
i got all the images and stuff
its a 30x30 pixel image
is it because the thing is in the middle of nowhere void?
do i have to set it somewhere else?
am i doing something wrong
im new to this thing its supposed to be a practice map
the are x y z spawn point isnt loded i think\
wym?
its there near the bigger stream thing
thanks
thanks
Is there a way to send objects (like zombie or furniture) except player to server, using sendClientCommand or something like
for furniture use the square's x, y, z and object's getObjectIndex(), you can get it on the other side using getSquare(x, y, z):getObjects():get(i)
for zombies, get the zombie's onlineid and then loop through all zombies until you find one with that onlineid (
)
I'm making Half-Life 2 headcrab zombies
Does anyone know any simpler alternatives the blender that can use blender models
I need to create the Half-life zombie shuffle animation
I need something that I can learn and animate in without
The extreme complexity of blender
I am seemingly incapable of learning it
Why does that look scary unfinished
I tried to replicate the source texture as best as possible
The face looks like that but the rest of the skin is unchanged
Only the hands are unfinished
what the fuck
Half life moment
that would only encourage me to go on a rampage with shotguns
what tf did kentucky do to get headcrab zombies
Probably piss off the Combine
did the combine just drop a bunch of headcrab pods on kentucky or what
why they gotta live in agony with that thing man
Yes
Kentucky was unruly
Had to go
fair enough
why wouldnt the US airforce just bomb the shit out of kentucky though
the US had F-15s and F-16s in service in 1993
along with M1 abrams and M2 bradleys
Eternal agony crab sends a message
i get it the combine is the actual result of what would happen irl with an alien civilization
but whats stopping the US airforce from shitting on combine airships with AIM-120 AAMs
I think the combine just had too many ships
Sheer numbers rather than durability
why wouldnt the legs of a tripod thing just collapse to a storm of mighty mouse M89 rockets
i mean fair enough
the resonance cascade kept fucking with the earth for 1 month before the combine arrived
Those things are unreasonably tough to kill
Not to meant the death laser
which would have def weakened everyone
but its 1993
just 2 years after the cold war
Very early invasion
not blaming you for all of this btw
i get it realisticish scenario
of an alien civilization taking over earth
its more kinda like a talk of hl lore
even if the combine invaded right after the resonance cascade many countries would be instantly willing to fight whatever the hell just came out of those portal storms
completely ignoring all treaties and whatever
we should probably take this to general chat
pretty cool idea, headcrab zombies in pz
Half-life lore is full of speculation
Thousands of people died in the initial cascade not to mention the invasion
It only took 7 hours to actually make humanity as a whole surrender
But that only goes for those who actually survived the slaughter
I mostly just want to do my best to create a combine ravaged Kentucky
take this to general chat
Yes
can vanilla actiongroups/players transitions be replaced by a mod? if so how because the one in my mod folder's media with the same folder path is not replacing it
Thanks :3

I'm moving this down here
Workshop milestone
I suggest watching small animation tutorials then reading the rare animation guides
Type-1 Jungle Fatigues & Type-3 OG-107
I notice stuff placed by build menu and stuff placed by brush tool are slightly different- why might that be?
Brush is brighter.
What object have you placed
I am thinking of trying to use the unlisted curbs, but they are brighter.
For example, to make sure it wasn't just b/c different objects, I found and placed "street_curbs_01_20" from both menus
the light post is in the way, but ya get the point x3
Also, I did check, it's not that the light it changing it. If I put the BT version above the BM, it's still brighter
oh- maybe it's b/c it's different object sorta things?
I just realized if I place a tile over the BM curb, it removes it, but if I place it over the BT, it just changed the floor.
The objects in brush tools are placed as IsoObjects. The objects in the Building Menu are created with the correct IsoObjects classes, but for example those curbs are attached sprites to the asphalt object, exactly as they are generated by the world at initialization.
Which curb
The ones in the pictures
BT or BM?
Ye, that makes sense to me. Thus, I assume, they are taking on the lighting or whatever of the asphalt, and thus are shaded different.
err-
idk if I used the right words but ye xD
Although, would that mean I could add these other curb pieces via a mod and it'd work fine? Might do that, atleast for the diagonal curb piece that is north-west side being lower. xP
How can I publish the translation as a mod?!
as a BM addon?
ye- I guess-
I think so, but I never did anything to add onto other mods, so xD
maybe also add some of the curve pieces too-
Seems they needa be attached too, and I like having smoother then 45 degree turns xP
Maybe could try to do a think to let ya build single, lines or areas- I doubt it, but maybe some day I could xP
Brain fart moment- Will it be fine to do
function a(arg1) -- a-1
end
function a(arg1,arg2) -- a-2
end
a(x) -- calls a-1
a(x,y) -- calls a-2
Or do I have to make it all in 1 function, accepts all args, and then does stuff according to what was provided?
If you do this, the second function definition will overwrite the first one. But you can define a single function that accepts a table as a parameter and can check the contents of the table to determine what to do based on the number or type of arguments provided.
Like this:
function a(params)
if params.arg1 and params.arg2 then
-- case where both arguments are provided (a-2)
print("Function with two arguments called")
elseif params.arg1 then
-- case where only one argument is provided (a-1)
print("Function with one argument called")
else
-- no arguments are provided or different cases
print("No valid arguments provided")
end
end
-- examples:
a({arg1 = x}) -- call the one-argument version
a({arg1 = x, arg2 = y}) -- call the two-argument version
Ah ye. Thanks!
I might expand it in the future, but I made a function I can call to get the square of an object. Maybe in the future, it could accept other stuff, but rn only works for objects xP
wh- that's weird. Build menu bulbs I'm guessing, they are making the light bulbs different colors. I remove them, and it's called just light bulb, but then inventory is colored and when installed also colored. 🤔
Inside a function I create an item in the player's inventory with a specific tint, the item is added to the player's inventory with the correct color but the icon is not, it appears with a random color, just it's the color it should be if I move away from the object or if I close and re-open the game. I use these events after adding the object to the inventory ("triggerEvent("OnClothingUpdated", self.character)" or "triggerEvent("OnRefreshInventoryWindowContainers", self.character:getInventory(), true)") but they don't work . Does anyone know how I can update the object icon to have the object color?
getPlayer():resetModelNextFrame()
try that
triggerEvent("OnClothingUpdated", getPlayer())
If I want a new color, do I do Color.new(1,1,1,1) or?
I wanna make sure before I call new 😅
Doesn't work and I don't know why
show your code
with shared, client, server lua folders, what order are the files loaded?
shared, then client and server depending on which one you're on
But server files can be loaded on the client in situations where the client is the one running the logical server, like when in singleplayer(?) and when hosting a coop game. Dedicated servers cannot load or run client code though.
You can check for this and return so that your code is only run on the dedicated server for stuff that you never want to run on client like
if isClient() then return end
IS_CLIENT = isClient()
IS_SERVER = isServer()
IS_COOP = isCoopHost()
IS_SINGLEPLAYER = IS_CLIENT == false and IS_SERVER == false
general rule of what code is considered what ^^
Though you can include server lua files in client lua files and vice-versa.
thanks, and then files within those folders are alphabetically loaded by default I guess?
yes
is there any pattern to PZ's lua method/vars naming convention? seems pretty mixed
Each dev stuck to his own pattern.
server files are *always* loaded on the client
infact if you look in the server folder most of it is actually client code
true, I can't believe I am still getting confused with this
someone here have the "tile template"? or a template for making tiles in the correct porpotions ?
#mapping message in the drive link the 2D Stuff
I sent it to you privately, please look at it when you can
Hey, I'm currently looking into modding in items and recipes. Fairly new to that (other than clothes).
Just to learn first, I wanna make something food related. I see that Evolved Recipes are those in which one can add new ingredients and spices and I see that the "EvolvedRecipe =" at various food items declare if one can add them to the food.
My question is, how would I add in a new entry to this parameter if I'm making a mod? Is there some function, to add something to that or would I have to copy the whole food entry into my mod and make the changes there? I'd assume this could cause problems with mods that also add or change that single incredient, right?
How can I get a helicopter object or find out when a helicopter event started?
Look at how game does it here: \media\scripts\evolvedrecipes.txt
you can use getHelicopterDay(), getHelicopterStartHour(), getHelicopterEndHour() to determine when the helicopter should be active
if the event is set to recur these values will get updated at midnight after the last event ends
you can get a helicopter object but it isn't exposed so you can't really do anything with it
these methods don't work quite the way I need them to, they show when the helicopter last flew by, and I need to get the helicopter at the moment
is it possible to do something with helicopter in IsoWorld? As far as I can see, IsoWorld interacts with the helicopter
not really, you can use reflection to get the object but it's not exposed so you can't do anything with it
if you could find a method that took a helicopter argument you could call it with that but i don't think there's anything like that
the helicopter stuff is very simple and hardcoded
Got it, then please tell me Is it possible to call lua function after calling DebugLog.log("chopper: activated"); ?
And can you please tell me more about intercepting methods? Is it possible to call lua code after calling a method with passing arguments of this method, or did I misunderstand you? Please explain in more detail
oh, what i meant by that is if you can get an instance of a class, even if it's not exposed, you can still pass that *to* functions
you just can't call any of its class methods
e.g. if you had a method like```java
public void doSomethingWithAHelicopter(Helicopter heli) {
...
}
Thanks, got it, but what about the DebugLog, can I call my code after sending this log?
i don't think so, i don't know if you can read that log or anything
thats smart, read the log and check when it logs that
But is there no getTarget()? Why would you specifically need to call stuff right after this being sent? It depends on what you want to do
i don't think the helicopter is exposed
I need to call code after helicopter event is fired
hmm, are there any events or methods that indicate the current event?
which are capable of indicating the helicopter event
not that I can see
I can only imagine how easy this would be if pz had a lua event system integrated (like with custom conditional events)
thanks, then is it possible to get the current sound of the helicopter and call code by it?
like you want to check if the sound is playing and then do your code?
yes
GameSounds.getSound("Helicopter") this is how Java does it and I believe GameSounds is exposed in lua
then do this check too like in Java if sound ~= nil and sound.clips:isEmpty() == false then
I am not 100% sure if this will work completely but it's worth a try
I think there's like 50 ways to check if a sound is playing, it's really confusing 😵💫
Can you please explain in more detail how to get the sound that is currently playing, I don't quite understand :3 I managed to get gamesound, but what to do with it next is not entirely clear
local heliSound = GameSounds.getSound("Helicopter")
anyone got some tips in how to speed up hosting a multiplayer game to test dev with? smaller map, anything like that?
turn off backups if you haven't yet
there's a one cell map floating around somewhere
I understand that the recipes are entered here. But I was more looking making an own evolvedrecipe and what ingredients one can add afterwards.
I understand that it is declared in the food items itself in the marked line and that the names corresponds to the evolvedrecipe (like how sandwich or salad are declared in the evolvedrecipe.txt). My question was more about, if I make a new evolvedrecipe and for example want lettuce to be addable to that (not being the base resource), would I need to copy the whole lettuce entry into my own mod or would something like this be enough?:
{
EvolvedRecipe = Sandwich:3;Burger:3;Salad:5;Sandwich Baguette:3;Taco:3;Burrito:3;OwnEntry:3,
}```
No you can't do that and you SHOULDN'T repeat existing scripts
What you should do is simply use DoParam on a script item to add or modify existing parameters
Tho I can't explain to you the whole process of it as I'm not 100% aware of how it is done but it is a thing which you can do easily
Is there perhaps a tutorial on it somewhere?
Not sure
guys, i have a problem with a custom car
I did this with the help of a tutorial
- The first thing you want to do, as with most mods is to create your mods folder structure, use the image below as a reference, replacing MOD_NAME with the name of your mod: Spoiler mods MOD_NAME mod.info MOD_NAME.png media lua client MOD_NAME.lua models Vehicles_MOD_NAME.txt scripts vehicles M...
i set scale as in original model
i use original 512x512 textures for my model
ERROR: General , 1725015825507> ExceptionLogger.logException> Exception thrown java.util.concurrent.ExecutionException: java.io.IOException: Unsupported bit depth: 16 at FutureTask.report. Message: C:\Users\Userost\Zomboid\mods\Huntley\media\textures\Vehicles\Vehicle_Huntley_Shell.png.
in logs i have that error
i solved it
now i still have problem with invisible car
as log says, i have troubles with textures, but i made them in gimp
and after reconvert i set 8 bit rgba
Here is a minimal example of how the DoParam command can be used to alter existing scripts:
local name = "Base.Lettuce"
local item = ScriptManager.instance:getItem(name)
if item then
item:DoParam("Weight = 0.5")
end
end
Events.OnGameBoot.Add(changeLettuce)```
This would change the weight from 0.2 to 0.5 and the code should go into your shared folder.
Problem is that I do not know whether you can use this to easily append a new entry in the evolvedrecipe list. Maybe you have to experiment a bit. Easiest way might be to simply overwrite the evolvedrecipe list using smth like
```item:DoParam("EvolvedRecipe = Sandwich:3;Burger:3;Salad:5;Sandwich Baguette:3;Taco:3;Burrito:3;OwnEntry:3")```
But that's probably not the best way.
The PZ javadoc contains several commands related to the evolvedrecipe list. Maybe you want to have a look at it. (See here: https://projectzomboid.com/modding/zombie/scripting/objects/EvolvedRecipe.html).
Alright, guess I'll look into that!
Thanks so far!
How would I modify a mod's item?
module SWFancyLanterns {
imports {
Base
}
item Orange_Fancy_Lantern
{
... (all same data)
}
}```
Just do this in a new file?
err-
Would I just do SWFancyLanterns (The original module name) in my folder then just the item?
oh, also, do I need to completely relaunch or just reload the save for this? xP
---Function responsible for checking % of bloodied clothes
---@param player IsoPlayer
local function bloodiedClothesLevel(player)
local wornItems = player:getWornItems();
local totalBloodLevelPercentage = 0;
local amountOfWornItems;
if wornItems ~= nil and wornItems:size() > 1 then
for i = 0, wornItems:size() - 1, 1 do
local item = wornItems:getItemByIndex(i);
if item:IsClothing() and item:getBloodLevel() then
---@cast item Clothing
local bloodLevel = item:getBloodLevel() or 0;
totalBloodLevelPercentage = totalBloodLevelPercentage + bloodLevel
print("clothing: "..item:getClothingItemName().. " blood level: "..bloodLevel)
end
end
end
end```
```LOG : General , 1725021919113> clothing: Bandage_LeftLowerArm blood level: 0
LOG : General , 1725021919114> clothing: Bandage_Chest blood level: 0
LOG : General , 1725021919114> clothing: Bandage_Abdomen blood level: 0
LOG : General , 1725021919115> clothing: Belt blood level: 0
LOG : General , 1725021919115> clothing: Tshirt_WhiteLongSleeveTINT blood level: 11.988797187805176
LOG : General , 1725021919116> clothing: WristWatch_Left_DigitalBlack blood level: 0
LOG : General , 1725021919116> clothing: Socks_Ankle blood level: 0
LOG : General , 1725021919116> clothing: Shorts_ShortFormal blood level: 11.241829872131348
LOG : General , 1725021919117> clothing: Shoes_TrainerTINT blood level: 2.941176414489746```
why are wounds and bandages clothings 
b/c how the game works :P
I didn't know wounds where cloths tho. Bandages make sense tho.
I mean, game dev point of view, easier then doing a whole new thing, just make them cloths ya can't mess with-
LOG : General , 1725022270414> clothing: Bandage_LeftLowerArm blood level: 0 category: Clothing
LOG : General , 1725022270415> clothing: Wound_Abdomen_Scratch_Male blood level: 0 category: Clothing
LOG : General , 1725022270415> clothing: Belt blood level: 0 category: Clothing
LOG : General , 1725022270415> clothing: Tshirt_WhiteLongSleeveTINT blood level: 11.988797187805176 category: Clothing
LOG : General , 1725022270416> clothing: WristWatch_Left_DigitalBlack blood level: 0 category: AlarmClock
LOG : General , 1725022270416> clothing: Socks_Ankle blood level: 0 category: Clothing
LOG : General , 1725022270416> clothing: Shorts_ShortFormal blood level: 11.241829872131348 category: Clothing
LOG : General , 1725022270417> clothing: Shoes_TrainerTINT blood level: 2.941176414489746 category: Clothing
3rd line
wound
Ye
also it was not a rethorical question so it's not really "ltes discuss why it is like that" but more of "anyone got an idea how to filter it out"
xd
Oh- uhhhh- do they all start with wound and/or bandage?
I mean i guess i could filter them out based on name but problem is that there are other injuries as well
and coving all of them is a lot
Oh, so they don't start with "Injury_x_y" then-
you can try filtering them out by checking their body location. wounds and bandages are assigned to locations "Wound" and "Bandage" resp.
oh I'll look into that thx
I wonder- there's also getBandagePower() for inv items. Bandages might be gotten with that, and- MAYBE wounds are just bandages but negative? Idk tho x3
to make sure nothing strange happens, you might also filter out items with location "ZedDmg" (but not 100% sure if this is necessary; also possible that this is only applied to Zeds and not player characters)
LOG : General , 1725022693508> clothing: Bandage_LeftLowerArm | blood level: 0 | body location: Bandage
LOG : General , 1725022693508> clothing: Wound_Abdomen_Scratch_Male | blood level: 0 | body location: Wound
LOG : General , 1725022693508> clothing: Belt | blood level: 0 | body location: Belt
LOG : General , 1725022693509> clothing: Tshirt_WhiteLongSleeveTINT | blood level: 11.988797187805176 | body location: Tshirt
LOG : General , 1725022693509> clothing: WristWatch_Left_DigitalBlack | blood level: 0 | body location: LeftWrist
LOG : General , 1725022693509> clothing: Socks_Ankle | blood level: 0 | body location: Socks
LOG : General , 1725022693509> clothing: Shorts_ShortFormal | blood level: 11.241829872131348 | body location: Pants
LOG : General , 1725022693510> clothing: Shoes_TrainerTINT | blood level: 2.941176414489746 | body location: Shoes```

fuck but i still have to have a list of all the locations to know what to filter
anyone has full one?
like is splint a location?
is suture a location? 
list of vanilla body location can be found in lua/shared/npcs/bodylocations.lua
ty
idk if it's cheat menu or not but there is an option in sandbox to show all clothing in character customization. I think I saw some stuff there, somewhere, but idk if that'd help ya x3
Thought I'd mention tho.
I am still new to modding tho so sorry if I am not of much help xD
yeah, in sandbox menu when you choose all clothing unlocked, you should also be able to see all (or most) body locations during character creation in game
Ye, I know I saw bandages.
why not
you know, how fix it?
LOG : General , 1725025172302> clothing: Tshirt_WhiteLongSleeveTINT | blood level: 16.638654708862305 | body location: Tshirt | hasBlood: true
LOG : General , 1725025172303> clothing: WristWatch_Left_DigitalBlack | blood level: 0 | body location: LeftWrist | hasBlood: false
LOG : General , 1725025172303> clothing: Socks_Ankle | blood level: 0 | body location: Socks | hasBlood: false
LOG : General , 1725025172303> clothing: Shorts_ShortFormal | blood level: 0 | body location: Pants | hasBlood: false
LOG : General , 1725025172304> clothing: Shoes_TrainerTINT | blood level: 2.941176414489746 | body location: Shoes | hasBlood: true```
anyone has an idea on how to filter out things that can't have blood? Like belt or socks
```lua
---Function responsible for checking % of bloodied clothes
---@param player IsoPlayer
local function bloodiedClothesLevel(player)
local wornItems = player:getWornItems();
local totalBloodLevelPercentage = 0;
local amountOfWornItems = 0;
if wornItems ~= nil and wornItems:size() > 1 then
for i = 0, wornItems:size() - 1, 1 do
local item = wornItems:getItemByIndex(i);
if item:IsClothing() and item:getBodyLocation() ~= "Wound" and item:getBodyLocation() ~= "Bandage" then
---@cast item Clothing
local bloodLevel = item:getBloodLevel() or 0;
amountOfWornItems = amountOfWornItems + 1;
totalBloodLevelPercentage = totalBloodLevelPercentage + bloodLevel;
print("clothing: "..item:getClothingItemName().. " | blood level: "..bloodLevel.." | body location: "..item:getBodyLocation().." | hasBlood: "..tostring(item:hasBlood()));
end
end
print("avg: "..totalBloodLevelPercentage / amountOfWornItems);
end
end```
I tried ctrl+f in https://zomboid-javadoc.com/41.78/zombie/inventory/types/Clothing.html for blood to see if there are any methods in Clothing or inherited from InventoryItem but none do the job
Can I display text next to the cursor?
like a tooltip?
Sorta, but follows the mouse in the world
You can use the renderer directly
Oh?
getRenderer() get the object used to render stuff
Let me check, getRenderer is used for sprites - there was a way to just draw text.
IsoRegionsRenderer has RenderString
of course, for all I know, that could be locked down x3
Ah ok
declaration: package: zombie.ui, class: TextManager
This is what the UI drawText functions call
TextManager- Could I do that from mouse move?
Thinking of making a thing to follow the mouse and show info from last clicked cell location.
The only 'trick' is to figure out which overload to use, as the arguments have to be exact.
Area Remove I made, but it's hard to know if I've reached the limit or not, so the info would show "###x###" as ya move the mouse around
You can use getMouseX() getMouseY() for that
so should be good to call it from there?
Oh, how do I get the TextManager?
And sohuld I get it outside of the on mouse or do I have to get inside?
oh wait I'm dumb for the first question
Lets try this
Why does it need a double?
That's not percent right?
Hmm-
not 100% sure but I think clothing items whose script.txt definitions don't have a "BloodLocation = " field cannot become bloody (or dirty). maybe you can find a way to check whether BloodLocation is nil or smth
I looked into it a bit, here's the interesting part:
{
DisplayCategory = Clothing,
Type = Clothing,
DisplayName = Socks,
ClothingItem = Socks_Ankle,
BodyLocation = Socks,
Icon = SocksAnkleWhite,
BloodLocation = Shoes,
Insulation = 0.15,
WindResistance = 0.1,
Weight = 0.1,
FabricType = Cotton,
WorldStaticModel = Sock_Ankle_Ground,
}```
``` item Shoes_TrainerTINT
{
DisplayCategory = Clothing,
Type = Clothing,
DisplayName = Sneakers,
ClothingItem = Shoes_TrainerTINT,
BodyLocation = Shoes,
BloodLocation = Shoes,
Icon = ShoesRunningWhite,
StompPower = 1.8,
ConditionLowerChanceOneIn = 10,
ConditionMax = 24,
RunSpeedModifier = 1.1,
RemoveOnBroken = false,
ScratchDefense = 10,
Insulation = 0.35,
WindResistance = 0.25,
WorldStaticModel = Shoes_Ground,
}```
both of them have blood location
are you sure that those items cannot become bloody? for example, belt or underpants cannot become bloody and have no bloodlocation
there is also a mod which allows underpants becoming bloody and does it by simply adding a bloodlocation
oh wait what if blood applies in layers
so socks cant get bloody cuz shoes are over
YEP
that was it
i took off my shoes and socks started to become bloody
getTextManager():DrawString(getMouseX(),getMouseY(),x2-x1 .. " x "..y2-y1) Any ideas why this ain't working?
Doesn't seem to appear at all.
No errors tho
Where are you calling it? Drawn stuff needs to be done every frame
OnMouseMove, which is where highlight is being called x3
how do I do stuff per frame now- hmm-
OnMouseMove is a UI call
If you're already using a UI, you can just call drawText from the UI
Events.OnMouseMove.Add(RCHT_ExtraTools.HighlightSquare)
That's not a standard event is it?
I mean- it's under Events and I think I got it from the fire brush tool
wait I didn't-
Oh I got it from Cheat Menu
OnMouseMove is a UI function call
Unless cheats menu added their own event for something
so- guess I need to see if cheat menu is adding it x3
You can use either: OnPreUIDraw or OnPostUIDraw
@small topaz I figured I'll just check only items that can have holes
best effort to accuracy ratio

since there's no method to get BloodLocation from item
I mean, it aslo seems to be called similar to render as opposed to mouse move.
setHighlight, default is only for 1 render right?
The second set seems to be related to the map
And it works fine if I just have it do a single arg setHighlight in mouse move
setHightlight works a bit differently but yes
MouseMove appears to work the same as the UI one, which is when the mouse is moved - so adding the render call there won't work unless you keep moving the mouse around
If you want text to appear you're better off using the event's I mentioned
So yea, looks like I might need to make a new event thing. Probably pre draw, so I don't have it overlapping stuff.
Meant to be sorta- like- well, like the highlighted object xP
Then I guess I can just change the line I have in mouse move to be setting 2 values, then read them from render event?
What do I do when I'm finished with highlighting an object, if I changed it's highlight color? Do I just let whatever else will be highlighting the stuff handle it, or should I change it to be back to original highlight color or?
If the latter, I have a slight issue xD
Ok, so it seems to be working!
And I'm making it so when ya open context menu is grabs the screen width (Not when script is loaded incase resolution is changed or something)
Then, as ya move the mouse, it if goes off screen, it will stop where it is on that axis
this will probably be a really awkward question but how do i get the game to read my lua scripts
i can absolutely swear on my steam account ive read every guide, half of this server, half of the forum and most of the workshop mods i got and yet i still cant get it to work
well it appears in the mod loader so id assume i am doing smthng wrong
Existing save or new save
always new
user\Zomboid\mods\CoolModName\media\lua\client\CoolScriptName.lua?
yup
Console showing any errors?
not anything related to my mod
Try putting a new file next to it that just says "THIS IS A TEST PRINT. HELLO WORLD!"
Then look for that in console.
oh huh
wdym by that
oh wait, in a print I mean
so like a new script that just prints?
print("THIS IS A TEST PRINT. HELLO WORLD!")```
I hope that's a funny thing and not like a dev command that they forgot to remove and I'm just causing the bot to crash by accident xD
i dont really get wdym by "Try putting a new file next to it"
The lua file, make a new file next to it, same directory.
ah
Oh, dumb question but also, it's a lua file right? xP
Not just ending with .lua, but an actual lua file
By default, windows will hide file extensions.
yes lua files have a .lua extension
So just makin sure ya made windows show ya file extensions. Ya know xD
oh a quick question
how often does the game reload lua? every loading? or do i have to force it
its fine
as someone who mods pd you dont know how stupid can ppl get
Idk if this is relevant, but normally I have the mod unloaded in menu, but loaded for the save
MAYBE it doesn't reload lua if it's enabled in menu?
Try unloading it, then open a save with it loaded. Or unload it and load it again in menu
Also, on my own thing, it works! Huzza!
I was making it just jump to offset from the side of the screen, but that looks weird, so I made it just stop instead and it works nicely x3
When is a player's corpse created? With the "OnCharacterDeath" event the corpse has not yet been created. With the "OnObjectAdded" event is when the corpse is created?
i decided to just straight up restart the game for the like 13th time just to be sure and it suddenly works? 
show ur code
oh it works
use debug mode and then you can force reload luas from main screen
in 90% of cases it works
there are some things that fired on game launch, those are not reloaded with that button
afaik
also i think for textures you gotta reload the game? fuck knows
meant as if i am fine to go to menu and back into the game
or if i am forced to go to menu, reload lua and then proceed to the game
menu -> reload -> back to save
or
f11 -> find your lua in list on right (you can typoe its name) -> click on it -> reload it slightly higher
2nd option works midsave but you gotta know what you reloading
as in if you have an event that fires at character loading into the world. reloading lua from midsave won't do shit
sounds like multiple pointless steps
both are great if you know what you using them for
kinda used to from pd that it reloads lua on all loadings meaning i can just restart with just 1 button and be ready to test my change within few secs
here for some reason whenever i reload lua it takes me almost a full minute for the game to unfreeze which is weird considering my friend has the same mods and way worse pc yet its faster
doubt that made sense
i got somehow lost in the middle of the message lmaooo
well when you reload lua it reloads all luas. Don't dev while having 300 mods enabled
also 2nd option reloads only specific lua
mid-save
but as I said you have to know what you're doing and what you're reloading
yea that is fair
I end up wanting to make a small that ends up being large but shhh change mid playing so I am like "Ok, lets use Visual Studio Code for a live console log, and just edit some code real quick instead of launching in debug!"
So I don't really have debug tools at my disposal xD
if you dont run pz in debug mode while modding you just shooting yourself in a foot honestly
Tbf, I mostly found ways to sorta get it working.
Visual Studio lets me have a live log. Cheat Menu has a lua interpreter. And so far, not doing much that I can't use those for
Now, before I got the live log working, yea- I had to use getPlayer():Say(tostring()) to do simple debugging b/c print only does console xD
Ye, but again, I plan on just making a simple change so I don't think I need to relauch it- then it's like 3 hours later xD
I wonder if it'd be worth looking into optimizing interops for Kahlua again.
The main show-stopper for this sort of mini-project would be due to the hard-coded & grafted nature of PZ with Kahlua specifically that'd hamper any sort of benchmarking.
The time it takes for Kahlua to convert its LVM context to the JVM is a major player in the TPS for PZ.
Kahlua utilizes JDK 1.6 technology which is incredibly dated which is also a problem IMO. =/
These sorts of operations are stuff I have experience working with for several years so I'm wondering if looking into that would be worth the time.
Has anyone been able to successfully toggle power at cell/square level? I feel like the only option is in spawning (and then managing) a metric tone of virtual generators
@thick karma i worked HARD bruh
LOL
Great work lmao I'll have to check that out
You should link us haha
@bronze yoke @grizzled fulcrum Please explain, am I misunderstanding something or is the helicopter sound also coded so much that it is impossible to know whether it is currently playing?
yeah but i didnt wanna be like that guy who like advertises his own mod
Naaaah we all share mods here
We all know the struggle, one link isn't gonna hurt anybody, anyone who gets mad about it is a loser who should be ignored
Oh lmao I am subbed to this, you just expanded it drastically
Sick
going to make a 2009 and below edition and lore friendly edition rn cuz i got nothin to do
lol hell yeah right on
@lost depot
Shared
what are you trying to achieve?
but you kinda did it by posting the picture with full name of the mod in it hahaha
I'll advertise my own mod 
Just got a big boy update 
https://steamcommunity.com/sharedfiles/filedetails/?id=2914075159

cool stuff! I've got it in my backlog to use on a new save. What's the difference exactly between that and dynamic traits?
if you don't want overdose or broken bones from overweight it's better in every single way
if you like overdose then DT is better

unbiased and true 
i mean
my main grip with DT is that you die from catching a mild cold
overdose mechanic is actually nice
but legit jokes aside I can't find a single reason how DT is better
but then again i havent touched DT in like 2 years
so my info on it is a bit outdated
I check comments every now and then, and get my info from there 
well the critical issues haven't been addressed because the dev thinks those are positive features
you know like getting permadepressed from walking in the rain for 5 minutes with pluviophobe trait

or even without walking outside in the rain, if the rain went on for too long
I haven't gotten a single non-bug-related complaint in 95 pages of comments so yknow
Not exactly same situation on there

hard to complain about bad settings when you can just change them
I actually was gonna do something like that
i think hooking a counter to this callback would do most of the work (except fine tuning the effects strength default setting)
https://pzwiki.net/wiki/OnWorldSound
though there's a caveat that some mods use world sounds to attract zombies by creating an extremely loud noise without an audio file directly over the player
hm
so that might be hard to distinguish from firing a gun
but maybe if a player fires a gun, then the source of the noise is the player itself
so yeah maybe just ignoring sounds without a source object would solve that issue
it's just one of the first things i've noticed when looking at the screenshot, was that hearing was a dynamic trait, and I thought - why would that be dynamic? Or if it is, it should only get worse, never better.
you know, as a tinnitus afecionado and concussion enjoyer. That stuff doesn't goes away.
Yea, no, I dont have a single negative trait that can be only earned and not lost
Unless you change sandbox settings to not be able to lose negative traits
That's kind of a blanket setting, right? So why would you set that? Being able to gain overweight but never able to lose it, that kind of stuff.

you have gain speed and lose speed settings, right?
Someone asked for a way to only gain positives
so i did all 4
gain/lose positive/negative
anyway its #mod_development
we are in #mod_development
tldr you can customize whatever so go play with it 
epic mod
maybe test if the function is there
item.getBloodLevel
cd / d "D:\Project Zomboid"
man, i already fix that
i have invisible car
thats main problem
It seems to me that no one knows how to fix it. I didn't get a response in any channel
its alway there
it's inherited from InventoryItem
or it's Clothing method
dont remember
Use visuals
ItemVisuals
Which gives every clothings as ItemVisual
And then you have stats for the clothings, notably blood, dirt
holes
(in case using inventory items doesn't allow you to get there)

i wish i could help
anyways goodluck
just ask again
someone who knows the answer might read it sooner or later
i dont see reason for spamming of my question)
i'm almost certain getTotalBlood() will return 0
for items that cant be bloodied
insated of 0
like it already does with other items
For visuals ?
im not saying spam
just on a timely manner
its not a problem
its encouraged actually to do so
You mean this method, yes?
https://zomboid-javadoc.com/41.78/zombie/core/skinnedmodel/visual/ItemVisual.html#getTotalBlood()
Javadoc Project Zomboid Modding API declaration: package: zombie.core.skinnedmodel.visual, class: ItemVisual
yes
getBlood ?
also float
function ISWashClothing.GetRequiredSoap(item)
local total = 0
if instanceof(item, "Clothing") then
local coveredParts = BloodClothingType.getCoveredParts(item:getBloodClothingType())
if coveredParts then
for i=1,coveredParts:size() do
local part = coveredParts:get(i-1)
if item:getBlood(part) > 0 then
total = total + 1
end
end
end
else
if item:getBloodLevel() > 0 then
total = total + 1
end
end
return total
end
@dull moss
damn almost tagged someone else
yes that's normal
OH RIGHT
i saw somewhere in game files that is uses soap only for blood

smart
wait why overwrite base game func tho
thats pure vanilla
i just snipped reference
oh i was looking at wash yourself
client/TimedActions/ISWashClothing.lua
yep
i see
so thats where its at
BloodClothingType
https://zomboid-javadoc.com/41.78/zombie/characterTextures/BloodClothingType.html
Javadoc Project Zomboid Modding API declaration: package: zombie.characterTextures, enum: BloodClothingType
going into textures is pain probably, I'll cannibalize ISWashClothing.GetRequiredSoap(item) to loop over equpped items
so if mod adds new clothing type they have to add it here im guessing
like add to the table maybe
I currently have this but it's not 100% accurate cuz sometimes it picks up items that cant have blood levels
---Function responsible for checking % of bloodied clothes
---@param player IsoPlayer
---@return number -- percentage of bloodied clothes (0-1)
local function bloodiedClothesLevel(player)
local wornItems = player:getWornItems();
local totalBloodLevelPercentage = 0;
local amountOfWornItems = 0;
if wornItems ~= nil and wornItems:size() > 1 then
for i = 0, wornItems:size() - 1, 1 do
local item = wornItems:getItemByIndex(i);
if item:IsClothing() and item:getBodyLocation() ~= "Wound" and item:getBodyLocation() ~= "Bandage" and not item:isCosmetic() and item:getCanHaveHoles() then
---@cast item Clothing
local bloodLevel = item:getBloodLevel() or 0;
amountOfWornItems = amountOfWornItems + 1;
totalBloodLevelPercentage = totalBloodLevelPercentage + bloodLevel;
if detailedDebug() then print("Clothing: "..item:getClothingItemName().. " | blood level: "..bloodLevel) end;
end
end
local avg = totalBloodLevelPercentage / 100 / amountOfWornItems;
if detailedDebug() then print("avg: "..avg) end;
return avg;
end
return 0;
end```
pretty close tho

or
item:getBloodClothingType()
clothing is really confusing tbh
they have so much stuff
actually you just can't add new blood locations, they're completely hardcoded
you just have to hope an existing one fits your body location well enough
hello ! is there a way to mod the faction system ( adding players to factions on first server join, prompting a faction selection panel or something like that ) ?
i read somewhere that pz loses the lua os library functionality
is there some equivalent to os.date("%H:%M:%S")?
Anyone uses Umbrella with IntelliJ?
It won't spellcheck comments for me and idk why
Without Umbrella it catches typos without problem
are you using the sumnekolua plugin?
i'll have a look at it - we don't really target intellij but now that it's mostly cross compatible we can at least try
i'm not getting any spell checking even without umbrella
Features say spellchecking present
But it actually disables what's already there 
oh
when setting up umbrella we make .luarc.json
ctrl+f for spell
it's in "diagnostics.disable": {
I don't think it straight up enabled
is it disabled by default? i don't think that's the vscode behaviour
I think it's disabled in schema, lemme tinker and see
the schema doesn't do anything, you could remove that line and it would parse exactly the same
the schema just indicates what kind of file it is and what fields are valid for autocomplete when you're editing it
most of that .luarc.json is just converted from the settings the vscode plugin sets, it's just made to set things that are unique to pz's environment so if the intellij plugin has some weird default settings it won't fix them
looks like it is off by default

how would one turn it on, I couldn't find anything in IntelliJ settings
besides vanilla settings
yeah this is one of the main reasons i didn't consider the intellij port worthwhile
there are no in-ide settings, you have to write a .luarc.json
adding ```
"diagnostics.neededFileStatus": {
"spell-check": "Any"
}
vscode is the best choice imo
the sumneko port to intellij is exciting but it's still comparatively lackluster
I kinda like both of them so no biggie
I do like extensive Intellij settings better tho
Or at least the layout

i prefer jetbrains ides a great deal
there's just no good solution for using them with lua
eh ?
Yes you can
What is your IDE
You're using a spellchecker ? In scripts lol ? Maybe that's not necessary ngl
Ye well I like my code and comments without typos
I thought this too, but there are some functions that are usable like os.time()
Also, you should set up your luarc for vscode well, it will help you
The luals defaults for errors like possible nil values and stuff are all really really low (like hints and warnings at max) whereas I like to have them error because I don't like having possible nil values that aren't optionals
As an example. this is my luarc for my latest mod, but I usually copy paste it over all my mods and just change the small things per project
Although I don't need these globals defined here anymore because I have a lib folder, this was from when I first setup the project.
yeah the default settings are really strange, i recommend anyone to go through the extension settings
oh thats messed up thnx for the info this is good to know.
saves me sometime in the future incase i need to take this route for a mod
umbrella will reconfigure a couple things to match pz syntax and stuff but i deliberately didn't make any other changes so i'd still recommend reviewing them
does setting up .luarc in VSCode work the same as in IntelliJ? Aka just yeet in root
yes
you can but you can just change them in-ide
you can change them in vscode too ^^^^
but I prefer luarc so it's universal for people not just including me
and also remember to set up an editorconfig file, because I noticed sometimes luals sucks at formatting without it
schema

I've set this up to try and it complains about me using tabs instead of whitespaces
smh whitespaces user

you can change that
I just have a bias for whitespace because in my opinion it feels cleaner
but I guess that is the default
I change it in editorconfig
you can set spaces or tabs or smart tabs
luarc doesn't change code style options
https://steamcommunity.com/sharedfiles/filedetails/?id=3321178403 after a year of work and tweaking, its out
you using this one?
Well that's the template you should start with, although mine I just customised to my liking here: https://github.com/aoqia194/AoqiaZomboidUtils/blob/main/.editorconfig
Ye, going over that editing things atm :D
Also in the luarc I posted before, I realised some problems so I changed some stuff which you can see, but remember to put the path to umbrella in the libraries list at the bottom!!!
ye already edited it
👍
oh i didnt even know you pinged me sorry
i figured it out few hours back
rn just trying to find my way through the source / find a mod that draws text on the screen which i could use as inspiration
Either im missing it or me dum dum but which setting in editorconfig responsible for complainging about whitespace after function?
aka
local debug = function() return EvolvingTraitsWorld.settings.GatherDebug end
gives
missing whitespace after token 'function'
I assumed its
line_space_after_function_statement
but I changed it to false and it doesnt change anything 
Draw text on a screen? You could just create UI element like UIPanel or something and in render call self:drawText
there should definitely be a vanilla game UI you can look at in the lua
dont really need that much for just plain text
trying to squeeze it between the minimap and the server version but i cant seem to get it to update?
NEVERMIND I JUST REALISED WHAT WAS WRONG
space_before_function_call_open_parenthesis
wait no thats for doing like test[space here]()
space_before_function_open_parenthesis = false
that is right one
Already got it on false

space_before_function_call_single_arg = false
this was it
wait no

oh actually my workspace was borked
had to reload it
silly me assumed it applied on the fly
Or maybe it still doesn't work? Idk, sleep time 
Once you modify the luarc, it should reload the luals and rediagnose the workspace
alight so i am having a weird problem where the damage overlay is making the texture blue for some reason i tried it with the map and its made the colors blue at one point a put a black bar and instead of it been black a was made into a dark purpleish blue
i just realized this sounds dumb so the damage scratch's are very light blue which looks very weird so i been trying to fix it but its not working but it has to be this mod in particular because the other cars aren't having this problem but since i didnt make the mod i have no idea where to look
sorry to bump, just wondering if anyone knows of a mod that does something similar by gradually updating an item while it’s in a container and/or replacing an item that’s placed in a container
check out global objects
esp freezers
@bronze yoke since you're VSCode for PZ enjoyer, do you have an idea how to make it ignore PZ vanilla code? Namely problems window, it keeps finding problems in vanilla pz folder that i added to workspace?
I've added
"files.exclude": {
"../../../../../Program Files (x86)/Steam/steamapps/common/ProjectZomboid/media/lua/**": true
},
"search.exclude": {
"../../../../../Program Files (x86)/Steam/steamapps/common/ProjectZomboid/media/lua/**": true
},
"files.watcherExclude": {
"../../../../../Program Files (x86)/Steam/steamapps/common/ProjectZomboid/media/lua/**": true
}
}```
to code-workspace file hoping that'd do it but to no avail
Pretty sure the Lua language server has its own “ignore” setting
(the reason I say pretty sure is because I'm not at my desktop to just confirm)
That might apply to the Lua in your current directory, rather than all diagnostics. I'm referring to a setting like the above ones, with file paths to ignore
ye that's the point, I dont want it to run diagnostics in vanilla PZ folder
in my folder i have the same and its enabled
What I mean is that those are vs code settings, which may not apply if vs code is not open in that directory
https://luals.github.io/wiki/settings/#workspaceignoredir exists, as well as one for how to treat libraries (which seem more appropriate for this use case than adding the folder to a workspace)
Lua Language Server uses the Language Server Protocol to offer a better Lua development experience for your favourite editors.
In the dark time before Umbrella, I always added the decompiled game folder as a library & had it set to not diagnose library files
I'm using umbrella atm
But idk how to add pz lua folder as library so its abailable in workspace for quick access
Besides adding a folder to workspace
if you're adding it as part of your project i'm not sure if you can get it to ignore all problems
Ok, question: any way to have vanilla lua folder in workspace for browsing and stuff?
Without extensions choking on it
i usually just open it in another window

fuck it i'll just keep using intelliJ without spellcheck
you can 😄
You see how I have put my pz lua in workspace.library?
it treats it as a 3rd party lib
the difference is they want to add it to the project proper
you also need to set diagnostics.libraryFiles to disabled too
i don't think you can have it ignore actual project files
?
Like copy paste the files or something?
it's not a library, the folder is added to the workspace
ohh
I've been switching IDEs franticly recently
I usually just open mine in a separate window but
Why you all like to open em separately 
idk I just don't need to look at the pz lua often, and when I do it's usually separate from my mod (ie helping someone or trying to dig stuff out of the vanilla lua)
i think you can have per folder settings in a workspace so i guess you could just turn off all inspections in that folder
you can create a .vscode folder in the PZ lua folder \media\lua\.vscode and put stuff in it if that helps
yep
Yes I tried
wat o_o
I honestly don't know
Maybe you could set a luarc file in the pz lua directory?
Though I don't know why the vscode folder wouldn't work
actually, in the settings.json file, just remove everthing except the last one




