#mod_development
1 messages ยท Page 164 of 1
these?
wouldnt that wreck the code
You're not removing them permanently, you're taking them out to see if something is causing issues
All it'd do it give them the default values unless it's a required value
You can surround them with /* */ if you're concerned about losing something
how would i see if ms is causing issue
If it's taken out and the item shows up, that was the problem
Which means you will have narrowed it down and can figure out what exactly was the problem with that value
how do ik if its that vlaue
Remove Value 1. The item still doesn't show up
Remove Value 2. The item shows up
This implies that value 2 (or a combination of values 2 and 1, if you don't add 1 back) was the problem, because the item does not show up when it's included
but why would that make the item not apear ingame
I don't know; as I said before, this is just a shot in the dark as a way you can debug it
Presumably it'd mean there's something wrong with the value which would cause it to not load
i think i miscommunicated somt
the item doesnt apear
so if i try and spawn it
its not there
๐คฆ๐พ
In your defense, I suppose I could've asked that question better originally, but yeah "item spawner" isn't a super clear answer lol
im looking for an event that has both zombie death and the weapon that kills it as param. this eevent doesnt exist so im thinking of using onzombiedeath then check if the player has equipped the specific weapon .
but then now if i do this, it will trigger the thing even if the zed died from other reasons
then i looked at
OnHitZombie
and thought this must be perfect except
idont know when if it can check if the zed is killed by the hit tho,.. does it?
can OnHitZombie
used to check if the zed is killed?
In that case it's probably just an issue with the model or texture; can you send the relevant item script?
sure
item Shiv1
{
MaxRange = 0.85,
WeaponSprite = shiv_1,
MinAngle = 0.65,
Type = Weapon,
MinimumSwingTime = 2,
KnockBackOnNoDeath = FALSE,
SwingAmountBeforeImpact = 0.02,
Categories = Improvised;SmallBlade,
ConditionLowerChanceOneIn = 6,
Weight = 0.4,
SplatNumber = 1,
PushBackMod = 0.3,
SubCategory = Stab,
AimingMod = 0.8,
ConditionMax = 10,
MaxHitCount = 1,
IsAimedHandWeapon = TRUE,
DoorDamage = 1,
SwingAnim = Stab,
DisplayName = Shiv,
MinRange = 0.61,
SwingTime = 2,
KnockdownMod = 0,
SplatBloodOnNoDeath = True,
Icon = dudclub,
RunAnim = Run_Weapon2,
IdleAnim = Idle_Weapon2,
CloseKillMove = Jaw_Stab,
BreakSound = BreakMetalItem,
TreeDamage = 1,
EnduranceMod = 0.5,
MetalValue = 5,
CriticalChance = 10,
CritDmgMultiplier = 10,
MinDamage = 0.3,
MaxDamage = 0.7,
WeaponLength = 0.19,
HitFloorSound = BladeHit,
ImpactSound = BladeHit,
HitSound = BladeHit,
AttachmentType = Screwdriver,
Tags = Screwdriver,
}
model Kurki
{
mesh = weapons/1handed/Shiv,
attachment world
{
offset = 0.0000 -0.1660 0.0070,
rotate = -180.0000 0.0000 0.0000,
}
}
}
its the same for 2 of my items
oh my god
i just
saw that the model and the item are differant
im gonna test it now
I believe OnWeaponHitCharacter fires for zombies, but it wouldn't only fire on death. You could feasibly use it to track the last weapon that hit a zombie, but that wouldn't be super great. OnHitZombie is triggered before the hit actually occurs, so checks for death wouldn't be accurate
great so tehres no event for what i want to do....
stil doesnt work

is there anywhrere i could hook?
i dont know when its triggered cuz its past tense then present
idk which is which
Holy hell. Format your script.
ill try tho
wym
It occurs directly before the hit function is called
i actually just used the script for the screwdriver

