#mod_development

1 messages · Page 281 of 1

opaque ocean
#

there's prob some way in lua you could do that on consuming it though

grizzled fable
#

was working on 41, i just need a timedaction to use

#

i was using animnode eat

bronze yoke
#

you can give foods an OnEat, it's how cigarettes are implemented

silent zealot
#

Just need to find it.

#

...by looking one line up, where albion mention OnEat 😂

crystal canyon
#

you COULD make your own timed action

opaque ocean
#

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

crystal canyon
#

can we access static objects and give them new properties? Like adding a fluidcontainer to a Barrel?

crystal canyon
#

any examples I could look at?

opaque ocean
#

yes

silent zealot
opaque ocean
#

you could basically retrofit what I was whinging about not letting me bypass container capacity earlier into a function to change tiledefs

crystal canyon
#

hmmm java

silent zealot
#

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.

opaque ocean
#

was from a mod from b41

#

and the only example I could find of someone doing it

#

one sec

silent zealot
#

I can't think of any world containers in B41 that would restrict what you can put in.

opaque ocean
#

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

opaque ocean
#

and it works

#

so I'm not going to question why it works, because then it might decide not to

silent zealot
#

I see "Massive Wood Container" and immediately feel like making an inappropriate joke about storing stuff in underware.

opaque ocean
#

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

silent zealot
#

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

opaque ocean
#

if TIS would just TRUST US and let us brick our own games by setting a container to a bajillion storage cap

silent zealot
#

hahahaha

opaque ocean
#

then I wouldn't have to suffer through trying to bypass it

silent zealot
#

It's a wierd and arbitrarily low amount

opaque ocean
#

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

silent zealot
#

I assume that it's a limit in the java side, not the lua? I've not gone looking, but that is my suspicion.

opaque ocean
#

it's java side

#

and the variables are private ints

#

java edit will still bypass it, but eh.

silent zealot
#

I've learned enough C# reflection that private variables are no longer private.

#

...but not for java

opaque ocean
#

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

silent zealot
#

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

opaque ocean
#

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.

silent zealot
#

hahahhhahaa

#

that sounds like a way to destroy every container in the world at once.

crystal canyon
#

sounds likr the minecraft obfuscated mcp mappings

opaque ocean
#

tbh, lotta games obfuscate their variables and functions

finite radish
# silent zealot ...but not for java

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

grizzled fable
#

guys, they change even OnCanPerform? is there another way to do it?

silent zealot
opaque ocean
#

just be thankful you could see anything at all in a C program, man...

silent zealot
#

C#, big difference for modding.

opaque ocean
#

every time I feel like messing with a C program, everything is in bins, even down to the models, textures and audio

#

ah

crystal canyon
#

I think arma is on C

silent zealot
finite radish
crystal canyon
finite radish
#

most games (Zomboid included) use at least some C/C++

crystal canyon
#

i remember editing a lot of hpp files for arma lol

opaque ocean
#

arma runs off hewlett packard printers?

#

I'd believe it.

grizzled fable
#

guys, they change even OnCanPerform? is there another way to do it?

opaque ocean
grizzled fable
#

the question is, can i use OnCanPerform into recipes?

#

from the vanilla files seems commented

opaque ocean
#

uh... yeah, what effect does it achieve?

grizzled fable
#

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

opaque ocean
#

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,

umbral ingot
#

Does anyone know if the Battery drain of the cars is an OnTick event or its an EveryTenMinutes event?

grizzled fable
grizzled fable
#

so i need to put SkillRequired:0,

opaque ocean
#

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

grizzled fable
#

ok ty

opaque ocean
umbral ingot
empty cosmos
#

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

bronze yoke
#

you need to remove b41 style recipes or the cars bug out

empty cosmos
bronze yoke
#

most recipes will use some lua functions but you just need to remove the stuff in scripts to fix the car thing

crystal canyon
#

what exactly is a thumpable?

bronze yoke
#

a world object that can be hit, damaged and broken

crystal canyon
#

ah ok. thanks

opaque ocean
#

okay real talk

#

between thumpable, isoobject, sprite, tile, etc... what the heck are we actually supposed to call them?

bronze yoke
#

