#mod_development
1 messages ยท Page 374 of 1
https://steamcommunity.com/sharedfiles/filedetails/?id=3625921385&searchtext=java Plenty of other java mods
it was an LUA vunerability
how do you know 
Because people posted the code on reddit
Do you have a link by any chance?
let's not get into the details of the exploit


Thanks for looking into it.
right, will carry this on through Spiffo, 2 mins
no no, just this isn't the place for this conversation
go back to your mod development
i will say that there's not really such thing as a vulnerability for java mods -- java mods don't need them, inherently they can do any malicious stuff they want, which is why they're generally not recommended
๐ค
And why you have to manually install them to make sure of your intent.
When you gotta install java mods to bypass hardcap 50 capacity 
Yes I have a mod for that -_-;
Lets you adjust player, floor, furniture, backpack and trunk capacity ๐
Because nothing will stop the power of hoarding!
Could you possibly ping me when your mod is back
cant play this game without it highkey
k
thanks man
if u have a local copy you can keep playing with it
aka if u installed it before and havent unsubscribed
I need to download it to dedicated server for b42.14 since our server got erased yesterday
Bro I'm so happy nothing really changed here and i dont need to figure out clothes again 
ETW Logger | bloodlustKillETW(): distance=1.4560546875
ETW Logger | bloodiedClothesLevel(): Clothing = Hat_Fedora | blood clothing type = [Head] | blood level = 14.509804725646973
ETW Logger | bloodiedClothesLevel(): Clothing = Tshirt_WhiteLongSleeveTINT | blood clothing type = [ShirtLongSleeves] | blood level = 0
ETW Logger | bloodiedClothesLevel(): Clothing = Shirt_FormalTINT | blood clothing type = [ShirtLongSleeves] | blood level = 5.9943976402282715
ETW Logger | bloodiedClothesLevel(): Clothing = Socks_Ankle | blood clothing type = [Shoes] | blood level = 0
ETW Logger | bloodiedClothesLevel(): Clothing = Shoes_Strapped | blood clothing type = [Shoes] | blood level = 0
ETW Logger | bloodiedClothesLevel(): Clothing = Skirt_Normal | blood clothing type = [Trousers] | blood level = 4.392157077789307
ETW Logger | bloodiedClothesLevel(): avg = 0.04149393240610758

wtf
and @NODISCARD
What the hell adds that ???
i can't remember which extension does that, i've since removed it ๐
Back up
thanks

What happened to it? Just a random steam thing? Fake report?
classified information 
shrugs
I ask because I had something like that happen, but it was more of a shadow ban than an outright removal lol
I assume either paranoia over the recent exploit, or people reported it beause PZ updated from B42.13 to B42.14 and they didn't realize to delete the zombie folder and reinstall all java mods, like they have to do every update.
(Once again.. I ask the developers to please delete zombie\ folder as a part of the update script.. or first launch after update)
since its about a 99% chance java mods will be out of date and require reinstall
oh lol
lol
about the Linux servers/case sensitivity problem, if there are any knowers around, can you comment on the following proposition ? If it is a good initiative, maybe they should make a guide of it that may survive longer than a soon to be burried discussion. here is the link, I just read it because it was posted on my workshop but I do not know if this is reliable or not. https://steamcommunity.com/workshop/discussions/18446744073709551615/806844795448264974/?appid=108600
dude
i am having a hell of a time porting my mod to multiplayer
everything broke
and i barerly can make something work properly there
how does this even work?
is there a documentation i can read?
i am doing everything that i can to use triggers to infect the player
and the server is like... nah
the debug doesn't work, that makes the experience of developing a mod so much worse
how do you guys manage that?
Just read the pin; there is some useful info.
How about using JSON Schema to generate a .txt script on the fly?
debug mode does work in MP, but you'll want to also /setaccesslevel "yourusername" admin to access all the debug stuff like spawn item, body parameters, etc
I was majorly pissed at trying to port stuff to MP (for the same reason as you) before I figured that out -_-
You can change player stats
dunno about skip time
https://steamcommunity.com/sharedfiles/filedetails/?id=3564950449 No idea what your talking about whistles
i am having problems with player:bodydamage
Yea. so first off, are you sure your code is executing server side?
do note: the client runs every .lua file in \server\ too because... reasons
i know, it is running on shared
K so your doing a timed action?
it is weird, some stuff works and other don't
that too
yea thats MP for you.
a lot of things actually
would some code to cut yourself help? lol
local bodyPart = self.character:getBodyDamage():getBodyPart(BodyPartType.Hand_L)
-- bodyPart:SetScratchedWeapon(true) -- Likely best for light wounds.
-- bodyPart:setScratched(true, true)
bodyPart:setCut(true)
self.character:playerVoiceSound("PainFromGlassCut")
-- bodyPart:generateDeepWound(); also an option.
syncBodyPart(bodyPart, BodyPartSyncPacket.BD_Health)
``` if you run that in a timed action *complete()* it will run server side and work
"Plz be careful with cut yourself code to avoid cutting yourself on it"
before i do it, i am aware that you need to put some special characters to deliver the code like you did right
shit
wait
it always send a text file
wtf lol
yeah
i am too stupid for that
but, i guess you can get what i mean by that
You can too, just ask chat gpt
As i was saying, that is in shared
it makes the player infected when you drink tainted water
and my code is filled with that kind of stuff
I'm not asking a bitch ass clanker to do my work
so, setInfected(true) is where your having problems
lol
also you can post just a function next time but yea.
nhumm... tell me more
Sorry for that
but tell me more about that
I only find that code in 1 location in vanilla
Looking to hire a dev for my PZ dedicated server.. is this the place to ask?
it works fine on the client side, i tought i was having problems because of player id
are you trying to set zombie infection or regular?
WHY THE HELL CAN BANDAGES BE INFECTED WITH ZOMBIE INFECTION!?!?!
so everything related is broke
if self.doIt then
local bandageLife = ZombRandFloat((self.doctorLevel + 1) * 0.5, (self.doctorLevel + 1) * 1.0) + self.item:getBandagePower();
if string.match(self.item:getType(), "Dirty") then
bandageLife = 0;
end
if self.bodyPart:isGetBandageXp() and bandageLife > 0 then
addXp(self.character, Perks.Doctor, 5);
end
self.otherPlayer:getBodyDamage():SetBandaged(self.bodyPart:getIndex(), true, bandageLife, self.item:isAlcoholic(), self.item:getModule() .. "." .. self.item:getType());
self.character:getInventory():Remove(self.item);
if isServer() then
sendRemoveItemFromContainer(self.character:getInventory(), self.item);
end
if self.item:isInfected() then
self.bodyPart:SetInfected(true);
end
else
what do you mean?
shakes head at code
if self.item:isInfected() then
self.bodyPart:SetInfected(true);
end
anyway you sure SetInfected causes zombie infection?
PS, after calling SetInfected it calls:
-- This number is syncParam, flags are:
-- BD_Bandaged + BD_bleeding + BD_IsInfected + BD_bitten + BD_cut + BD_alcoholicBandage + BD_stitched + BD_deepWounded
-- BD_bandageType + BD_getBandageXp + BD_bandageLife + corresponding _Time flags
syncBodyPart(self.bodyPart, 0xc001966b8e);
so your likely missing a syncBodyPart() call for MP
I would also question if SetInfected() does what you want.
are you sure it gives you a zombie infection in SP?
it does
Weird.
replace that silly number and letter combo with BodyPartSyncPacket.BD_Health
this code is supossed to infect you by drinking water i guess
Wrappers.checkbox("Is Infected", player.getBodyDamage()::IsInfected, player.getBodyDamage()::setInfected);
@bronze yoke what kinda syntax is that?
Iv never seen :: before
I hope they use this! (not)
it's certainly not lua syntax ๐
oh wait its java
I still don't understand it
oh yeah you have to use :: to reference a method directly
ah k
i gotta warn you first
this code is my attemp to make it work on mp. i was asking chat gpt to help with it but as you can see
@bronze yoke did you know of this? I think I just found a new way to troll people.
it is filled with nonsense
Is it a small file? If yes, when was it last updated?
its part of the main inventoryItem system
i had no clue
oh nvm then lol
bandages with isInfected() true will infect you with zombie virus if you apply them to yourself (seems to be skipped if other people apply them to you?0
has that always been a thing that seems insane
ok... can you explain to me what is going on?
i don't think that's even in line with the lore
It doesn't seem to have any mechanic where a bandage gets zombieInfection
but there is totally a mechanism for zombie infecting people with zombie infection bandages
function ISApplyBandage:complete()
self.bodyPart:SetInfected(true);
end```
For your mod, use syncBodyPart(bodyPart, BodyPartSyncPacket.BD_Health) on the server side in your complete function (also set the damage just before it)
oh thanks
no wait.. when anyone applies a bandage?
lame you only get first aid XP from applying clean bandages
lets just say that i have a menu that saves information in the game data
every time i leave the game and join it again it reads this data in sp
making every world have it's own information
I can't find any code that would ever actually set an item:isInfected() though
Definitely prevents spamming I guess, also doesn't help that we can't clean bandages/rags in washing machines
Do it on the server is usually the answer to most of these questions lol
ok, let me try fix my problem with the solution you gave me, thanks btw
just gonna call this crazy unused code of the day.. and here I was thinking you could somehow troll people with zombie infected bandages... sure would make ripping up clothing for bandages a lot more risky lol
dude, what are you even talking about?
also, that is a good idea
I found some weirdo code in ISApplyBandage that doesn't seem to ever be triggerable -_-
in my code?
no
ok
I mean you could make it triggerable in a mod, but its vanilla code.
dam...
items with item:setInfected(true); called on them will give the player zombie infection if he uses them as a bandage
yeah, i mean, probably the devs was trying to make something like, zombie blood
But there is no code in the game that calls item:setInfected(true)
it seems very stupid to use a bandage from a zombie cloth tho
Ok but we all do it ;P
yeah. That is the thing, probably they were cooking something with it
belive it or not
Turns out zombie virus was never airborn, people where just reallllyyyy stupid and kept using zombie brand bandages.
but i have the same problem with my mod
in my mod, if you get yourself covered in blood
you get infected
but here is the thing
if you butcher an animal
you also get yourself covered in blood
and eventually gets infected as well
and there is nothing i can do
yea, you can reduce the amount by using the butcher hook and draining the blood first
you can also make it require a certain amount of time past <blood limit> to get infected, so they could wash themselves ASAP
it does
Guess in your mod animals are carriers too ๐
but still, a don't think it would take that long to infect you in real life if you have zombie blood on you
shrugs
bro, rain water infect you on my mod lol
and when i tried to fix it
i figured out that it is in the java files
doh
and you cannot just mod it
there is why there is no mod that makes the rain water clean
if you wanted to make that change you would have to make a custom java files that directly changes how the game work
because the lua file isn't enogh
Speaking of, has anyone seen how washing machines work?
no, i haven't
yeah, what you recommended me didn't really work.
Share the complete function in your timed action
Bro, it is 1 am. Can i add you to my friend and text you directly? I am about to go to sleep
But if you are curious
That is my mod
4am for me, but I have a different sleep schedule, I'd prefer if you just share it here for others to chime in
Oh, ok. Then i will share how it work when i wake up. Thanks for your help.
Actually, there is
You hook onto butchering, and before you butcher you check how bloodied the character is. Then after butchering you check again. You save the delta and in your % to get infected calculations you subtract it.
This way you ignore blood from animals
I feel like they would end up at max blood and then immune to zombie blooding though
Honestly I kinda like the concept of butcher better wash himself after ๐
Decay the delta over time
You could maybe give him extra time before infection if hes butchered an animal?
yea
thats fine then
He still would have to clean himself, but he'd have a nice grace window
'animal blood is mildly infectious' (also butchery hopefully causes less chance of scratches and stuff than combat)
Honestly just kinda annoyed how cleaning yourself has no real purpose in PZ, we need more mods that make it a thing you gotta do for whatever reason
I good bloodlust perk that actually makes you happier when you're covered in blood 
its a super cool feature how much graphical work went into it, scratches, bandages, etc and most players just get totally filthy and ignore it forever more ๐
Honestly considering how easy it is to grab bloodiness and filthiness it ain't hard to make it affect wounds, mental, etc
the main thing with it is you get bloody so easily i don't know how fun it is to punish it in a serious way
the hemophobic trait is awfullll
Realism for the sake of realism ๐
is bloodiness tied to body locations ?
I know clothes have it
Body parts probably too or whatever
Haven't looked into pz anatomy and how body parts and etc are coded
no, blood locations
body locations don't really do anything except be equipment slots
pretty much everything else is handled by blood locations
^
Don't remember how I did it since it didn't break with 42.13

