#mod_development
1 messages · Page 281 of 1
you can give foods an OnEat, it's how cigarettes are implemented
I'd be suprised if there was no "OnConsume" event you could add a "if item==foo then <do stuff> function to.
Just need to find it.
...by looking one line up, where albion mention OnEat 😂
you COULD make your own timed action
you'd think there'd be a bunch of useful events... but I basically had to add AcceptItemFunction onto an isoObject container by running the function to do it through onCreate on the build recipe
and felt so dumb for spending almost an entire day looking for a way to run it in the same lua script
can we access static objects and give them new properties? Like adding a fluidcontainer to a Barrel?
yes
any examples I could look at?
yes
You mean like container items can have an accept fucntion defined, but for an in-world object?
you could basically retrofit what I was whinging about not letting me bypass container capacity earlier into a function to change tiledefs
hmmm java
Was that in B42? I suspect there might be one now there are feeding troughs. Not that I've tried to put non-food in them.
yes. have it working too
was from a mod from b41
and the only example I could find of someone doing it
one sec
I can't think of any world containers in B41 that would restrict what you can put in.
last two functions are the ones to look at
not the commented garbage
D:
feew wake up and tell me the rest of your secrets
doesn't matter though. that example of it I found in the script showed applying AcceptItemFunction to a sprite container
and it works
so I'm not going to question why it works, because then it might decide not to
I see "Massive Wood Container" and immediately feel like making an inappropriate joke about storing stuff in underware.
trying to make mass log/branch/twig storage... as soon as I figure out the rest of this to bypass that 100 cap restriction I can make a couple variants for planks/stones/bricks/etc too.
or yknow
Probably because I just spent a few hours deciding that making an equipped item not of type container usable as storage would never work because of teh way containerItems and items are different on the java side
if TIS would just TRUST US and let us brick our own games by setting a container to a bajillion storage cap
hahahaha
then I wouldn't have to suffer through trying to bypass it
It's a wierd and arbitrarily low amount
but either way, it's more of an MP mod. purpose is to let players actually store those heavy things you need tons of for building/crafting/etc without just dumping them all over the floor or having to give them negative weight items to abuse
and without them having to dedicate 90% of their safehouse to storage
I assume that it's a limit in the java side, not the lua? I've not gone looking, but that is my suspicion.
it's java side
and the variables are private ints
java edit will still bypass it, but eh.
I've learned enough C# reflection that private variables are no longer private.
...but not for java
C is way more locked down than java. you can actually decompile java almost any time you want.
or at least, way easier than C
Traveller's Rest was a fun modding challenge because something they used to help build it means half the stuff in the code is autogenerated with random names that change every build.
So you have to hang all your changes off the bits with real names and get creative with reflection to get the right randomly named thing
problem is you can't really change the java through the lua here... though if you wanted to go full evil genius and manage to make your own lua code that could set a container's capacity and bypass the java function to do it entirely... please do share with the rest of the class.
hahahhhahaa
that sounds like a way to destroy every container in the world at once.
sounds likr the minecraft obfuscated mcp mappings
tbh, lotta games obfuscate their variables and functions
java also has reflection, but without a java modding framework (and there aren't really any that are popular, mainly due to fears of unmoderated execution) you're beholden to whatever the devs expose to Lua
guys, they change even OnCanPerform? is there another way to do it?
There's no way it was deliberate - a lot of it used real names, it felt more like they used a higher level framework and it built compiler optimized versions of things.
just be thankful you could see anything at all in a C program, man...
C#, big difference for modding.
every time I feel like messing with a C program, everything is in bins, even down to the models, textures and audio
ah
I think arma is on C
C/C++, yeah, with a custom scripting language iirc
dear lord!
most games (Zomboid included) use at least some C/C++
i remember editing a lot of hpp files for arma lol
guys, they change even OnCanPerform? is there another way to do it?
can you... describe what it did? I'm not really famailar with that one
the question is, can i use OnCanPerform into recipes?
from the vanilla files seems commented
uh... yeah, what effect does it achieve?
function Recipe.OnCanPerform.TestCook(recipe, playerObj)
local SkillLevel = playerObj:getPerkLevel(Perks.Cooking)
-- Controlla se la skill è inferiore a 1
return SkillLevel < 1
end
check if the level of a skill is less than 1
so... it's the same as SkillRequired?
or how is it different from SkillRequired?
like in:
craftRecipe SewPillow
{
timedAction = SewingCloth,
Time = 200,
SkillRequired = Tailoring:1,
xpAward = Tailoring:5,
AllowBatchCraft = False,
Tags = AnySurfaceCraft,
category = Tailoring,
inputs
{
item 1 tags[Scissors] mode:keep,
item 1 tags[SewingNeedle] mode:keep,
item 1 [Base.FabricRoll_Cotton],
item 1 [Base.Thread],
item 100 [Base.ChickenFeather;Base.TurkeyFeather],
}
outputs
{
item 1 Base.Pillow_Crafted,
}
}
SkillRequired is also a very common b41 recipe element, it's not just a b42 thing
requiring you to have the levels listed in it to do the recipe
though b41 is slightly different in formatting
SkillRequired : MetalWelding=2,
Does anyone know if the Battery drain of the cars is an OnTick event or its an EveryTenMinutes event?
i'm not asking that you have at least 1 in the skill as skillrequired, but i'm asking that you DON'T have 1 in that skill
OH
so i need to put SkillRequired:0,
no if you're trying to restrict recipes to not having OVER a level then...
fuck, only example I can think of would maybe be building wood/metal walls... crates...
even then, they probably handle that differently
wait, it looks like they straight up got rid of scaling quality building in b42...
tf
a b41 media folder might still have examples of how they did that though
and it might be applicable to recipes... otherwise you're gonna have to write lua to like... "on character levelup, remove recipe from character" "on character creation, give recipe" and make it require recipe to achieve that
those are definitely events you can hook a function into though, so 100% doable
ok ty
i don't know the first thing about how car mods work, so i wouldn't know where to look in base-game files, but im sorry for burying your question if someone wants to look at this.
Hey no worries I'm just firing off into the void in case someone knows. I've looked through the events manager and Java back end of it and the VehicleCommands for the server I'll keep combing
Not quite making a mod, but I'm trying to see if I can get a few old ones from B41 working on B42, but I've noticed some of them seem to work fine but cause errors in other areas, the biggest example I've found so far is a car's dashboard not showing up, was wondering if there's a fix for this? I think it might have something to do with crafting, but idk if that's just me grasping at straws, can post error logs if I sound like an idiot trying to explain this
you need to remove b41 style recipes or the cars bug out
Gotcha, I'll try and see if I can get rid of anything with crafting stuff. I found a text file in media/scripts that held a bunch of crafting stuff, are there any lua files that have to do with crafting as well?
most recipes will use some lua functions but you just need to remove the stuff in scripts to fix the car thing
what exactly is a thumpable?
a world object that can be hit, damaged and broken
ah ok. thanks
okay real talk
between thumpable, isoobject, sprite, tile, etc... what the heck are we actually supposed to call them?
worked perfectly, thanks 
@opaque ocean accidentally made barrels have the containers of counters
@opaque ocean it is starting to work.
LOG : Lua f:0, t:1735118444262> [MassiveWoodMain] OnLoadedTileDefinitions event triggered.
LOG : Lua f:0, t:1735118444262> [MassiveWoodMain] Loading fluid tiles...
LOG : Lua f:0, t:1735118444262> [MassiveWoodMain] Setting properties for tile: industry_01_23
hell yeah
just uh... dont use massivewoodmain or you're gonna conflict with me stuff down the line, lmao
though I'm prob renaming every function, variable, etc later anyways once it's working
i think.
they are tile objects
- they have sprites (the image from spritesheet)
- they can be thumpables(type of isoobject that have certain properties that other objects dont such as health)
- they are isoobjects
Hello everyone! I'm trying to revive an old backpack mod and noticed that in B42, for some reason unknown to me, the stats in the game don't match the ones in the script. Has anyone encountered a similar issue?
I also checked some mods from other creators who had backpacks, and the same issue occurs there. The capacity doesn’t match the script and doesn’t go above 100.
containers are capped at 100 right now for some reason
So I’m not losing my mind after all! 😄 Thanks! I was starting to think I had some inexplicable issues, but it’s just B42...
Actually 50 for Inventory Items (usually backpacks), 100 for tile objects and 1000 for car parts containers.
#mod_development message
Hello guys, I am triying from yesterday evening how to get a free "square" or "tile" from a room ? Have the feeling that the room has to be rendered first before getting a free/valid square, have some already tried to use these properties ?
Oh god i hope this is changed, specially for tile objects
Okay, I have another question: does anyone know how to make weapon placement on the back display the same way as with the Duffelbag?
Is there a thing in B42 for lua to trigger events with more than 4 required object parameters ? (like triggerEvent("OnWeaponHitXp") that requires 5 of them) LuaManager exposes only triggerEvent up to 4 parameters in addition to the Event string
I assume it's the AttachmentReplacement = Bag parameter, but I don’t quite understand what value needs to be used.
UPD: Found it! You just need to remove this parameter entirely.
Does anyone actually make mods for B42 or are everyone just transfering their old B41 mods to 42
pack them all into one table?
vanilla does not unpack on the other side
I'll probably call LuaEventManager directly
sorry, I thought this was for custom event and you'd pull anything you want
does it count as porting if it was unreleased before b42 came out lol
i guess
Some Bags have this line. It makes it so it replaces Back Weapon attachment position to one specified here. Maybe you could create new Attachment point and its name put here and see if it work? Working with attachment points is rather confusing, just a headsup.
Its just need to remove this parameter and that's all.
From what i see right now Dufflebags do not have this line.
I'm trying to make one or two and learn stuff at the same time
Good luck! I would never have intelligence to make one so i just leave it to other people
I am trying to port someone's mod to b42 and they didn't respond if I can post it so I am in an weird situation
Any idea how can I programatically show/hide the Crafting UI?
Any idea if they're any changes with the health Ui?
Feel free to upvote
#1318920979581501502 message
Hello, I'm trying to upload a mod for the b42 but when I want to do it it doesn't recognize the mod.info file, any suggestions?
Someone asked me if I created the "42" and "common" folders but still when I want to create the mod from the game it does not recognize the mod.info, it is not urgent but it would help me to port more outdated mods to 42
Sent an picture with the folder structure
What version of Lua is PZ running? I'm gettting " '=' expected near continue" error on a goto statement so I'm assuming its an older version without goto statements?
I would love to help but I doubt Lua is like C#
All good I'm reading up on it. Looks to be the case
I think I will try make an trait rebalance mod. I don't know if it's easy tho
Honestly Im partial to the way CDDA just made points a legacy feature and lets you freeform make your characters without trying to balance. Hard to roleplay yourself if you're ADHD and a tiny bit good at everything lol
Hmm
I am an beginner lol
Ahh gotchyea, well I've never messed around with the traits but I'm sure they have .txt files you can modify to change their point requirements. Not sure where you edit the total point pool
No like add functionality to them
Like you can lose smoker if you don't smoke x amount of days
Ahhh that'd be cool.
https://zomboid-javadoc.com/41.65/zombie/characters/IsoPlayer.html
https://zomboid-javadoc.com/41.65/zombie/characters/IsoGameCharacter.CharacterTraits.html
Gotta find a way to access this stuff from the Lua side probably
Javadoc Project Zomboid Modding API declaration: package: zombie.characters, class: IsoPlayer
Javadoc Project Zomboid Modding API declaration: package: zombie.characters, class: IsoGameCharacter, class: CharacterTraits
Is there a way to modify/delete cached zombies?
5.1ish
as is pretty common with lua it's not exactly on spec
why are you using javadocs from 41.65? 😅
if you're developing for b41 the official javadocs are newer than that and have more info https://projectzomboid.com/modding/ and if you're developing for b42 i'm hosting unofficial ones here https://demiurgequantified.github.io/ProjectZomboidJavaDocs/
No Idea it was the first set of docs I found on google lol. I'll check out the unofficial ones thanks!
Has anyone seen the script for the ALICE Belt and Suspenders? I want to check how the vanilla attachment for the angled flashlight is implemented.
whats the difference albion?
my ones are b42, the official ones are b41
damn thats useful
Im doing b42, and thse are all lua exposed?
no, but i am thinking about ways to mark things as exposed or not
any methods and constructors you can see are exposed if the class is exposed, but i don't have anything to show if the class is exposed yet
Anything in the LuaManager.java file with LuaMethod annotation right? So could parse that I suppose
nah, that's just for the global lua api, the rest are automatically exposed by class using Exposer.setExposed
i recently updated umbrella to parse that for building java stubs, but the javadocs have a totally different system - main thing really would be working out how the site generation actually works and where i can insert this information (and how to actually display it in a way that's clear)
What about adding option to middle click search results on the javaDoc?
i'll try and look into that too!
yo do it using AttachmentsProvided
e.g. AttachmentsProvided = WebbingRight
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\scripts\clothing\clothing_bags.txt
try looking in here
Thx ❤️
where are my downloaded project zomboid mods
Steam\steamapps\workshop\content\108600
where i can find items icons?
steamapps\common\ProjectZomboid\media\textures
are their any tutorials for how to get a mod set up for build 42
cause I'm looking at other mods that already exist for 42 and they just make a "42" folder and toss everything in that
but it didn't work for my stuff
check pins
I'm so dumb tysm
there too, lol theres 2 guides right away
@hidden compass
Order most definitely has nothing to do with the names I believe. It might be linked to how the game iterates through every recipes to add them, could also be linked to the order in the recipe file
i would not be surprised if they were just in the order of definition
there wouldn't be any reason i can think of for it to intentionally sort them
Yeah
Was messing around editing some genomes of animals (via the ingame debug) and... i think faster growth rates led to infinite animals spawned when an animal grows from juvenile to mature (which can be the reason of those rabbit/chicken bombs, as the animal seems to try to spawn itself in the mature phase... infinitely) https://www.youtube.com/watch?v=jbzvE5AnscU
hi guys, what's the error here?
craftRecipe MakePotOfSap
{
timedAction = Making,
time = 200,
tags = InHandCraft,
skillRequired = PlantScavenging:4;Cooking:4,
xpAward = Cooking:3,
category = Herbalist,
inputs
{
item 8 [Herbalist.Sap],
item 1 [Base.Pot] mode:destroy,
item 1 tags[WoodenStick;TreeBranch;Spoon] mode:keep,
},
outputs
{
item 1 Herbalist.PotofSapUnboiled,
}
}
or here
craftRecipe MakeRiceMilk
{
timedAction = Making,
time = 80,
tags = InHandCraft;Campfire,
skillRequired = Cooking:4,
xpAward = Cooking:3,
category = Herbalist,
inputs
{
item 1 [Base.WaterSaucepanRice],
item 1 [Base.Sheet],
item 1 tags[SaltPacket],
item 1 [Base.Spoon] mode:keep,
},
outputs
{
item 1 Herbalist.RiceMilk,
}
}
i can't figure it out
Onlything I could think would be the category or the items?
is this valid item id? Herbalist.PotofSapUnboiled and Herbalist.Sap
The rest of the recipe seem fine
Herbalist.RiceMilk
item 1 tags[SaltPacket],
and i dont think salt packet is considered as tag (is this valid too tho)
yes
where i can check all the tags?
I did a search in the item folder for base PZ and SaltPacket doesn't come up
i have no idea if theres a documentation about it but you can see it at C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\scripts\recipes
Salt is a valid tag however
just look at some examples there
Tags come from the items Tags = foo;bar, line
yea in the wiki some of the items he put doesnt exist? maybe its a modded item he did?
Well the Herbalist tag is from their mod, I assumming they are trying to update to the b42 crafting system
I am trying to port The Only Cure mod to b42, and I am tested if it works and I get an error every second that's passed in game, also when I get bit the "exercise" button just vanishes and I can't do amputate the limb ;d.... How can I find what's wrong lmao
Anyone have any idea what changed and what should I look into?
I'd takea look at the console.txt or trying running in -debug mode since it will break when an error pops for you to look at it easier
console.txt?
%UserProfile%\Zomboid\console.txt assuming windows
WARN : General f:0, t:1735150977290> TextManager.Init > font "MediumNew" not found in fonts.txt
WARN : General f:0, t:1735150977290> TextManager.Init > font "AutoNormSmall" not found in fonts.txt
WARN : General f:0, t:1735150977291> TextManager.Init > font "AutoNormMedium" not found in fonts.txt
WARN : General f:0, t:1735150977291> TextManager.Init > font "AutoNormLarge" not found in fonts.txt
WARN : General f:0, t:1735150977305> TextManager.Init > font "DebugConsole" not found in fonts.txt
I found it and I see an warning for this
I think it has something to do with "exercise" panel vanishing
I found more errors
Anyone know if the tag for saws has changed?
Were rooms in B41 random generated?
The storytelling with the zombies and items were the only thing that was randomized, as far as I know.
Including those affected by survivor and burnt home randomizers
anybody know why this, and only this item is not having info, no texture and has a random hue/tint allowed when the xml doesnt allow it?
Its literally item that you're not supposed to have...
Its for displaying damage on your character?
its a cosmetic "clothing" item
its like equiping a shirt
Yes, but you're not supposed to be able to interact with that item without debug ect.
oh yes, not implemented recipes yet
No, It literally works how its supposed to. The moment you get injured game equips it on you so when you look at your plater model you can actually see that the injury is there.
Its just the way they went with it.
what im doing works with all other items
let me explain what i've done
i've added a new set of clothing items, scars from scratches. these have the textures of the ingame scratches but with a color hue. these do not take into account damage, they are like shirts or pants.
Okay. I thought you force spawned item that is for displaying scars/dmg
actual scratches override these clothes
nono, i added new ones
Okay. But it gets overriden. Let me guess. You copied whole itemscript from them and pasted for your clothing item, meaning that it uses same BodyLocation, right?
same body location, wound, yes. but they all have different names and clothing item
Thats why its overriden because it equips vanila injury on place, where you have your item already.
nono, i forced these scratches
thats a good thing
scars would open up
my issue is that a specific scratch isnt loading
a specific clothing item, abdomen male
the display item is "the same" as the vanilla wound but these dont have a display item in vanilla
so it doesnt matter if they are the same
Maybe its there but isn't actually used?
Devs tend to add stuff that are not used/leftover. In b41 some things straight up did not work/poped error every time you loaded up game.
Those screenshots are really hard to read. So the issue is that when you hover over that item, it gives errors?
yes and when you equip it nothing happens
also the icon's color randomly changes
Might i ask, why do you have separate wound for male and female if they're both usually use same textures is xml file states "Basetextures"
scratches actually use different files, for example the chest scratch in a male would be in the female's model bra
thats wearing a male chest scratch
Install nude mod 👍 .
But in fair seriousnes. I don't see anything wrong from what you posted.
But are you using vanila clothing item or you make your own clothingitem.xml file with them?
i made my own xml file for all of them
and textures
and GUID
Because you want them to have slightly diffrent texture?
yes, a scar texture
my idea is that people craft and wear their scars after healing wounds
ideally i would add more scars that dont look like vanilla
because theyre kinda underwhelming
Yeah. From what i see there should be nothing wrong, Maybe try new diffrent guids?
yeah did that twice, maybe i got really unlucky
let me see
both items that arent working are next to eachother in the fileguidtable, interesting...
still doesnt work
anybody else may know what the issue is?
@bronze yoke
sorry, i have no idea
the error indicates that the clothing item can't be read but i don't really see why
is it possible to compare java strings and lua strings with == directly? or do i need to convert it
java strings are lua strings
ok thx
i am so tempted to give up
i moved the item ids and recipes of the bats over to my SOMW tweak because idk, maybe it'll work cleaner there
still nothing
I'm tired of waiting for animal mods. Anyone know how to decrypt and encrypt the .class files? Is it a fairly simple process or is there a specific encryption technique it uses
Use a java decompiler
shits either broken or not working every step of the way
I already know how to decrypt it, but not encrypt. Is it the same for all .class files or are there different methods
it's not 'encryption' it's compilation
you can compile class files with the java sdk, most ides that support java can do it in-ide too
if you're compiling a single file you'll need a jar of the rest of the game to compile against, plus its dependencies
apparently the method people used primarily was a pain in the ass, but wouldn't this bypass recompiling everything?
this sounds way more annoying
way more annoying, but I don't think the game comes with a jar file for the entire game lol
the bandits mod code insinuates they're actually zombies in disguise somehow. maybe I'll try to be lazier and find a way to do the same thing with animals. no idea if that's possible
just make one
jar files are literally renamed zip files lol
Would renaming the entire game folder .jar actually work?
i've always separated out all the non-java stuff for file size and processing time concerns but that's how i make my jars
just grab the java stuff, put it in a zip, rename to .jar
alright
im putting it in its own folder now
forget attaching it to a tweak for ease of updating, whole new mod just for backporting bats
Alright. Just to clarify, the bytecode shit won't screw up if I do it that way will it? I don't want to make the people that play my mod have to replace every file
Just the modified ones
you don't need to do any weird bytecode editing for this, i don't really know what that guide is talking about
oh i misread it, it's basically telling you to check your recompile to see if the decompile is actually perfect
and to fix it manually if not
so the recipes show up
items dont though
progress!
i can even craft using them
just cant pull anything
alright so
i'm struggling to get the items to show up at all in my mod to add some b42 bats to b41
is there like, anything iffy there?
actually, here, have all the files
ah, i see now. i forgot to correct the modules from the move
Hi guys, I would like to add bow to the game and I am new to this. I created a model in Blender and added texture, script and sound in it. It is currently using shotgun animations/ammo etc but first I want to see it in the game.
I can spawn in the bow and it shows up the bow icon. I can equip it and rack shotgun ammo and kill zombies the issue is, bow does not show in the game world. I believe I messed up the blender/texture part since I have never used it. I was following this tutorial but it is pretty old https://www.youtube.com/watch?v=2M2fWLBLaX8&t=1304s. Any help would be appreciated 🙂
The mod content is here https://file.io/S3J06ffcAMQc
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...
you mean like placing it in the world?
Placing in the world also it does not render in character's hand as well. It plays the shotgun animation though. To see if the issue is with my Bow.fbx, i will change it with a working model to see if I messed up my model
make sure that your .txt file that adds the bow item has a line to indicate world render and textures
Yep, I changed it to assualt rifle fbx and named it Bow.fbx and it now renders in my character's hand. I messed up it in Blender :/ Thank you for the reply. I will see if I can fix it
add .xml to the ends of the path file
Ok, my current issue is driving me bonkers lol.
I have created a script that fires on the event OnFillWorldObjectContextMenu
it scans world objects that are containers and checks for a specific item. If that item exists, it adds a context menu option.
This part is working, but I'm trying to pass 2 references to the script called by the context menu. One to the item found, and one to the container it is in.
But no matter what I do, the variables are out of order or nil. Sometimes I get some of them to pass, sometimes not.
Is there any good writeups on context menus?
you've very likely stumbled into addOption's stupid argument order
addOption("Option Name", arg1, function, arg2, arg3, ...)
yeah, literally everyone i've seen try to add a context menu reacts like that 😭
it really was that simple, THANK YOU 🫶
Yup, that was it. I'm commenting in my code right now to thank you. Hahahah.
I'm making this mods, This is a bug or i'm missing something ?
Maybe you need to be properly in front of it
Did you try to open it from the right side ?
Still doen'st work

Rejoining the game now it works, but the SOUTH side don't lol
Probably a bug right?
Sure, only my mod it's loaded
Thank you :)
Ok, now its time to venture into territory I have never touched before. Any advice on where to look for syntax dealing with map coordinates and distance?
I need to record where a specific ISO object is, and then check how far away the player is.
does anyone know why the weapon I created as a mod doesnt hit any targets at all? when aiming, the dot doesnt turn red and nothing can be hit, even though the weapon uses the msr700 rifle script
Just a possibility, did you increase your aiming? B42's aiming is sus af at the moment.
yeah its at level 10
now I noticed that the muzzle flash appears in a random ass spot far away from the character
is this the correct way to get the Crafting Recipe In B42? getScriptManager():getCraftRecipe(RecipeName_)
should be
Found a source, Bobber.lua has a bunch of distance code.
oh wow after two days of trying to figuring out, that seems to finally work
is there a way to erase or hide the Recipe?
ive been looking for the same thing honestly, (I just started like 2 days ago) B41 had setIsHidden to hide from craft menu but from what im seeing on javadocs craftrecipes doesnt have this function anymore
or override argument to replace a vanilla recipe
Did you add the south facing sprite to the spriteconfig in the script for your sewing machine?
Sure
apparently the game doen'st update in real-time the UI for workstations.
When I re-enter the save I can access it, but if I change the side I can't.
So I have to go back in again
If you notice that no built workstation can be moved
anyone figured out a way to disable new crosshair completely?
if I pass a reference to a world object into the modData for the player, and then restart the game, is that reference lost? Seems to be the behavior, but its possible I'm storing the reference wrong.
yeah
Ok, bummer lol.
what are the proper terms for an onCreate function? (b42)
not sure if you mean a recipe or an item but there's documentation for either here https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md
albion would you know the proper way to hide / overwrite a recipe in b42?
not yet unfortunately
i haven't seen anything like an intentional provided way to do this but generally you can hack around that
or bug the devs to add a way to do that since it's very likely an oversight
The closest I've gotten is scuffing the recipe to require learning
Effectively making it unusable- but it still appears in the menu
The only way Ive really seen to replace recipes is to simply overwrite the whole recipes.txt file its in but thats not the best way
Wait - what happens if you reuse the same ID?
it uses your modded txt
Yeah
both appear in crafting menu
So they're not unique? 😐 Someone told me they were
I started modding 2 days ago so idk ¯_(ツ)_/¯
A large issue with hiding/obsoleting recipes in the past was due to them being able to share ID names
and they're in the same module?
base
Probably should have specified given how many things are named with "OnCreate," I was referring to the functions referenced to in item/recipe scripts, not general events
unless one is somehow derived from the others
This is the entire txt for my custom bread recipie
{
craftRecipe MakeBreadDough
{
timedAction = MixingBowl,
Time = 50,
NeedToBeLearn = True,
category = Cooking,
Tags = AnySurfaceCraft;Cooking,
xpAward = Cooking:10,
AutoLearn = Cooking:7,
inputs
{
item 1 tags[MixingUtensil] mode:keep flags[MayDegradeLight],
item 1 [Base.Bowl] mode:keep,
item 1 [Base.RollingPin] mode:keep flags[MayDegrade],
item 1 tags[Flour],
item 2 [Base.Salt],
item 1 [Base.Yeast;skittles.SourdoughStarterActive],
item 1 [*],
-fluid 1.0 [Water],
}
outputs
{
item 1 Base.BreadDough,
}
}
}```
in the base module
was thinking that would override it
but nope
there's information on callbacks further down the page
i've been meaning to split them into different pages since it's definitely confusing
Try Base
Modules might be case sensitive
if I skilled issued the captialzation im gonna lose it
they are yeah
what happens now? does it override?
yup
just the one with updated recipe
oh wait
why does it take double items
and double output
how exactly should I be linking my callback functions? I can't seem to get LuaManager to recognise them.
is it merging them 
they need to be in the global namespace by the name you give them
and default scope is global, correct?
yeah
That's how it worked with my changes too
I didn't expect this though
Seems like an override behavior should be default 😅
ohhh fuck i bet i know what's gone wrong
my item creation callback is on client side
and i bet it has to be defined server side
since that's where all the other stuff usually is with items
oh fuck me it's still not working
client/server location shouldn't matter for most cases (except when it affects load order) since we don't have multiplayer yet
singleplayer works as one single environment so everything is loaded
ah alr
Anyone see an issue with using os.time() as a "reasonably unique" id to tie a world object to modData?
I give the timestamp to the worldobjects modData, and store it in a table on the players modData. Then use it to check status later, and delete it when its done.
probably fine yeah
i forgot
a single fucking comma
in the item script
this whole time it was looking for a function with a completely seperate name but because there was a newline i didn't notice
yeah it works now godamnit lol
it's always a comma
Hey I added a recipe mod and now all the other mods are instantly ❌ and unable to be readded, is something with this code causing it?
craftRecipe MakeMakeshiftNeedle
{
timedAction = SewingCloth,
Time = 200,
AllowBatchCraft = False,
Tags = AnySurfaceCraft,
category = Tailoring,
inputs
{
item 1 [Base.Nails],
item 1 tags[Hammer] mode:keep,
}
outputs
{
item 1 Base.Needle,
}
}
/info lua
oh I wish I remembered the command
Oh wait wrong discord
print('Please use this. kthxbye');
Some of my professions have discriptions when you hover over and some dont, LiveStock Farmer is bugged and LongBlunt won't appear for blacksmith
I've credited it as rancher but not sure if that is right. I think the UI issue is to do with Trait Order, which could be wrong and LongBlunt not implementing could be wrong ID or wrong order. Any ideas??
Content: I made a profession mod that overwrites the defaults and half are working and half are not
nvm Fixed it
Hmm. Does modData on worldObjects get removed on restart?
what would be a good way to record preview videos for spawn selection?
Oh, no I just confirmed it stays. Weird.
https://steamcommunity.com/sharedfiles/filedetails/?id=3387563172 I had similar issues as well
are you using Profession Framework?
Nah, I was re-writing the source files
gotcha
I know there's extra options with that but I find it simpler just to work the MainCreationsMethods file
Just got to make sure your values are correct
and in alphabetical order
which is mentioned no where and I found by accident
I made mine like that too, but got a bit messy because I had to make duplicates of vanilla traits to add them as a free profession trait
wym a free profession trait
Like you don't have the default trait cost for the profession and set your own?
I don't understand
like axeman, you cant choose it in character creation, but its a free trait for lumberjack
make their own one like it im guessing
no, add others to my own professions
yeah this is how profession traits work
e.g. chef's free Cook trait is actually a separate trait entirely from the one you can pick
more traits just adds new traits
im duplicating vanilla traits, make them cost 0 and give them to some of my professions
then at the end, a function replaces my duplicate trait with the vanilla one so it retains its functions
if you publish your mod, let me know so I can add compatibility to mine if needed
can you just use the command: policeofficer:addFreeTrait("Brave");
for example
policeofficer:addFreeTrait("Axeman");
would work for that Ax-pert
yes, but it wouldnt be displayed in the character creation screen as a feature that profession has
anybody know if we can do subfolders inside textures/bodydmg or if the files have to be freballing in there?
same inside clothing/clothingItems
the new zombie spawns are all kinds of borked...
this happens when i do a subfolder
I wish I knew, Im looking at the javadocs for any indication, but for now, you can try both in subfolder, in base folder or in subfolder with inverted slash /
declaration: package: zombie.core.skinnedmodel.Texture, class: TextureManager
allright ill try that, thanks :)
Anyways, back to my rant with new zombie spawns. Look at this crap
adjustability
that location is exremely remote
secret zombie party
also in the remove cabins
Firecrackers! They are such a dope new item. Lite em, toss em, and just run around the building. Zeds wander into the forest, things are great.
smh didnt get the invite
yeah
the little kid in me wants to set them off around seasoned pvpers bases lmao
The cabins spawn mod is nearly unusable now 🙂
unless I modify it and add a function to wipe zombies in a radius
seems like a great fix!
Are the ff. methods I listed valid in B42?
Hunger: getHunger(), setHunger()
Thirst: getThirst(), setThirst()
Fatigue: getFatigue(), setFatigue()
Stress: getStress(), setStress()
Panic: getPanic(), setPanic()
Endurance: getEndurance(), setEndurance()
Boredom: getBoredomLevel(), setBoredomLevel()
Unhappiness: getUnhappynessLevel(), setUnhappynessLevel()
Sickness: getSicknessLevel(), setSicknessLevel()
Pain: getPain(), setPain()
Infection: getInfectionLevel(), setInfectionLevel()
Wetness: getWetness(), setWetness()
Temperature: getTemperature(), setTemperature()
or is it like:
getHungerLevel()
setHungerLevel()
declaration: package: zombie.characters, class: Stats
thanks!!
public float getHunger()
public void setHunger(float var1)
boredom seems different getIdleboredom()
ah theres 2 boredom
getBoredom()
I wonder whats the difference
yeah right im curious
if i remember right the boredom stuff in stats is deprecated
the real boredom is on bodydamage
declaration: package: zombie.characters.BodyDamage, class: BodyDamage
player:getBodyDamage():getBoredomLevel()
like this?
yeah
player:getBodyDamage():getBoredomLevel()
return boredomLevel
Ill ask a previous question again, incase new eyes are available, What would be a good way to record short videos like the ones in the spawn selection?
hey guys I have a local mod for my personal use but in b42 it does not show up. how should I update it? i did put it in 42 folder
check pinned messages
using more scale mod for drone view and then 360 vision mod
the rest is can be achieved with video editing
and also you will see some shadows on top buildings or behind buildings with the more scale mod, to remove that u need to walk around it because unvisited areas have shadows
idk how to remmove the shadows on roofs but if u can fly up there then thats all😆
you got me a great start already
ill work it out. My next mod upload will be an updated Cabin spawns mod with new spawns from the new portion of the map
it looked like this when unvisited (look at the orange building in front of police station)
but when you visit that area (it get removes when your character see it), it will look like this
Nice
I finished my mod for professions after 2 days of hard grind. Take a look xoxoxoxox
feels good eh?
It's still impossible to give zombies custom models right?
And animations?
Individual ones I mean. I had a mod for boss zombies, it ended up sucking because the default animation stretched the model I put on using a random clothing item
10000 zombies in a house twelve miles into the woods 🔥
anybody know where to find this loading zombie gif? i could only find a png
aaaah, so thats why, thanks!
anyone manage to make their own Print_Media yet? Like the fliers, photos, etc?
Any way to overwrite the grab context menu option on a custom item
someone did, theres a mod up already.
https://steamcommunity.com/sharedfiles/filedetails/?id=3391711960
and the person made a guide
https://steamcommunity.com/sharedfiles/filedetails/?id=3391857427
FANTASTIC, thank you!
Oh also dope! Ty. I clicked around, but is there an index page for the pzwiki for B42 mods?
i doubt it, it's never been great for modding and the whole wiki's pretty frazzled right now with b42
For sure.
Is the workshop acting silly for anyone else? Downloads seem to not be working and installing / uninstalling mods isn't working for me.
ive had to verify files a few timess the last few days so mods can actually dl and update
hello guys, was wondering how to deal with empty container now, if i need to use an emptywaterbottle in a recipe now that is deprecated how i need to put the item to be empty?
does it matter that the bottle needs to be empty? Can it be assumed that your character dumps it out before crafting?
Ok, I guess I'm off slightly in what I am looking for. I don't want to add a random flier to the pool of random fliers, I just want access to Read the thing -> Show the picture.
I might need to write the UI part myself.
add flags[IsEmpty] to the input
e.g.```
inputs {
item 1 [Base.PopBottle;Base.WaterBottle;Base.PopBottleRare] flags[IsEmpty],
}
you the best 🙂
which mods did you use? the ones in steam are gone https://steamcommunity.com/sharedfiles/filedetails/?id=3387892883&searchtext=
make sure to backup your zombie folder first because i didnt like how it zoom in and out😅
and for 360?
do we have a list of flags or i just look in recipe file?
ah good, thanks!
anyone get progress bars to work?
specifically on item tooltips
i can clearly see the method setProgress in the java code but it just doesnt want to work
it ends up looking like this
what happened to it -_-
is there a guide to uploading mods for 42. cant seem to get it to work. itll upload but unstable wont display it
check pinned messages
nvm im looking in pinned now
yeah lol ty
no idea, all i know is that it is no longer available lmao
i keep backups of mods. so not for me >:D
...why did I waste time looking for the definition of a pencil under** item_literature**, item_office and item_misc instead going straight to the obvious place: items_weapons_stab
pencil only run when
Might need a craft pencil from wood & charcoal recipe or it will quickly be an unarmed run.
well if anyone knows why this **function LSMRRInventoryUIListeners.MakeProgressBar(volume, layoutItem) local max = LSMRRMain.getProgressBarMax() if max < volume then max = volume end local progressValue = tonumber(string.format("%.2f", tostring(volume / max))) if math.abs(progressValue or 1.0) > 1.0 then progressValue = 1.0 end progressValue = 0.6 local color = ColorInfo.new(1,1,1,1) getCore():getBadHighlitedColor():interp(getCore():getGoodHighlitedColor(), progressValue, color); layoutItem:setProgress(progressValue, color:getR(), color:getG(), color:getB(), 1.0) end isnt working, lemme know
cuz i aint got a clue partner
progressbar just doesnt wanna render properly
label renders fine tho
had the best house I've found so far in the new map area pull something similar. spawned like 20 zombies in a bedroom, along with a police/criminal zombie set (of about a dozen total zombies) in the shed just next to it.
this one outside ekron
are mapping tools out yet
tbh, enjoyed it. scared the hell out of me and made me replace some windows, but ye
its crazy. Even if distribution is set in urban
also that house is going to cause some uh... bloodbaths in MP
even with pvp off, god knows everyone who joins after day 1 is going to drive there to see if it's available.
B42 has a lot of good base locatiosn comapred to B41
fireplace, antique oven, well, close enough to looting areas but not close enough to deal with looting areas spawns
a fishable pond/stream
feels like a modded safehouse
plus big garunteed basement
My single player game in Mauldraugh I'm in the Rusty Rifle - it's now a bar and motel around a central carpark with a pre-built high chainlink fence, chickens and a well across the road a minutes walk from forest foraging zones...
That is nice, especially for a rural location
they added a bunch of farmhouses with wells around ekron, but that map location is the best one I've found so far
worlded might still work? I know I saw an updated map mod on the workshop
they did nerf wells though, no longer clean water.
i found a nice log cabin it has a hand pump well
I'm working on a way to deal with the severe lack of crafting recipie scematics.
The BSToolScematics only spawn in blacksmith crates, survivor houses and very very rarely on welding whop shelves... that's just not feasible!
gotta just hitup the post offices instead of libraries now. post offices have become magazine heaven.
instead of skillbook heaven
gotta check if they might spawn inside mailbags on shelves
Not for these schematics. I've not looked up others scematic spawn points, but I went through trying to figure out where I shoudl go loot
the distribution table only puts BSToolsSchematics in CrateBlacksmithing, SafehouseBookShelf and WeldingWorkshopTools
because idk if distros are only for loose items of shelves or not... or how they're handling item spawns inside item containers in containers
Unless tehre is some random generated thing that is "any thing wih tag: scematic" or some such
there probably is, one day they added tags to items and used them in a few recipes in b41, now they're doing it everywhere.
tags are so good - item 1 tags[Write] mode:keep, instead of writing pencil or red pen or blue pen or black pen or red marker or black marker of multicolor pen...
And you can have an input -> output map,
they are, just feels like it's gonna be a pain to keep track of... but then again, so was keeping up with having to add every hammer/etc to a recipe manually.
so "put ammo in box" takes any ammo, and maps 9mm bullet -> box of 9mm bullets, shotgun shell -> box of shotgun shells etc.
different but equally likely to lead to losing track of stuff
I really prefer the tags, makes things more future proof if a modder adds a new type of pen or something.
i get that for ammo... but I don't like how they did that with remove tool head recipes or fixers/etc.
the tool head stuff is so confusing
because at first glace, I thought I could turn a woodaxe axe head into a sledgehammer
And some things you can't seperate, or you can seperate but not repair the head... Like a machete
You can stamp a machete out of sheet metal, they don't even need to be forged... but they're too good for repairs or something
yeah, I'm just now to a point in my save where I can start playing with the new crafting.
and already to the point where I hate that the only way to aquire clay is foraging
I got there this morning, whcih is when I found that it really sucks if you didn;t choose teh blacksmith profession for base recipies
I added a mod to give you a chance of clay on digging dirt into a bag
clay is a bottleneck and stupid to find single lumps via forage
Then finding a "large stone" took me a long time
I'd probably just go in, figure out how they added those big rocks that I'm assuming you need a pickaxe to interact with... make one for a clay deposit to randomly spawn and just make it harvestable with a shovel.
Then I can't make metal tongs without knowing how to make a header and I can't make a header without a recipe. cries
That would be a good way to do it.
Also, forage chance for roads is based on the "AllOther" loot setting which is 0.4 by defaultinstead of 1.0 like most foraging... so it took me a lot of wandering along the highway (which is supposed to have lots of rocks!) trying to get 10 ordinary stones.
Who makes highways out of flint????
Kentucky, that's who
the problem with adding clay as a chance from shoveling dirt into bags... is it's just going to bring back the hydrocraft issue of uh... "stand in place for an irl hour while your character does something automatically and you wait until you can continue progressing"
Anyone know the best way to setup a debug/command line that sets the time to midnight? Need to debug in darkness. Or do I just make my own sandbox scenario where time is midnight and apply that?
Not at all, you have to move to a new tile every time. 😂
tbh, getting more rocks from farm fields than roads. but you can just pick up one of the weird new like... non-aligned sprites and right click to pickup a big rock, as long as you've got a masonry chisel or 2 knapping for a stone chisel you can turn those into a bunch of stones... or just pickup the normal stones
The "clay with dirt" mod feels more like an emergency stopgap than something meant to be a long-term part of the game,
I used apickaxe, a chisel would be lighter to carry around on foraging trips. I also tracked down where #$@#$^ing large stones spawn, and they are in forests and deep forests.
i dont actually know if they added a way to set the time... but there's already b42 mods to speedup time by like 100x+
.. and weigh 40 so fun to carry out
Okay thanks that works too
that's what 6 seater vans are for... or just put a table in the van
I was quite away down a forest trail.
Also, I had driven a dart to the trailhead... oops.
actually...
do those plastic garden tables work as workbenches?
since they're technically tables
those things can't weigh more than like, 10 encumb. you can fit one of those in a dufflebag along with a chisel and hammer.
carry that duffle in secondary slot and just run around turning big rocks into small rocks
also... after driving for a bit, it feels like camper zombie stories aren't showing up, or are way rarer than they used to be
man i just want a mili backpack
Ah yes, a millipack.. 1/1000th the size of a normal pack.
Got it working - random scematics from a category, limit one recipie per scematic. I'm going to add the other schematic categories and make it take a lot longer than 10 minutes.
And maybe add sandbox options for how long they take to craft, if I can figure how to modifiy a recipe in lua (it's probably either super easy or impossible, depending one what the API gives me to work with)
...and change "recipies" to "recipes"
tbh... making it take longer doesn't mean much. just means dudes are either going to AFK or speedup time in singleplayer.
what I did while revamping/adding recipes for researching blueprints to hydrocraft back in the day was make it so like... it took stuff you'd use in that profession, took (and consumed) skillbooks, had level reqs, etc.
If it takes 30 minutes to an hour it will at least feel like a little investment, as opposed to 5 seconds
And if it goes in sandbox options people can do whatever. But it can't take too long, since you can't stop/start like you can with a skillbook.
why... cant it though?
If you interupt crafting it stops the crafting
Could override the update function of the crafting to update moddata with the progress - then skip to whatever saved progress you have if current progress is lower to load it next time.
skillbooks already exist, so there's code for partially doing something. you could make the recipe take like an irl minute or two to craft... then the result is a skillbook you have to "read" to completion to get the recipe (turns the skillbook into a magazine on finishing reading), and then just use a different animation than reading.
I could probably do something like have you craft a skillbook that you "read" but that's feeling like a lot more coding effort and doesn't quite make sense.
skillbooks have X pages and track how many pages are read
basically, just use recipe to make a blueprint "skillbook", that you "read" until finishing then transform it into a mag.
That requires more effort to make though 😂
but animation/gameplay wise you're just drawing on it
yeah but it's so much cooler
than just sitting in place for like 30 irl minutes, you could make it take longer based on reading speed but have saved progress
I think I'll do that as a version 2, something that may actually be useful even after teh update (hopefully) plugs all the gaps in crafting tech.
I'll make it 30 in-game minutes.
that's just seconds if you hit F5
fuck it, if you're not taking it right away, it's going on our server's ideas forum. legitimately sounds like a cool way to do recipe magazine crafting.
and I can already partially see how I'd make it work
I'll get the first version up (so I can keep going with learning crafting in my game!) and calling "modname (easy mode) "
then add the full mode, becauseit really does sound a lot better that way
or screw it, I'll see if I can get the core of full mode out today.
It's only 9pm, I'm not going to sleep anyway with Zomboid to play 😂
Starting with a 9mm handgun is such a trap. "Learn the new aiming system by attracting more zombies than you can handle with aiming zero!"
Can anybody please tell me what the count refers in the ammuniton script?
item Bullets44
{
DisplayName = .44 Magnum Round,
DisplayCategory = Ammo,
Type = Normal,
Weight = 0.03,
Icon = PistolAmmo,
** Count = 3,**
MetalValue = 1,
WorldStaticModel = 9mmRounds,
Tags = Ammo,
}
I know a gun can have how many ammo it can have but I have no idea what count does in ammo script 😮
No idea, maybe a clue if you see what values different ammos types have.
when it is boxed etc. this is how many is given or taken.
Thanks a lot! So also does it mean that if I create a recipe, and create 1 arrow with count=5, it would give me 5 arrows? ( i am tryinc to create a bow and arrow mode)
Got it. Thanks a bunch. I appreciate it. Merry Christmas 🙂
@bright fog
Thanks for the reply, I'm afraid I haven't been able to check the Java source, but I've tried different settings and it seems that in the Crafting menu, the recipes are sorted by the translated recipe name. However, in the context menu of the item, the translated recipe name is irrelevant and appears to be in the order in which the recipe settings were probably loaded. However, I have the recipe settings (recipes.txt) defined in ascending numerical order, and I am wondering why they are not in the same order as defined. As a specification, I think it would be better if the “context menu is also sorted by the translated recipe name” to match the Crafting menu.
Hi! a technical question that im sure a few people have thought about in the past, what actually is the main cause of server lag in multiplayer when it comes to modding or base game, i would love to cut down a few things here and there and make mods that dont suck because of horrific overhead
i would assume its mostly a shear amount of different items or items with high stack amounts, like clothing mods and ammo mods respectively
i don't think there's really a good answer anyone will be able to give to that, other than "do expensive operations as rarely as possible" more or less, which is a loaded/vague answer in itself. it all depends on what you're trying to do and how you're trying to do it. generally it's good to set out with a mindset of common sense (don't run complex multi-stage functions every single tick) and go from there, because over-optimizing from the start without even knowing what's required to accomplish what you're trying to do is going to result in frustration and an unfinished mod.
tl;dr build it first, then benchmark, then optimize.
Hello fellow modders it's me again with a request to upvote dis: #1318920979581501502 message 
Hi, anyone knows how to make a recipe output for example a Bucket of water?
Since I can't do the following, so should I use onCreate or is there something im missing?
outputs
{
item 1 [Base.Bucket],
-fluid 0.5 [Water],
}
nvm, figured it out
Hi everyone, I'd be very grateful if anyone with even the slightest knowledge of "PZ lore" could quickly give their opinion on this. I understand that the exact nature of the Knox infection is never explained in any great detail but, on the surface at least, do you think this basic premise holds water?
- It was initially an airborne infection, meaning everybody was infected.
- The Player Character (and presumably a small number of others once NPCs are added) have some sort of natural immunity to the infection, meaning they weren't effected by the airborne variant but can still be infected by blood and saliva.
- If, a few weeks into the event, the immune system of anyone with this natural immunity were compromised in any way, say if they were malnourished, got otherwise sick, etc. it's reasonable to assume they would be at risk of catching the airborne infection, even though they didn't turn during the initial breakout.
Thanks anyone who replies - it's the basis for a mod, so even just a very general "yeah that probably does/doesn't make sense" would be very helpful.
1 / 2 yes
3, not really so much
walking dead mentality, you beat the airborne sure. but a bite. and that virus is your end.
Bite is straight up killing you overtime, but no matter what, you would reanimate. At least thats how i remember it.
IN TWD, sorry*
yeah you burn out trying to fight it
Body kills itself by going into high temperature in hopes of killing virus
Has the interaction between food sickness and sickness changed? Using debug mode, moving Food Sickness to 100 only moves the Sickness meter up to 49 or so. Basically it seems now that Sickness = 1/2 food sickness. In b41, moving the Food Sickness meter > 90 resulted in Health going down. Doesn't seem to the case at the moment. Or am I missing something?
Trying to make sub-mod for Dynamic Traits B41. Cuz in original mod players are dying from 1-2 scratches from broken glass because mod add poison wounds on food sickness base. Maybe, someone has some ideas about better modify original code for less poison damage by 2 or 3?
`function DTincreasePoisonByWounds(player, chance, poison)
--print("DT Logger: Chance: " .. chance);
--print("DT Logger: Poison: " .. poison);
--print("DT Logger: running DTincreasePoisonByWounds function");
local currentFoodPoison = player:getBodyDamage():getFoodSicknessLevel();
if chance == 0 then
if ZombRand(2) == 0 then
player:playEmote("dtpoisonvomit");
else
player:playEmote("dtsmellgag");
end
if player:HasTrait("Thinskinned") then
poison = poison * 1.2;
--print("DT Logger: player has trait Thinskinned");
--print("DT Logger: Poison: " .. poison);
elseif player:HasTrait("ThickSkinned") then
poison = poison * 0.8;
--print("DT Logger: player has trait ThickSkinned");
--print("DT Logger: Poison: " .. poison);
end
if player:HasTrait("ProneToIllness") then
poison = poison * 1.3;
--print("DT Logger: player has trait ProneToIllness");
--print("DT Logger: Poison: " .. poison);
elseif player:HasTrait("Resilient") then
poison = poison * 0.7;
--print("DT Logger: player has trait Resilient");
--print("DT Logger: Poison: " .. poison);
end
player:getBodyDamage():setFoodSicknessLevel(currentFoodPoison + poison);
if player:getBodyDamage():getFoodSicknessLevel() > 100 then
player:getBodyDamage():setFoodSicknessLevel(100);
end
end
end`
Hello, is there a way to refresh the game entirely without re-starting the game again and again to test my features ?
i found the grapple animations but i need to find the code stuff for it, anyone know to spot?
do i just need to make the anims?
If it’s lua you can rug in debug mode and just reload lua from home screens
Is there a guide on how to re-structure your mod for B42 for multi version approach?
yes, check pinned messages from nasKo
Oh I'm sorry, I should have done that. I always forget about the pinning feature. Thanks!
Guys, does anyone know how I can make the player execute an animation while he is inside the vehicle. I tried using "vehicle:playPassengerAnim()" and the game doesn't give me errors, but it doesn't execute any animation.
when using PZ specific events and functions, objects etc. is there a way to make VSCode aware of them? so they aren't marked as wrong?
Isn't it what "Umbrella" does, I belive if you search for this keyword here you should find something
its some sorts of addon to vscode
Or however are those called.
oh i see thanks!
this guide still works but the actual files are for b41
this one should work for 42
awesome thank you! is there btw a official modding api documentation especially to see what changes between b41 and b42?
theres a version of the javadoc for b42 but idk if anyones made any list of changes
package index
the biggest one i know of is that to spawn items you use instanceItem() instead of itemfactory now
Do you want a Git diff?
i guess i have to look into the decompiled b42 version anytime soon
#1125248330595848192 message You might also be intrested in this.
I wrote a TypeScript environment that reflects all exposed API so this naturally shows added and removed API from builds.
Useful depending on what you're looking for.
nothing specific, more to be aware of what changes i need to do for my mods to be compatible with b42
Global API calls are in here in the GlobalObject scope: https://github.com/asledgehammer/PipeWrench/commit/fc46fa086b93a44df859a6326e060d340e54933c#diff-e5b1e7a6f33e8c24845ca0cfc729aa6286e54e0e970d91baa17e4eea926e5a61
So if you need to see what parameters changed this can help too.
thanks! i will look into that
hi ! did anyone had luck getting a lua remote debugger extension for vscode ?
PZ takes a few years after Operation Just Cause, funny mod idea would be to have amps mounted to humvees like the ones used outside Noriega's hiding place and can be used to blast music to attract zombies from far away
Hello everyone, is there any guide on how to publish a mod in the workshop ? 🙂
Thanksssss 🙂
So I'm at my wits end and I need help. Basically I'm trying to add a custom backpack to existing entries in clothing.xml, but doing so completely breaks all clothing on any outfit entry I make changes to? Basically my backpack will spawn okay, but nothing else will. Insights into exactly what I'm doing wrong or literally any help at all I would appreciate.
The pic shows my backpack spawning on the test outfit, but nothing else. THe code is basically the test clothing.xml script I'm using to try and figure this out.
the fileguidtable in your mod needs to include every single item you use in any of your outfits
no idea why
As far as i know (sadly) there is no way to add a single new clothing item to already existing outfits without completly overriding them?
no
So basically copy the vanilla guidtable into the mod and append it with my modded items basically?
I.e. the specific file in projectzomboid/media?
so much time wasted troubleshooting due to a bugged appliance...
im not sure if theres like a performance or loadtime impact when having a big fileguidtable though
That's so stupid and absurd and I am going to try it and it will work, and I will have wasted Christmas evening on this bollocks 
yeahh
i'd give anything for the guid system to get removed
it only exists to make outfits more painful
Is it possible to backport the build 42 heatmap to build 41
I have mad respect for Authentic Peach for AuthenticZ in that regard.
Basically they're reading/writing machine code like the mad lunatic that made the first RCT
Why does lua not have a continue statement
its not too bad if you comment which items are which but its still extremely fucking tedious
the designers of the language are quite annoying about keeping the language as minimal as possible
later versions of the language get goto which can be used to implement continue but i really dislike it lol
did they not see the benefit of exiting a loop early 
i think the argument was always that it wasn't flexible and that something like goto could do the same thing and more
but doing it with goto is ugly and i think literally any other usage of goto is probably bad design so i don't really get it
guess I will just have to use an ugly nested if statement
extremely tedious is something I am coming to understand.
I've been at it a couple of days now and I am starting to recognize guids at a glance
b02d is the first 4 of the duffel bag lmao
I just use while / for loops. it's ugly but it works.
there's a weird thing some people like doing to emulate continue
for i = a, b do
repeat
until true
end
within the repeat, break acts as a continue for the for loop
@winter bolt it worked lmao, thanks
alright sweet got this properly loading laundry machine
Does anyone know if it is possible to make a book that teaches all skills?
Yes
Anyone noticed this weird log?
How would it be done? The xp system seems to work only with a single skill at a time
Hi fellow mods devs, do you know if there is a file to get the list of Events we can use to trigger our custom code? In case there is new added / old removed in b42?
don't think there's a file, but albion has this github page of documentation
https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md
https://pzwiki.net/wiki/Lua_Events
Wiki got a lot as well
it has every event, but don't rely too hard on specific information about b41 events since there's not really any way for me to detect what's changed
Thanks!
2 questions is there a way to completely hide the UI
you can bind a button to it in the settings, it's unbound by default
is there a command to reveal everything around you?
Damn I love you! Youre so knowledgeable
Guys I developed my first mid and thank you all for the guiding me but I have something very weird but it’s working, my mods does not work in the « 42 » folder but only in « common » folder 😂😂 I don’t figure out why
the main thing to watch out for is the game will refuse to load your mod if there isn't a common folder
it doesn't have to have anything in it but it does have to exist
You can set All skill level at max in cheat menu: rebirth
I think, if you check cheat menu used code, it may have the same way in the book
I need a savy guy/girl, who is savy with code
Can someone find out why crops are being planted with cursed-true even on good seasons
as in my testing if you turn off seasonal growth the cursed tag is false
Yeah but why my mod works where it is in the common folder but not working anymore when it’s in the 42 ?
What file is now responsible for moodle background colors in B42?
I found the code, to do with bad seasons but there is no line to say what a bad season is
It seems to be setCurSeason()
https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/erosion/season/ErosionSeason.html#setCurSeason(int)
declaration: package: zombie.erosion.season, class: ErosionSeason
Also here it has number's for the months
It's not letting me view it D:
You mean the documentation website?
No that is fine, when i go into the folder location it's all encrypted.... i am a massive noob at this btw 😄
Its fine, its okay to ask 👍 Must be some administrator rights thing on windows then, or some other windows shenanigans. Either way - i blame Bill Gates
You have to decompile the class
I can check when I am on my computer to see if we can have the month from the object
Anyone know how I can stop B42 from reading data in the base media directory that is associated with B41. I have some AnimSets no longer in use on the B42, but I'm getting 2 errors saying that it's looking for them in B42 folder. Is that a bug?
Yes that went over my head good sir/madam 😄
What lua script in Build 42 is responsible for moodle background colors?
what are you trying to see here exactly? you can see the badMonths in the crop definition you posted after this
In my debug testing the tag cursed is being applied even in the sow and best months. That's why plants are not surviving longer then 2 weeks without compost
So i am looking for the line of code that applies cursed
i dont think the math is mathing 😄
I agree, the isbadMonth() method is based on the badMonth array
So the cursed tag is being applied regardless
in what month are you testing the cursed tag ?
Hello, I'm sure this has already been asked 1000 times, but I can't find the right message: If I have a small mod for 41b, 100% compatible with 42b, do I need to create a separate mod to leave it for both versions?
you can just put them both in the same mod folder
b41 will ignore the b42 files and b42 will ignore the b41 files
Did you check these lines ?
elseif self.fertilizer > 2 then -- too much fertilizer and our plant cursed ! self.cursed = true self.health = self.health - 25 end
And these ?
if getSandboxOptions():getOptionByName("PlantGrowingSeasons"):getValue() == true then if not self:isSowMonth() then self.cursed = true elseif self:isRiskMonth() and ZombRand(20) < (11 - skill) then self.cursed = true elseif self:isBestMonth() and ZombRand(20) < (9 + skill) then self.bonusYield = true end end
Does not matter, in my testing but you could use the example of radish in july
not with animsets it don't! BUG
has anyone figured out the new transforms?
most people arent modding animsets tbf so
Without any fertilizer or compost also 🙂
i think you found it Ysaaro
That should be false right?
im going to jump into debug and switch that to false i will post my finding
looks normal to me, although a bit confusing
the plant def you posted had every single month either as a sow month or a bad month
Hey, Im very much new here (and to modding in general).
I was stunned to see the new B42 menu screen when I first started playing. And I understand why the devs had to remove it after all of the AI discussions.
I was thinking I could do a simple mod to re-enable those screens back - does anyone know how to acquire those screens again?
if it's not a sow month then it'll be cursed, if it's a risk month then it has a chance of being cursed, and if it's a best month it has a chance of (presumably) extra yield
yeah thats how it supposed to work, but it's not the cursed tag is always being applied i have change that line of code to false to see if that fixes it
unless someone saved the image the n I dont think youll have much luck, (I havent seached yet)
keep us informed 🙂
it worked Ysarro you are a beast
Acquiring idk if they are not available anymore in the media files, but you can add your own images as a mod if you want 🙂
I am going to try a crop where july is a bad month now
You're welcome 😄
I spoke too soon
Aaaah 😦
this is corn Where july is a bad month, and does not have cursed applied
because you just told it to always make cursed months not cursed
Yeah, I tried searching for it and unfortunately no luck
It's so weird man
I got around to making a video about FrameworkZ (a framework I'm making for Project Zomboid): https://www.youtube.com/watch?v=-2ObvIJjFCw
For more info, please visit: https://frameworkz.projectzomboid.life
I think MoodlesUI java class. The background colors work with filters in background textures, but not sure how it works exactly
self.Border = getTexture("media/ui/Moodles/Border.png");
self.Background = getTexture("media/ui/Moodles/Background.png");
thanks
Its so fucking hard to capture a good video for the map review
all my ui is hidden, the character is hidden but when panning, the damn buildings cutout
It retrieve only to you the background texture, but does not change the color :/
I'll figure it out
(probably)
check Moodle Framework mod (folder 42) MF_ISMoodle.lua lines 249-250.
I don't really understand how to work with all this
I'm looking for a file that has vanilla moodle background colors to change them so they are visible more clearly
My only find on how texture are changed is on there below, I don't have any idea on how it works, have no background on texturing:
short var7 = 9985; short var8 = 9729; this.Background.getTextureId().setMinFilter(var7); this.Background.getTextureId().setMagFilter(var8); this.Border.getTextureId().setMinFilter(var7); this.Border.getTextureId().setMagFilter(var8); this.DrawTextureScaledCol( this.Background, (double)((int)var4), (double)((int)this.MoodleSlotsPos[var3]), (double)this.width, (double)this.width, var6 ); this.DrawTextureScaled( this.Border, (double)((int)var4), (double)((int)this.MoodleSlotsPos[var3]), (double)this.width, (double)this.width, (double)this.alpha ); float var9 = this.width; double var10 = Math.ceil((double)((this.width - var9) / 2.0F)); var5.getTextureId().setMinFilter(var7); var5.getTextureId().setMagFilter(var8);
your var6 is the color.
If you wanna change the color reference set by TIS, they opened the interface in B42 here: ```lua
--Java:
--Core.setBadHighlitedColor(ColorInfo var1) {
-- this.OptionBadHighlightColor.setValueVarArgs((double)var1.r, (double)var1.g, (double)var1.b);
-- this.badHighlitedColor.set(var1);
-- }
-- same for Core.setGoodHighlitedColor Core.getGoodHighlitedColor
local colorInfo = getCore:getBadHighlitedColor()--this is how you can get bad color reference.
local newR = (colorInfo:getR()+1)/2--new red component is twice MORE red
local g = colorInfo:getG()
local b = colorInfo:getB()
local a = colorInfo:getA()
colorInfo:set(newR,g,b,a)--for each value 0=min, 1=max
getCore:setBadHighlitedColor(colorInfo)--this is how you can change bad color reference.
I'll add this to MoodleFramework
these usually dont have a code, they just use debug features. It is also not the same as getting the xp modifiers from books
ohh wow thanks for the updated event list in 42
also contains OnZombieCreate for lua event when zombies spawn 😄
Yup OnZombieCreate will be very very useful
back on your topic, you can change bad and good color references from OPTIONS / ACCESSIBILITY. those are already primary colors though and they are used for many other things so beware. to get more primary moodles, you would need to change java code &/or Color.gray values.
Is there a way to take control of a new instance of IsoPlayer?
damn, for some reason, it doesnt want to read my .bik video for the map preview
How can i get the ZoomX/Y/S for an specific place in the map for the map.info?
its a pain
at first i thought it was a matter of just loading the ~170MB worldmap.png on a tool to get coordinates like this one and then trying to get the coordinate i was interested
Quick way to mark coordinates on an image
but seems like the coordinate i'm getting for muldraugh (for example) is different that the vanilla map.info gives 🤷
Maybe this function can be modified to get coords as well
wait...
are these coordinates the same that appeared in the b41 zomboid map? https://map.projectzomboid.com/
yes
but what about the zooms variable?
but its a pain if you want to get the coords for new regions
i'm porting a b41 spawn point mod for myself, so dont need to mess with new regions
for zoom, sepends, if you want to get close-ish try 14.5
thanks
Why not just right click on floor in debug mode:
oh right hahahahaha\
sometimes the simplest way goes /woosh
I was trying to figure out how to get player co-ordinates and then I saw that and was... oh.
it's active even in normal mode for unstable
Mod idea for after DIY schematics is "naked and alone" that spawns you in a random campsite with no clothes or equipment and a hangover.
ok, I converted my video to bink 1 format, added it to videos folder, added it to the map info, but it doesnt want to play!!!
Im already making a spawn point mod that puts you in the most remote locations I could find on the vanilla map
{worldX = 0, worldY = 25, posX = 292, posY = 99} --Isolated Spawn
{worldX = 17, worldY = 25, posX = 247, posY = 108} --Isolated Spawn 2
{worldX = 18, worldY = 44, posX = 22, posY = 209}
{worldX = 28, worldY = 44, posX = 256, posY = 115}
{worldX = 41, worldY = 40, posX = 251, posY = 225}
{worldX = 40, worldY = 33, posX = 277, posY = 217}
{worldX = 43, worldY = 24, posX = 299, posY = 294}
{worldX = 48, worldY = 6, posX = 130, posY = 236}
{worldX = 14, worldY = 43, posX = 224, posY = 72}
trying to get the new video preview thing figured out first >.<
I like these middle of nowhere/caveman challenges
I think I figured out all the code I need to tweak for DIY schematics, except for teh context menu action which I have a rough idea where/how I need to alter it.
Really needs mods or crafting rework to avoid getting utterly stuck without schematics
or you can just do pre-metal tech
agreed, but at least we have the framework already. This new crafting system can really become very robust
Ah, i see whats wrong with the video. It wants to load it from
LOG : General f:0, t:1735264714115> Unable to load video texture C:\Games\Steam\steamapps\common\ProjectZomboid\media\videos\FishingCabin.bik.
Yes, huge improvment in a lot of ways.
not from my mods media\videos folder
Same with the aiming system - such a shame it has been badly received because of the issues, because it's amazing
i started to get the gist of the aiming system. I got to the conclusion that it is off-centered. If I aim that the center is slightly left of the zombie, i tend to hit more
disable pan-on-aim
And I'm pretty sure some animations are a problem - for example when a zombie bangs their head on a door, the hitbox seems to stay in the on-door position and does not move with the head.
Also, get a pump action shotgun, Right click -> edit and change the range from 12 to 18.
will try on my next run
Feels like a much more natural range
optianl: edit the crosshairs in the UI settings to taste
Actually I should make a quick mod for +50% shotgun distance
ive noticed that a lot of youtubers are trying to play as if it were b41 and they even arent reading the item or action tooltips
Once I noticed I had to aim for teh head things got better
the gun changes definitely would've been a lot better received if people knew what to expect
M9 is weak though - with aiming four still takes 2 or 3 hits for a kill a lot of the time.
and a lot of their complaints come down to them not reading
And starting with a M9, and probably zero aiming
So you shoot, enough zombies come over to panic you, then you have no chance even if you know how to use the gun.
that too, at aiming 2, i can kill in 2 shots
so, how can I put the file path so it reads from the correct location?
https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/gameStates/ChooseGameInfo.Map.html#setDemoVideo(java.lang.String)
declaration: package: zombie.gameStates, class: ChooseGameInfo, class: Map
HI everyone, what's the best reference for methods/events? I can find some on the wiki but not all
title=Cabin Spawns: Fisherman's Cabin
lots=Muldraugh, KY
description=Cabin to the south east of muldraugh. Close enough to loot town easily, has a sink.
description=
description=
zoomX=11063
zoomY=10637
zoomS=14.5
demoVideo=FishingCabin.bik
this makes it load from pz videos folder
How's this for stupid mod idea: Accurate Digital Watches. Replace the easy to use alarm setting UI with 2 buttons and make you click through hours, minutes, and on/off with one button and the other increase the value. Just like actual cheap digital watchs from the 1900s.
Is that for B42?
Seeing the horrible orange streetlights made me wonder what other terrible aspects of the 1900s I've forgotten. 😂
b42 events are present and have partial documentation, i haven't reviewed if any b41 information has become inaccurate
The game already has torches woth low power beams that eat batteries in minutes so that does not need a mod.
I've found this for methods, is it a good reference?
declaration: package: zombie.characters, interface: ILuaGameCharacter
There's definitely a few, OnGameStart is now OnNewGame so I'd expect to find others
I actually love the color of those sodium vapor lamps
beautiful amber
in b41 both existed, are you sure OnGameStart no longer fires?
OnNewGame was once per character and OnGameStart was every time you created/loaded into a save, so both were useful
OnGameStart still works, my mod uses it
that's for b41, this is for b42 https://demiurgequantified.github.io/ProjectZomboidJavaDocs/
package index
CDDA Reading mod got updated for B42 but I think it broke it on B41. Do mods have versioning file structures? I see he threw everything into a /B42/ folder and I'm wondering if that's why its not loading the lua anymore. Would love to try and fix it myself.
Events.OnGameStart.Add(function()
local player = getPlayer()
if player then
replaceTraits(player)
end
end)
Events.OnCreateLivingCharacter.Add(function()
print("[DEBUG] OnCreateLivingCharacter triggered")
traitsInitialized = false
exclusivitySet = false
professionsInitialized = false
initializeTraits()
setMutualExclusivity()
initProfessions()
traitsInitialized = true
exclusivitySet = true
professionsInitialized = true
end)
only in b42, previous versions did not have this and don't support it - if there's nothing outside of the 42 folder then he deleted the entire 41 version for no reason
Thank you. I don't suppose theres a way to download a previous workshop version? I'll try just throwing all the lua outside the folder.
so where b42 would load mod files from MyMod/42/, b41 just loads from MyMod/ (so there should be MyMod/mod.info, MyMod/media/, etc)
Gotcha. I'll see if I can rig this together. Dev here with zero Zomboid modding experience lol
Oh sweet. Thank you
So if i put the video in the pz videos folder, it works. I need to figure out how can I put the path. Its weird beccause for preview image, it loads straight from the map folder
i wonder if it reads it if i put ./ before the vide filename
Uh, they probably do yes, good chance I just screwed up folder structure on that one...
Is there a way I can prevent the server from updating CDDA after I change the files? Worried it'll reach out and detect changes and update again.
Not 100% clear. This is a server I rent. Usually updates on restart.
ah, i see
Maybe just have to make it its own mod