🤷‍♀️ objects

#

'tile object' would probably be the most descriptive you can get

crystal canyon
#

@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

opaque ocean
#

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

ancient grail
mental urchin
#

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.

winter bolt
mental urchin
coarse sinew
#

Actually 50 for Inventory Items (usually backpacks), 100 for tile objects and 1000 for car parts containers.
#mod_development message

blissful urchin
#

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 ?

spare burrow
mental urchin
#

Okay, I have another question: does anyone know how to make weapon placement on the back display the same way as with the Duffelbag?

mellow frigate
#

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

mental urchin
granite moss
#

Does anyone actually make mods for B42 or are everyone just transfering their old B41 mods to 42

mellow frigate
#

I'll probably call LuaEventManager directly

fast galleon
#

sorry, I thought this was for custom event and you'd pull anything you want

winter bolt
tranquil kindle
mental urchin
tranquil kindle
#

From what i see right now Dufflebags do not have this line.

worthy sparrow
granite moss
regal crest
worthy sparrow
#

Any idea how can I programatically show/hide the Crafting UI?

regal crest
#

Any idea if they're any changes with the health Ui?

final rampart
#

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

dull moss
#

Do you have submod in your mod?

#

Make sure it's updated to b42 as well

regal crest
umbral ingot
#

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?

regal crest
umbral ingot
#

All good I'm reading up on it. Looks to be the case

regal crest
#

I think I will try make an trait rebalance mod. I don't know if it's easy tho

umbral ingot
#

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

umbral ingot
#

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

regal crest
#

Like you can lose smoker if you don't smoke x amount of days

umbral ingot
#
signal ibex
#

Is there a way to modify/delete cached zombies?

bronze yoke
#

as is pretty common with lua it's not exactly on spec

bronze yoke
umbral ingot
#

No Idea it was the first set of docs I found on google lol. I'll check out the unofficial ones thanks!

mental urchin
#

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.

ancient grail
bronze yoke
#

my ones are b42, the official ones are b41

ancient grail
#

damn thats useful

umbral ingot
bronze yoke
#

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

umbral ingot
#

Anything in the LuaManager.java file with LuaMethod annotation right? So could parse that I suppose

bronze yoke
#

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)

signal ibex
#

What about adding option to middle click search results on the javaDoc?

bronze yoke
#

i'll try and look into that too!

vague marsh
#

C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\scripts\clothing\clothing_bags.txt

try looking in here

drowsy delta
#

where are my downloaded project zomboid mods

mental urchin
tiny valve
#

where i can find items icons?

vague marsh
drowsy delta
#

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

crystal canyon
#

Try this

drowsy delta
crystal canyon
bright fog
#

#1318920979581501502 message

@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

bronze yoke
#

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

bright fog
#

Yeah

spare burrow
grizzled fable
#

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

icy yarrow
#

Onlything I could think would be the category or the items?

vague marsh
icy yarrow
#

The rest of the recipe seem fine

vague marsh
#

item 1 tags[SaltPacket],

and i dont think salt packet is considered as tag (is this valid too tho)

grizzled fable
#

where i can check all the tags?

icy yarrow
#

I did a search in the item folder for base PZ and SaltPacket doesn't come up

vague marsh
icy yarrow
#

Salt is a valid tag however

vague marsh
icy yarrow
#

Tags come from the items Tags = foo;bar, line

vague marsh
icy yarrow
#

Well the Herbalist tag is from their mod, I assumming they are trying to update to the b42 crafting system

regal crest
#

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?

icy yarrow
#

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

icy yarrow
#

%UserProfile%\Zomboid\console.txt assuming windows

regal crest
#

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

bronze yoke
#

that's normal

#

idk why but that's always there even without mods

regal crest
#

Anyone know if the tag for saws has changed?

worthy sparrow
#

Were rooms in B41 random generated?

alpine timber
pulsar pagoda
#

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?

tranquil kindle
#

Its literally item that you're not supposed to have...

pulsar pagoda
#

what do you mean?

#

log throws this at me

tranquil kindle
#

Its for displaying damage on your character?

pulsar pagoda
#

its like equiping a shirt

tranquil kindle
#