So I just left it be
Well if blood locations are reliable enough, why not just have it only infect you if you have an open wound in the same spot while also not having clothing coverage in that spot
could base it off the insulation stat
of the clothing
Because imma so fr, why would blood soak through my leather jacket
it's leather
Sweater has high insulation, ain't that waterproof
hmm, what clothing stats are there
Material
Oh ye lol that
I wanted to say that but I haven't played PZ in like a year so wasn't sure if I'm just coming up with clothes stats

My irl leather jacket is borderline water proof, I can't imagine how I would get blood in an open wound through it
but yeah could just cross examine blood location with waterproof stat of clothing covering that area
I would imagine even clothing that soaks easily would provide at least a lil bit of protection from it
It also is just your own fault if you have an open wound and get blood on it
I wouldn't make it gradual, I'd make it 0/1
If your blood level % on a body part is less that water protection on that part you are fine
If above you get infected
Only if there's an open wound, right ?
Ye ofc
thats why I wanna add it to my cooking mod to add food poisoning (non lethal)
if you didn't know, sweat is just filtered blood
because then its like, you go out, get all bloody, come home, clean up, cook, do stuff, sleep, repeat.
Ah, plan to make it so preparing food while bloody/dirty adds a chance for food poisoning ?
I like mechanics like that
Yep!
Realism mechanics that have gameplay purpose other than just making gameplay tedious
Food poisoning would help flesh out an otherwise very overlooked part of the game
Yea, its realistic and it just feels good IMO to have a reason to care about you get home, CLEAN UP, then do your stuff. change clothing if you must be cheap/lazy about it and do a body wash
I can't remember the last time I actually cared what my character ate other than calorie count
It's such a non-issue in vanilla
I haz a mod for that but its still pretty meh.
also one for cooking.
and... stuff.
I will admit, I don't want like,,,, having to track food pyramid stuff
I used to make minecraft modpack stuff with a focus of difficulty through mechanics, but having to spread your food focus just felt tedious
no I made it more like.. just try to eat SOMETHING with protein.. and the more protein you eat, the higher your fitness/strength XP boost.. the higher your strength level and the higher your protein level, the more protein your body consumes
high carbo gives a small endurance regen boost, low carbo gives a small malus....
and fat being high/low changes body weight.. but needs a few tweaks still
same issue with hydration mechanics and heat.
It's fine in zomboid, but I've never seen a survival modpack for minecraft that used Tough as Nails and wasn't just tedious to play
Yea honestly I wanted food poisoning to be an 'annoyance' that might get you killed, not something that kills you.
ie, pooping needs, lost of hydration, loss of calories (puking), endurance malus, etc.
yea, if you can sit at home in your base you'll be 100% fine
I'mma be so real, I don't think zomboid needs bathroom mechanics
no matter how bad it is.
it feels like a lot of these mods are made as jokes for youtubers to play more than anything else ๐
devs added sitting on toilets, IT IS FORTOLD IT MUST BE.
Unless you plan to like, make the game time 1:1 irl time I can't imagine it would be anything but tedium
But yea iv honestly never cared for those mods
It only made any sense to me once it could become something linked to food poisoning
Last day on earth survival has a piss mechanic, it only sometimes interrupts the game
it's primarily triggered from drinking beer, so it's a non issue and never annoyed me
and even then, I feel its less about the act of the pooping (other then maybe leaving you vunerable?), and more about the loss of fluids that could become deadly
Can't wait to shit myself in zomboid cuz I forgot to interact with a toilet for 3 days