I've bloated my zomboid play hours by like 80% due to having it running in the background for testing/scraping when writing mods - anyway around this lol?
silly modder, coding is the game for you now.
nosteam, no hours
This is the way
well yes, but it's very rapidly climbing my most played now
not that there's anything wrong with that, I kinda just want it to reflect gameplay
Can I just launch the .exe without steam running?
https://pzwiki.net/wiki/Startup_parameters
Most of these should work
Ooooh, thanks
Hi i need help with getVehicleById()
I Send from server this
sendServerCommand("ProjectRP", "NPCSPAWNCARCOMMAND", { ARG1 = steamID, ARG2 = vehid})```
send 254. I checked
On Client i wrote this:
local function NPCBuyCARCmd(_data)
player = getPlayer()
local username = player:getUsername()
local steamID = getSteamIDFromUsername(username);
veh = getVehicleById(_data.ARG2)
if(steamID == _data.ARG1) then
if(veh == nil) then
player:Say(tostring(_data.ARG2))
player:Say("No") -- <- player says. This part of the code is executed
return
end
ARG2 = 254. I checked
But getVehicleById can't find the car. What is the reason for this
I buy a car from the NPC, I'll spawn it on the server side, and I'm trying to find it on the client side to give the keys to the player
Hello there, is there a function in vanilla or in a mod that already duplicates a player ? My main objective is to reset the pathfinding from lua which is only ever done at IsoGameCharacter creation.
Does anyone have an idea where the graphics for the vehicle dashboard are stored? As far as I can tell, they don't seem to exist in media/ui like I assumed they would. Doing a ton of searching and they don't seem to exist at all. Is this constructed in the .class files maybe? I would think at least the icons exist somewhere, but I can't find them
must be in a texture pack
local textures = {}
textures.texEngine = getTexture("media/ui/vehicle/engine.png")
textures.iconEngine = getTexture("media/ui/vehicles/icon_enginetrouble_light.png");
textures.iconAirCondition = getTexture("media/ui/vehicles/icon_airconditioning_light.png");
textures.iconDoor = getTexture("media/ui/vehicles/icon_doorslocked_light.png");
textures.iconLights = getTexture("media/ui/vehicles/icon_headlights_light.png");
textures.iconHeater = getTexture("media/ui/vehicles/icon_heating_light.png");
textures.iconIgnition = getTexture("media/ui/vehicles/ignition.png");
textures.iconIgnitionKey = getTexture("media/ui/vehicles/ignition_key_off.png");
textures.iconIgnitionStarted = getTexture("media/ui/vehicles/ignition_key_on.png");
textures.iconIgnitionHotwired = getTexture("media/ui/vehicles/ignition_hotwired.png");
textures.iconBattery = getTexture("media/ui/vehicles/icon_lowbattery_light.png");
textures.iconTrunk = getTexture("media/ui/vehicles/icon_trunk_light.png")
textures.iconSpeedRegulator = getTexture("media/ui/vehicles/speedregulator_light.png")
textures.dashboardBG = getTexture("media/ui/vehicles/dashboard.png");
textures.gaugeFull = getTexture("media/ui/vehicles/rj-vehicle_fuelguage-full.png");
textures.gaugeLow = getTexture("media/ui/vehicles/rj-vehicle_fuelguage-low.png");
textures.gaugeEmpty = getTexture("media/ui/vehicles/rj-vehicle_fuelguage-empty.png");
textures.engineGaugeTex = getTexture("media/ui/vehicles/rj-vehicle_engineguage.png")
textures.speedGaugeTex = getTexture("media/ui/vehicles/vehicle_spedometer.png")
something like
media\texturepacks\UI.pack
media\texturepacks\UI2.pack
media\texturepacks\Mechanics.pack
soulsteal={}
local damageBoost = 0.0009
function soulsteal.EvolvingWeapon(zed, _, _, wpn)
---TODO add weapon's moddata check if wpn and wpn:getModData()['isSoulStealer'] == true then
zed:getModData()['isStoleSoul'] = true
end
function soulsteal.ZedDead(zed)
local player = getPlayer()
if not player then return end
if zed:getModData()['isStoleSoul'] == nil then return end
local wpn = player:getPrimaryHandItem()
if wpn then
if wpn:getModData()['killCount'] == nil then
wpn:getModData()['killCount'] = 0
end
end
wpn:getModData()['killCount'] = wpn:getModData()['killCount'] + 1
print("killCounter")
print(wpn:getModData()['killCount'])
print("Zed Dead?")
print(zed:isDead())
if wpn:getMaxDamage() >= 12 then
wpn:setMaxDamage(wpn:getMaxDamage()+damageBoost)
player:Say(tostring(wpn:getMaxDamage()))
end
zed:getModData()['isStoleSoul'] = nil
end
Events.OnZombieDead.Add(soulsteal.ZedDead)
Events.OnHitZombie.Add(soulsteal.EvolvingWeapon)
Hadn't thought about using the zombie's mod data when I said the "wouldn't be super great" bit, makes sense
Much thanks! I'm going to have to do some digging it looks like. I havent worked with texture packs before. I appreciate it.
Anyone know how Global Moddata works online?
They work like pretty much any modData you can have a client copy and a server copy, you can transmit them inbetween the two
You have to use special events to receive and handle changes
ProjectZomboid\media\lua\client\Foraging\forageClient.lua
ProjectZomboid\media\lua\server\Foraging\forageServer.lua
may have some example, but there are plenty if you search for ModData.getOrCreate
Thank you!
Hello there people
You all are good number crunchers
How many zombies spawn indoors in Louisville?
@left plank
I'm pretty sure that's a scam bot man
OH FOR FUCK'S SAKE
@left plank - Scam spyware links
thank you!
<@&671452400221159444>
I don't like free stuff
thanks again
Warning! PZ modding can be addictive 
Newbie modder trying to make a new option for this wheel here. question is would it be a user interface mod?
Images only, apparently.
I was looking into this but - is there something to confirm modData changes to items if the item is in a world container?
I know isoObjects can transmitModData but that seems to be for world objects
Having an issue with my shops code - where I have money able to stack values stored in modData - removes the other item
Someone was storing money in world and piling it
when they relogged half of it was missing
The client must send a command to the server which changes the data on the server and then transmit it to all clients if needed. At least from what i've seen it's how vehicles work.
That's what I was semi afraid of lol
Hopefully all this stuff gets ironed out with the inventory changes
The more things goes the more everything will or should become server sided.
It make sens to have the real value on the server and client that needs it request it
the thing is if items are in the inventory it already transmits the information once you place it on the floor
maybe I can just make stacking money force it into the player's inventory than back out
You mean to transmit the worldinventoryItem'item modData
Yes
In-hand the actions are fine, as it's client side in one person
They can drop it on the floor and the game knows to trasmit the information
To sync it up basically
The issue here is they can perform actions outside their inventory that seems to not trigger this syncing
@sour island did you try to isoWorldInventoryItem:transmitCompleteItemToServer()?
that would be for an item dropped on the ground
so if the item is inside a container i supose you can send the whole container back to the server or something
@sour island it seem that ItemContainer has a removeItemOnServer addItemOnServer, did you try that on the client
yes for removal
The issue is I made it so if you drag money onto other money items it combines the modData.value
so there is no isoWorldInventoryItem as I made it required to be in a container
going to make it so the container has to be a player
Going to just leave it as is
lol
cba to deal with network code rn
I had already made splitting only work in your own inventory
should've known to match merging
when your creating traits using TraitFactory.addTrait() what are the 2 booleans at the end of the function?
local t = TraitFactory.addTrait("internalname","Display Name",Cost,"Description",DisableSinglePlayer?,DisableMultiplayer?)
i'm trying to make a trait that is only enabled in multiplayer. i know one of those values is for disabling it on multiplayer but im wondering if the other one is for disabling in singleplayer or if its for something else entirely
boolean profession, boolean removeInMP
profession means it isn't selectable normally
so theres no way to disable traits specifically in single player?
no
looking for the location of the files where i can add options to this menu
You can add to this menu from anywhere, create a script in your mod client side.
then use:
local function someFunction(param1, param2, param3)
end
local function contextMenu(playerNum, context, worldobjects, test)
context:addOption(getText("ContextMenu_My_Text"), param1, someFunction, param2, param3),
end
Events.OnFillWorldObjectContextMenu.Add(contextMenu)
You would add conditions to define when to show or not show the menu options you are adding.
There is also a context:addOptionOnTop(...) if you want to add the option on top of the menu options list.
interesting, im new to modding so i may need to find someone to walk me thru it, its a pretty simple mod i think
thank you very much
search for OnFillWorldObjectContextMenu in the game lua source code. Youll find so many example how to use it
here steamapps\common\ProjectZomboid\media\lua
so with this i can make it to only show in a car with the window rolled down?
holy moly
Will probably need some balance patches
oh nice man some dayz shit
gotta try that
We take a deep dive in how to keep inventory management entertaining on a live stream.
#darkanddarker #tarkov #gaming
โบ Twitch: https://www.twitch.tv/thespudhunter
โบ Twitter: https://twitter.com/TheSpudHunter
โบ Discord: https://discord.gg/thespudhunter
๐ธ Patreon: https://www.patreon.com/TheSpudHunter
That said, I'm very impressed by the work !
Well done Notloc, massive undertaking, but I'm gonna have a blast when I'm back home from work
anyone in here willing to walk me thru making my first mod? its a simple idea i think Lol
super new to modding pz but im a fast learner
what do you need help with
that's what we're here for ๐
Lol Pretty much start to finish, someone to help me get a general idea of finding what i need and some minor stuff maybe. i got myself into a situation in game and been thinking of modding so i found the perfect mod to make when i got stuck if u would like to know more dm me
i really dont need all that, i can figure that out later but for this specific mod i do need some help as its my first one
mod development
the resources provided are (Stale) Buns
the resources actually make me want to tie concrete blocks around my feet and jump into a river
grats on the release homie
Any clue how to get the current mod's workshop ID? I tried this but the workshop ID is null:
local mod = getModInfoByID('OutTheWindow')
print(mod)
print(mod.workshopID)```
and yes the target mod is available on the workshop
@weary matrix ```lua
mod:getWorkshopID()
there is never any java field accessible only methods
yeah totally forgot and didn't check the permissions on the field
@weary matrix port your mod into pzstudio and youll get the whole intelisense for lua working ๐
sorry but I hate IDEs, and IntelliJ ๐
don't need all that crap
sweet it's working
well if I needed it how come I was able to make mods without it?
Well it would boost your productivity thats all
its a plus not a negative thing ๐
no IDEs are only wasting my time to be honest
i programmed my previous mod mostly in notepad
its a matter of opinion anyway, but with the IDE i could answer your question in 2 seconds
#mod_development message
in case you haven't gotten a response, you can probably try getPlayer()
https://zomboid-javadoc.com/41.78/zombie/Lua/LuaManager.GlobalObject.html#getPlayer()
and then create a "new" isoPlayer
https://zomboid-javadoc.com/41.78/zombie/characters/IsoPlayer.html
from that point, you might need to fiddle around with SurvivorDesc SetID()
https://zomboid-javadoc.com/41.78/zombie/characters/SurvivorDesc.html
Funny enough, I can't seem to find a delete(), so you'll have to come up with a new copy function that cleans up
yeah well haven't been modding pz for more than a year now, so like I told you I'm a bit rusty, but I could have answered that question at least as fast as you when I was really into pz
yeah bud i know
@thin hornet also you're obviously not that much into efficiency or you wouldn't be running windows ๐
I got my reasons and by the way I've been trying to reach you concerning your vehicle's extended warranty.
whaaat? ๐ค
Where can I find the icon for hoodies in the game files? I'm talking about this image 
I have no clue what you mean
Why don't you just go to the wiki and download the PNG there? :P
@weary matrix so whats the plan new mod idea?
Throw your inventory through the window?
U brilliant
Anybody know any tools, guide or example for writing custom moodles?
@thin hornet nah, I'm making a tool for modders who want to protect their IPR. I'm trying to have the following features:
- obfuscate lua code to prevent edits
- possibility to blacklist a steam user ID
- possibility to disable the mod when running from inside a modpack
https://steamcommunity.com/sharedfiles/filedetails/?id=2859296947 seems to have what you need
There is a moodle framework if you haven't investigated that
^^^^^
Thank you!
Hum, so this should be enough to detect if a mod is running inside a modpack right?
local mod = getModInfoByID('OutTheWindow')
local workshopID = mod:getWorkshopID()
if workshopID == "2659216714" then
print("No modpack detected")
else
print("MODPACK DETECTED!")
end
I don't understand, how are you gonna force people's client to disable a mod?
i would imagine that if workshopID is true, run the mod, else, don't run anything
well that seems like a way to detect it but it doesnt prevent it so far
also it's not strong enough to consider using
it's just one part
Well i dont see anything wrong with it
Assuming it even works, you would be forcing the user to not use a mod they obviously want
I don't think there's any law in any country that prevents you from protecting your IPR, Windows and Apple do it too
it's very possible and not at all illegal
When they could have no idea about the infringement
In my country there's a law for forcing people to use a product they don't want
You're not punishing the modder here
The mod would not load if it was loaded from a different workshop id so it would work
^
I'm not trying to punish any modder
at least if you stop it from loading
local mod = getModInfoByID('OutTheWindow')
local workshopID = mod:getWorkshopID()
if workshopID == "2659216714" then
print("No modpack detected")
else
print("MODPACK DETECTED!")
return
end
that's a totally different topic?
That's your idea from what I understood
Thanks! I need get it working with your carry everything mod at some point. They seem like an obvious combo now that I think about it due to how I handle Moveables, doesn't seem to work out of the box though ๐ฆ
let me know if you need anything.
What's stopping the reposter from deleting this?
Nothing
Hey Notloc, great job on the mod! Haven't tried it out, but will do when I'm back from work
well Co is making an obfuscator so that would be hard to remove it
@heady crystal Modpackers are stealing code basically, I'm just trying to give modders a tool to add some level of protection against that
its not bullet proof but it require some work from the reposter
By punishing the end user
And you're generalizing
obviously this won't be applied to mods that are allowed to be in modpacks, and exceptions will be made for authorised modpacks U_U
The user just has to download the original mod for free, I don't see any punishment here
Well its not punishing the end user, when they join the server that include redistributed content it would just not work and they would find an other legit server to play into
There is a point to this. I don't enjoy having people shove my mod into a modpack
@weary matrix instead of disabling, you could try doing a UI pop-up saying "This mod is being used in a modpack without permission". The pros are that, if the modpacker is stupid or lazy, they wont be able to remove it. The con is that if they are smart, they will remove it
also mod pack creators aren't going to even upload something that doesn't work so i don't think the 'end user' will be a large group of people
You're making them do it
You're not giving them the option to refuse
You know, the person who has no blame
They have no way of knowing if the modpack is not authorized by some random modder
They dont need option they dont even know what they are subscribing to when its a mod pack
you're not making them do anything, they can just not download your mod if they don't want to use it morally :3
@thorn bane imagine having this line embed somewhere in your code (when all your code is some sort of similar gibberish:
local a0 = getModInfoByID('\79\117\116\84\104\101\87\105\110\100\111\119') local a1 = a0:getWorkshopID() if a1 ~= "\50\54\53\57\50\49\54\55\49\52" then print("\77\79\68\80\65\67\75\32\68\69\84\69\67\84\69\68\33") else print("\78\111\32\109\111\100\112\97\99\107\32\100\101\116\101\99\116\101\100")```
What if they don't know
"Messy code that runs is just debt to sanity"
@thorn bane not saying it's bullet proof of course, but I'm pretty sure it would be enough to deter many average modpackers
it's just the code you publish that is gibberish, you can still have your normal code in your git repo
How does error logging show when its obfuscated, does it give enough details
@thorn bane this is what it would look like for a not so big mod (still some work to get it to work though):
error would be the same, except the line number would indicate 1, but if you want you can preserve newlines if that's a problem
gotta say it's always kinda funny to watch people protecting IP
To each their own, I don't support the slightest chance of negatively impacting an innocent end user.
the modder is free to add a popup to tell users where they can get the real mod
this would mostly impact server owners who put mods in modpacks even when it's against EULA or similar
if they're not happy with that they can still use mod collections
Anyway modpack are not really usefull, steam workshop keep mods up-to-date and modpack need to update manually the mods, plus the user need to redownload the whole modpack everytime something small has been updated.
modpacks are a disease that should be eradicated ๐
When project zomboid workshop update was bugged, modpack was a good thing
Now its fixed and workshop update works great
Except when we have a Dislaik situation and the whole server dies
Or something like that
Doesnt happen too often hopefully
what happened?
Deleted all his mods from the workshop
well I know him a bit, he's not an ass, pretty sure he had his reasons
but I fail to see how Dislaik deleting all his mods from the workshop would result in a server dying?
the unachievable dream of foss modding
well probably prevent it from starting until the admin remove it from the list
depend of the mod but yeah
Nothing too serious, but I understand why they wouldn't want to risk it. Specially for big servers
having people abusing your TOS when you're not asking money is also bad for health
what tos are you talking abt here
whatever TOS the modder decide for his own mods
oh
I can't take you seriously with that pic lol
lmao nice
that is the worst code i have ever seen
i want it
@thorn bane hahaha โค๏ธ
the lua experience
well you'll have to wait a bit for me to finish it ๐
Let's make Lua uglier
actually obfuscated JS can be way worse than obfuscated Lua
tbf all js counts as obfuscated code
cause there's no restrictions on the characters you can use for a symbol
the infamous ==
I've read proper JS code
when a core feature of your language is considered bad practice
js > lua
if its proper js then yea i agree
@drifting ore have you checked fabrice bellard jslinux code?
nope
it might not be the best example but is perfectly readable, looks like C actually
it's a Linux implementation in JS
ooo
thanks
Godless abomination...
see it as a performance, an artist move rather than something really useful
there's also a C compiler in there ๐
also written in JS of course
its impressive
Its must be only 3 distributives of linux
I don't get what you mean
Why choose anyway? Windows for games and linux is for anything else
true
that's not true anymore, for many games you actually get better performance for gaming on Linux than Windows, thanks to valve's proton
You are in pz anyway so two computers dont make you a more "nerd" than you already are))
people even use proton when the game is Linux native because the performance are better
Well, we are still have that large pool of non optimized onlywin games
Meanwhile people running wow with all that ~300 mods on lua and somehow its works in linux without of fps drops
@shrewd violet since proton is out I've been buying games on steam without checking the compatibility, never had a game I couldn't play so far
or well yes but for other reasons, my CPU was too old and missing an instruction set the game was using, but that's a problem that would have ocured on windows too
@shrewd violet check your favorite games here: https://www.protondb.com/
Yeah, thanks, i know) Im just lazy
the only games that wouldn't work are the ones with DRM
(and have a job which require a both ecosystems to know)
or that rely on non regular stuff outside of the win32 API
which is kind of rare to be honest
hehe
oh and cherry on top of the cake, proton is using bubblewrap, which adds a really good layer of security with no performance penalty. It's a sort of VM at the filesystem level, a bit like chroot but better and safer
do you guys also have issues with github today?
first time in my life I'm having timeouts on github ๐ฎ
nope
@thin hornet does this page works for you?
https://github.com/boolangery/py-lua-parser/tree/master/luaparser
yep
damn it seems to be working for discord too
don't think it's my connection either because it's the only website I'm having issues with
ah finally
@thin hornet how nice, it seems TIS added some random crash to make their game even more convivial ๐
hopefully it's only when using debug mode and you have an error, but I'm 100% positive this is new, never had this problem before
guess it's a way to say thank you to the modding community ๐
Oh geees
[ |\t]*
what?
check the mod moodle framework or I'm not sure about the name, but it should probably help you figure it out
ok thanks
like for example the insanity mod
rather this one: #mod_development message
ok
@thorn bane OK, I got my Ladders mod to work when obfuscated, let me know if/when you want to give it a try on your mod
I probably still have many stuff to handle, but at least I got a real mod working
Sure, probably won't use it on the mod I'm currently working on but if I have any further ideas I'll let you know
@grave oyster Hi, I'd like to talk to you in private, just let me know if you're OK with that
hm, should radial textures be cached? I'm guessing it's better to cache only things that run every tick?
Hey mate, from a general perspective I don't think there's any downside in using a cache, unless you have a limited cache
I havenโt seen a mod that changes the protection values of the padding/patches you can add onto clothes. Anyone know if thatโs a technical limitation or just something only I wish existed lol
There's a ISGarmentUI:doPatch method, maybe you could take a peek at that and see.
Welp time to learn how to mod zomboid lmao
Oh, sorry :P I assumed you were familiar.
It doesn't look like it'd be hard limitation, from my quick glance.
Some of the values are hard coded in java but they scale based on skill and fabric.
Somebody motivated enough, might find a solution.
The only thing I can think of is to add custom patches. Like a crafted leather patch that has its own values compared to the vanilla one lol
But itโs too complicated for my brain to understand lol. I make art for a reason. Code is too complicated for me
Modding's how I learned to program originally, now I've been at it for like 4 years!
I would encourage you to give it a go if you're interested; Zomboid's modding is pretty lightweight, you just need to figure out the project structure and have a text editor and you can start writing code, no need for compilation or specialized software (Though such things might help in the future).
Well I guess this could be a decent way to kill some time.
Could do! And you're already at a good advantage because you've got this community to back you up.
Do you have much understanding of programming concepts, like if statements, for loops, functions, objects?
The last time I did anything related to coding was code academyโs html courseโฆback in middle school
So no I have no idea what any of that meant lol
Ahh alright :P Objects were the trickiest thing for me to pick up, but with some time they start to make a lot of sense. A lot of programming is just a simple concept on top of a bunch of other simple concepts.
Lua is very similar to javascript in how it's designed, which I've heard from beginners is easier to start with compared to python/C#/etc.
Well at least this might go better than my attempt at making a mod for stardew valley. That went nowhere cause the game is coded on C# and the any 101 style video is like an hour or two long
Oh yeah, I've done stardew modding and outside of adding simple items that thing is the real deal. Uses harmony and code injection stuff - very interesting, but also very complicated.
Yeah. And I wanted to add guns to the game (I wanted to shoot slimes with something that wasnโt a childโs toy) that went nowhere fast. Spent a month on it got nowhere.
lmao dang, yeah that is ambitious. Comparatively, adding patches to clothes sounds like a cakewalk.
If you're the kinda person to dedicate a month on a mod in spite of that though, I think you can absolutely pick up something like lua in time :)
Well do you know where I should start with making a mod for zomboid? Cause YouTube has only provided a video from 2 years ago and one thatโs like 3 hours long. Iโm not saying my attention span is bad. But I donโt have the patience to watch a 3 hour lecture
the one from two years ago is an hour too 
Sadly there probably aren't any video tutorials on zomboid modding. Lua is quite well covered as it's used on Roblox, though.
Before zomboid modding I'd never used lua and it was a complete enigma to me. So I approached it at two fronts: Tried to find a basic, text tutorial for it, which I usedd these:
https://pzwiki.net/wiki/Modding#Modding_tutorials
https://github.com/FWolfe/Zomboid-Modding-Guide/tree/8d3a1265c10ce96a89f4c67a092c7fb7d3e9114d
And to complement that, I looked at existing mods that I liked. Taking apart something and figuring out how it works, without actually having to make it yourself, is such a great way to learn code imo.
And of course, asking ample questions of communities like these will help out.
I guess Iโll take a peek at the repair any clothes mod. Maybe thatโll have something to offer as far as clothing patches go.
Good idea! I hope it goes well.
I feel like Im missing something obvious, but how do I actually make a blank mod, like just getting the game to recognize the mod exists and is technically loadable. the documentation isn't entirely clear on this ๐
Ahh yeah, that was a bit weird too. You need a specific file structure.
Your local mods will go in a different file to steam mods. There should be a folder called "Zomboid" somewhere near the root of your file system - i'm on linux so i can't give what the windows location is exactly. Maybe just directly in c:
In there is a folder called Workshop
In this folder, you'll make a new folder with the name of your mod - something like MorePatches
Then inside of MorePatches, make a folder called Contents
make a folder called mods
new folder, MorePatches
Then finally, in here, you'll put a mod.info file, which you can look at in another mod, or it's described here: https://github.com/FWolfe/Zomboid-Modding-Guide/blob/8d3a1265c10ce96a89f4c67a092c7fb7d3e9114d/structure/README.md#modinfo
ah okay got it, thanks for the help. at the very least I'll have made a blank mod today lol
it was confusing to me too
It makes a lil more sense why they do it this way now, though it's still a bit messy :P
Oh yeah, this Workshop folder will also have a template mod that you can glance over for structure, called ModTemplate.
Annd I should also mention, capitalization is important. It has to be Contents, capital C.
and mods, lowercase m
I certainly wish it was better explained on the documentation that does exist lol
Yep! I just tore apart mods to figure it out :P
but yeah I usually just assume by default that capitalization matters
I feel like this wouldn't even need to be a whole lua file. it's probably just a script edit. but what's the values im editing lmao
I'm not quiite sure. I can't find anything in any of the script/.txt files from searching patch.
It's possible that the tailoring system doesn't use any script files and is just all in lua - it's a relatively squirrelled away portion of code.
That ISGarmentUI:doPatch function I mentioned earlier is in projectzomboid/media/lua/client/ISUI/ISGarmentUI.lua, which is where I'd look around. That whole file is the UI that pops up when you inspect a piece of clothing.
I think that do patch function is only responsible for the action of applying a patch/padding to a piece of clothing. it seems to be getting the bite and scratch defense values from IGUI_perks_Tailoring
Alright! Then you have some leads to follow up on.
local x = player:getX();-- these values are used to prevent AFKing to grind nimble
those sons of- so thats why nimble feels like such a pain in the ass skill to grind. well this isn't the protection values im looking for but this is interesting to learn
yep
there are tonnes of interesting artefacts in the code
my favourite one I noticed is that, you cannot slice pizza. There's a recipe for it, but it doesn't work.
Reason being, they inverted a check, and instead of checking if the pizza is cooked before allowing you to do it, they check if your knife is cooked.
ah yes my favorite meal, knife fricassee XD
mmmm mm!
i also tried throwing the knife in the oven and sadly that doesn't cook it :P
guess i gotta get a furnace and smelt the knife if i wanna eat my pizza in nice bites
yep XD
okay so good news, I figured out what IGUI_perks_Tailoring is. bad news, its just the line in the translation file for the tailoring perk name
Imma need someone to take a look at this line for me cause I know somewhere in here is what I'm looking for, but its all gibberish to me
tooltip.description = getText("IGUI_perks_Tailoring") .. " :" .. self.chr:getPerkLevel(Perks.Tailoring) .. " <LINE>" .. ISGarmentUI.ghs .. getText("Tooltip_ScratchDefense") .. " +" .. Clothing.getScratchDefenseFromItem(self.chr, fabric) .. " <LINE> " .. getText("Tooltip_BiteDefense") .. " +" .. Clothing.getBiteDefenseFromItem(self.chr, fabric);
The .. syntax you see there is lua's version of string concatenation. That basically means, join the string on the left to the string on the right.
So everything used there is a string. It seems what you want is the following functions:
Clothing.getScratchDefenseFromItem(self.chr, fabric)
Clothing.getBiteDefenseFromItem(self.chr, fabric)
self.chr:getPerkLevel(Perks.Tailoring)
Those first two look like java functions - you won't be able to look at or modify their code, but you can look at the java docs to get an idea on how it's being used, the object it's on, etc. Here's the one for Clothing.getScratchDefenseFromItem:
https://zomboid-javadoc.com/41.78/zombie/inventory/types/Clothing.html#getScratchDefenseFromItem(zombie.characters.IsoGameCharacter,zombie.inventory.InventoryItem)
Like someone else mentioned, it seems that however scratch defence is calculated, it's all done in java, it isn't exposed to the lua.
That doesn't necessarily mean your goal is impossible, but it does mean it'll take more work - from here, you'd probably have to reimplement the functionality of the java code in Lua, modify it to fit your purposes, and then replace the usages of that function in the codebase.
(Perhaps there's a cleaner way, someone more experienced here might be able to chime in?)
Hello, welcome to PZ mod development!
Here are some links with resources to get familiar with making mods for Project Zomboid.
https://pzwiki.net/wiki/Modding
https://github.com/FWolfe/Zomboid-Modding-Guide
im starting to think the reasonable way out is to add in a new item for clothing patches that has a higher value than the base game fabric options.
Possibly! I don't have much experience with even vanilla tailoring, so you'd know better how to take the design of it than me.
im gonna take a look through item tweaker first before I make any decisions, maybe it has something I can use as a base lol
Item Tweaker would make changes for all items - the Item script. Not the specific InventoryItem instance of the item.
yeah I figured that out real quick after taking a look at its files lol
I just assume whatever it does is too broad for what Im trying to accomplish lol
welp this leaves me at square one. Im gonna get some rest, maybe i'll have better luck in the morning.
Sleep well.
Hello there, when a player (Dog) dies, the mod (Dogs) tries to replace the IsoDeadBody by an item.
The item adding works
The IsoDeadBody removal does bug:
Immediately after death, There is an IsoPlayer on the square that should not be there (should have been removed).
When I quit and continue, that IsoPlayer has disappeared (as expected, but it is too late)
If I look at the IsoMovingObject list of the square, there is no IsoPlayer
Note that there is no IsoDeadBody (its removal was a success, set aside that remaining IsoPlayer)
I remove the IsoDeadBody at OnUpdateContainer time with ```
function DogsOnContainerUpdate(container)
--some check that identifies it is a dog corpse
square:removeCorpse(container, false);
square:RecalcProperties();
square:RecalcAllWithNeighbours(true);
container:setSquare(nil)
end
Events.OnContainerUpdate.Add(DogsOnContainerUpdate)
Do you have any Idea how I could get rid of the IsoPlayer as soon as possible ?
Check the "furry mod" they do something similiar when the player dies
Yeah, check fur.lua. I had to check that mod cause one guy reported a bug with my transmog mod, and the code is very solid, lot's of cool tricks
thx
The author even does an interesting trick by swapping the position of the body locations. which is something I was struggling to do
Omar, I did a quick test on https://www.lua.org/cgi-bin/demo and it looks like my forEach isn't particulary slow. I tested it like this:
local function forEach(array, callback)
for index, value in ipairs(array) do
callback(value, index, array)
end
end
-- Example usage
local myTable = {}
for i = 1, 1000000 do
table.insert(myTable, i)
end
-- Measure execution time of forEach
local startTime = os.clock()
forEach(myTable, function(value)
-- Do something with each value
end)
local endTime = os.clock()
local forEachTime = endTime - startTime
-- Measure execution time of for loop with ipairs
startTime = os.clock()
for index, value in ipairs(myTable) do
-- Do something with each value
end
endTime = os.clock()
local forLoopTime = endTime - startTime
-- Compare execution times
print("forEach execution time:", forEachTime)
print("for loop execution time:", forLoopTime)
And it's printing
forEach execution time: 0.03
for loop execution time: 0.03
In the wort case is printing
forEach execution time: 0.04
for loop execution time: 0.02
What do you think?
Try add remove body function to Ontick event and after remove body remove function from event
Hi @ancient grail! How do you do?
Im fine sir thank you. Just reading the chat. Lots of veteran modders chatting feels like i have travelled back in time
anyone know how to export x file in blender?
I hope this is helpful btw
https://discord.com/channels/136501320340209664/1109270548418150410
I believe you need a plugin
I dont have it tho.
ok cause the one i found seems to break the file, any model export as x file end up 1kb and doesnt work
It might be due to version incompatibility
Interesting, but not too unexpectedโthose numbers aren't precise enough to tell you much. A loop that does nothing will be p quick either way. That said, these results can't very well be used to make assumptions about the game; I believe that site uses Lua 5.4, whereas the game uses Kahlua
I don't think the speed is that much of a concern anyway, though, despite what I said before (the only overhead is the additional function call, so it's negligible)
Alright, thank you for your insight ๐บ
Do InventoryItems actually have an Id? can I trust getID? Is this ID persistent?
Or should I implement my own Id system using moddata?
Also @tame mulch sorry for the ping, but, is it possible to write unit tests for zombie mods?
PZ accepts FBX too, that one is easier to manage
yeah i noticed, just had to resize it because somehow fbx is x1000 bigger lol
I usually export with 0.01 scale and adjust from there
yes
I think you can't do unit tests for all stuff, but for some functions you can write custom checks
Okay thank you ๐
Why can't I use this code?
TraitFactory.TraitMap:remove("Asthmatic")
Not even this helps me
local num = getNumClassFields(TraitFactory.TraitMap)
for i=0, num-1 do
print(getClassField(TraitFactory.TraitMap, i), " --", i)
end
I get this error
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field transient java.util.LinkedHashMap$Entry java.util.LinkedHashMap.tail accessible: module java.base does not "opens java.util" to unnamed module @179061e1
linkedhashmap is not exposed
Well, fuck ๐ฆ
also last time I checked, most global functions that use reflection are only properly working in debug mod
Well, good to know, thanks mate
as a workaround you can probably use the getTraits() methods to get a list of all traits, Reset method to clear the TraitMap, then use addTrait() to add back those you want
Yeah. that's basically what I'm planning to do.
But I'm trying to see if setting a trait to profession only does the trick
I'm a bit confused, what is this? Like, what is patchClassMetaMethod ?
another approach that might work is to use the setMutallyExclusive() to make a trait mututally exclusive with all other traits
Yeah, also this can work
Ah I see, but what does your code exactly do? I'm a bit confused, do you mind examplaing it?
This intercepts calls to add the trait, so you can change arguments or stop it from being added.
Ah, that's interesting ๐ค
But how are you checking if the trait passed to the intercept is correct?
TraitFactory.addTrait("Axeman", getText("UI_trait_axeman"), 0, getText("UI_trait_axemandesc"), true);
if args[1] == "Axeman" then --[[...]] end
wait, this has error, I think I had improved this
Ahhh, okay, makes sense, since the args[1] is the first param, and args[0] is the self, right? And then for safety sake I can return a dummy trait Trait.new("","",0,"",false,false) of it does not match I forward to the original function, right?
One more question, what is local def = TraitFactory.overwriteDef[arg[1]] doing?
It could be used as an API to insert /replace values
Aaaah okay I see
But I also noticed another odd behaviour, I'm looking at this:
print('TraitFactory.getTrait("Axeman").prof: '..tostring(TraitFactory.getTrait("Axeman").prof))
And prof is nil even when it's supposed to be true, am I doing it wrong?
like TraitFactory.addTrait("Axeman", getText("UI_trait_axeman"), 0, getText("UI_trait_axemandesc"), true); prof should be true O.o
Also Trait in not exposed.... ๐ Alright, plan B
How could you make a mod to make most props moveable?
I see a lot of stuff that can't be built, or can't be obtained
This applies for a lot of tiles from popular mods
For example, I would like to build or obtain the short fences in some homes
Specially those from Raven Creek
they work also out of debug mode but crash if you try to use non public members. you can counter it with some string analysis. That's how I made https://steamcommunity.com/sharedfiles/filedetails/?id=2973841201
hm, TraitFactory.Trait is exposed
Apparently not fully exposed?
Got an example of the UI?
you cannot directly access public parameter, call TraitFactory.getTrait("Asthmatic"):isFree()
Yeah, apparetly I can only use isFree to read prof but I cannot write it
I made no UI, just lua functions to encapsulate the problem. but there is an exemple in the mod and the interface is in the description.
in the intercept, add Asthmatic.prof = false
yes, this is only set at trait construction time.
Would be a neat Ui to add to community projects
Should also note:
@sour island
time to add this?
TraitFactory.overwriteDef = TraitFactory.overwriteDef or {}
util.patchClassMetaMethod(TraitFactory.class,"addTrait",function(addTrait)
local obsoleteTrait
return function(...)
local args = {...}
local def = TraitFactory.overwriteDef[args[1]]
if def then
if def.obsolete then
obsoleteTrait = obsoleteTrait or Trait.new("","",0,"",false,false)
return obsoleteTrait
end
for i,v in ipairs({"name","cost","description","prof","removeInMP"}) do
if def[v] ~= nil then args[i+1] = def[v] end
end
end
return addTrait(unpack(args))
end
end)
I have a general purpose patch class method in the issues sections
Yeah, I'll probably need to work with the intercept, or I'll do something else. Anyway, it's enough coding for me today, need a break , I'll catch up with you soon
HOOOOOOOW ๐ป
How did you make it so that from github it pushes to the steam workshop?
Long story
It's not something you can safely do broadly speaking
If you visit the workshop button youll see it's not my actual account
and this is because 2FA needs to be disabled
Ah, interesting ๐ค
I think I'll give it a deeper look tomorrow
Good job anyway, very cool stuff!
The code above is from when we discussed that some trait properties can not be set, leading to people recreating the whole trait from start.
Ah right
I do recall that-- I would suggest dumping that into issues too
Both the general patching method and that trait patch can work in tandem
ty, I'm looking for maintainer volunteers - or if anyone has useful utility stuff
I'd love to help, but I can barelly mantain myself right now ๐
Interesting, that also makes sense.
overwrites can be false now
does anyone got an idea what "posx/y" do?
wanted to make a spawn points
I knoe world x and y
and posz
world co-ordinates are cells, pos co-ordinates are position in that cell
cells are 300x300 areas the game is divided into
ohh
okay
thanks alot
anyone knows what be the best way to remove the unemployed requirement so that it works for any profession?
Indeed ! Thanx a lot ! In my solo case it took ~=100ms after the dead body container update for the dead player to be accessible OnTick to the getMovingObjects of the grid square.
would getActivatedMods() work for what you want?
I don't think so because for example if your mod is in a modpack you don't know the mod id
i think i've seen it extracted from the callframe
that might have been the mod name and not the mod id though
Yeah i've seen this too, but i'm wondering if there's a better way
how do you get a reference to current mod object in the first place? ๐
I'm not sure what a current mod is, Lua files aren't loaded based on mod.
in my case it would be the mod to which the file currently being executed belong to?
hum but thinking about it, I don't really need the mod ID, just the workshop ID would be fine, but I don't want to hardcode the mod ID to get it
Is there a way to disable lua checksum?
Trying to make server testing a bit less cumbersome
in server settings yes
Ah, there it is under other
true, also nothing stops someone to rename the mod itself
@weary matrix
local mod = getModInfoByID('OutTheWindow')
if not mod then
print('mod renamed?')
return
end
local workshopID = mod:getWorkshopID()
if workshopID == "2659216714" then
print("No modpack detected")
else
print("MODPACK DETECTED!")
return
end
what if the user has my mod installed from the workshop and also from a modpack? Then I think it would not detect that it's running in a modpack
getModInfoByID will return the mod if installed, whether it is loaded or not for the current game
in that case you still get your sub anyway
oh, interesting, that's a good point indeed ๐

but then I wouldn't get the pleasure to ruin some modpacker days ๐
Tho that check must be included in every single files
So it should be added automatically when obfuscating your code
of course
@thin hornet but why do you copy/paste my code back at me? ๐
@thin hornet anyway I decided to improve my strategy, I want to "encrypt" my code using the corresponding workshop ID as key
even a simple xor would be enough I guess (yeah I know it's trivial to break, but not to most people)
Anyone have an idea on how to sync item mod data when the item is on the ground?
IsoWorldItems transmit their data fine during play, but when I rejoin nothing get retrieved from the server.
InventoryItems themselves only auto sync their data while actively inside a player inventory.
And InventoryItem does not have a transmitModData function ๐ฆ
I'm not 100% sure but you should be able to sync the data by calling square:transmitAddObjectToSquare() or something (on the square where the item is),
The issue this is causing me is that on servers with Inventory Tetris, when someone reconnects, item containers placed in the world revert to the item arrangement they had when they were dropped.
hum so it's a different issue I guess, forget what I said
Similar issue with vehicles.
They refuse to transmit their mod data.
Server complains that their IsoObject index is invalid
Does anyone have a livestream or channel where they are working on mods? I use to watch for mods on skyrim and enjoyed it.
Authentic Peach does https://www.twitch.tv/authenticpeach
Hi! My name is AuthenticPeach and I mod and play games like Project Zomboid. I like to make cool stuff and improve players' gameplay experience. I like to have fun and chill, I hope you enjoy your stay!
Thank you!
vehicle will only transmit from the server side
Tho for items on the ground i have no idea yet
Yea I'm just playing around with some custom networking via global mod data
Hopefully this works the way I think it does
I had this issue with my money - my solution was to restrict manipulation to items inside the player :\
you'd have to send the modData through server and back to clients
and I didn't want to deal with all that
hi! Did you evaluate the possibility of having threads inside this channel? I think it could be great. good Monday!
Threads are allowed in this channel
Ayy I got it working for ground items
Time spent on the actual networking architecture: 10 minutes
Time spent hunting down silly typos and silent bugs only possible in lua: 90 minutes
this is programming 101
Is this real?
Because thats kind of a huge problem I shouldn't have to deal with. I can't change my mod ids at this point. Basically all of them have underscores.
seems unlikely
Maybe trolling, trying to get unsuspecting authors to remove their mods from everyone's saves
more likely someone unknowledgeable blaming their issues on something completely arbitrary
sus.
but folder path naming IS case sensitive though for Linux, Macs, and Unix OS iirc.
Underscore doesnโt cause issues with macs from my experience
Otherwise all steam deck users would be having a lot of issues
Shoutout to @mellow frigate, your contribution is greatly appreciated!
i made an addon for true music if any of you guys or gals like phil collins or genesis
32 songs, all lore friendly as they were recorded before 1991
Are evolved recipes handled through code that's not exposed?
i've messed with them a bit and i didn't run into anything that wasn't exposed
Original:
evolvedrecipe PieSweet
{
BaseItem:PiePrep,
MaxItems:4,
ResultItem:PieWholeRawSweet,
Cookable:true,
Name:Prepare Sweet Pie,
CanAddSpicesEmpty:true,
}
Mine:
evolvedrecipe Prepare Literally Anything
{
BaseItem:PiePrep,
MaxItems:4,
ResultItem:PieWholeRawSweet,
Cookable:true,
Name:Prepare Something for the love of GOD,
CanAddSpicesEmpty:true,
}
Original
what module is your recipe in
Base
hmm not that then
It's identical
Wdym?
items assign themselves to the recipe, they work backwards for some reason
this is especially frustrating because this is not even how it works behind the scenes, it's only backwards as far as the scripts go
How does one add the ingredients?
are you familiar with using DoParam?
local item = ScriptManager.instance:getItem("module.myItem")
if item then
item:DoParam("EvolvedRecipe = RecipeName:Amount")
end
if you want to add to multiple recipes you separate them with semicolons e.g. EvolvedRecipe = RecipeName:Amount;Recipe2:Amount
module.myItem is the ingredient?
yeah, that's right
And what's the amount?
i think it's the amount of usedelta or something
shared or server, as long as it runs on both sides
Sorry for all the questions I just want to make sure it works I am super frustrated rn lol
I'll give it a go, thanks for the help!
Has anyone tried using AI to develop their mods?
is there a way of pulling the list of valid hammers for crafting?
in vanilla its just the ball peen, normal hammer, and stone hammer, but if i make a list of those 3 then modded hammers wouldn't be detected. even though they're valid and being used for the recipe.
not just hammers, saws, propane torches. pretty much all of the tools. how do you pull those lists?
they probably use a tag + function for it, like [Recipe.GetItemType.Hammer] or something
I used ChatGPT to get a head-start on some of the mods, but it's really only good for checking if your Lua code is good
Anything regarding Project Zomboid modding specifically gets iffy
here it is```lua
function Recipe.GetItemTypes.Hammer(scriptItems)
scriptItems:addAll(getScriptManager():getItemsTag("Hammer"))
end
you can reference functions in a recipe script by enclosing the name in square brackets like that
where is that? is that in a lua file?
yeah, server/recipecode.lua
thanks ๐
Anybody know if there's a way to check if an object is being cooked?
Like an event or function that gets triggered or something
item:isCookable() and item:getItemHeat() > 0
Yeah but that only checks its temperature, I am looking for a function or something that gets triggered when you say put something in an oven
Or a fridge
Not quite sure if If this is what your looking for but in ISCraftActiin there's
newItem:setCooked(resultItemCreated:isCooked());
And in food lua
---@public
---@return boolean
function Food:isCookedInMicrowave() end
the good ol' OnContainerUpdate
with a bit of clicky turn on/off
I'm making ice cream aaaand apparently I cannot prevent it from turning into a cookable item
but good luck with that
So I am looking into forcing it to melt on cook
Using evolved recipes
you can do whatever with the oncreate function in the recipes don't you ?
Ice cream rules
Don't know, never touched recipe code before
Maybe copy normal cookable food
I am already setting it to turn into a regular base game ice cream
and make the iced ice cream a "uncooked" and the melted one a "cooked"
But the evolved recipe forces it to become a cookable item
hum nevermind
Yeah it's pretty silly haha
i mistaken, cooked item arent a different one
what a waste
This might work tho?
You've gone too far into madness !
If the oncontainer thing gets called frequently I can just check if the ice cream is heated and destroy it
that's pretty much what Cooler mod does
Coolbag
- I need a lil guidance ๐. Recently inspired by Ra's body mod.
I've gone through and made new assets for m&f and 500+ decals and overlays I know I can just replace the default player texture but I'd like to add them to the character creation screen and maybe a few new buttons for eye types/color.
Can some one direct me as to where I should look/ how to Guid?
the only way i would see this possible so far, is by hooking into InventoryPane and checking there, but thats wrong on many level
items do have an update method but not something we can access in lua
oh
item CheeseSandwich
{
DisplayName = Cheese Sandwich,
DisplayCategory = Food,
Type = Food,
Weight = 0.3,
Icon = Sandwich_cheese,
IsCookable = true,
ReplaceOnCooked = GrilledCheese,
MinutesToCook = 4,
DaysFresh = 2,
DaysTotallyRotten = 4,
HungerChange = -15,
Calories = 366,
Carbohydrates = 28,
Lipids = 22.5,
Proteins = 12,
WorldStaticModel = CheeseSandwich,
Tags = HideCooked,
}
ReplaceOnCooked is a thing
there you go man, that must be it
its already what the vanilla ice cream is
item Icecream
{
DisplayName = Ice Cream,
DisplayCategory = Food,
Type = Food,
Weight = 0.2,
Icon = Icecream,
Packaged = TRUE,
ReplaceOnRotten = IcecreamMelted,
DaysFresh = 1,
DaysTotallyRotten = 1,
HungerChange = -30,
UnhappyChange = -10,
Calories = 1680,
Carbohydrates = 180,
Lipids = 84,
Proteins = 26,
WorldStaticModel = IceCream,
Tags = GoodFrozen,
}
item IcecreamMelted
{
DisplayName = Melted Ice Cream,
DisplayCategory = Food,
Type = Food,
Weight = 0.2,
Icon = IcecreamMelted,
Packaged = TRUE,
HungerChange = -30,
Calories = 1680,
Carbohydrates = 180,
Lipids = 84,
Proteins = 26,
WorldStaticModel = IcecreamMelted,
DaysFresh = 2,
DaysTotallyRotten = 2,
}
No way
ReplaceOnCooked = IcecreamMelted,
ReplaceOnRotten = IcecreamMelted,
Dont cook too much ice cream keep some for us
Cya! Thanks again ๐
@heady crystal btw i love your mod presentation with your purple hoodie character and the speech bubble
Thanks so much! I'm glad people like it, I wanted to have my own avatar like a lot of the bigger modders do
mine is a woman in bikini lol
i dont actually have one
used to have gorillaz characters
Yeah that one stuck with me
It looked great
I think you should go for something like it
always loved their drawing
But that's just me
You're the modder for Bravens Utilities?
Yeah, something up?
Not at all
Its a great mod. My players love the common sense additions
Thanks so much! ๐
It really means a lot. It fills me with joy to know people are having fun with my mods ๐
Do you ever take mod commission work?
Hit me up with a friend request, let's see if I can make it
Hey how does the npc spawngroup for clothing work? Is 1 meaning they are guarnteed to spawn on 1?
table.insert(ZombiesZoneDefinition.Offices, {name = "Jacket_samurai_classic", chance = 0.1})
table.insert(ZombiesZoneDefinition.School, {name = "Jacket_samurai_classic", chance = 0.1})
table.insert(ZombiesZoneDefinition.FancyHotel, {name = "Jacket_samurai_classic", chance = 0.1})
Im talking about stuff like this btw
anyone got any idea whats wrong with my code?
everytime trying to load a new game it just breaks?
Also I have a question is possible to make a vehicle with new animations? Like a walker or mech type deal?
Same
See?
any clue if there's a way to have a unique identifier for a server?
from lua of course
for example I'd like to call something like: getServerID() and it would return a unique identifier, always the same for a given server but different for each server
Guid generator:
https://guidgenerator.com/
Free Online GUID/UUID Generator
I wouldn't worry about it, I have a lot of popular mods installed with _. One mod also has empty space and -.
neat, I can retrieve the server IP with steamGetInternetServerDetails()
SpawnPoints is a Java type in PZ
Posting with the preview picture cause Discord's embed is broken lmao
https://steamcommunity.com/sharedfiles/filedetails/?id=2982620850
I want to create a propane furnace that the player can create. Like the one in BlackSmith that is not implemented, but that works with propane, and that like the propane barbecue can be interacted to insert and remove the propane tank. For this I must create a new class in java that extends IsoObject, or is there a way to do it in lua?
How to fetch the "CustomContextMenu" property of an item in a mod? It's in the documentation but it doesn't show up within the table when I debug a food Item?
I tried:
- item:CustomContextMenu()
- item:getCustomContextMenu()
- item.CustomContextMenu
Reason I need it because I want to perform a certain action on drinks, and not other food/smoke/etc
Events.OnFillInventoryObjectContextMenu.Add(myModdedFunction);
function myModdedFunction(playerNum, context, items)
Animated Musical tiles WIP :
https://imgur.com/WH353bI
https://imgur.com/Nx1WApQ
https://imgur.com/fXv9aNb
Iโm imagining this being used by ice cream truck!
Oooh yeah i could make this an api
Hi Aiteron
I don't understarnd how the client/server command works
It seems like MyDebugServer is not functioning properly
Thank you
client-side MyDebug.lua
require("MyDebugServer")
local function onServerResponse(response)
print("Received server response:", response)
end
local function sendServerRequest()
local player = getPlayer()
sendServerCommand(player, "exampleCommand",
onServerResponse(response), nil )
end
Events.OnKeyPressed.Add(sendServerRequest)
server-side MyDebugServer.lua
local function handleClientRequest(player)
print(">>>>>>>>>>>>>>>>>> handleClientRequest")
local response = "Hello from the server!"
sendClientCommand(player, "exampleResponse", response, nil)
end
Events.OnServerCommand.Add(function(player, command, args)
print(">>>>>>>>>>>>>>>>>> OnServerCommand")
handleClientRequest(player)
--if command == "exampleCommand" then
-- handleClientRequest(player)
--end
end)

Hello!
hi
if im not mistaking, sendServerCommand need to be called on the server and sendClientCommand called on the client.
Me on my way to make ice cream:
trying to make a mod that adds a draggable day counter to the screen
i know not where to start
hi everyone. I'm using arsenal gunfighter 2.0 data to in my mod an i call it like that : local player = getSpecificPlayer(0); local weaitem = player:getPrimaryHandItem(); local recoilamount = weaitem:getModData().TempRecoilDelayis there anything unreliable in that ? provided i specified require "content.108600.2297098490.mods.ARSENAL-26-GunFighter.media.lua.client.GunFighter_02Functions.lua" at file start ?
how do you guys call mod data in your mods, if any ?
wym
And many thanks @fast galleon, i ended up to understand how to use time and time instance, here is how i made a double sinusoidal works in pz ^^ : ```if drunklevel > 0 then
local newtimeinstanz = Calendar.getInstance()
local secz = math.abs(newtimeinstanz:getTimeInMillis())*0.001
local drunknesstime = 0.4 --0.25*math.sin(2*math.pi*0.1*secz)+0.35
local drunknessoffset = 0.2*math.sin(2*math.pi*0.2*secz)
local oscillationamplitude = drunklevel*1.8
local oscillationoffset = 0
local drunkennessAdjustment = oscillationamplitude * math.sin(2 * math.pi * (drunknesstime * secz - drunknessoffset)) + oscillationoffset -->> y = A * sin(2ฯf(x - h)) + k
Advanced_trajectory.aimnum = math.min(math.max(Advanced_trajectory.aimnum + drunkennessAdjustment-adsEffect, aimin), maxaimnum)
else
local drunknessAdjustment = nil
local drunknessoffset = nil
local secz = nil
end --Drunkness ``` it drives distance between sight's sprite
that's correct, and requiring a file isn't relevant to moddata
waityou said you used time
are you amodder
yeah
would be able to help me
i have an idea for a mod with no understanding of how to do it
its something like a day counter for the corner of your screen, to help people making any form of 100 days series for PZ
like what Predz did
i haven't done much with ui, not my area
editing in the day counter is confusing cause even predz lost track
i know gametime tracks how many days survived
yea
its similar to that
it would be days since the world was created
and wouldn't reset on death
i mean technically it could reset on death
so people would have to keep track by not dying
...
it helped me with time. From what i barelly understand about your idea, did you tried to catch ISAlarmClockDialog.lua ?
i think gametime's days survived is probably time since creation
then don't anchor it
i have no idea how to even make it
thats the thing
im very smol brain
the most i've done is tweaked the antiserum mod
to allow me to disinfect used injectors
You'll have to learn how to make a mod with folder organisation, then you start from clock ui, u set anchor false, you drive it the way you need about time, custom sprite, and go.
and...there goes my brain
i believe in you ;p
anchor true would be fine tbh
as long as the background of it is similarly transparent to the watch ui
does not reset on death```
thats my storyboard/plan
been thinking, would it be possible to rollover the "time survived" and "kills" stats from one character to another?
anyone know where those 2 stats are stored?
in the world save folder i believe
it's easy, grab the last part of the file, remove what you don't need (it refers to ISPanelJoypad wich is interactive buttons, look in there too if you need anything). then you need the prerender function, render function and update function. You name them the way you need. You place it in another corner or set anchor false, you make your sprite, you grab all what's about days.
IsoPlayer:getHoursSurvived(), IsoGameCharacter:getZombieKills()
- where should i look for the code
- where the fuck am i gonna get a sprite, im ass at art
and yes, before you ask, i can fuck up simple text in photoshop
Program Files\Steam\steamapps\common\ProjectZomboid\media\lua\client\ISUI\ISAlarmClockDialog.lua
Hi all, im new modding, how can I see the amount of propane in a propane tank? I want to write a recipe, if the tank is below 5% or its empty, will consume some materials to destroy the tank an respawn a filled one, OR to simply refill the current item to 1 .
Def's long term survival mod convert empty tanks to a new item, that item its destroyed and the recipe spawn a new item, I want to do the same with the Industrial propane tank from the mod "the workshop"
This might be the function you need. I believe the "uses" function is the main way items like that are checked.
Either way, this page will almost certainly have the function.
https://zomboid-javadoc.com/41.78/zombie/inventory/InventoryItem.html#getCurrentUses()
you said i need this:
self.backgroundColor.a = 0.8
self:drawRect(0, 0, self.width, self.height, self.backgroundColor.a, self.backgroundColor.r, self.backgroundColor.g, self.backgroundColor.b);
self:drawRectBorder(0, 0, self.width, self.height, self.borderColor.a, self.borderColor.r, self.borderColor.g, self.borderColor.b);
self:drawTextCentre(getText("IGUI_SetAlarm"), self:getWidth()/2, 10, 1, 1, 1, 1, UIFont.Small);
end```
There's also "getDrainableUsesInt", might be that? I'd run a search on the codebase to see if you can find an actual instance of it being used.
end```
and that
ISPanelJoypad.update(self)
if self.ok.joypadFocused then
self.ok:setJoypadButton(Joypad.Texture.AButton)
else
self.ok.joypadTexture = nil
self.ok.isJoypad = false
end
if math.abs(self.character:getX() - self.playerX) > 0.1 or math.abs(self.character:getY() - self.playerY) > 0.1 then
self:destroy()
end
end```
and that
IsoPlayer:getHoursSurvived()
and i'll need this
local o = {}
o = ISPanelJoypad:new(x, y, width, height);
setmetatable(o, self)
self.__index = self
local playerObj = player and getSpecificPlayer(player) or nil
o.character = playerObj;
o.name = nil;
o.backgroundColor = {r=0, g=0, b=0, a=0.5};
o.borderColor = {r=0.4, g=0.4, b=0.4, a=1};
if y == 0 then
o.y = getPlayerScreenTop(player) + (getPlayerScreenHeight(player) - height) / 2
o:setY(o.y)
end
if x == 0 then
o.x = getPlayerScreenLeft(player) + (getPlayerScreenWidth(player) - width) / 2
o:setX(o.x)
end
o.width = width;
o.height = height;
o.anchorLeft = true;
o.anchorRight = true;
o.anchorTop = true;
o.anchorBottom = true;
o.player = player;
o.playerX = playerObj:getX()
o.playerY = playerObj:getY()
o.alarm = alarm;
return o;
end```
Thanks! gonna test all of them
you'll also need everything wich is used to display and update days
uhuh
ask chat gpt to do the thinking
Is Blackbeard here?
I have a piece of feedback about the MRE mod
I think it's important, I found a huge exploit
tell us
what is it

@white pivot
ISDayCounter = ISPanelJoypad:derive("ISDayCounter")
function ISDayCounter:initialise()
ISPanelJoypad.initialise(self)
self.dayLabel = ISLabel:new(0, 0, 100, 20, "", 1, 1, 1, 1, UIFont.Small, true)
self.dayLabel:initialise()
self:addChild(self.dayLabel)
end
function ISDayCounter:update()
ISPanelJoypad.update(self)
-- Get the current day from GameTime
local daysSurvived = GameTime.getInstance():getWorldAgeDays()
-- Update the day label text
self.dayLabel.name = "Day " .. tostring(daysSurvived)
self.dayLabel:setX((self:getWidth() - self.dayLabel.width) / 2)
end
function ISDayCounter:prerender()
ISPanelJoypad.prerender(self)
end
function ISDayCounter:render()
ISPanelJoypad.render(self)
end
local dayCounter = nil
local function showDayCounter()
-- Create the day counter instance
dayCounter = ISDayCounter:new(10, 10, 100, 20)
dayCounter:initialise()
dayCounter:addToUIManager()
end
Events.OnGameStart.Add(showDayCounter)```
how does that look
remove everything about ISPanelJoypad, you don't need interactive buttons
No
farming gives infintite food too
I mean infinite food without any effort
Not even searching for the stuff
It's obviously a non intended mechanic
You see, there's "Boxes of MRE"
Each has 12 MRE
You can unpack the Box to get them
๐
I clearly haven't finished
yeah
i checked, you don't need ISPanelJoypad, it's only about interactive buttons
You can eat half or a quarter of the 12 MRE's, then you can pack them back into a Box, and unpack them again to get Full MRE's
Infinitely
but its in there a bunch
i dont wanna mess up and have to start over
its in there six times
yes yes, but it's for buttons
delete the whole line for each occurence
what about the line that says require ISUI
function ISDayCounter:initialise()
self.dayLabel = ISLabel:new(0, 0, 100, 20, "", 1, 1, 1, 1, UIFont.Small, true)
self.dayLabel:initialise()
self:addChild(self.dayLabel)
end
function ISDayCounter:update()
-- Get the current day from GameTime
local daysSurvived = GameTime.getInstance():getWorldAgeDays()
-- Update the day label text
self.dayLabel.name = "Day " .. tostring(daysSurvived)
self.dayLabel:setX((self:getWidth() - self.dayLabel.width) / 2)
end
function ISDayCounter:prerender()
end
function ISDayCounter:render()
end
local dayCounter = nil
local function showDayCounter()
-- Create the day counter instance
dayCounter = ISDayCounter:new(10, 10, 100, 20)
dayCounter:initialise()
dayCounter:addToUIManager()
end
Events.OnGameStart.Add(showDayCounter)```
there it is
requiring a vanilla file doesn't do anything anyway
the only reasons you'll see someone require a vanilla file is either they don't know that or it's just for organisation
so i can remove the entire requirement line
yes, or you can use ISPanel instead, but look into ISPanelJoypad functions thats called in the clock file
you broke my brain again
when you hit initialise(), it does function ISPanel:initialise() ISUIElement.initialise(self); end
am i adding that
that's not too harsh
im a dumbass lmao
i wish i had the mentality of a pz character
read one magazine and learn an entire field of information
do i need to add anything to what i have
any clue in how to directly run a SendCommandToServer on the server?
Specifically, I wanna trigger a /Save
function ISDayCounter:initialise()
self.dayLabel = ISLabel:new(0, 0, 100, 20, "", 1, 1, 1, 1, UIFont.Small, true)
self.dayLabel:initialise()
self:addChild(self.dayLabel)
self.dragging = false
self.dragOffsetX = 0
self.dragOffsetY = 0
end
function ISDayCounter:update()
-- Get the current day from GameTime
local daysSurvived = GameTime.getInstance():getWorldAgeDays()
-- Update the day label text
self.dayLabel.name = "Day " .. tostring(daysSurvived)
self.dayLabel:setX((self:getWidth() - self.dayLabel.width) / 2)
-- Update the label position if dragging
if self.dragging then
local x = getMouseX() - self.dragOffsetX
local y = getMouseY() - self.dragOffsetY
self:setX(x)
self:setY(y)
end
end
function ISDayCounter:onMouseDown(x, y)
-- Check if the mouse click is within the day counter panel
if x >= 0 and y >= 0 and x <= self.width and y <= self.height then
-- Set dragging flag and calculate drag offsets
self.dragging = true
self.dragOffsetX = x
self.dragOffsetY = y
end
end
function ISDayCounter:onMouseUp(x, y)
-- Reset dragging flag
self.dragging = false
end
function ISDayCounter:new(x, y, width, height)
o.backgroundColor = { r = 0, g = 0, b = 0, a = 0 }
o.borderColor = { r = 1, g = 1, b = 1, a = 0 }
return o
end
function ISDayCounter:prerender()
end
function ISDayCounter:render()
end
local dayCounter = nil
local function showDayCounter()
-- Create the day counter instance
dayCounter = ISDayCounter:new(10, 10, 100, 20)
dayCounter:initialise()
dayCounter:addToUIManager()
end
Events.OnGameStart.Add(showDayCounter)```
alright so i made it draggable i think
cosmik does that look good?
youtube
I want to create a propane furnace that the player can create. Like the one in BlackSmith that is not implemented, but that works with propane, and that like the propane barbecue can be interacted to insert and remove the propane tank. For this I must create a new class in java that extends IsoObject, or is there a way to do it in lua?
Check pinned messages, and sadly there is no youtube tut for cloth modding in PZ...yet
Hey guys! I wanted to make myself a custom map, just like they did flyers in Expanded Helicopter Events, and I was wondering if someone here could help me out with it, I am quite new to modding zomboid, haven't done anything except for clothes, and I am unsure of where to start with it, thank you in advance
You can open up mods that do things to see how they did it.
also, hit my first mili
Nvm... my menu mod beat it, I forgot to check it first
Egg on my face, a menu mod is my most subbed
Then again, mod options is still at #1
Congrats!
Oh nice, better sorting jumped up a few spots - I wonder what happened there.
Haio could someone dm me who is willing to help me with a modding issue? or @ me when you can (Ty)
hi, if I want to do some mod, where should I start with? I now the basic of basics in code and never touched lua
@sour island
Now request a job at The Indie Stone
I actually think they should consider hiring more QoL modders
Oh yeah! I did open your mod guys, and checked around, tried to copy a bit, and play around... but now it crashes my game whenever I activate the mod
If you post the error people will help
Got it, I will try to, it doesn't show any error, though I can show what files, and code I put so far
im trying to learn modding could anyone help me?
im trying to modify project humanoid because i got perm from aiteron and i wanted to see how to make npcs spawn naturally
I've fixed the code, it doesn't kick anymore, however I can't seem to find the map in the cheat menu, the map is already coded aswell as an item
though Muldrough is changed to MapS1
I also got LUA stuff for the overlay thign from EHE
along with UI
you can use Events.OnGameStart.Add(<function>);
and Aiteron's code is from 2 years ago, which may or may not work in the current b41 build.
it actually works
I'm assuming you have it spawn on command or by a function call...
Either way, you can try spawning NPCs "naturally" by using Lua events
https://pzwiki.net/wiki/Modding:Lua_Events
In the case of NPCs, I strongly suggest no faster than EveryHour (in-game hour)
every minute in-game is about 2 seconds(?) IRL, which will kill your game performance very quickly.
@stone garden hope that's enough to get you started.
alright thx
the npcs dont spawn in
https://cdn.discordapp.com/attachments/1110555632383299625/1113244046480113725/image.png well, I've got the map somewhat, is there a way to make it wider?
i got it!!!
I decided to update my color picker for the transmog mod, it even support custom pickers ๐
Good night guys! I have a problem, I created a machine item to use at an ATM, I set its weight to 2000 so that no one can pick it up, but I can't place it on the ground for some reason, is there a way to work around this problem?
I needed to use the place item option, to prevent the machine from being deleted on floor cleaning...
You made an item to act as the ATM?
Yes
Take it from someone who thought using cars as crates was a good idea - look into IsoObjects instead
Storage goes vrooom?
I'm making a savings system that uses cash items to buy things from vending machines and ATMs, so the ATM and machines could show up in receipts as well
Would be like this
Can you make it possible to hack ATMs using a laptop to withdraw money like in terminator II? ๐
Next to that my mods are extrmely niche nd unknown
does anyone here have project humanoid file?
how do you cause zombies to fall? I found :setStaggerBack() which causes them to react as if they're pushed but is there a way to force a knock down?
Hydrocraft has the file you'll want to copy. Their biogas refill does just that, and you can just swap out the ingredients for the ones you want. You can search their GitHub for "biogas" to find the relevant recipe
@weary matrix its a bit iffy. it looks like zombies have some kind of "fall resist" mechanic? is that what im seeing or is it something else.
its being tied to the WeaponHitSomething event so could that be it?
i think you just need to setBumpFallType
what are the valid strings for that?
i think glytch3r kept a list of them but his resources aren't very organised so idk how to find it
can you send me the link? i'll dig around myself. maybe i'll find some other stuff too
probably somewhere in this entire thread and everything it links to ๐ https://discord.com/channels/136501320340209664/1070852229654917180
from searching vanilla code i see only "pushedBehind" and "pushedFront" used
no dice.
but setBumpFallType() is something that i already use for causing a player to trip. gonna try the same setup on a zombie and see if ti works
yeah it might be part of a larger thing, i've never used it myself just seen it come up here a couple times
oh god... it corrupted the entire save
what the fuck
i've never seen zomboid do that, instead of the error reporter it just faded to black and went back to the main menu
it saved the corrupted world as a new one. good to know zomboid has failsafes for when things go wrong.
If it comes from one of your mods, you can consider this as +1 level in modding perk.
buddy i'm already level 8 at least.
i've been developing in lua since i was 13 years old :P
the java lua hybrid shinangains that zomboid does is a nightmare for me though. java is so much different than lua its not even funny
i made some custom items but cant attach it to my backpack in the utility slot, anyone know how to fix this?
is the utility slot from another mod?
or are you talking about the back slot