Yes, but you're not supposed to be able to interact with that item without debug ect.

pulsar pagoda
tranquil kindle
#

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.

pulsar pagoda
#

what im doing works with all other items

pulsar pagoda
#

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.

tranquil kindle
#

Okay. I thought you force spawned item that is for displaying scars/dmg

pulsar pagoda
#

actual scratches override these clothes

pulsar pagoda
tranquil kindle
#

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?

pulsar pagoda
#

same body location, wound, yes. but they all have different names and clothing item

tranquil kindle
#

Thats why its overriden because it equips vanila injury on place, where you have your item already.

pulsar pagoda
#

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

tranquil kindle
#

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.

pulsar pagoda
#

its there for sure

#

complete files

#

same thing happens with female chest

tranquil kindle
#

Those screenshots are really hard to read. So the issue is that when you hover over that item, it gives errors?

pulsar pagoda
#

also the icon's color randomly changes

tranquil kindle
#

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"

pulsar pagoda
pulsar pagoda
tranquil kindle
#

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?

pulsar pagoda
#

and textures

#

and GUID

tranquil kindle
#

Because you want them to have slightly diffrent texture?

pulsar pagoda
#

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

tranquil kindle
#

Yeah. From what i see there should be nothing wrong, Maybe try new diffrent guids?

pulsar pagoda
#

let me see

#

both items that arent working are next to eachother in the fileguidtable, interesting...

#

still doesnt work

pulsar pagoda
#

@bronze yoke

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

strong pine
#

is it possible to compare java strings and lua strings with == directly? or do i need to convert it

bronze yoke
#

java strings are lua strings

strong pine
#

ok thx

ashen mist
#

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

tranquil reef
#

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

ashen mist
#

recipes are a no show

#

cant find anything

icy yarrow
#

Use a java decompiler

ashen mist
#

shits either broken or not working every step of the way

tranquil reef
bronze yoke
#

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

tranquil reef
#

apparently the method people used primarily was a pain in the ass, but wouldn't this bypass recompiling everything?

bronze yoke
#

this sounds way more annoying

tranquil reef
#

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

bronze yoke
#

jar files are literally renamed zip files lol

tranquil reef
#

Would renaming the entire game folder .jar actually work?

bronze yoke
#

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

ashen mist
#

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

tranquil reef
#

Just the modified ones

ashen mist
bronze yoke
#

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

ashen mist
#

so the recipes show up

#

items dont though

#

progress!

#

i can even craft using them

#

just cant pull anything

worn mica
#

does anyone know how to remove or hide a Crafting Recipe in B42?

#

via the recipe name

ashen mist
#

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

sonic dome
#

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...

▶ Play video
pulsar pagoda
sonic dome
#

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

pulsar pagoda
#

make sure that your .txt file that adds the bow item has a line to indicate world render and textures

sonic dome
blazing vine
ebon dagger
#

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?

bronze yoke
#

you've very likely stumbled into addOption's stupid argument order

#

addOption("Option Name", arg1, function, arg2, arg3, ...)

ebon dagger
#

OH

#

WTF

#

That would very much explain it. thank you. Hahahahah

bronze yoke
#

yeah, literally everyone i've seen try to add a context menu reacts like that 😭

pulsar pagoda
ebon dagger
mystic vessel
bright fog
#

Did you try to open it from the right side ?

mystic vessel
bright fog
mystic vessel
#

Probably a bug right?

bright fog
#

idk, maybe

#

That's all vanilla ?

mystic vessel
ebon dagger
#

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.

compact rampart
#

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

ebon dagger
compact rampart
#

yeah its at level 10

#

now I noticed that the muzzle flash appears in a random ass spot far away from the character

worn mica
#

is this the correct way to get the Crafting Recipe In B42? getScriptManager():getCraftRecipe(RecipeName_)

hybrid tiger
#

should be

ebon dagger
worn mica
#

is there a way to erase or hide the Recipe?

hybrid tiger
#

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

worn mica
#

i wish it would be as simple as = nil

#

oh well still big thanks to you skittles

little harbor
mystic vessel
finite scroll
#

anyone figured out a way to disable new crosshair completely?

ebon dagger
#

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.