nah you'll just die of being backed up ๐
No because I hate how so many survival modpacks are just this
kABOOM. "This is how you died. forgot to poop"
Like maybe I'm just being a narc but I always felt like the modpack I was working on stood out significantly from the norm just by simply,,,, not adding the same 15 mods every other survival modpack uses
Took me few sec to realize you didn't mean law enforcement
just be me, who has written like 7 different 'realistic mods' all only half assed released as part of Moons mods that nobody cares about ๐
but at least nobody complains about it either so thats OK
I may get back into making my minecraft modpacks at some point
I have this concept pack where a lot of stuff revolves around undead and demons.
This is important because it also uses a breath mechanic, going too high or too low in the world requires a rebreather or air tank.
Or going to the nether.
Which meant I had to go through every single undead/demon mob in the pack and mark them as not needing oxygen
I also think the whole ailment/poison system could be expanded with a few more counters.
otherwise you have demons suffocating in hell
Like, a poison that limits your max HP like being overencumbered does.
Whaaaaaa
the vanilla system is flawless
poison that causes hydration loss, poison that causes calorie loss (With maybe double whammy of slow hunger loss meaning your not likely to eat enough calories unless you remember and force yourself to)
I too eat burnt hamburger and die of food poisoning while my friend sits naked outside in -43F weather and doesn't freeze to death.
Poison that causes endurance regen loss or caps endurance level or something.
It's as nature intended
said friend then steps on a rock, and collapses dead
so I once rewrote car air conditioning in PZ right...
and as one does, I made a few mistakes here and there.
turns out that sitting in a -200c or +200c car does not kill you very fast at all, who knew.
No because genuinely why is freezing to death not a thing, but death by burnt cabbage is
I mean it IS a thing IIRC, it just takes like... 20 hours?
unless they changed it, hypothermia leaves you at 1hp :)
hu I never let it go that long to test
that's why I made the joke about said friend
Also, even actual food poisoning isn't inherently deadly
so idk why zomboid food poisoning is guaranteed death
by show of hands, who here has eaten burnt things?
I've had food poisoning like 3 times from worse things than a burnt bowl of macaroni
cause iv left 20 minute pizza in the oven for over a goddamn hour before and had to scrape the edible semi-carbonized cheese off the top to eat off the fully carbonized crust before.
mmmm semi-carbonized cheese...
My grandma used to intentionally char her fried chicken because she liked the carbon taste
not like burn burn, just lightly carbonized
"This is how you died: a slight increase in your cancer risk killed you in 2 days"
no literally
she uhh
she did happen to die to pancreatic cancer though
which is linked to burnt food consumption...
oops
granted this was over the course of like, 70ish years of eating burnt chicken
so definitely not as dangerous as zomboid makes it out to be
Gotcha, 953 burnt chickens = death
Death.. by cholesterol!
imagine getting heart attacks in PZ and having to raid the pharmacy for drugs... and a book on what the hell the drugs do
imports creatures 3 organ/biochemical simulation into PZ
I've seen jokes about a mod that makes it so your character has a chance for cancer after years of your character surviving with the smoker trait.
Has anyone like, actually done it
"This is how you died.. you mixed up a diuretic with your high blood pressure medication"
I remember someone making an overdose mod, which for some reason added suicide dialogue involving the character crying and stuff ?
I asked them about it and they hadn't considered the idea of someone being apathetic toward their own overdose, or simply being unaware of it
I don't know if they kept the dialogue or not, but I told them that my personal opinion is heavily in favor of not adding dialogue to the player ever if possible
I don't like it when I'm playing a sandbox survival game, and my character says something contradicting my own actions and thoughts
feels out of place
No hate to the creator ofc, I'm just very picky in my mod choices
Yea, I had a food boredom mod that made the player say stuff and a lot of people wanted to turn that off.
also it's a zombie apocalypse, why the hell are you speaking out loud to yourself
(plus the phrases where pretty lame and repeative lol)
you're gonna get bit like that
it was just a cheapo way to give the player feedback without altering the item tooltips
I feel like a moodle would've made more sense
you need to use a moodle framework because vanilla moodles are.. meh
craving meal diversity or something
I guess.
Basically, it just caused boredom if you had eaten food with the same ingredient over and over
to prevent mono-cropping or just eating 1000 sunflower seeds or whatever.
it also had a quip (I forget if I had a bonus) upon eating something for the first time in like 2 weeks (if you haden't gotten sick of it at least)
To an extent I understand that, but I have little issue with repetitive meals irl
but of course at the start of the game.. and a typical persons rando-diet before farming... everything is new. lol
yea, it was supposed to standin for requiring you to eat different things to have a balanced meal
I also know that I would not care about this sort of thing personally.
When I was homeless for a few months, I was consistently eating the same things and did not care because of the mentality of taking what I have
I have no doubt I would have the same mentality in an apocalypse
some people liked it... but I felt boredom was such a mehh malus
unhappyness would have been better but never got around to adding that.
Maybe nausea and unhappiness instead if you eat the same thing too many times in a row
I know a lot of people's bodies will start to reject food if their diet is too restricted
Yea it was basically just to prevent you from going "ok I have 300 watermelons from raiding this farm, im set for 4 months"
Stuff like this is probably too complex irl to translate well into gameplay
Like, care a TINY bit about changing your food around
The ability to feel Food boredom should be a something yoh can get as a negative trait
Vintage story does it decently though
not enough to really.. matter, but just enough so min/maxer goes "ok I'll use some of this and that and this" instead of just "day 432, still eating straight watermelon"
However that's because they give you buffs for having food diversity instead of debuffs for a restricted diet
positive reinforcement
Nah Zomboid doesnt run on hp like vintage does
yea, maybe thats a better idea TBH
I just meant buffs instead of debuffs
And a diet buff would be super op
not health specifically
bake it into my nutrition mod where you get some bonuses to <something> for eating some varied foods
you can have other stuff, like strength/fitness XP bonuses, melee damage, health/endurance regen
I mean you could totally get away with having small buffs, like better endurance recovery for example if you have a well balanced diet
Huh
How will that work with the calorie system tho
Well I would assume it wouldn't be directly tied to calories
as you can eat tons of calories but still get fatigued easily because of poor diet and vice versa
intermittent fasting is a good example of quality > quantity
Iv already expanded the calorie system in "Nutrition overhaul" mod of mine
where it uses carbo/protein/lipids instead of calories, and calories is basically hard set to 4x carbo
Also I feel Cooking would have to be overhauled for this
Ah oki
way ahead of you:
eats u
chomp
Is it broken on 13.1?
it prob works on B42.13, I don't see why it wouldn't, but haven't tested
I dun wanna deal with having to troubleshoot mods if I update my save
Link pls
I mean B42.13 was removed... so...
My friend who updated lost their world due to horde spawning in their base
Thanks
Seems like it wouldnโt be able to be added mid save tho
... why not?
Idk Iโm new from vintage story. combat overhaul and a buncha overhaul mods there donโt like saves
PZ is very good for adding mods mid-save
thanks
the biggest gotcha is mods that change items, anywhere you have been will have 'old' stats for items
the 'new' stat items only are found in unexplored areas
Also, if mods add an item, don't remove the mod without items all placed into containers or deleted. removed items on the ground turn into ? tiles and delete the whole tile -_-
that said, Realistic Cooking should be fine to add/remove mid game
'Refresh' can even be used to respawn items to the latest modset if your using mods that change items
PS: realistic butchery is still very beta so thats only for testing right now.
Please give feedback if you try realistic cooking ๐
Does it verify the folder names ?
I need a proper way to format scripts files anyway
I tot the PZ runtime accepted any name as long as the script block was correct. So, we'll just need to create a JSON file with a JSON schema (just like .emmyrc.json) and then generate the .txt script for PZ.
No, the unifier template accepts any folder name (but the project and mod_id directory names are sanitized on creation by pzstudio).
Even if Build 51 changes the mod structure, PZ Studio still worksโyou just need to adjust the build process to match. (WIP)
The schema can be automatically generated from the PZ Scripts Data
Eh
I think it should verify the lower / uppercase
This is very unlikely to move across versions
It's a common source of problem
Be it the folders in media or the mod.info file being improperly cased
Let linters do their work.
Use ls-lint for folder and file naming.
For code style conventions (such as constants, variables, and functions), use Luacheck or a custom Selene fork.
I am considering a custom build process rather than just verifying and building mod.info or the media/ folder. The current version only handles mod.info within 42/ and common/, and it can skip the build if mod.info already exists.
Yes. Using ZedScript generated from a JSON file (with a proper JSON schema) is far better than manually typing and guessing blocks in a .txt file. (i'm new)
You can even use a JSON schema to manage ZedScript versions and ensure they remain backward compatible.
No idea what these are
Not sure what you mean
ZedScripts handles the .txt files syntax itself
Create a JSON file with a JSON schema for ZedScript; then, a tool will generate .txt files from that JSON.
I think this idea will help, since you're already working on the ZedScripts extension.
I have my personal PZStudio project template here, in case you're wondering how I use a multi-linter combo
https://github.com/escapepz/my-pzstudio-template-project
It's not that easy, but I need to create a Scripts formatter anyway
Something I'd like to do is make ZedScripts able to parse scripts and export in a json/yaml format the scripts
Same would be nice to import
I know the performance impact on this is negligible but say I have this
local function OnZombieDeadETW(zombie)
local player = getPlayer()
traitsGainsBySkill(player, "kill")
end
where traitsGainsBySkill is a lot of if (one top-to-bottom run can easily get into 50+ ifs, it's a long func)
but the thing is as you probably can guess is that it fires on every zombie kill, right? And I'm kinda interested only in kills made by current player. So off the top of my head I was thinking I can check if zombie that died was attacked by player but dunno how reliable that is. Alternitively I was thinking maybe grabbing a distance between player and zombie 
or do I just ignore this?
thoughts?
yes i know that it's still lightweight considering no big calculations but yknow
Is there anyone I might be able to commission to make this Functional Great Kilt mod?
This is the most detailed commission description I've ever seen
You can post request on modding community discord
Thank you! And I have just done so, I appreciate ya tellin me ^^
As a Scot myself, Iโd love to see this in pz
i remember somewhere at the beginning b42 there was some info that mod ids now require to have workshopid/modid structure and it will be enforced later. did it get implemented? or am i giving my mod id id=2914075159/EvolvingTraitsWorld for no real reason, while everyone else are giving normal ids?
I changed the settings of a sprite in my mod, how do I make the game read them and not the game's own settings?
I think your request is missing pictures
Good afternoon, everyone. Well, I'm developing a mod to add some attachments and combinations for the VFE on b42.14. Specifically, I want to make the M4a1 and M16 the legendary SOPMOD version. However, when I try to create the items, I can equip them on the weapon, but their 3D models don't appear in the game. I've already checked the address in the script, etc. I have no idea what could be happening. If anyone could take a look at the mod and give me a diagnosis, I would be very happy. I haven't been able to solve this issue for a week now.
examples
I understand what you mean, at first this list was just meant for me as I was going to make the mod myself as I know exactly what I want, but after making this list I suddenly lost all motivation and it's been sitting in my files for almost a year. Only recently did someone point out I can pay someone to make it
Yeah :)
Just make it simple; this is hard for me to read with that font
Having it like this allows for the player to choose between longblunt/spear skill and have access to both tool's abilities
bayonet mode allows for spear fishing, spade mode allows for digging and removing ash
I will be adding in a quick-action method that quickly swaps to a melee mode for panic situations, while keeping the manual selection as seen in this photo
The quick-action will have a priority queue and will attempt them in this order:
ReadyBayonet > ReadyChopper > ReadySpade
ReadyBayonet > ReadyChopper > ReadyMace > ReadyImprovised
A few different weapon types will fall under โMaceโ such as the spade attachment
Improvised will just be using your gun barrel as a blunt instrument
why does this still create a ghost item in mp (the code runs from server)
local item = instanceItem("myitem")
player:getInventory():AddItem(item)
sendAddItemToContainer(player:getInventory(), item)
it's executed by Events.OnCreatePlayer.Add(giveStartingItem)
that's not a server event
PS: Client runs all code in \server\ too.
Iv still no idea why...
Yea that about sums up how I felt about it when I found out.
Protip: isServer() = true if server, false in SP
isClient() true if client, false in SP
so generally you put something like:
if isClient() then return end at the top of your 'sp/server only' files
yea but it looks like ill be doing a client command since albion mentioned that OnCreatePlayer executes only on client
Ah, yea
https://demiurgequantified.github.io/ProjectZomboidLuaDocs/md_Events.html the events doc contains what side a lot of events fire on
Not seeing anything for 'when client is done loading' server side
Couple of questions since Iโm planning to create a mod for B41.
- Are the animations for loading a rifle magazine and racking its bolt one or separate?
- And can you increase the amount of ammo loaded in a gun with loose ammo (like shotguns and revolvers) instead of just one at a time?
Kind of want to do a semi-automatic shotgun mod for the JS2000. Not making an entire weapon, just a texture.
Increase MaxAmmo to like 9, set the script for rack after shot to False, and that probably leaves me with just making a new reload animation and a texture.
Don't change the JS2000, just make a new weapon that uses the same model.
Loading and racking are seperate animations. Some things are controlled by flags in the animation XML becing detected by lua stuff in the Action, so when you make a new weapon they may not trigger... but I don;t think that will apply here, the "rack after each shot" is controlled by RackAfterShoot = true,
You can either reload Full ammo or one at a time. Other would probably require lua
Even without magazine
And yes you can increase the number of rounds loaded but you'll have to override a bunch of lua functions related to reloading and handle cases only having one round to load, handle not needing to load two rounds, etc
Alright, canโt have everything. The loading 2 rounds part. Thatโs alright with me.
And how do you make like the โrequired itemโ in the workshop thing?
Bit ambitious for a first mod, but kind of want to do one animation for reloading the JS and the modded shotgun while standing up and another while in sneak mode with the True Crouch mod.
Also, why would you need a new reload animation? There are animations for loading round-by-round, and animations for reloading a magazine... Onless you're going for an accurate street sweeper I don;t know what else you'd need for a semi-auto shotgun
the "required item" on steam is done on the workshop website, the required item in Zomboid is done is in mod.info
Style points, really.
How would the animation differ from the normal reload?
I definitely suggest starting without the animation, because animations in zomboid are not very straightforward to deal with.
Actually, I could only have like one animation for standing up and in sneak.
Place shotgun stock on right shoulder, gun tilted on its side, loading port facing outward.
Left hand holds the pump, right hand loads rounds one by one.
More like this below.
Actually, I could just settle with just doing an animation. Iโve been using the texture of the JS2000 from EtherealShigure for who knows how long and I really like the look of it without using any other gun mods.
Well, I've asked a few times in the mapping area, but it's a little more quiet over there and seemingly no one has the answer, so I will appeal to this side once again for help. How can you get custom tiles to show up in the tile picker? I am able to force the sprite into existence through a hokey script (I get a 'invalid spriteconfig object' error every time), but it does not appear in the tile picker itself. Any ideas?
if your tile is set up correctly it should just be there, it's not something you're meant to have to do something special for
i assume you have a tiledef
I do.
I can't imagine it's important, but one thing I've noticed when working with the tilesheet in TileZed is that the gid of the sprites are 1000 and on. Other packs I have examined for clues all seem to have much higher, less consistent gids. Are the gids an important aspect of how the game references the tiles or should I not be concerned with this?
Man after playing RE9, I want to be able to reload bullets like this on shotguns in the game lol
but blendering and animation for me its not my best friend lol
I got the perfect shotgun models to make that anim
if I only had the skills 
How do I display a character's name in more than one word? This code takes the player's full first and last name, but outputs it as one word.
local m3 = getPlayer():getUsername()
print(m3)
result - AgentSmith
need - Agent Smith
doesn't getUsername() return the account username and not the character name?
You can use gatPlayer():getDisplayNAme()
But... only if your character is called Bob.
OK, got it. Short version: p=getPlayer();print(p:getDescriptor():getForename().." "..p:getDescriptor():getSurname())
Long Version: since we know the characters full name is displayed in the character info screen, I looked in ISCharacterScreen.lua to see how they did it.
If you saw my message.
No you didnโt.
If anyone can help, I'd appreciate it.
Where are the sprites for the buildings located?
Like the wooden boxes and things like that.
I think "tilesheet" is the term you want to search for, but I've never actually tried to track them down
Just use the vanilla animation and tilt your head 90ยฐ ๐
This is what I will one day force myself to learn animations to make: a "Mares Leg" cutdown rifle that fits into a holster instead of using a long weapon attachment slot.
I try to only make weapons that are offering something different from the many existing guns.
But I need the lever action racking animation, and I don't want to just steal that from someone else's mod.
you could use the vanilla pump shotgun animation
as a placeholder though
I know, but I still need to make the animation/find one I can use without stealing before I can complete the mod.
I could try and cook something up in blender but i suck at animating + i can't promise anything
i also dont know how to mod.. so it'd just be a .blend file
Thanks, but I'll get around to it one day.. in theory it's a very simple animation, the hard part will be learning how to actually make a zomboid animation.
I should also message the author of the modpack I saw teh lever reload animation in to ask if I can use theirs.
(Not Rain, one of the other modpacks with lever reload... I don't want to be crediting Rain on my mod after recent events lol)
what'd rain do?? i'm not filled in on the mod dev lore </3
First, they rained. and all was good. but then, the rain dried up. And people where mad that all they had left was rain collectors.
...ok
I even found some sprites, but I want to know where it becomes Carpentry 01_16 because all the references I find only refer to Carpentry but none to the original sprite.
the tile definition.txt file?
media\newtiledefinitions.tiles.txt
// carpentry_01_16
tile
{
xy = 0,2
BlocksPlacement =
CanScrap =
ContainerCapacity = 60
ContainerPosition = Low
CustomName = Crate
IsLow =
IsMoveAble =
IsPaintable =
IsStackable =
IsTable =
Material = Wood
Material2 = Nails
PaintingType = crates
PickUpWeight = 75
SnowTile = object_snow_overlay_01_184
Surface = 32
container = crate
solidtrans =
}
this code in particular.
theres 4 files that reference carpentry_01_16
Also just wanna say, I was worried that the shovel head would look weirdly big on the gun
and then
I remembered what the vanilla spade looks like
Take it from mine
Thanks!
The last of guns remastered has lever action
Was just looking though your mods to find it.. I gured the G11 probably wasn't what I was after ๐
Very much appreciated... now I just need to make the Everything Else. ๐
Funny thing I also made this reload anim
But... I made it for Rainmaker before her tantrum
And what a tantrum it was!
I like that the Zomboid Modding community is mostly drama free.
Compared to what I remember from playing modded minecraft, this is utopia.
Nice if you can, if not the proper level action racking is the important bit.
OK, I'm set up for a weekend with Blender to work on Both Mare's Leg and my latest stupid Idea: Vanilla Crowbars Expanded.
Crowbar with Rake. Crowbar with spike. Crowbar with Sawblade. Crowbar with Nails.
It's just racking
I have the anim file for it
Send it to you in DM. The default lever action anima you have to take from my older mod though
Thank you so much for that!
I can pull the lever action anim from that.
Now I can once again put off learning to animate in blender. Which is good, because just learning to make models that work in Zomboid was hard enough.
Do you think you could upload an animset mod for modders, or would you prefer people just rip them from the mod
I no longer have local files for those mods so i'd had to subscribe/redownload them too.
I don't want people to "Rip them off". I simply gave permission to Stalker to use them
The moment people would simply take all my assets without even asking and i'd notice it i wouldn't really be happy about it
Not many. I tried to work around vanila anims, but i really wanted lever action rifle so i made it. I didn't realy wanted to take it from someones mods so i decided to make my own
It has probably only Lever action anims and M4 like charging/racking where you pull the thingy
Sorry folks, I'm reopening an old mod of mine, I forgot how to mod this game and I was doing some cleanup.
DO you know if my mods ClothingSelectionDefinitions.lua should contain a copy of all the original professions if I'm simply adding a new one?
Or can I remove all of them and simply have my new profession?
I'm now focusing on version 41 to keep it simple, as I need to get back the hang of it.
Your mods should never contain copies of vanilla stuff, they should just contain the new things that they add. If you modifiy a vanilla thing, modify it; don't duplicate it and change it, or you will conflict with other mods that change it/break when vanilla updates
Unless you're planning on playing B41 I'd suggest just going to B42, otherwise you'll re-learn how to mod and then have to re-learn again with all teh B42 changes.
so I simply specify my new profession with
ClothingSelectionDefinitions.newprofession {}
without adding anything else?
obviously I add the custom equipment in the list
Sorry, I'm too deep in B42... completely different system for professions.
Also, don't have a file named Definitions\ClothingSelectionDefinitions.lua or it replaces the vanilla one - always use unique filenames unless it's one of the few things that need to use specific filenames.
which one?
i assume its this one
hey, im working on a challenge mod and after hours watching in the game archives and trying in VS i still have troubles to make it appear in the challenges list, i have a .lua which i want to get started with the challenge, thats all, but it seems so difficult for me, idk if someone can help me with maybe structure of the archive of maybe if i missing something
this is what i was able to make
This one, to be exact.
oh! my older R870, Nice
Really like when shotguns in games have their barrel with the same length as the tube magazine.
Good morning, guys. I created a mod that adds 2 items to the game, however, they are invisible. If anyone could take a look at the structure to see if I made any mistakes, I would be grateful.
Where can I open these .pack files?
Having too much fun with different magazines for weapons.
You can recreate the patriot now from mgs3 heh
Mapping tools come with builtin tiles unpacker as it's part of mapping
How can one grab a translation string from CharacterTrait?
neither getName() or toString() return translation string
Which is quite crippling if you have a table of CharacterTrait objects that you work with and you need to put them into UI

oh right, ofc
trait is no longer a real CharacterTrait when you read it back from modData.
That error says exactly that:
expected argument of type CharacterTrait, got KahluaTableImpl
So this part assumes traitEntry[1] is a CharacterTrait, but what actually came out of modData is just a Lua table representation, not the original Java-backed object.

Wait but how come it works in other parts
im so confused
no wait but thats not true
because this works as intended
modData.DelayedStartingTraitsFilled = modData.DelayedStartingTraitsFilled or false
modData.DelayedTraits = modData.DelayedTraits or {}
for i = #modData.DelayedTraits, 1, -1 do
local entry = modData.DelayedTraits[i]
if not instanceof(modData.DelayedTraits[i][1], "CharacterTrait") then
print("ETW Logger | System: trait in modData.DelayedTraits at index " .. i .. " is not a CharacterTrait type, deleting it ...")
table.remove(modData.DelayedTraits, i)
end
end
yea fuck knows im confused
it will stay a charactertrait until the object has actually reloaded once
so if i have a table in moddata with CharacterTrait objects it works until the character is reloaded or what?
yeah
but if you're not using it persistently there's not much reason to use mod data in the first place
I have to redo so much shit rn
I do use it persistently, it's a system that gives player traits with delay after they earn them
fuck these registries, I used to use strings like a normal person, but no, now we got registries and I was like "oh cool, i'mma store objects"
jebaited by OOP
I need to rethink whole thing now how to make it work
can you add a trait to player based on its string?
or like how can one get from trait name to CharacterTrait object? 
Like if I registered a trait AV_CLUB = CharacterTrait.register("ETW:AVClub"), as example, is there a way to get CharacterTrait object from "ETW:AVClub"?
I don't see any fitting methods in any of these classes
CharacterTrait.get(ResourceLocation.of("ETW:AVClub"))
be sure to nil check the result if using unknown strings
ah I see, I tried CharacterTrait.get(ResourceLocation("ETW:AVClub")) xdd
Should've dig a bit deeper
actually this question still stands 
I really dont wanna do getText("UI_trait_" .. trait:getName())

because those are not consistent in base game
i guess another option is to build a map
probably CharacterTraitDefinition.getCharacterTraitDefinition(characterTrait):getUIName()
hmmm
I'll have to build a map either way since those are not gonna change at runtime anyway and it's a UI render so dont wanna do stuff there
ok, well at least now I know what I gotta fix. As always, you're the best
big thanks
this is basically free
hm
i wouldn't stop you from optimising it that way because it probably will turn out slightly faster, but it is massively unnecessary in my opinion
well it essentially becomes
CharacterTraitDefinition.getCharacterTraitDefinition(CharacterTrait.get(ResourceLocation.of(traitName))):getUIName())
that looks like a lotta calls
in ui render() function
is it still fine?
and I expect anywhere between 0-20 traits to require it (aka call that whole thing up to 15-20 times)
does my mod have to be public on steam workshop to be downloaded when my friends join my server or does unlisted/friendly only work
it's giving me this error if i enable my mod
EDIT: making it unlisted instead of friends only fixed it
how hard it is to make mods in this game? I'd like a mod where I can feed zombie corpses to pigs (and after they eat it, their meat can't be consumed anymore)
Has anyone else implemented the fluffy hair mod into their own mod? I have no idea how to change your hair type when equipping a helmet
thank you
I completely forgot that wiki page is a thing too
@bronze yoke hey, sorry for direct ping but you were the one that said I don't need to do any wierd shenanigans when trying to hook onto consumeNicotine even though there are 2 methods with same name but different signature
https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/scripting/logic/RecipeCodeOnEat.html#consumeNicotine(zombie.inventory.types.DrainableComboItem,zombie.characters.IsoGameCharacter)

So I tried
local original_RecipeCodeOnEat_consumeNicotine = RecipeCodeOnEat.consumeNicotine
function RecipeCodeOnEat.consumeNicotine(item, character, percent, ...)
ETWExportedFunctions.smokingAddictionMath(character)
return original_RecipeCodeOnEat_consumeNicotine(item, character, percent, ...)
end
and
local original_RecipeCodeOnEat_consumeNicotine = RecipeCodeOnEat.consumeNicotine
function RecipeCodeOnEat.consumeNicotine(item, character)
ETWExportedFunctions.smokingAddictionMath(character)
original_RecipeCodeOnEat_consumeNicotine(item, character)
end
function RecipeCodeOnEat.consumeNicotine(item, character, percent)
ETWExportedFunctions.smokingAddictionMath(character)
original_RecipeCodeOnEat_consumeNicotine(item, character, percent)
end
and it works if I run a 2-arg method (aka smoke a singular cigarette, for example)
but if i run a 3-ard func (for example, smoking a cigarette from a pack of cigarettes without taking it out first) it crashes
ERROR: General f:1387, t:1772845696366> ExceptionLogger.logException> Exception thrown
java.lang.RuntimeException: No implementation found for function: consumeNicotine(class zombie.inventory.types.DrainableComboItem Base.CigarettePack:zombie.inventory.types.DrainableComboItem@770812c3, class zombie.characters.IsoPlayer IsoPlayer{ Name:null, ID:134 }, null null)) at MultiLuaJavaInvoker.call(MultiLuaJavaInvoker.java:113).
Any ideas? 
2nd doesnt even make sense cuz i overwrite first def
but hey I tried

