#mod_development
1 messages · Page 153 of 1
cool!
maybe instead of getting rid of the shadow, theres a way to recolor it or replace the shader?
how can i get PZ API for making mods in visual studio code?
Hi Guyz,
what could it be, when a zombie gets a custom HP value over lua that the zombie just disappears instead dies on a MP server
using zombie:setHealth(100 * data.HP) and zombie is type of IsoZombie
setHealth is inherited from IsoGameCharacter https://zomboid-javadoc.com/41.78/zombie/characters/ILuaGameCharacterDamage.html#setHealth(float)
Use the lua-language-server extension and generate docs using pz-zdoc. You may need to fiddle with the .bat or .sh file a bit since it's outdated
Setting it on the client or server? Someone else was having trouble with this a few days ago, I think. Unsure how they resolved it but you could probably find it by searching in this channel
will set on client and server, but will check for the post here
In regards to spawn points... Is it possible to raise the point so that you can have spawns on rooftops?
I want to spawn items on the ground at the given coordinate. I think something like this has been discussed before, I searched but couldn't find it, can anyone help?
Off the top of my head, get insurgent mod, there's a server folder with item spawning stuff in there, does this exact thing I believe
Looks cool. You should make it compatible with the autotsar boat mod if possible since that has swimming as well but the char is invisible.
Yeah it does make sensse
this looks so fine 😄
You just dont see it when the player turns around
Linter logic seems to be holding up so far:
{
"type": "error",
"location": { "start": { "row": 3, "col": 5 }, "stop": { "row": 3, "col": 14 } },
"message": "Unknown word: animation"
}
Do masks need to connect to a bone?
Hey y'all, how do you test a mod? I've been throwing mine into another mod's workshop folder and launching my game, but i've been getting an error. I need to figure out if that's normal or something wrong with what I wrote
gotta love that java.lang.reflect.InvocationTargetException at NativeMethodAccessorImpl.invoke0 (Native Method).. error
and empty stack trace lmao
anyone help? i have no clue whats wrong
module Base
{
item Kurki
{
MaxRange = 1.23,
WeaponSprite = Kurki,
MinAngle = 0.7,
Type = Weapon,
SwingSound = MacheteSwing,
HitFloorSound = MacheteHit,
ImpactSound = MacheteHit,
DoorHitSound = MacheteHit,
HitSound = MacheteHit,
MinimumSwingTime = 4,
KnockBackOnNoDeath = FALSE,
SwingAmountBeforeImpact = 0.02,
Categories = LongBlade,
ConditionLowerChanceOneIn = 25,
Weight = 2,
SplatNumber = 2,
PushBackMod = 0.3,
SubCategory = Swinging,
ConditionMax = 13,
MaxHitCount = 2,
DoorDamage = 10,
SwingAnim = Bat,
DisplayName = Kurki,
MinRange = 0.61,
SwingTime = 4,
KnockdownMod = 2,
SplatBloodOnNoDeath = TRUE,
Icon = Dudclub,
TreeDamage = 10,
CriticalChance = 20,
CritDmgMultiplier = 5,
MinDamage = 2,
MaxDamage = 3,
BaseSpeed = 1,
WeaponLength = 0.3,
DamageCategory = Slash,
DamageMakeHole = TRUE,
AttachmentType = BigBlade,
Tags = CutPlant,
DoorHitSound = MacheteHit,
HitSound = MacheteHit,
HitFloorSound = MacheteHit,
BreakSound = MacheteBreak,
SwingSound = MacheteSwing,
}
model Kurki
{
mesh = weapons/1handed/Kurki,
attachment world
{
offset = 0.0000 -0.1660 0.0070,
rotate = -180.0000 0.0000 0.0000,
}
}
}
i would assume so
how tf do you make gifs like that
sharex
share what
ah
ShareX
and it auto makes it gifs/
Yiu record as gif
you can clip regions of your screen for images, mp4, or gif
and it will auto paste it to your clipboard
i love 3d modeling and hate coding smh
like windows snip tool but with gif / video function
i hate modeling and love coding
thats actually usefull
it grew on me
that's why my project ive been working on is almost entirely modeling
trying to get these damn wings to work is killing me
ooh
dude i fucking hate normals
last night
my model
half was normal
and not
when i re calc it just swapped sides
so i couldnt texture it
it looked like this
is there any known tool/method of profiling code?
Could someone take a look at my mod and see if i'm doing anything wrong? after doing some fixes i'm still getting Error 1 on the bottom right of my screen after attempting to turn my mod on
and the log continues to be unhelpful
Install error magnifier
ooh, where do i get that? the workshop?
Ye
I probably should have specified that after it gives me an error, i get the menu screen but blank
could somone help me
I took a video so it'll be a lot easier to understand what's going on on my end
any ideas?
Could really use some help haha
I would if I knew more about modelling!
I have never delt with overlays.
Dried fish mod(made by poltergeist)
Uses a single tile fish rack
Where you can hang the fish to dry
But what we are doing now is a crab netting thing and it has 4 tiles
If theres anyone who knows or has an idea as to how do the same thing but with 4tiles
( only requires to inteact with one of em but all 4 should change)
Pls let us know how
Thnx
Seems like this is syntax error
by the way, usually you want your working folder to be Users/username/Zomboid/mods or Zomboid/Workshop, following the mod templates in the respective folders
?
You have like a missing comma or closing pare thesis or something like that
Sometimes it doesnt know what tl do if theres a syntax error
i didnt know if you were talking to me or not
Also usual culprit would be
Missing end
Var1 and var2 and ...end
Bet. I'll take a look at the traits declaration and see if there's a syntax error or something, thank you! And i'll change up where i'm putting the files so maybe it'll load properly.
what IDE are you using?
ide?
Integrated Development Environment. Like Visual Studio Code, Visual Studio, Eclipse...
or are you using a text editor like notepad ++ or something?
oh thank goodness
I highly, highly recommend editing in visual studio code
there's a .lua extension
that can help you find some syntax issues
i'd recommend vsc but notepad++ is at least usable for code
if you launch zomboid in debug mode it'll pop up on your screen, or else you can read console.txt in the Zomboid folder
i dont belive there is errors btw
cause this is an old code that i used as a template
but idk
nvm
fml
i found it
wait nvm
syntax errors or errors in game?
syntax
🫢 mother of god
its in my passport, cat jumped on the keyboard when they registered me
Also, you have won a big JACKPOT, I need your credit card info.
while you at it, make a simple canoe mod too
I think the modules for that are something custom-written by the zomboid devs, correct me if i'm wrong
you'd have to compare what you're writing to a mod that work's weapon modules
so its not the same
i used one of my other weapons
Clearly there's something up with that one, I'd download another mod that adds weapons and see how they do it and what differences there are between yours and theirs. Try to follow their format exactly just to see if it works
i have working weapons
Are you sure it's the weapon script itself then? Maybe you forgot to include it somewhere? What's the actual error you're getting in game?
its just not apearing ingame
wait
hold on
somone once told me that somtimes it doesnt apear inside the spawner meny
menu
i forgot the command tho
i got it
what was the issue?
it would show up in the debug item spawner, you using -debug?
no i mean i have the command
not always
it happened to me before
i used the command additem
and it went in my inv
but it wasnt in item spawner
huh. Weird. Thx for the heads up
for adding an item?
/additem username item amount
post your file here
alr
module Base
{
item Kurki
{
MaxRange = 1.23,
WeaponSprite = Kurki,
MinAngle = 0.7,
Type = Weapon,
SwingSound = MacheteSwing,
HitFloorSound = MacheteHit,
ImpactSound = MacheteHit,
DoorHitSound = MacheteHit,
HitSound = MacheteHit,
MinimumSwingTime = 4,
KnockBackOnNoDeath = FALSE,
SwingAmountBeforeImpact = 0.02,
Categories = LongBlade,
ConditionLowerChanceOneIn = 25,
Weight = 2,
SplatNumber = 2,
PushBackMod = 0.3,
SubCategory = Swinging,
ConditionMax = 13,
MaxHitCount = 2,
DoorDamage = 10,
SwingAnim = Bat,
DisplayName = Kurki,
MinRange = 0.61,
SwingTime = 4,
KnockdownMod = 2,
SplatBloodOnNoDeath = TRUE,
Icon = Dudclub,
TreeDamage = 10,
CriticalChance = 20,
CritDmgMultiplier = 5,
MinDamage = 2,
MaxDamage = 3,
BaseSpeed = 1,
WeaponLength = 0.3,
DamageCategory = Slash,
DamageMakeHole = TRUE,
AttachmentType = BigBlade,
Tags = CutPlant,
DoorHitSound = MacheteHit,
HitSound = MacheteHit,
HitFloorSound = MacheteHit,
BreakSound = MacheteBreak,
SwingSound = MacheteSwing,
}
model Kurki
{
mesh = weapons/1handed/Kurki,
attachment world
{
offset = 0.0000 -0.1660 0.0070,
rotate = -180.0000 0.0000 0.0000,
}
}
}
i have to ask, do you have the weapon somewhere as "kukri" and in here you have it referenced as "kurki"?
wym
Well the actually spelling of the real weapon is "Kukri" your file here says "Kurki"
I'm not too familiar with weapon mods yet (was gonna start work on one today actually) but if it is labeled as "Kukri" anywhere in your mod that would give you problems
The kukri (English: ) or khukuri (Nepali: खुकुरी, pronounced [kʰukuri]) is a type of short sword with a distinct recurve in its blade originated in Nepal. It serves multiple purposes as a melee weapon and also as a regular cutting tool throughout most of South Asia. The kukri, khukri, and kukkri spellings are of Indian English origin, with the o...
So i kind of figured out what was wrong. The reason it was crashing was because i included a sandbox_options.txt file in there
unsure why that was crashing stuff
does anyone here know how to separate male and female animations?
Would it be possible to give a backpack an animation
I'm assuming no or it would have been done / I would have seen it by now
I was wondering if I could make the wings on my backpack slightly animated
Hey all, where can I find the file that defines what the vanilla traits do?
i haven't seen anything that couldn't be done yet
just sounds like a set variable
but what your wanting though
i would think it'd be possible
I imagine it would involve using player update and changing visuals of the backpack. Unless there's a better way of course.
I'm not sure there's a specic place for this. Most things check if player has trait and then do one thing or another and that's spread through multiple files.
Ah okay
Thanks this is super helpful
That’s very different than how trait mods work
Anyone know how to directly access a body part?
this would be so much easier if I could do just getBodyDamage("Foot_R") rather than throwing in another for loop
i think bodydamage:getBodyPart(BodyPartType.Foot_R)
oh nut, i saw that when the error screen came up in game but didn't know I could access it like that
thank you
Is there any one I could ask a quick question about making a mod that just creates in game cash spawns?
Try small-ish bone weights with some unexpected bones, like arms or feet. I used to use that trick back in the days of Starcraft 2
Anyone know the difference between setInfected and setFakeInfected? Is former for a knox infection and the latter is for a regular infection? Or is the latter a obsolete hypochondriac thing
infection is zombie infection, infectedWound is regular infection, fake infection is used instead of infection when infection mortality is off
fake infection behaves like real infection but once it reaches 100 it starts decreasing
Take my bag hider codes
It does what you need to do the animation
Just have to keeep on changing em
awesome, ill look into it
thank you
little preview of some of the bags in my new mod
hey yall, what is the event to call a function during mp server bootup?
trying to load some counter from a previous game kind of thing -- if that makes sense
if you want it to run during bootup you don't really need to attach it to an event
if you're relying on a system that loads after lua like moddata you should attach it to the event for that loading but otherwise you can just do it when the file executes
local function CBTS_ServerSetup()
print(DebugPrefix .. "Setup Server Defaults for The Calm Before The Storm")
print(DebugPrefix .."RandomDurationFlag=" .. tostring(SandboxVars.CBTS.RandomDurationFlag))
local modmodData = ModmodData.getOrCreate(CBTS_STATE_KEY)
if modData.CycleCounter == nil then
modData.CycleCounter = 0
end
if modData.CurrentCooldownDuration == nil then
modData.CurrentCooldownDuration = 0
end
if modData.CurrentCalmDuration == nil then
modData.CurrentCalmDuration = 0
end
if modData.CurrentStormDuration == nil then
modData.CurrentStormDuration = 0
end
print("this is inside CBTS_ServerSetup")
end
``` i this is the function i want to start when the server boots
so i can access modData later on
is that what your second sentence is referring to? (very new to all of this so i have no idea what i am doing)
yeah, you'd want to use OnInitGlobalModData then
that is what i thought but it keeps yelling at me. let me get the error.
to be sure, it would be Events.OnInitGlobalModData .Add(CBTS_ServerSetup) correct?
also that is a typo ^ gotta fix thst
local function CBTS_ServerSetup()
print(DebugPrefix .. "Setup Server Defaults for The Calm Before The Storm")
print(DebugPrefix .."RandomDurationFlag=" .. tostring(SandboxVars.CBTS.RandomDurationFlag))
local modData = modData.getOrCreate("CBTS_STATE_KEY")
if modData.CycleCounter == nil then
modData.CycleCounter = 0
end
if modData.CurrentCooldownDuration == nil then
modData.CurrentCooldownDuration = 0
end
if modData.CurrentCalmDuration == nil then
modData.CurrentCalmDuration = 0
end
if modData.CurrentStormDuration == nil then
modData.CurrentStormDuration = 0
end
print("this is inside CBTS_ServerSetup")
end```
Error java.lang.RuntimeException: attempted index: getOrCreate of non-table: null
which is the 4th line in the snippet
ModData.getOrCreate
Is there a way to add scratch/bite protection to certain body parts? Or is there any mod that has done it before? (i.e. only add 10 protection to torso, or 10 protection to torso and arms)
Turns out it is connected to "BloodLocation" in the script files
But is there a workaround for this? TO have partial protection with complete body blood texture enabled
now I can carry that damn rat with me on my new strap-on-coffin
an idea for someone, making the jukebox work for vinyl and cassette tapes found in truemusic mod
I'm having trouble setting up intellij and gradle. I'm getting this error:
I've looked everywhere and have no idea how to fix
A common issue is using the wrong java version - should be 17/18.
I'm using 17
Are you using Konijima's guide?
yeah
Are you getting this error when you try to run the tasks?
Or better yet, which step are you on?
B)3)
Pre-setup
I made it further before but I forgot what I did
either way, the time I made it further, I ran into the same error
v 17 doesn't work, use a higher version. It's how most people get it to work.
Maybe the problem is with gradle version though.
or should i stick around 17
yeah I think I used that yesterday
but the decompiled code looks different when you use v17, so I'm not sure of what is the best solution
working is better than not haha
I followed that guide last night with no problem and used java 17
I passed the problem step with no problem
ran into the other issue
poltergeist mentioned the issue might be with the gradle version. How can I go about changing it?
Guide by Konijima about PZ Libraries (v2)
https://github.com/Konijima/PZ-Libraries
Works with next settings:
- Capsid 0.4.2
- Intellij 2023 -> new project -> advanced settings: Gradle 7.6, JDK azul-17
Known Issues: - gradle 7.0 does not support jdk 17
- gradle 8.0+ not working
Notes about decompile and capsid:
- Current version of FernFlower bundled with Intellij throws error and fails to decompile certain methods. Last working version fully decompiling PZ v41.78.16 was included in Intellij 2022.3.
- Capsid includes a version that works and successfully decompiles.
- Capsid is missing files like:
server/Vehicles/VehicleCommands.lua, several GlobalObject systems.
Other Tools
- This is an intuitive and efficient solution to create and maintain Lua mods for Project Zomboid with greater ease.
https://github.com/Konijima/project-zomboid-studio - A collection of EmmyLua typings for Project Zomboid's API
https://github.com/asledgehammer/Umbrella - Alternative guide for direct decompile using Intellij
https://steamcommunity.com/sharedfiles/filedetails/?id=2748451514 - This is a tool to help reverse-engineering Java code. It's meant to help with reversing the source code from the game Project Zomboid.
https://github.com/quarantin/beautiful-java - You can also use Bytecode Viewer, it includes multiple decompilers
https://github.com/Konloch/bytecode-viewer
#selfpins decompile tools
@gaunt thorn
for this project I think Yooks set it on a hosted site
there was an issue with the previous iteration of 'pz-mod' (capsid's predecessor) breaking because the game no longer used java8
Hello.
I am making a mod that allows you to teleport selected car to the player. The problem is that the car does not teleport.
Here are the methods I use:
vehicle:setY(y)
vehicle:setZ(0)
vehicle:setSquare(square)```
When the function is executed, there are no errors, but the vehicle doesn't teleport. I check "square" variable, it's not "nil", I check "vehicle", it's not "nil" either, but still the car doesn't teleport. The vehicle coordinates before and after execution of the line "vehicle:setSquare(square)" are different, but after execution of the function are the same.
I can't figure out what's wrong. Ran through all of Project Zomboid's code, but found nothing new, just these methods that belong to "IsoMovingObject".
Please help me out.
how do I manage to get a custom item i made to spawn in the world
not on zombies, but in containers
SuburbsDistributions.lua
thats where all the loot for the containers is defined
you'd just need to insert.table your items and spawn chances in the desired container
Anyone have any idea why my sandbox-options.txt file would be crashing the menu on loading the mod?
i think i stuck it in the right place. The formatting of my file seems similar to other mods'
here's what it looks like
am i missing something?
type= integer, min = 1, max = 100, default = 0,
I've done this myself before too, check this line for errors.
||default value is lower than minimum||
really.
really?
type= vs type =
I hate programming sometimes because of stuff like this. Thank you
lol
added help
thank you!
how do I find where all my mods are installed? I cant seem to find them in any mod folder ;-;
C:\Program Files (x86)\Steam\steamapps\workshop\content\108600\
if it's not there then you shouldn't have them, unless they're in your user's zomboid mod folder
Does everyone else just close and reopen their game a billion times while developing? I've tried reloading from the debugger, that works randomly but only for certain extremely minor issues I can't fully fathom. I've tried quitting the game (but not to desktop) and toggling on some other mods just to get it to reload the LUA. That doesn't work. I've tried the Reset Lua button in the bottom right of the menu screen -- nothing. 99.985% of my dev time is just restarting the game over every typo. Surely I'm doing something stupid.
does restarting lua not work?
Most things can be resolved with quit to main menu. You can reload Lua safely in-game as long as you're aware of what is cached and where, especially for SP.
omfg thank you so much! I kept looking in pz's game workshop folder
If you use an event then you need to remove your function before reloading the file and add it after reloading. For testing you can do a dummy function that calls a global function if you're bored and need to reload a lot.
Maybe this will help, because I'm adding some events. Thanks.
Or make a script that does the mentioned logic by itself. As long as it's not happening during reload of the file.
Is there any way to interact with the HealthPanel w/ lua, I can't find anything within the game's own lua and there seems to be random missing attributes in some objects
Anyone in the future this peice of code in XpUpdate.lua shows how
getPlayer():getID() can be used to get player ID :)
xpUpdate.displayCharacterInfo = function(key)
local playerObj = getSpecificPlayer(0)
if getGameSpeed() == 0 or not playerObj or playerObj:isDead() then
return;
end
if not getPlayerData(0) then return end
if key == getCore():getKey("Toggle Skill Panel") then
xpUpdate.characterInfo = getPlayerInfoPanel(playerObj:getPlayerNum());
xpUpdate.characterInfo:toggleView(xpSystemText.skills);
end
if key == getCore():getKey("Toggle Health Panel") then
xpUpdate.characterInfo = getPlayerInfoPanel(playerObj:getPlayerNum());
xpUpdate.characterInfo:toggleView(xpSystemText.health);
xpUpdate.characterInfo.healthView.doctorLevel = playerObj:getPerkLevel(Perks.Doctor);
end
if key == getCore():getKey("Toggle Info Panel") then
xpUpdate.characterInfo = getPlayerInfoPanel(playerObj:getPlayerNum());
xpUpdate.characterInfo:toggleView(xpSystemText.info);
end
if key == getCore():getKey("Toggle Clothing Protection Panel") then
xpUpdate.characterInfo = getPlayerInfoPanel(playerObj:getPlayerNum());
xpUpdate.characterInfo:toggleView(xpSystemText.protection);
end
end
i just reload the save, the individual file reload thing is not very reliable because of stuff like altering the global namespace and it only takes twenty seconds to reload
i have it open but im not sure how i would do anything with it myself
no worries! There’s a ton of little things here and there that can break your mod if you don’t know what you’re doing. If we all put our minds together, we can help eachother do even better things! or complete mods that wouldn’t have been completed otherwise
speaking of, is there such a thing as a mod wiki or tutorials? I’m kind of piecing things together here and there from old videos and articles such, but with years between official PZ releases a modding wiki would be so helpful
Can somone help it doesnt work ingame im gonna sleep tho so i wont respond ping if yoy find the error pls
module Base
{
item Kurki
{
MaxRange = 1.23,
WeaponSprite = Kurki,
MinAngle = 0.7,
Type = Weapon,
SwingSound = MacheteSwing,
HitFloorSound = MacheteHit,
ImpactSound = MacheteHit,
DoorHitSound = MacheteHit,
HitSound = MacheteHit,
MinimumSwingTime = 4,
KnockBackOnNoDeath = FALSE,
SwingAmountBeforeImpact = 0.02,
Categories = LongBlade,
ConditionLowerChanceOneIn = 25,
Weight = 2,
SplatNumber = 2,
PushBackMod = 0.3,
SubCategory = Swinging,
ConditionMax = 13,
MaxHitCount = 2,
DoorDamage = 10,
SwingAnim = Bat,
DisplayName = Kurki,
MinRange = 0.61,
SwingTime = 4,
KnockdownMod = 2,
SplatBloodOnNoDeath = TRUE,
Icon = Dudclub,
TreeDamage = 10,
CriticalChance = 20,
CritDmgMultiplier = 5,
MinDamage = 2,
MaxDamage = 3,
BaseSpeed = 1,
WeaponLength = 0.3,
DamageCategory = Slash,
DamageMakeHole = TRUE,
AttachmentType = BigBlade,
Tags = CutPlant,
DoorHitSound = MacheteHit,
HitSound = MacheteHit,
HitFloorSound = MacheteHit,
BreakSound = MacheteBreak,
SwingSound = MacheteSwing,
}
model Kurki
{
mesh = weapons/1handed/Kurki,
attachment world
{
offset = 0.0000 -0.1660 0.0070,
rotate = -180.0000 0.0000 0.0000,
}
}
}
What do you mean by "doesn't work in game"
It doesnt spawn
I mean
The item doesnt exist
That is usually due to an error that makes it fail to load.... or a txt file placed in the wrong folder
ZedScript intellisense would be useful here, if it doesn't appear in debug item list try checking logs
What does that mean
console.txt file in your Zomboid folder
is there a console.writeline or a function that writes to the debug log?
I'm using player:say() but it seems really, uh, picky about when it actually activates
print()
bet
Anyone have an idea why my custom crafting recipes do not show up in the crafting ui?
I followed the exact same way the default game does it but it just doesnt show up, and I know the mod is loaded
the file is either not being read or unreadable
it might be in the wrong directory, missing a file extension, or there's a syntax error in it
you need to study distribution
is there any way to test for syntax errors?
if you're using vscode jab's working on an extension for that, not sure exactly what it's capable of at the moment though
I hate how picky it is, I removed a random , and it suddenly started working but only the second recipe showed up 
only the second? 
usually if only some show up you expect it to be the earlier ones since that means something broken is making the parser give up
could you show your script? i might be able to spot the issue
I managed to fix it but now I'm trying to use a custom tool in a recipe and in game it wont let me craft the recipe and it doesnt show the tool as a requirement
Tho as I said, It lets me create the toolkit and it shows up in my inv
it should just be keep Base.Screwdriver/TechniciansToolkit,
square brackets mean the thing between them isn't an item but the name of a lua function that returns a list of items
Ah ok
If thats so, then why does keep [Base.GardenSaw/Base.Saw/Base.Axe/Base.HandAxe/Base.AxeStone/Base.WoodAxe/Base.Scissors], work?
does it?
i can't find exactly where the lua functions are handled but from my reading of other parts of the source i think it would partially work
i think it'd find most of the items, but it would look for [Base.GardenSaw and Base.Scissors], which obviously aren't valid items
found the code i was looking for, seems like that's definitely what would happen (in theory)
which folder has item icons in it?
hello to anyone have the knowledge of mod making : not me
I just have an idea for project zomboid mod and I think its cool and I wanna try the game with this idea buuut- I cant make the mod I want
so I am here to tell you guys the idea so maybe one of you friends can make it and also I think its a good idea so why not I get my mod you get 5 star on workshop
the idea is about making PZ more realism:
1-some new traits adding to PZ.
2-it has a new gameplay mechanic
3-idk but its cool 👍
Well, people in the real world may not like every food. And like some foods more
But in PZ the world is destroyed, you have to eat to survive. But it is so easy that in the apocalypse you can eat whatever you get, even a mouse by just peeling off its skin.
Well, this mod brings 4 new traits
Two positive and two negative
The first negative trait is to choose 50 different foods for example. (randomly)
And when you want to eat this food, you get bored and unhappiness
The second negative trait does the same thing to 150 foods at random.
The first positive trait makes you like 25 foods and you can eliminate boredom and unhappiness by eating them.
And the second positive trait does the same with 50 foods
In my opinion, sections like first aid and cooking are interesting but boring.
There is a way. New mechanics.
For example, when you want to cut or peel something. A new page will open for you, forcing you to play a mini-game to succeed. If you succeed, the food will reduce hunger more and vice versa if you don't succeed
My idea was to open a new page, a 2D page, to pour different things into the cooking pot.
You can drag and put in, for example, foods that can be used. Or you can peel the potato. Or remove the leafy head of the tomato.
Or even a mini game to break the egg and pour it into the pan.
This mod can also be used for first aid! For a short mini game for bandaging around the hand.. or Disinfect or stitch
I will not leave the topic of cooking. The last thing that came to my mind is a job that forces you to cook cleaner. If you cook with a pan that has blood on it, you might get sick or even start turning into a zomboid.
You need oil so that the food does not stick to the pan. If this food sticks, it will make you less hungry and make the dish dirtier, forcing you to use a sponge to wash the dish. If you don't do it, the pan will be dirty and oily with pieces of the previous food, and cooking it again will bring boredom and unhappiness, so washing it is a must.
My last idea is a mini-event. If you eat a lot of fatty food (too much) and you are also fat, you may get a heart attack in the middle of activities like sports or fighting with Zambia, which will not kill you, but it will make you tired and take 50% of your health.
corpses *are* special. a zombie's outfit and any visible weapons is moved to the corpse immediately when they die, but random inventory loot such as cigarettes isn't generated until a player comes into looting range
you can still add items to the container at any time, even when the zombie is still alive (though i doubt anything you add will save if the zombie unloads)
i thought i'd mention this here since it seems many people are very sure it is not the case
This is true, I'd like to add that the corpse doesn't exist until the animation is finished, which is not the same time as the trigger for Zombie Dead event. However, the dead body has the same container object.
this wouldn't really be a big deal but corpses don't fire the onfillcontainer event
🤔 is that the event itemPicker calls from/to?
A zombie does not have an invemtory before it dies. The exception is a zombified player
I've almost got this mod working, but im not sure how worldstaticmodel works, the icon works, and so does holding it
k, figured out that part, just gotta figure out how to swap the texture now :/
I'm trying to teleport player when the player's health is low. When I add the function to OnTick it works fine, but when I add it to OnPlayerUpdate it cannot teleport the character. I wonder why?
I think i was just offered to create an npc mod for 1$
Well not directly but implied
How about 2$??
If it's 1$ for 1 minute .. * 8h of work .. ^^
not bad if thats the case haha
whaat wow this is nice

that would be so cool
i know theres a lightsaber mod that adds light to the weapon
so maybe?
YES!
i swear this is the last one ill add
i'm up to 12 new backpacks now
😅
or else ill never release it
if me and my gf ever play pz together im definitely telling her about the backpack lmao
my mod is adding a bunch of cute goth backpacks
there will be a black mushroom too
some of them
Omg how long till release?!
soon
it depends on if i want to research and try to make them spawn on zombies or not
i may save that for v2
Im gonna add all the hotline miami masks with mine but i have no idea what to do lmao
ooooooo that would be cool
just need to do item distributions and its done really
all the models and code is there
all backpacks craftable
oh wait
that image doesn't show the coolest bag
several bags have multiple textures
i'm excited to release it
oooooooo i love that
YES
so I'm not sure what I'm doing wrong.....it looks like i've swapped the texture, but when I drop it in game its a flat 2d image :/
did you define WorldStaticModel
i believe so, in item script i have the name of the file listed there
anything in the error log?
YESSSSSSSSSSSSSSSS
you good aha?
a purple one would be kinda cool
That usually results in nothing being shown when the item is plced on the ground. A 2d image is used when there is no world static model defined
Is there a way to equip items to the hotbar on character spawn like you can equip clothing pieces to the character?
not that i'm seeing
but i just did a quick search for "hotbar" in the class lookup
There must be something you could add to the OnCreatePlayer event for that
I was actually about to announce that I found it. It can be found in steamapps\common\ProjectZomboid\media\lua\client\Hotbar\ISHotbar.lua
There's actually quite a bit that can done it seems. Going to play with it for a few days, see if I can't go full schitzo with my insurgent patch so you spawn full equipped and ready for battle 😂 right down to hotbar items already being equipped
ty. I'm going to go back now and see what I've done wrong now that I sorta know the problem.
Think we could get a plain black heart? Or cat shape? 🐈⬛
Oh yay
theres the cat
it has a purple texture too
so it looks like the sailor moon kitty
Ah I missed it earlier lol
I would 100% be interested in running a cute-punk character that is a zombie killing badass hahaha
if y'all have any other requests for backpack i'm all ears
ive been having lots of fun modeling lol
I mean....
what about a spiked bag like this?
Ty again everyone, finally got the mod fully functioning 😄
making good progress on the heart
not really happy with the strap color though
but i can't decide on a good color
sooner or later mae will beat authentic z's record (number of clothing item on a single mod)
if were counting different colors of the same bag
i'm up to 20 bags
at this point i'm going to have to do a custom context menu for the recipes because theres so many. Don't want it to crowd players inventories
after this heart itll be 22 bags
and i think ill start working on distributions at that point and release v1
i can always add more bags later
next texture is done
toSpawn is how many of the zone are allowed to spawn in the entire map
oh, sorry, i'm looking at something else
toSpawn in the context of zombie outfits (which i think is what you're talking about) guarantees that at least that many of that outfit spawn
it only gets applied if mandatory is true
ok i see
I'm making some changes to the wiki. Anyone have some input on this? Did I get anything wrong? It's a short read
https://pzwiki.net/wiki/Modding:Lua_Objects
A few things wrong.
Use this link instead because it is relatively up-to-date and is official: https://projectzomboid.com/modding/
package index
You can list the other one as a secondary, third-party alternative.
I have my own third-party documentation that only shows exposed API.
These aren't called "Lua Objects". Are you defining the term locally?
I don't want people to confuse "Lua Object" as "Lua Table".
It's also "Deprecated" not "Depreciated".
@trim mist
I'd rewrite this as it has grammar issues:
While modding, this can be useful to look at to get an idea of how to use objects for your purposes; however, not all objects and variables may be exposed via the game's Lua API.
It's one sentence trying to say too much and is too wordy.
With a list of objects, this page will be very long and very redundant. Refer to the JavaDocs on a list of objects.
most worth noting is that the official one has named parameters and the unofficial ones don't
This is why I always refer to it.
=)
I refer to mine as well because it is only the exposed API.
it's a nightmare trying to work out what a method is supposed to do when it just says int1, int2, int3, int4
The documentation itself can be confusing. A lot of non-native English speakers wrote it.
Depends on where nuance is needed for certain tasks.
i never expect anything to do anything i want without reading the source, but it gets me to the right places sooner
I have a PZWiki account and have edited a bit already.
how do you make a certain type of zombie outfit enter the "Default" zombie spawn pool after a certain amount of time?
what folder are traits found in? what they do, specifically, not the MainCreationMethods.lua file- eg if i was looking for Speed Demon's speed increasing thing
gotcha, i suppose that does make sense even if it's a little disorganised
theres no way of organizing that since traits does things on different areas
oh yeah i figured, i just meant from this specific standpoint of wanting to work on traits haha
idek how to model that one
that's gonna be difficult
most of these have several textures each btw
lol
is there a guide or walkthrough for adding weapons somewhere? trying to add a texture swap to a pen and the mod just keeps crashing :/
i got you
i remember i saw one long ago
lemme see if i can find it
0:00 Intro
0:29 Video Start
1:00 Start Blender
1:22 Using a background image
2:04 Using photoshop to edit the background image
2:52 Adding the edited background image to blender
3:26 Adding the cube mesh
3:46 Quick start with the cube
4:56 Importing a finished 3d Model from the internet
5:56 Moding the imported model
6:47 ADD NOTE ABOUT MAGAZIN...
ty, i'll go watch that
0:00 intro
0:46 open Blender
0:57 add background image
2:39 making the model start
6:01 Fast forward / making the model
7:12 Using the Knife Tool to work on the trigger guard area
8:05 Fast forward / making the model
9:17 Adjusting the model thickness
11:25 Map Image (uv mesh)/ Node setup
14:33 Painting to help place image
16:57 Using Photoshop...
Sorry, I was having dinner!
thoughts on this? https://pzwiki.net/wiki/Modding:Lua_Objects
I feel like i'm not really grasping the difference between Lua tables and objects. I want a word that encompasses these objects you can use and the functions / vars inside them
i've always called them java objects
so when we do lua scripting, are we working directly with the Java objects, but only some of them/their functions are exposed to Lua? Or Kahlua or whatever java-lua is called
pretty much
I thought the objects were like, translated into lua, and were updated when the lua objects were updated
that's different than the equivalent of writing getters and setters in a different language
the game uses a lot of objects created through lua too, so it'd be best to save the term 'lua object' for those
hrm, not sure what im doing wrong, only error I keep getting is that steam fails to download the mod :/
What is your experience with programming in general?
I feel like this is one of those areas of the Wiki that requires a pretty solid understanding of not just programming in Lua and Java, but the relationship between Lua and Java in the PZ environment.
It's a silly environment, the PZ scene.
I can see people with master's degrees still flop somewhat when introduced to this madness.
All I'm asking is to be careful and not create new ways of explaining something that could end up confusing everyone.
It's already crazy enough.
I'm a software engineer that that specializes in C# desktop development
So I bet it's what I said about people introduced into the PZ environment having a little bit of a flip flop moment.
Then you know your shit and I won't lecture you. =P
I mean, go ahead. The more I know the better
I specialize in doing the most niche shit here.
Going to be doing C# soonish. Been doing VB for my job for an ancient ASP.NET site.
4.8 ASP framework?
Not even modern enough for C# syntax candy.
Hello, im creating a mod. Basically, when a zombie die i spawn a item in his inventory.
Im testing in a alone world, but doesnt spawn the 'base.ham' on zombie inventory.
No erros logs
Also I might take a break from working on my VSCode extension.
Having trouble getting my linter to work for ZedScript.
so if i’m understanding correctly, you’re working on an IDE for zomboid coding?
Right now I'm working on an extension to VSCode, a rich text editor with debugging tools.
VSCode is honestly more than a rich text editor but I won't call it a full-blown IDE.
that’s poggers
Visual Studio is too overwhelming.
I have to use it at work but I only use it to run the project. I use VSCode to code.
I'm trying to write a linter for diagnostic support for ZedScript... however I'm running into a wall on how to setup clean & straight-forward rulesets with recursive scanning of scoped property bags.
So thinking about how to re-approach.
try declaring as much as you can as locals and print things, see if everything comes out as you expect it
I have a solid tokenizer.
is there anything in your console.txt?
I have a passive, non-aggressive tokenizer / formatter and an aggressive one that rewrites the script entirely
no errors means it must either be AddItem that's failing, or that the code is not executing at all
Nothing
I also crafted a full Typescript environment for modding PZ. That was last year's project.
i can write a print in my function to test
[24-04-23 21:48:59.820] LOG : General , 1682387339820> 755,682,307> Workshop: onItemNotDownloaded itemID=2966858504 result=15.
[24-04-23 21:48:59.820] LOG : General , 1682387339820> 755,682,308> Workshop: item state DownloadPending -> Fail ID=2966858504.
This is the only error my mod keeps throwing, what would cause this?
is this when you try to test it in multiplayer?
trying to open the workshop page for that id shows it's private, and the server can't download private mods(i think?)
its on hidden
i didn't want to put it as public since im trying to add something to an already working mod
try making it unlisted
that was probably the problem, i must have gotten hidden and unlisted mixed up :S
looks like its loading, tysm! now I get to see whats broken haha
ugh
now it hangs on intializing, and the debug isn't saying anything :/
elaborate on "hangs on intializing"
just stays on intializing forever
these are the last few lines in the debug log
[24-04-23 22:09:38.778] LOG : Mod , 1682388578778> 756,921,266> loading TheyKnewMore Testing.
[24-04-23 22:09:38.782] LOG : Mod , 1682388578782> 756,921,270> mod "TheyKnewMore Testing" overrides media/fileguidtable.xml.
[24-04-23 22:09:39.165] LOG : Lua , 1682388579164> 756,921,653> Loading: media/lua/shared/Sandbox/Apocalypse.lua.
theres only 3 mods being loaded, I have a working version of the mod, but when I tried to add a texture swapped pen it craps out :/
oh.....now I let it run longer and it threw an out of memory error...
Lovely loop logic
For anyone who might use ParseScript I figured out my issue -- it doesn't seem to play well with recipes that are not Base. Even though it imports Base it doesn't seem to recognize it as a valid recipe(?) The items appear, and I can use the 'give ingredients' successfully, but it's not able to be activated. 🤷♂️
For clarification, I made a recipe dynamically generated from sandbox options.
Going to do more tests tomorrow - may have to leave the core recipe as Base instead - or parse each ingredient to check if it needs "Base." otherwise require fulltype.
i'm not quite certain how this works, so i want to check something before i start digging in case it's obvious- am i able to directly type the strings for the name and description here, like i have it? or do i need to use the getText method that's used in the MainCreationMethods.lua file?
you can directly type them, but getText() is used so that it can be translated
gotcha, makes sense
issue's probably lying in the other lua file, then. i'll keep looking
is this the full file? nothing calls initTraits
oh duh, you're right, i completely blanked on that
it'd just be an Events.OnGameBoot.Add(initTraits()); right?
gotcha, gotcha
Don't burn yourself out.
i think i'm probably just goofing on this logic somewhere, seeing as the trait shows up fine in game but doesn't seem to work from my testing- i did look at a couple of other mods that touched how car damage works in order to make this and i don't 100% understand some of it, especially how the stat tables factor in (my best guess is that they're an array that stores the health of each car part, looking at it)
oh whoops ignore that comment on line five, i renamed checkPartChanges to reduceDamage to be a bit clearer but forgot to change the comment
what calls these functions?
oh man is it that again. man i really need to just check that first, let me look
yep, exact same mistake again. i wrote down the Events.OnPlayerUpdate.Add(checkCar); earlier but i must have deleted it on accident 😔
thank you for catching my obliviousness twice, heh
hm, after fixing up a couple of other things and a good bit of testing in-game the trait still doesn't seem to be reducing vehicle damage
the logic of it seems to check out to me? but i could be missing something, of course
OnPlayerUpdate updates every frame, doesn't it? or close to it?
it should, yeah
hm... what does player:getModData().VehicleImpactTable[i] do, exactly? i can tell that it's pulling the data of something from the stat table that's getting created using the specified part, but past i'm actually not quite sure
oh, hang on. i might've found it?
i'm not really sure why it uses moddata, that kind of just seems to complicate things
i assumed it was something or other to make it work with modded vehicles
i'm eyeballing that last statement setting player:getModData().VehicleImpactTable[i] to midHP
thinking that should probably be set to the final HP value, not midHP?
yeah i noticed that
i'm not sure if that's the cause of your issue but that should be changed
i'm trying that now, popping in one more variable
moddata is just a lua table that saves with the object, it's usually only useful for data that needs to be carried over after a save and load
huh, gotcha
teaches me for overreliance on the code of other mods i suppose
probably a better way to figure this whole modding thing out
yeah, unfortunately despite being the best resource to work out how to start modding, obviously the mod scene is primarily amateurs and most mods aren't going to be excellently well written
i just wish 80% of the guide links on the wiki weren't red, heh
but the moddata approach should still *work*, it's just unnecessary
tried putting two DebugLog.log("check"); statements in a couple of spots to see if they were even activating and they seem to not be, so i do believe that the issue is relatively early in the reduceDamage function (at or before if(startHP ~= midHP) then, at least)
assuming that you can have those print from the middle of a function in lua, anyways- most of my experience is in java so most of this is fairly new still
this is what it's at now (i commented every line to try to make clear what each line is supposed to do)
"DefensiveDriver functioning!" shows up in the log, but neither "Damage detected" nor "Damage adjusted!" do when i test smashing a van into a wall
oh, i see
if(player:getModData().VehicleImpactTable[0] == nil) then
this errors out because player:getModData().VehicleImpactTable has not yet been initialised as a table, but it's being indexed as one
oh, huh, i think i see what you mean
usually we have a function attached to OnCreatePlayer that initialises any moddata tables if it doesn't already exist to avoid problems like these
just throwing player:getModData().VehicleImpactTable = player:getModData().VehicleImpactTable or {} in there should be enough to see if that's the only issue though
replacing line 11?
before line 11
it's kind of a bad idea to have it in there, it should be initialised in oncreateplayer (or not moddata at all) but that'd be enough to ensure that's the problem
pasted in, let's give this a shot
out of curiosity, why's it a bad idea to have it there?
it'd be checking if it exists every frame, which is just kind of wasteful
oh yeah, of course
partial success! sorta, kinda. i think i'm accidentally doubling damage instead of halving it? i'm testing with a mostly consistent distance and have gone from taking 25-30 damage to taking 50-60
at least things are changing though! it's just me figuring out my math now i think
or huh, wait, hang on. i tested it with a third van and that one took the same 25-30
i think those first two must've been flukes, weird
either that or it's breaking after going off twice? i could see it breaking after one run through but i have no idea how it'd break after two
oh!
local finalHP = (startHP - (dam / 2));
...
end
end
player:getModData().VehicleImpactTable[i] = finalHP;
```finalHP is out of the scope of the last line, so it's actually setting it to nil
oooh, you're right
hmm... probably best to declare finalHP earlier, set it to the starting value, and adjust finalHP if needed otherwise leave it alone?
just as a quick double check between lua and java. i can just say finalHP = (...) instead of local finalHP = (...) after the first time, right? don't need to declare it every time?
actually no wait yeah, of course, i am literally doing that multiple times already
yeah, once it's local it's local
sometimes you have to be careful with naming since a side effect of this is that you lose access to variables from higher scopes with the same name
gotcha, i usually try to keep unique names for as many of them as i can anyways
those debuglog commands should be printing to the console, right? just did another test and there's no damage reduction or printout in the console
oh whoops
how do you do that box thing?
i'm not sure of anything to do with debuglog.log, i've seen people using it before but i just stick to print
```lua
code here
```
function reduceDamage(player, vehicle)
--counts the parts for use in the for loop
partNum = vehicle.getPartCount();
--loops through every part of the car, checking to see if the condition of any part is
--unequal to its frame on the previous frame
for i = 0, partNum - 1 do
--selects the appropriate part
local part = vehicle.getPartByIndex(i);
--sets the hp value to check against to, presumably, the hp value set in the stat table
local startHP = player:getModData().VehicleImpactTable[i];
local finalHP = startHP;
--finds what the new hp value would be, assuming normal damage
local midHP = part:getCondition();
--checks the hp value against the new hp value. if these aren't the same, then one can assume damage took place
if(startHP ~= midHP) then
--calculates the damage done
DebugLog.log("Damage detected");
local dam = startHP - midHP
--verifies that damage is not zero or a negative number (repair)
if (dam > 1) then
--sets the condition equal to the starting hp value minus half of original damage done
finalHP = (startHP - (dam / 2));
part:setCondition(finalHP);
DebugLog.log("Damage adjusted!");
end
end
--sets the initial value that was checked to see if the vehicle was damaged to the final hp value
player:getModData().VehicleImpactTable[i] = finalHP;
end
end
i'd imagine that finalHP is in scope with that, i don't see why it wouldn't be
yep, should be
honestly i wonder if it wouldn't be better to rewrite this to not use moddata at all
it'd run better, and might be a bit prettier, but i don't know if it'd help with the issues you're seeing
oh, actually
since moddata is persistent, it's probably not working because the nil values from before are being loaded
oh, actually, it deletes the table if you get out of the vehicle
so it shouldn't matter
hm yeah, assuming those are all working properly
oh hey, shouldn't local dam = startHP - midHP have a semicolon?
function checkCar(player, vehicle, args)
local car = player.getVehicle and player:getVehicle() or nil
if (vehicle == nil or not vehicle:isDriver(player)) then
removeStatTable(player)
else
if(player:getModData().VehicleImpactTable[0] == nil) then
createStatTable(player, vehicle);
end
reduceDamage(player, vehicle);
end
end
```the player's vehicle is stored in ``car``, but the checks check ``vehicle``
aggh, yep, i think you're right
vehicle is always nil (it's the second argument of the function, but OnPlayerUpdate only passes one argument), so it should delete the table every time
changing it to if (car == nil would do the trick, right?
yeah, as well as car:isDriver
gotcha, gotcha
i'm not sure which are actual functions that already exist and which are referring to that variable
oh, the createStatTable and reduceDamage calls are passing vehicle instead of car too
ah, so pretty much all of those that aren't VehicleImpactTable should be swapped to car?
yeah, looks like it
ooh, this is new
errors on line 37 and 15, let's check those out
oop, i think partNum is out of scope since i have it in two functions
or wait, no, not in two functions, i just never declared it
getting errors on line 37 and 15 even after i've declared partNum
hm... that wouldn't need to be changed to car.getPartCount(), would it?
oh! it should be :getPartCount()
oh! yeah that's a lua thing, isn't it?
unless they're static, java functions should always be called with a colon
gotcha, gotcha
local part = vehicle.getPartByIndex(i); the same mistake is over here
both of those fixed, let's see if it's all functioning
these typos keep tripping me up
it's always syntax
ah, not getting hundreds of errors per second anymore! that's certainly an improvement
oh, i think it worked, too! albeit it does seem to be looping indefinitely until i leave the car, flooding the log with the practice 'damage detected' message i put in there
it... actually just occurred to me that none of this is actually linked to the Defensive Driver trait, actually. hm, let me figure out how to do that
is there any resources to help me learn how to work with custom audio files? since the Modding wiki page for audio doesnt exist?
We all had our self-inflicted wounds learning this madness.
i'm having fun at least haha
i've put out two simple mods already, i wanted to see if i could learn something a little more complicated by playing with some actual code
i don't suppose there's a simple 'if(player has trait:DefensiveDriver) then' thing i could encapsulate this whole file in, is there?
player:hasTrait("DefensiveDriver")
you couldn't wrap the file in it because the player object won't exist when the file executes
hm... i could toss that into checkCar, probably? only have it progress beyond the first line if the player has that trait?
it'd be best to start the checkCar function with a if not player:hasTrait("DefensiveDriver") then return end
yeah
it's a bit annoying to have to do a check every update like that, but it gets a bit difficult when splitscreen comes into the mix to just avoid adding the event or something
hey, as long as it works, i can deal with a little bit of poor optimisation for now
i can see why it's doing the infinite loop, just gotta figure out how to fix it
since player:getModData().VehicleImpactTable[i] is changed to finalHP as the last action, checkCar is detecting that the hp value has changed in the last frame and immediately running again
i'm not really sure why it's getting to the damage detected part every time, but keep in mind that when properly working that function should be running once for every vehicle part every frame
if it was a true infinite loop, the game would lock up
yeah, not so much infinite loop as it's running further into the function than it should every frame
poor wording on my part
hmm... could i set a public/whatever the opposite of local variable to 2 or 3 and have that count down once per frame, give it a cooldown of a few frames before damage can be reduced again?
though that might reduce the effectiveness against the car melting aura that happens when too many zombies are around
yeah, i'm curious why this is happening in the first place: i've written similar code before and didn't run into that
it could be a rounding error
oh, yeah, that'd make sense
if you replace the finalhp with a getCondition at the end that'd account for any java-lua shenanigans
this line is doing the whole. hundreds of errors per second thing
oops, it's HasTrait
ah, gotcha, gotcha
i should give the zomboid documentation another look sometime, last time it melted my mind a bit but hopefully i'll understand a bit more now
here is another exposed java class
https://pzwiki.net/wiki/GameTime
ugh
how do I fix workshop item is different from server.......i'm uploading the mod and subscribing and unsubscribing and its not working
how long has the server been up? How many mods are enabled on the server?
Has anyone figured out how to change an item's type without having all of that item get deleted when loading an existing save?
IE: Normal to Drainable
unless that's been addressed by basegame now.
theres only 3 mods, and I'm going through host to try to test it
do any of those mods have another mod as a dependency?
yeah, the mod im working on has 2 dependencies
two that aren't yours?
correct
which two
CoolBag and They Knew
hm
@viscid drummaybe check that discussion
yea, I always found issues when trying to load when I still had my mods in the workshop folder
Darkslayer you item tweaker correct?
that is mine yes
This is exactly why I made a local cached version of zomboid

Makes it easier
I mostly wanted to know because I remember the -other- item tweaker did things really weird and caused all sorts of chaos
ah, k I'll try taking it out of that folder once I get done redownloading everything :S
sudden ping i thought something i made was relevant here 💀
Pls read this very carefully
oh sorry
no prob
funny enough
function ItemTweaker.tweakItems()
local item;
for k,v in pairs(TweakItemData) do
for t,y in pairs(v) do
item = ScriptManager.instance:getItem(k);
if item ~= nil then
item:DoParam(t.." = "..y);
--print(k..": "..t..", "..y);
end
end
end
end```
my script DOES do DoParam
which is why it was brought up
Ah so it wasnt yours that made the chaos
Who made the other one then
it was more for people who didn't know as much of LUA to figure it out themselves
i'll try coming back and finishing the blackouts mod after the semester ends. haven't been feeling this game lately
nah I made this mod 7 years ago. the fact that's it's been working this whole time has been surprising, but I guess it's because the doParam function never changed
he made it try to make the changes on map load I think, instead of on LUA/mod init
but if I recall correctly, map load is after checksum
then again, I haven't modded for PZ in like 7 years.. so I could easily be wrong
Cuz we fixed sapph cooking when remove item tweaker dependency
And other occasion with the same thing but to tbf to you i dont know of it was your item tweaker or the other one
All i know is that theres something causing error for somereason
well, I just found a mod today using my code four times in it
Ahhhh
like, redeclared my entire script, and included my entire mod in it's workshop link
I get what youre saying
So why didnt he fix it
as far as I know, the other item tweaker guy made his mod unlisted
but any other mod that was built on that version will have problems, since it's different than mine which loads on lua/script init
though his mod probably works fine in SP
Ah man. Youre the one suffering from others actions
But they just dont know
Cuz comst modders dont even go to dev chat
comst?
oh most?
Funny enough, I was actually trying to rewrite my documention for the mod, and reupload it as the documentation update.. Not sure if I should if we can just get people to do DoParam more commonly
so I see people mentioned the fact that my item tweaker was printing stuff to the log... Turns out I thought I actually uploaded the version that disabled that print 7 years ago.. I'm so sorry to everyone for that..
Most sorry typo
Maybe you can
Actually
Maybe post it on the description. The technical aspect of doParam and instructions somewhere like a steam guide
And we post that guide on the dev thread
was thinking of using this to catch people's eyes for when I update and we finish planning out the new guide
this work okay?
looks perfect
actually, I should edit the green text to
"For mods using this:"
well I thought I was making progress with the workshop error, now I'm back to the out of memory error :S
=(
okay, so before I can upload the changes, I suppose we'll need to finish the actual guide
I'm horrible at writing, and still don't 100% understand how to explain how it works lol
I know I'm 6 months late, but I didn't quite understand just -how- bad things had gotten regarding clones of my mod and such.
As you can see a little above this, I've decided to depreciate my mod (while still keeping it up for existing mods), and ask modders to make use of DoParam, as is best.
I haven't uploaded changes yet, as I didn't want to write anything prematurely.
I'm pinging you (sorry) to ask how you'd like me to go about doing it since you seem to have been stuck dealing with the aftermath of my mod for so long.
Please ping or PM me a response, as I most likely will not see it otherwise.
that being said, is there a difference between these two?
scriptItem and item
in this
local scriptItem = ScriptManager.instance:getItem("Base.EngineerMagazine2")
if scriptItem then
scriptItem:DoParam("TeachedRecipes = Make Smoke Bomb;Make Improvised Gas Mask")
end
local item = ScriptManager.instance:getItem("Base.Vest_BulletArmy")
if item then
item:DoParam("Weight = 8")
end```
could either of them be item or scriptitem?
is that possible to detect any action player do in certain area?
... ummm idk if i should write this here but!... whoever made the insurgent mod ( it is crashing )
Hey all, I’ve been on this server for a while but never really used it. I was wondering if there was any advice or tutorials you could give me. All I want to do is a simple recolouring of a hat/adding a marking to it. Any help would be greatly appreciated as I have never done anything like this and have zero experience.
which version of lua is zomboid?
im trying to use the debug library but it doesnt seem to be present in zomboid
how I can separate these from walls? Are there more "walls" that are not full size?
its fine the player should know that its not a full wall. or maybe you should just do a check?
if its the sign thing
maybe the wall with windows also? but thats alot so i guess no need to actually make the checks
If possible, I'd like to fix it for this and other billboards.
local items = {
["Base.Vest_BulletArmy"]="TeachedRecipes=Make Smoke Bomb;Make Improvised Gas Mask",
["Base.EngineerMagazine2"]="Weight=8",
["Base.SomethingElse"]="Icon=SampleIcon",
}
for k, v in pairs(items) do
--ScriptManager.instance:getItem(k):DoParam(v)
getScriptManager().instance:getItem(k):DoParam(v)
end
i dont think so
you cant mask them but maybe you can resize eem
ingame
not sure tho
but i know icons can be scaled thats it
not sure. how do i find out?
@vast palm oh hey, glad to see the OG is back. In your snippet it appears both of those variables are calling the same thing. Also you can use getScriptManager() instead. (Internally it's calling the instance but it looks a bit neater to do so.)
Also it should be noted keeping your files in the client folder can cause some issues due to MP checksums and if a modder wants to refer to scripts/recipes on the server side.
I'm not 100% sure why the "other item tweaker" was made -- perhaps with that in mind. I'm not sure. However, if you want your stuff to engage in SP and MP one time a piece -- I use on map load for SP and onGameBoot for MP.
Should avoid checksum issues and anticheat + keep the serverside information the same as SP.
Events.OnLoad.Add(shopsAndTradersRecipe.addDeedRecipe)
if isServer() then Events.OnGameBoot.Add(shopsAndTradersRecipe.addDeedRecipe) end
I put my recipe code in shared
print("\n***** zxTestEvents: file Loaded *****")
for i, j in pairs(Events) do
local c = 0
local limit = 3 --v41.78 keep it above 1 or some init events will be skipped
local s1,s2 = "\nzxTestEvents: "..i.." [", "/"..limit.."]"
local function info2(c,...) print(s1..c..s2,...) end
local function EventPrinter(...)
c = c + 1
info2(c,...)
if c == 1 then
--
end
if c >= limit then j.Remove(EventPrinter) end
end
j.Add(EventPrinter)
end
you can use something like this to find a common event that triggers for all: SP, Client, Server.
this should be used from shared directory
Hmm so you'd just put in the OnLoad and GameBoot events into the table?
While I like the idea of automating it to a point -- seems a bit complicated lol
is there a way to make a type of zombie spawn in the “Default” spawn pool after a certain amount of days have passed
Nothing has changed with that mod since last month... Likely an incompatibility issue with another mod you are running. But that's more of a mod support channel thing proba
If the spawn pools are tables then you could use something like OnEveryDays event to compare the GameTime daysSurvived.
is there a way to do it on the distributions xml
Distributions xml?
like the file that says where zombies spawn in zones, i meant to say definitions
Hey chuck do you have a way to contact Brita or Arsenal? I'm working on a model for a pistol (Walther P99) that I'd like to just give to them as it appears from the notes in gunfighter that they really don't want people patching into their code 😦
?
I guess it really depends on how/when those tables are accessed by the game. In theory you could check for WorldAgedHours and then insert
idk what a lot of this means i’ll just have to figure this out
They are on discord but communication with them is spotty. Both seem very busy / probably inundated with requests.
GameTime getNightsSurvived is what worldagehours derives from fyi. Not to be confused with players' getNightSurvived 
hi, got a problem on one of my mods (SixthSense) I do not understand: for one user at some point, player is null in the following code. anyone knows how this could happen ?
for playerIndex = 0, getNumActivePlayers() - 1 do
local player = getSpecificPlayer(playerIndex);
this is client side
is there any resources to help me learn how to work with custom audio files? since the Modding wiki page for audio doesnt exist?
there might be a gap in player indexes if a splitscreen player stops playing
Howdy. What language is used for PZ modding?
lua
I can help with activating something when you want but I'm not familiar with spawn zones or how they're handled.
Thank you
well, mod actually loads now :S
so i made a pen with all 4 colors, but it won't erase. did i do some thing wrong on the tags?
Tags = BluePen;Pen;Pencil;RedPen;Erase;Write,
just gotta figure out why the model is invisible afterwards
it looks like the tag is meant to be Eraser
the vanilla item mistakenly uses Erase, but it's hardcoded to accept that item anyway
yeah, im trying that now, haha yeah I was going by the eraser tag :S
now i gotta fix the model and figure out why its not taking my icon
yup, eraser fixed it, now to figure out the model and icon issue
Canonically Lua. Typescript is an alternative option.
The naming conventions parameters related to models are a bit aged -- weaponsprite = in-hand/weapon model, staticmodel = floor, icon = icon
I strongly suggest writing this in the wiki.
Capitalization may differ
yeah, the icon i got fixed, there was a space i left in the icon name by mistake
Should be covered if I'm not wrong
the pen model is something i probably screwed up, i copied the vanilla model and altered the texture
I rewrote the Icon property description on the Wiki to make more sense.
Use onlineplayers instead
Thats just for splitscreen iirc
ok, thanx

Albion already replied to it didnt read
That helps.
Thanks for confirming.
Its ok cuz she didnt mention the online players thing
it looked like client code
if that's server code then yeah, that won't work in multiplayer at all
my census is that there are no resources available for working with custom audio?
Actually once you take off your bag you cant pick it up and wear it again
A good idea for this channel: First-time posters get sent a msg from a bot with a mega-list of resources and common questions answered.
ya there is in the pins but...
so there is no resources available to learn how to work with audio 
More like there's no official sources.
I don't know how many of us in here have worked with audio but I'm one of them. I'm at work though.
i'm not really sure what you're looking for when you ask about it
how to implement custom audio when using items like VHS tapes or CDs
Use true music as reference
Tho its on a different media but pretty much would still apply maybe
I don't think that simply pointing someone to a mod is helpful. I'd point them to a GitHub codebase if so and if that didn't exist for the mod I'd explain how to look at the files for the mod.
duckling has raised a good point that there's no audio guide.
We need one.
This is an issue.
ya ive tried to look at true music before but got confused
I have never used true music before while playing the game but it looks like they use a custom boombox to play the music, which isnt the same as using vanilla TV's and ect
truemusic is really complex, it's not a great place to learn from
no video guide either
What about animation? Dislaik's guide right
thanks, this does help push me in the right direction.
what would a video guide even cover?
yestarday I spent hours trying to dig through the games code to figure out how the TV plays audio to see if I can make it pull a different sound file, but I couldnt find anything
I'd like a list of links to helpful/commonly used programs(and what they are used for) the major contributors use as well. I've got my own list of programs I've used before but for new folks, people in the market for better programs, etc would be cool to have
How hard is it to code animations into Java?
it's handled in the radio object's update method
it's not really something you can hook into unless you want to replace the sound completely
damn, thats probably why other mods just make new items instead of using vanilla TVs and radios
I'm very actively working on my own tools for the modding community so I mostly know about my own stuff.
Working on this atm: https://marketplace.visualstudio.com/items?itemName=asledgehammer.zedscript-vscode
i'd be shocked if they weren't still using the vanilla radio classes
i'm guessing you want something like special voicelines when a certain vhs line plays? i'd attach a function to the OnDeviceText event and use its uuid to match it to a sound
ya, my idea was that I have a custom VHS tape and I wanted audio clips of the VHS to play when it does
You can create AudioEmitters from IsoGridSquares and play audio on them.
It's deep API that isn't documented.
I know this because I went in and modified the living hell out of the sound engine to do some whacky things.
Actually, I thought doing it in client on "gameboot" was what was making it work properly on multiplayer? or is gameboot not triggered at the same time as reloading lua?
you can just use the emitter the radio already uses
Oh yeah and that.
IsoObjects have the API.
Oh hi Jab
my recent project has been related, so i'm familiar with that specific area
Chairchu
I've been trying to figure out how to explain on my mod's page how people should switch from my mod to not needing my mod lol
but I suck at this stuff
I had an issue a while back involving events -- applying changes too many times or such flagged anticheat.
I think that might have been the other mod
that one was crazy messed up in MP
he like moved it to the MP side, and it was really messing with checksums
This issue occurred with my own mod -- making doParam calls from shared
i'm surprised to hear that it is in client, i would've expected to hear about issues with that by now
The anticheat may have been adjusted accordingly then. 🤷♂️
hm.. it's possible
Recipe changes should be in shared
but I do want to eliminate the need for my mod now, after seeing how much grief it's been causing people
I think recipecode is also in shared no?
I don't think my mod handles recipe changes though
Scripts too*
recipecode is server
Oh?
I mean this was all just supposed to change the item database so items had different values
by the time the mods were enabled locally, it should have matched the server, because it'd all be done before joining
I dunno what's going on then
Calling doParam from the client directory doesn't make changes to the serverside afaik too - I also ran into that issue with another mod.
wouldn't the server do it too?
Or I could be confusing the two -- changes on server didn't work on client
the server doesn't execute the client folder
DoParam from clientside doesnt work for the current weapon you hold but when you spawn in a new one it does, i believe
hm..
doparam never modifies existing items regardless of where you do it
but wait
Depends on the param
I remember it always editing items I already owned
although it might modify items when they load again, and some properties are never stored on the instance in the first place
I remember changing TYPE would completely destroy existing items
but anything else would change properly
I never needed to find a new instance of an item to see changes that weren't "Type"
then again, I never did extensive testing after build 37
It really is a strange thing
I can try to look up why I had to do this
if you were doing it on game boot then most params would apply to existing items because they haven't loaded yet
I recall it being related to my literature mod
But i also think that albion is right: it depends on the param you alter
No I never used the other mod
ok
Cause vanilla has the edit item option but it doesnt list everything for the item that can be altered
Initially I used itemtweaker for vanilla weapons expanded but I adopted a template system using doParam instead
My point is that that person may have been trying to resolve the anticheat
And I ran into an issue with doParam being on clientside as well
"This is just a change on the initial callback to apply the changes on each game load.
I did 0 non-regression test so do not use it on your games unless you backed-up your save first."
that's what his mod did differently
I can't find where I spoke about the OnLoad vs ongameboot but Im at work
This?
The last thing I messed with (as of yesterday) was parseScript