bronze yoke
#

yeah

ebon dagger
#

Ok, bummer lol.

finite scroll
#

what are the proper terms for an onCreate function? (b42)

bronze yoke
hybrid tiger
#

albion would you know the proper way to hide / overwrite a recipe in b42?

bronze yoke
#

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

sour island
#

The closest I've gotten is scuffing the recipe to require learning

#

Effectively making it unusable- but it still appears in the menu

hybrid tiger
#

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

sour island
#

Wait - what happens if you reuse the same ID?

hybrid tiger
#

it uses your modded txt

sour island
#

No I mean of just the recipe ID

#

They're unique now

hybrid tiger
#

like craftRecipe makebread

#

and you make your own called makebread

sour island
#

Yeah

hybrid tiger
#

both appear in crafting menu

sour island
#

So they're not unique? 😐 Someone told me they were

hybrid tiger
#

both have makebreaddough id

sour island
#

I feel like that's maybe a bug 🤔

#

Or atleast an oversight

hybrid tiger
#

I started modding 2 days ago so idk ¯_(ツ)_/¯

sour island
#

A large issue with hiding/obsoleting recipes in the past was due to them being able to share ID names

bronze yoke
#

and they're in the same module?

hybrid tiger
#

base

finite scroll
#

unless one is somehow derived from the others

hybrid tiger
#

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

bronze yoke
finite scroll
#

oh, I must've missed it

#

alright

bronze yoke
#

i've been meaning to split them into different pages since it's definitely confusing

sour island
#

Modules might be case sensitive

hybrid tiger
#

if I skilled issued the captialzation im gonna lose it

bronze yoke
#

they are yeah

hybrid tiger
#

DISASTEEEERR

#

yeah

#

that was it

#

ok cool

bronze yoke
#

what happens now? does it override?

hybrid tiger
#

just the one with updated recipe

#

oh wait

#

why does it take double items

#

and double output

finite scroll
#

how exactly should I be linking my callback functions? I can't seem to get LuaManager to recognise them.

bronze yoke
hybrid tiger
#

yeah

#

lovely

bronze yoke
finite scroll
#

and default scope is global, correct?

bronze yoke
#

yeah

sour island
#

I didn't expect this though

#

Seems like an override behavior should be default 😅

finite scroll
#

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

bronze yoke
#

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

finite scroll
#

ah alr

ebon dagger
#

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.

bronze yoke
#

probably fine yeah

finite scroll
#

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

bronze yoke
#

it's always a comma

wet osprey
#

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,
}
}

red tiger
#

oh I wish I remembered the command

#

Oh wait wrong discord

#
print('Please use this. kthxbye');
wet osprey
tacit sparrow
#

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

tacit sparrow
#

nvm Fixed it

ebon dagger
#

Hmm. Does modData on worldObjects get removed on restart?

crystal canyon
#

what would be a good way to record preview videos for spawn selection?

ebon dagger
#

Oh, no I just confirmed it stays. Weird.

crystal canyon
#

are you using Profession Framework?

tacit sparrow
crystal canyon
#

gotcha

tacit sparrow
#

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

crystal canyon
#

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

tacit sparrow
#

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

crystal canyon
#

like axeman, you cant choose it in character creation, but its a free trait for lumberjack

tacit sparrow
#

and you wanted to do what?

#

add it to lumber jack?

#

or have it available for all

sonic fiber
#

make their own one like it im guessing

crystal canyon
#

no, add others to my own professions

bronze yoke
#

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

tacit sparrow
#

could just use "More Traits" as that does that

#

or did you not like there version

crystal canyon
#

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

tacit sparrow
#

can you just use the command: policeofficer:addFreeTrait("Brave");

#

for example

#

policeofficer:addFreeTrait("Axeman");

#

would work for that Ax-pert

crystal canyon
#

yes, but it wouldnt be displayed in the character creation screen as a feature that profession has

tacit sparrow
#

but it would in game?

#

I see

#

nice bit of polish

pulsar pagoda
#

anybody know if we can do subfolders inside textures/bodydmg or if the files have to be freballing in there?

#

same inside clothing/clothingItems

crystal canyon
#

the new zombie spawns are all kinds of borked...