basically, when you call RecipeCodeOnEat.consumeNicotine(item, character, nil), there is no implementation that can accept nil as the last argument -- it's not like lua where nil is the same as not passing anything
but they are named the same 
if you don't need the percent it is better to do this instead:```lua
local original_RecipeCodeOnEat_consumeNicotine = RecipeCodeOnEat.consumeNicotine
function RecipeCodeOnEat.consumeNicotine(item, character, ...)
ETWExportedFunctions.smokingAddictionMath(character)
return original_RecipeCodeOnEat_consumeNicotine(item, character, ...)
end

to lua, a java method with multiple implementation is really a magic box that decides which implementation to call based on the arguments it received
to it, nil is not the same as nothing, you need to pass nothing to get an implementation with less arguments
in a worst case scenario you might need an if tree like this:```lua
if percent then
original_RecipeCodeOnEat_consumeNicotine(item, character, percent)
else
original_RecipeCodeOnEat_consumeNicotine(item, character)
end
๐

#musicmaniacpins on hooking into java methods (potentially with multiple signatures)
Introduction to Scripts
This guide explains the basics of scripts, also known as zedscripts, for Project Zomboid modding. It goes in-depth on how they are made, their syntax and an extension which helps you more easily write them.
Relevant Wiki pages:
https://pzwiki.net/wiki/Scripts
https://pzwiki.net/wiki/Mod_structure
https://pzwiki.net/wiki/Game_files
https://pzwi...
If you ever feel useless, just remember that someone was given the task of creating the sound of a crowbar breaking
hahahahahah.
"How... how do I even record that?"
proceeds to spend 2 years trying to break a crowbar
I'm looking forward to the release of your cooking mod.
BTW> loving realistic driving physics & project summer car combo.
I love making cursed meals in zomboid so anything adding new ways to traumatize my buddies with my cooking makes me happy
Along with With No More Wiggly Vehicles to fix being slightly misaligned with the road, driving is much more fun.
Thanks. Still looking for more beta testers.
lol I saw that mod and thought it was kinda cool
They still speak in hushed horrified tones about the six cheese stew....
It's in the pack of WIP mods?
yep
I've made six cheese pizza in real life and it was really good.
I'll check it out, I assume each mod in that pack can be activated seperately?
yep
Oh sure! It probably works great on a pizza! A stew is a different story
its just cause A: im too lazy to make proper release pages for em and B: mods do so much better when they are working properly on release
I figure if it works for me then it's tested to Zomboid Standardsโข just like the actual game.
I just go with a distinctive font (thanks Rimworld!) and whatever background image I think of (which will be AI generated occasionally)
Animated thumbnails are more work.
lickable batteries lol
"Authentic 1990s Battery Charge Detection"
A+ at dismantle any car btw.
F- at only being able to dismantle "wrecks" and not any other sort of car that may be in your way.
Yea
...I think my best mods all come from something in a game that annoyed me
lol yea
headlights are so dim, summer car added some brighter headlights/taillights for B42.14
kinda wanted to make the brightness dynamic with battery voltage and maybe flicker at low condition or something but couldn't be bothered lol
I like to take credit for TIS finally making it possible to adjust headlight brightness in LUA with my "High Beams" java mod. ๐
lol
Sometimes it feels like they look at popular mods and incorporate them into the game.
I hope so.
(they stole my "colored battery charge light" mod too!)
Glad some of the right click context menu of common sense got vanilla'ed.
(stuff like open and drink)
I hope some of realistic car physics gets vanilla'ed too.
yeah, we seem to have a decent balance of usability & spamming the context menu & performance now
God yes, the vanilla car physics is horrible and better car physics has been a thing for years because of that
Yea im fine without crafting there.. but we really needed barricades lol
we have a couple right click crafting recipes that seem common enough to make sense though
can someone tell me how to import vehicle wheels? I would greatly appreciate it ๐ im new to blender so bare with me
file->import->fbx -> ProjectZomboid\media\models_X\WorldItems\Wheel.fbx
or what do you mean? ๐
Rough placeholders for Vanilla Crowbars Expanded.
AXE?!
Bro melee attacking zombies in next house
Can it mount an under-barrel toilet plunger?
will be a framework. so you can mount anything
(if you want to do that in your mod lol)
had to mess around with how flexible it is hahah
I'd be interested in this. I have a mod that adds more longswords and the like to the game.
And I'm also working on a firearms mod.
Does it work for pistols?
yeah it works with any item type for both bayonets and underbarrels
there will be instructions on how users to set up to properly register weapons with the system
Is it recursive? So I can have a 5.56mm rifle with a 12g shotgun with a 9m pistol with a bayonet?
bruh
that would drive me insane haha
no its not possible that
while you can attach anything, is a system meant for underbarrel attachments
You could theoretically do this actually
You can attach stuff onto attachments
You would need to have the parent gun and attached gun be on different slots
And store all the relevant data on each attachment
This would be absolutely absurd to code though
I sorta want to just as proof of concept, but for my own mental health I really shouldnโt
You would need to store so many values
And would definitely be a nightmare for debugging
It would be its own framework just by simply existing.
Would probably break every single mod under the sun
Hello, how can I define a jerrycan as empty or full; With the B42, liquid containers are no longer managed with a condition.
Posible is it. Making it with a straight forward code? No
Dope man! Let me know when you release that if you're cool with it. I'd be happy to help alpha test the modding guide.
yeah I will post more here
Why don't you retrieve it from the Workshop directly ?
where?
On the Workshop duh
When you download a mod, it downloads it locally
wth man
ฤฐ need direct file
not on steam
Why ?
You can already retrieve the files from the version you downloaded on Steam dude
ฤฐ no have steam
there's like a billion websites that mass upload steam workshop items for pirates, just go on one of those
You're on GOG ?
Why do you not have Steam ?
LOL
idk
You cracked the game did you ? 
Hahahah
no sir
Why is my question so hard to answer then ?
If you don't have Steam and don't know what GOG is ?
idk whats does mean GOG
ohh
Why don't you have Steam, why do need the mod files ?
Where did you get the game from is what he is asking
My dude
If you cracked the game we don't give a shit
But stop being so dishonest here
why man
Na bro
omh
Why do you not retrieve the files from Steam then ?
ฤฐ js want only file zip
No one here is going to give you a .zip file of a mod
Get it from the Workshop then
Just download the workshop item then
Because it's an odd request that no one is going to go out of their way to fulfill when that sort of thing, like albion said, exists anyway online. You pirated, no one cares, but that isn't everyone else's problem
Can I transfer them to other devices?
They're just files
Oh
Why do you need to transfer them ??

if you transfer to a device that has the game, that device has Steam then
Same as your other device
Why does he have wiki editor role?
i mean it's opt in, anyone can have it
lol at pirate trying to get mod authors to send mod zips.
Hi, I've got a weird issue, so when editing stats in multiplayer with my mod it changes them to the amount and then immediately gets resets to what it used to be. It works just fine in singleplayer. It ends up just pulling the number around. It weirdly it works with some stats like stress, fatigue but other like endurance, panic it just freaks out. All code editing the stats resides in the server folder.
your code is probably running on the client instead of the server
Even if it runs in the server folder? I turn on the code (client side) with playerdata.TBFuryBuffs = true and then in the server side I use if playerdata.TBFuryBuffs then to decide if it should run the stat changes.
oh, I had a horrible misunderstanding then. Thank you
Yes, but not as bad of a misunderstanding as whoever thought it was a good idea for the client to execute everything in \server\
I don't think 'playerdata' is going to replicate to the server without a sendClientCommand packet btw.
(Whatever playerdata might be)
(Basically no changes made to anything client side will ever replicate to the server, and changes made on the server almost always need a corresponding 'sendchangedthingy' call afterwards
I see, I'll give that a try here tomorrow. Thank you very much. I was going crazy trying to fix it.
anyone have any collections for b42 mp?
Hey guys, I recently wanted to practice modding in this wonderful game. And I thought adding skis would be a very easy task. However, I ran into the problem that in order to implement sliding and animations, I need a new State for StateMachines. I tried for a long time to consult with chatgpt, but in the end, they gave me all sorts of crap advice. It all came down to me realizing that Lua doesn't have access to StateMachines, and I need to write a new State in Java, compile it into a class, and then I don't know what to do, because as I understand it, you can't just shove a new Java class into the game as a mod. Could you tell me if I'm going too far and should be going in a completely different direction?
Sometimes you come up with a cool idea, look at what is needed to implement it, and put that cool idea away on the this-will-never-happen pile.
Do not make a java mod unless you are really keen on the mod idea and OK with the ongoing commitment of keeping it updated with every patch.
I'll totally accept it if it's truly impossible without modifying projectzomboid.jar
Or you come up with a very different way of doing things; can skis work the way the skateboard mod does?
(You don't need to modify projectzomboid.jar, you can put compiled java files into the zombie folder and they will take preceidence over the ones in the jar.)
Yes, I think you're right, I should look at the implementation of other mods ๐ค
Good luck!
Anyone got any ideas on what is happening here: I made 6 weapons. Every model definition has the exact same attachment world and attachment Bip01_Prop2 values. Every model is oriented the same way in blender. Every model has the same transformations applied/set in blender. They all work correctly when on the players back or equipped in hands.
But when placed on the ground, the Railspikebar (bottom in image) always defaults to pointing up, while the other five default to proper lay-on-sided orientation.
I can probably fix this by messing with the world attachment rotations, but... why would this one behave differently to others, and only when placed on the ground?
Solved: something about model attachments/orientation get stored in the save file, so if I start a new game instead of loading the testing save the weapons all behave consistently.
Funny cause I was gonna jokingly say โReason: your game hates you specifically.โ
I didnโt hit send because I try to avoid meaningless replies on problems.
Turns out it would have been correct.
Hahaha
Time for a break, I sat down to do a quick 15 minutes edit to a file and that was 8 hours ago.
Also; any other suggestions for new crowbar based improvised weaponry? Right now I have: with bolts, with hammerhead, with rake, with saw blade, with railspike, and sawnoff crowbar (that fits on your belt)
Is it possible to wait few ticks somehow?
I have a func that manages setMaxWeightBase and setMaxWeightDelta and I wanna see whats player getMaxWeight after changing setMaxWeightBase so I know which delta I need to apply to reach desired weight. But problem is that while my func runs the engine will not update getMaxWeight. So I either need to queue a func that works with getMaxWeightDelta after I update base max weight or force engine to recalc max weight somehow
player:getBodyDamage():Update()
actual W

sorry folks, is there a documentation regarding porting b41 mods to b42?
Like a list of deprecated java functions and main differences, so to know how much I can keep and how much should I change.
check pins
Is there a way to force hijack function? I know it's not a good idea to do it and we shouldnt as it'd break compatibility with any other mod that tries to hook onto it, but I need it.
For example, I want to hijack setMaxWeightBase() so no other mod fires it (and if it fires I instead run my code), but I don't really see a way to do it?
because I still need base game func to run eventually, so if I do something like
original_func = IsoGameCharacter.setMaxWeightBase
local myfunc()
--- something
original_func(x)
end
function IsoGameCharacter.setMaxWeightBase(maxWeightBase)
myfunc()
end
i got no way of guaranteeing that other mod is not running setMaxWeightBase before me, no? Which would mean that other mod changes are already saved in original_func
so your mod should load and hook it before others
ye but i cant rely on users manually adjusting load order, also i havnt messed with load order in a while, i dont really rememebr how it works in pz. Is there a way to force my lua file run before others?
copy your mod into vanilla dir ProjectZomboid\media\lua
i have no idea how to prevent or restrict users from adjusting the load order
is there anything else i need to do to get custom ammo to work properly in b42, ive done all the stuff like registries.lua and adding the ammotypes to the weapons and mags but neither of them will recognize that i have the ammo in my inventory, even if i make the weapon load each bullet individually like a revolver
ive also looked at other mods and how they added their own custom ammo but i cant get mine to work
it's hacky, but you can overwrite a vanilla file in your mod, like this:
-- contents\mods\test1\42.14\media\lua\client\ISUI\ISMouseDrag.lua
local earlier = print
print = function(...)
earlier("[evil hijack]", ...)
end
-- override ^
ISMouseDrag = {}
ISMouseDrag.dragView = nil;
then another mod overrides the same function:
-- contents\mods\test2\42.14\media\lua\client\main.lua
local later = print
print = function(...)
later("[random hijack]", ...)
end
print("hello")
an you get:
[evil hijack] [random hijack] hello
while the second mod loads first, overwritten vanilla file would be executed before mod files are
oh ye i forgot about this
really dont wanna do this though tbh
cuz then i overwrite whole file yknow
yeah, sure. But that's about all you can do afaik. The file I chose for the example contains only 2 lines of code, so if you use that or something similar, then chances are you won't need to worry about maintaining it. You only need an entry point, after all
What typa mods you thinking
Maps, models, additional features
Like i can do some shi in blender but if its goes to coding im like little kitty on Metallica concert
do you know any lua?
I just was chopping zombies and like ,,Hey, what if i could see how damaged they are"
nope
Well you'd need to learn how to program in Lua
afaik all zomboid mods with scripts are programmed in Lua
I learned Lua from years of development on Roblox, so you could try that as a base
okay thanks, i heard lua is't too hard
Lua is very easy, its kinda like this
if thisConditional == true then
-- additional code goes here if conditional proves true
end
pseudo code
How do i shorten animation so character can get up more quickly?
Different ways to do that, depends how you're triggering all of this in the first place
Also that's really cool 
is there any updated guide how to convert .x files to fbx or some other format, edit animation and then convert back to .x ?
thank you.
to a modder
damn char limit 
--- Example of how to register modifiers for the Unified Carry Weight Framework.
--- 1. Code is expected to be ran pn the client so your lua file gotta be in client folder as well.
--- 2. require the main framework lua file
require("UnifiedCarryWeightFramework")
--- You register your modifiers by calling the registration functions and passing in a definition table. The definition table must have an id field and a resolve function. The resolve function will be called with a context table that contains the player object and any other relevant information you may need to determine the modifier's effect. The resolve function should return a table with add and/or mult fields to indicate how much to add or multiply the carry weight by, or return nil if the modifier should not apply.
--- Example of a base modifier that adds to the base carry weight based on a sandbox setting
UnifiedCarryWeightFramework.registerBaseModifier({
id = "SomeMod.SandboxSettingForBaseWeight", -- id is required. Try making it unique, for example YourMod.ModifierName, to avoid conflicts with other mods.
resolve = function(ctx)
--- 8 is default game base weight
if SandboxVars.SomeMod.SandboxSettingForBaseWeight ~= 8 then
return {
add = SandboxVars.SomeMod.SandboxSettingForBaseWeight - 8,
}
end
return nil
end,
})
UnifiedCarryWeightFramework.registerMaxModifier({
id = "SomeMod.AthleticGivesCarryWeight",
resolve = function(ctx)
local player = ctx.player -- context will always have getPlayer() object so you should access it from there.
if player:HasTrait(CharacterTrait.ATHLETIC) then
return {
mult = 1.5,
}
end
return nil
end,
})
-- Framework by default calculates carry weight on character load and every hour afterwards. But what happens if you need to recalculate carry weight from your side? You can just call the recomputeAll function and pass in the player object, and it will recalculate carry weight applying all modifiers in the correct order.
-- For example, for sandbox setting you dont need to do anything, since adding modifier that depends on sandbox setting and calling recomputeAll on character load is enough
-- But lets say you want to give player extra 0.25 base weight per level of strength. So you want to hook onto LevelPerk for example. You gotta register recalculations on levelup.
UnifiedCarryWeightFramework.registerBaseModifier({
id = "SomeMod.ExtraCarryWeightPerPointOfStrength",
resolve = function(ctx)
local player = ctx.player
local strengthLevel = player:getPerkLevel(Perks.Strength)
return {
add = strengthLevel * 0.25,
}
end,
})
local function recomputeCarryWeight_LevelPerk(character, perk, level, increased)
-- DO NOT put your logic here, all you have to do is call recomputeAll in here. The logic deciding how much to add or multiply should be in the resolve function of the modifier, and the framework will take care of calling it and applying the modifiers in the correct order.
if character then
UnifiedCarryWeightFramework.recomputeAll(character)
end
end
Events.LevelPerk.Remove(recomputeCarryWeight_LevelPerk)
Events.LevelPerk.Add(recomputeCarryWeight_LevelPerk)
-- That's all you have to do.
-- !!!!!!!! VERY IMPORTANT !!!!!!!!!
-- You NEED to follow the convention of calling the function that fires on event recomputeCarryWeight_EVENTNAME. So if you want to recalculate carry weight for example on clothes change, it'd be called recomputeCarryWeight_OnClothingUpdated
-- Why? Because if some other mod also wants to do it, we don't want to run framework code twice, so thats why you also have to do this:
-- Events.LevelPerk.Remove(recomputeCarryWeight_LevelPerk)
-- Events.LevelPerk.Add(recomputeCarryWeight_LevelPerk)
-- First you unregister the event that might or might not be there. If it is there, you remove it so the framework code is not ran twice, and then you add your own function that calls recomputeAll, which will run the framework code once and apply all modifiers in the correct order. If you don't follow this convention, you might end up with carry weight being recalculated multiple times on the same event, which is inefficient. This is also why you don't put your logic for calculating how much to add or multiply in the event function, but rather in the resolve function of the modifier. Because it's meant to be unregistered by other mod and registered again.
-- Last example: say you have a mod that has a trait that gives player extra carry weight and they can get the trait midgame. Waiting 1h is not great, and increasing the frequency of recalculations is not needed. In this case you can just add modifier and call recomputeAll when the trait is added to the player.
UnifiedCarryWeightFramework.registerMaxModifier({
id = "SomeMod.YourTraitModifier",
resolve = function(ctx)
local player = ctx.player -- context will always have getPlayer() object so you should access it from there.
if player:HasTrait(YourRegistry.YourTrait) then
return {
add = 1,
mult = 1.5,
}
end
return nil
end,
})
local function yourFunctionThatAddsTrait(player)
if some_condition then
player:getCharacterTraits():add(YourRegistry.YourTrait)
UnifiedCarryWeightFramework.recomputeAll(player)
end
end
is this file understandable to a modder?
or should I add some details?
on how to use a framework
Have your mod set a counter to zero and attach a function to OnTick (or PlayerUpdate, or whatever event makes sense)
That function increments the counter, sees if it reaches the desired value, and if so it does the delayed thing and removes itself from the OnTick event.
(With a bit more work being needed if this is something that can happen twice overlapping )
Ye I thought about it but really didnt wanna do that
Turns out I can just call Update on player
^

I try to avoid onTick events like a plague
regardless if my logic is light or not
Just dont like the idea of running code every tick when It's not crucial
this is my only OnTick function and I still feel bad about it 
local function painTolerance()
local player = getPlayer()
local PainTolerance = player:hasTrait(ETWTraitsRegistry.PAIN_TOLERANCE)
local stats = player:getStats()
local pain = stats:get(CharacterStat.PAIN)
if PainTolerance and pain > SBvars.PainToleranceThreshold then
stats:set(CharacterStat.PAIN, SBvars.PainToleranceThreshold)
end
end
I think some animations are still set to "hold a shovel prop in right hand" from B41 when there was only one item for each type. Other animations were updated to "when you find an item that satisfies hasTag(base:digahole) make a note of that and use that item as a prop"
Running x = x +1; if x < 5 then return for a few calls is fine. The big problem is if you put anything heavy in there, especially if you do it constantly instead of just for the fraction of a second you need to do it.
True
But it's good to hesitate and think before using it, because I've seen some mods really abuse it.
For context, this is the howto guide for a carry capacity modifying API?
If so, that makes sense to me. I will suggest you have the API (well, more of a library, but the terms are rather smooshed together in LUA modding) end with return UnifiedCarryWeightFramework so it can either be called like your example as a global or use the better isolating syntax:
local weightAPI = require("UnifiedCarryWeightFramework")
weightAPI.registerBaseModifier(...
Does that need to do the logic every tick, or can it just check every X ticks with a simple counter? You could also store the results of player:hasTrait in a lua variable and skip that API call, and just recheck on game start/character load. And finally, it can return as soon as you know the character does not have PainTolerance and skip the getstats and get(pain) calls when you know they won't be needed.
I'd also suggest making it trigger on PlayerUpdate rather than OnTick; that way you will know the player without looking it up (and if the player is not updated in a tick the function is skipped)
dude, i am developing a mod, the thing is, o made it's code to multiplayer, ok... but it only runs the cliend side and not the server side
meaning i cannot do the conextion between client/server
It's a howto, the framework itself is a different file that returns itself
Multiplayer is a bit messy.... first question is what does the mod do and what triggers it doing something?
You might need to move the code and add some conditionals, or you might need to make an event system for communication.
I know, but the suggestion was a way to let it work with "proper" lua coding practices which doen't stop you from using it the way you describe as well.
Ah
bro. it is basically this mod https://steamcommunity.com/sharedfiles/filedetails/?id=3675915922
i separated the code for the menu
so, it basically bring only the menu for the game... ok
so, i tried save the menu information like i do in single player, but ported for the multiplayer
separated what needed to be in client and server
OK
when i am in single player
the conextion between server and client happens as expected
in multiplayer in the other hand
no
only the client, i added prints to the log
cliend and server
to check
the server never answer back in multiplayer
only the client
i checked the server log
there is a weird error and the server never loads the mod, only the client
i checked everything i should
not even a fucking print from the server works
is there anything i am missing?
i wasted a week i could be working to fix stuff on my mod to make the multiplayer, and yet i am stuck with a simple error that doesn't allow the client/server connection
this is driving me crazy
First of all, I don;t know what the "Necroa Virus" is so I don't know what this mod does... but for this specific issue:
What menu is this? Are you talking about part of the settings (options -> mods, sandbox, etc) or an in-game menu that does stuff?
no, it is a menu that i made up that saves information in the world data. let me send a picture
see that menu right there, those are icons that can be turn on and off. in the single player, i made a sistem that saves them when i left the world and go back, ok. in multiplayer i made a code that is correct when you campare with other mods that have multiplayer. ok, but the server never really reads it so it basically never saves, and yes, it is in server, not in client
If you have added an in-game menu then it will be running on the client, so how are you telling the server what it needs to know? In single player everything is smooshed together, but in multiplayer (including locally hosted) you need to actually send information to the server. isClient() is true only if the game is a client in multiplayer (it's false for single player) so expect code like:
if not isClient() then
<whatever you do in single player>
else then
local args = {}
<fill args with the changed menu settings using on lua primatives, no fancy objects>
sendClientCommand("Necroa", "menuUpdated", args)
end
Then on the server, you handle that client command:
Necroa_OnClientCommand = function(module, command, player, args)
if module == "Necroa" then
if command == "menuUpdated"
<do the needful>
end
end
Events.OnClientCommand.Add(Necroa_OnClientCommand)
But the menu has to run on the client so the player can see it and interact with it. Then the results need to go to the server to get saved to the world.
(Note that the client/shared/server folders are misleading and don't actually control where code runs.)
that is right, but the issue beggins when i cannot make the server do something as simple as print something
see this cute "print("[NecroaMod] SERVER SCRIPT LOADED")
if print then
print("[NecroaMod] ========== NecroaMod_Server.lua CARREGOU (servidor) ==========")
end"
i never see it in game
i do see it in single player
NEVER in multiplayer
Where are you looking for the output?
console
in game console is for the client. console.txt is for the client. Look in coop-console.txt
It's a text file, it doesn;t have a color ๐
c:\users\<you>\Zomboid\coop-console.txt
console.txt is all you need for single player, but for multiplayer testing using "Host game" you want to look at coop-console.txt as well
If you're using a dedicated server for testing, I'm not sure where the equivilent output goes.
yes, i host my game... so wait, the server never answer on that console? the one that you uses ' to open?
no fucking way
that explains so dam much
Yeah, the in-game lua console is client only when using hosted.