pulsar pagoda
#

this happens when i do a subfolder

crystal canyon
#

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 /

pulsar pagoda
#

allright ill try that, thanks :)

crystal canyon
#

Anyways, back to my rant with new zombie spawns. Look at this crap

crystal canyon
#

that location is exremely remote

pulsar pagoda
vague marsh
ebon dagger
#

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.

hybrid tiger
#

smh didnt get the invite

crystal canyon
hard seal
crystal canyon
#

The cabins spawn mod is nearly unusable now 🙂

#

unless I modify it and add a function to wipe zombies in a radius

pulsar pagoda
vague marsh
#

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()

crystal canyon
crystal canyon
#

public float getHunger()
public void setHunger(float var1)

#

boredom seems different getIdleboredom()

#

ah theres 2 boredom

#

getBoredom()

#

I wonder whats the difference

vague marsh
bronze yoke
#

if i remember right the boredom stuff in stats is deprecated

#

the real boredom is on bodydamage

crystal canyon
vague marsh
crystal canyon
#

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?

crisp fossil
#

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

crystal canyon
#

check pinned messages

vague marsh
#

the rest is can be achieved with video editing

crystal canyon
#

that sound great

#

gonna try that after I reinstall windows

vague marsh
#

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😆

crystal canyon
#

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

vague marsh
#

but when you visit that area (it get removes when your character see it), it will look like this

crystal canyon
#

Nice

tacit sparrow
#

I finished my mod for professions after 2 days of hard grind. Take a look xoxoxoxox

crystal canyon
#

feels good eh?

tranquil reef
#

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

finite scroll
pulsar pagoda
#

anybody know where to find this loading zombie gif? i could only find a png

bronze yoke
#

it is stored as the rare animated png though

pulsar pagoda
ebon dagger
#

anyone manage to make their own Print_Media yet? Like the fliers, photos, etc?

tranquil reef
#

Any way to overwrite the grab context menu option on a custom item

crystal canyon
bronze yoke
ebon dagger
#

Oh also dope! Ty. I clicked around, but is there an index page for the pzwiki for B42 mods?

bronze yoke
#

i doubt it, it's never been great for modding and the whole wiki's pretty frazzled right now with b42

ebon dagger
#

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.

crystal canyon
#

ive had to verify files a few timess the last few days so mods can actually dl and update

grizzled fable
#

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?

ebon dagger
#

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.

bronze yoke
#

e.g.```
inputs {
item 1 [Base.PopBottle;Base.WaterBottle;Base.PopBottleRare] flags[IsEmpty],
}

grizzled fable
#

you the best 🙂

vague marsh
#

make sure to backup your zombie folder first because i didnt like how it zoom in and out😅

crystal canyon
#

and for 360?

grizzled fable
crystal canyon
#

ah good, thanks!

fluid current
#

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

crimson ore
#

is there a guide to uploading mods for 42. cant seem to get it to work. itll upload but unstable wont display it

crystal canyon
#

check pinned messages

crimson ore
#

nvm im looking in pinned now

crimson ore
crystal canyon
sonic needle
#

i keep backups of mods. so not for me >:D

silent zealot
#

...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

fluid current
#

pencil only run when

silent zealot
#

Might need a craft pencil from wood & charcoal recipe or it will quickly be an unarmed run.

fluid current
#

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

opaque ocean
# crystal canyon that location is exremely remote

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

molten hornet
#

are mapping tools out yet

opaque ocean
#

tbh, enjoyed it. scared the hell out of me and made me replace some windows, but ye

crystal canyon
#

its crazy. Even if distribution is set in urban

opaque ocean
#

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.

silent zealot
#

B42 has a lot of good base locatiosn comapred to B41

opaque ocean
#

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

silent zealot
#

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

opaque ocean
#

they added a bunch of farmhouses with wells around ekron, but that map location is the best one I've found so far

opaque ocean
#

they did nerf wells though, no longer clean water.

crystal canyon
#

i found a nice log cabin it has a hand pump well

silent zealot
#

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!

opaque ocean
#

instead of skillbook heaven

#

gotta check if they might spawn inside mailbags on shelves

silent zealot
#

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

opaque ocean
#

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

silent zealot
#

Unless tehre is some random generated thing that is "any thing wih tag: scematic" or some such

opaque ocean
#

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.

silent zealot
#

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,

opaque ocean
#

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.

silent zealot
#

so "put ammo in box" takes any ammo, and maps 9mm bullet -> box of 9mm bullets, shotgun shell -> box of shotgun shells etc.

opaque ocean
#

different but equally likely to lead to losing track of stuff

silent zealot
#

I really prefer the tags, makes things more future proof if a modder adds a new type of pen or something.

opaque ocean
#

i get that for ammo... but I don't like how they did that with remove tool head recipes or fixers/etc.

silent zealot
#

the tool head stuff is so confusing

opaque ocean
#

because at first glace, I thought I could turn a woodaxe axe head into a sledgehammer

silent zealot
#

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

opaque ocean
#

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

silent zealot
#

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

opaque ocean
#

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.

silent zealot
#

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

opaque ocean
#

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"

umbral ingot
#

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?

silent zealot
opaque ocean
silent zealot
#

The "clay with dirt" mod feels more like an emergency stopgap than something meant to be a long-term part of the game,

silent zealot
opaque ocean
silent zealot
#

.. and weigh 40 so fun to carry out

umbral ingot
#

Okay thanks that works too

opaque ocean
silent zealot
#

I was quite away down a forest trail.

#

Also, I had driven a dart to the trailhead... oops.

opaque ocean
#

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

silent zealot
#

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"

opaque ocean
#

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.

silent zealot
#

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.

silent zealot
#

If you interupt crafting it stops the crafting

agile vigil
#

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.

opaque ocean
#

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.

silent zealot
#

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

opaque ocean
#

basically, just use recipe to make a blueprint "skillbook", that you "read" until finishing then transform it into a mag.

silent zealot
#

That requires more effort to make though 😂

opaque ocean
#

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

silent zealot
#

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

opaque ocean
#

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

silent zealot
#

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!"

sonic dome
#

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 😮

silent zealot
#

No idea, maybe a clue if you see what values different ammos types have.

sonic needle
sonic dome
sonic needle
#

Technically. yes.

technically.

#

usually its for stacked items like ammo.

sonic dome
#

Got it. Thanks a bunch. I appreciate it. Merry Christmas 🙂

hidden compass
# bright fog https://discord.com/channels/136501320340209664/1318920979581501502/132152803108...

@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.

tulip cipher
#

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

finite radish
# tulip cipher Hi! a technical question that im sure a few people have thought about in the pas...

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.

dull moss
worthy sparrow
#

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],
}
worthy sparrow
#

nvm, figured it out

verbal raft
#

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?

  1. It was initially an airborne infection, meaning everybody was infected.
  2. 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.
  3. 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.

sonic needle
#

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.

tranquil kindle
#

IN TWD, sorry*

sonic needle
#

yeah you burn out trying to fight it

tranquil kindle
#

Body kills itself by going into high temperature in hopes of killing virus

jaunty gate
#

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?

rain musk
#

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`

blissful urchin
#

Hello, is there a way to refresh the game entirely without re-starting the game again and again to test my features ?

eager imp
#

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?

icy yarrow
hearty gulch
#

Is there a guide on how to re-structure your mod for B42 for multi version approach?

mellow frigate
hearty gulch
pearl prism
#

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.

full escarp
#

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?

tranquil kindle
#

its some sorts of addon to vscode

#

Or however are those called.

full escarp
#

oh i see thanks!

winter bolt
#

this guide still works but the actual files are for b41

#

this one should work for 42

full escarp
#

awesome thank you! is there btw a official modding api documentation especially to see what changes between b41 and b42?

winter bolt
#

theres a version of the javadoc for b42 but idk if anyones made any list of changes

#

the biggest one i know of is that to spawn items you use instanceItem() instead of itemfactory now

red tiger
#

Do you want a Git diff?

full escarp
#

i guess i have to look into the decompiled b42 version anytime soon

tranquil kindle
red tiger
#

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.

full escarp
#

nothing specific, more to be aware of what changes i need to do for my mods to be compatible with b42

red tiger
#

So if you need to see what parameters changed this can help too.

full escarp
#

thanks! i will look into that

grave nest
#

hi ! did anyone had luck getting a lua remote debugger extension for vscode ?

normal galleon
#

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

blissful urchin
#

Hello everyone, is there any guide on how to publish a mod in the workshop ? 🙂

crystal canyon
#

look at the bottom of the wiki in this link

zealous wing
#

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.

winter bolt
#

no idea why

tranquil kindle
zealous wing
#

I.e. the specific file in projectzomboid/media?

winter bolt
#

yeah

#

unless you feel like finding all the items your outfit uses and copying them

icy yarrow
#

so much time wasted troubleshooting due to a bugged appliance...

winter bolt
#

im not sure if theres like a performance or loadtime impact when having a big fileguidtable though

zealous wing
winter bolt
#

yeahh

#

i'd give anything for the guid system to get removed

#

it only exists to make outfits more painful

quiet lion
#

Is it possible to backport the build 42 heatmap to build 41

zealous wing
#

Basically they're reading/writing machine code like the mad lunatic that made the first RCT

icy yarrow
#

Why does lua not have a continue statement

winter bolt
bronze yoke
#

later versions of the language get goto which can be used to implement continue but i really dislike it lol

icy yarrow
#

did they not see the benefit of exiting a loop early stressed

bronze yoke
#

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

icy yarrow
#

guess I will just have to use an ugly nested if statement

zealous wing
#

b02d is the first 4 of the duffel bag lmao

queen oasis
#

I just use while / for loops. it's ugly but it works.

bronze yoke
#

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

zealous wing
#

@winter bolt it worked lmao, thanks

icy yarrow
#

alright sweet got this properly loading laundry machine

cunning haven
#

Does anyone know if it is possible to make a book that teaches all skills?

tranquil kindle
#

Yes

round notch
#

Anyone noticed this weird log?

cunning haven
#

How would it be done? The xp system seems to work only with a single skill at a time

winged lotus
#

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?

finite scroll
finite scroll
#

pretty sure it has most of them

#

if not all

round notch
bronze yoke
crystal canyon
#

2 questions is there a way to completely hide the UI

bronze yoke
#

you can bind a button to it in the settings, it's unbound by default

crystal canyon
#

is there a command to reveal everything around you?

crystal canyon
blissful urchin
#

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

bronze yoke
#

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

digital oxide
warm yacht
#

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

blissful urchin
hallow anvil
#

What file is now responsible for moodle background colors in B42?

warm yacht
#

I found the code, to do with bad seasons but there is no line to say what a bad season is

warm yacht
#

It's not letting me view it D:

heady ember
warm yacht
heady ember
blissful urchin
blissful urchin
round notch
#

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?

bronze yoke
#

yes

#

animations don't seem to have made the transition properly, wait for a fix

warm yacht
hallow anvil
#

What lua script in Build 42 is responsible for moodle background colors?

bronze yoke
warm yacht
#

So i am looking for the line of code that applies cursed

#

i dont think the math is mathing 😄

blissful urchin
warm yacht
blissful urchin
#

in what month are you testing the cursed tag ?

rare saddle
#

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?

winter bolt
#

b41 will ignore the b42 files and b42 will ignore the b41 files

blissful urchin
# warm yacht So the cursed tag is being applied regardless

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

warm yacht
round notch
nimble badger
winter bolt
warm yacht
#

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

bronze yoke
#

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

fair python
#

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?

bronze yoke
#

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

warm yacht
#

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

nimble badger
warm yacht
#

it worked Ysarro you are a beast

blissful urchin
warm yacht
#

I am going to try a crop where july is a bad month now

blissful urchin
warm yacht
blissful urchin
#

Aaaah 😦

warm yacht
#

this is corn Where july is a bad month, and does not have cursed applied

bronze yoke
#

because you just told it to always make cursed months not cursed

warm yacht
#

Ill revert it back and post

#

July is not a bad month

#

for radish

fair python
warm yacht
#

It's so weird man

warped valve
blissful urchin
mellow frigate
crystal canyon
#

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

blissful urchin
hallow anvil
mellow frigate
hallow anvil
blissful urchin
# hallow anvil I don't really understand how to work with all this I'm looking for a file that ...

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);

mellow frigate
#

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

cunning haven
signal ibex
#

ohh wow thanks for the updated event list in 42
also contains OnZombieCreate for lua event when zombies spawn 😄

bright fog
mellow frigate
noble shell
#

Is there a way to take control of a new instance of IsoPlayer?

crystal canyon
#

damn, for some reason, it doesnt want to read my .bik video for the map preview

sly gazelle
#

How can i get the ZoomX/Y/S for an specific place in the map for the map.info?

crystal canyon
#

its a pain

sly gazelle
#

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

#

but seems like the coordinate i'm getting for muldraugh (for example) is different that the vanilla map.info gives 🤷

crystal canyon
sly gazelle
#

wait...

crystal canyon
#

yes

sly gazelle
#

but what about the zooms variable?

crystal canyon
#

but its a pain if you want to get the coords for new regions

sly gazelle
#

i'm porting a b41 spawn point mod for myself, so dont need to mess with new regions

crystal canyon
#

for zoom, sepends, if you want to get close-ish try 14.5

sly gazelle
#

thanks

silent zealot
#

Why not just right click on floor in debug mode:

crystal canyon
#

oh right hahahahaha\

crystal canyon
#

sometimes the simplest way goes /woosh

sly gazelle
#

didnt paid attention haha

#

thanks a lot

silent zealot
#

I was trying to figure out how to get player co-ordinates and then I saw that and was... oh.

bronze yoke
silent zealot
#

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.

crystal canyon
#

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!!!

crystal canyon
# silent zealot Mod idea for after DIY schematics is "naked and alone" that spawns you in a rand...

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 >.<

silent zealot
#

hahahahah

#

I'm taking a break from modding to play the game for a few hours.

crystal canyon
#

I like these middle of nowhere/caveman challenges

silent zealot
#

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.

silent zealot
#

or you can just do pre-metal tech

crystal canyon
#

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.

silent zealot
crystal canyon
#

not from my mods media\videos folder

silent zealot
#

Same with the aiming system - such a shame it has been badly received because of the issues, because it's amazing

crystal canyon
#

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

silent zealot
#

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.

crystal canyon
#

will try on my next run

silent zealot
#

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

crystal canyon
#

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

silent zealot
#

Once I noticed I had to aim for teh head things got better

bronze yoke
#

the gun changes definitely would've been a lot better received if people knew what to expect

silent zealot
#

M9 is weak though - with aiming four still takes 2 or 3 hits for a kill a lot of the time.

crystal canyon
#

and a lot of their complaints come down to them not reading

silent zealot
#

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.

crystal canyon
#

that too, at aiming 2, i can kill in 2 shots

verbal raft
#

HI everyone, what's the best reference for methods/events? I can find some on the wiki but not all

crystal canyon
#

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

silent zealot
#

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.

silent zealot
#

Seeing the horrible orange streetlights made me wonder what other terrible aspects of the 1900s I've forgotten. 😂

bronze yoke
silent zealot
#

The game already has torches woth low power beams that eat batteries in minutes so that does not need a mod.

verbal raft
verbal raft
crystal canyon
#

beautiful amber

bronze yoke
#

OnNewGame was once per character and OnGameStart was every time you created/loaded into a save, so both were useful

crystal canyon
#

OnGameStart still works, my mod uses it

kindred grove
#

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.

crystal canyon
#
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)
bronze yoke
kindred grove
bronze yoke
#

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)

kindred grove
#

Gotcha. I'll see if I can rig this together. Dev here with zero Zomboid modding experience lol

crystal canyon
#

you might still be able to get the previous version here. search by modid

kindred grove
#

Oh sweet. Thank you

crystal canyon
#

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

verbal raft
kindred grove
#

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.

crystal canyon
#

load themm from the mods folder

#

in your users Zomboid folder

kindred grove
#

Not 100% clear. This is a server I rent. Usually updates on restart.

crystal canyon
#

ah, i see

kindred grove
#

Maybe just have to make it its own mod

crystal canyon
#

not sure then, since every server hoster is different. You could upload it as hidden

#

and only people with the link can sub to it