#mod_development

1 messages Β· Page 315 of 1

main pasture
#

The vehicle speed is in km/h internally and in the gauge, but is just labeled "mph"

#

If you want to just make it go very fast you could make it teleport constantly in the right direction when you reach fast enough speed

silent zealot
#

Overriding common sense on the cruise control doesn;t help

silent zealot
#

I was working on a mod that woudl align the car to the road if you were a few degres off, so you didn't drift back and worth... but using setAngle bumped speed to zero every time

main pasture
#

That would be kind of janky, but you could have it to keep teleporting to seem like it is moving until you release the button

silent zealot
#

teleporting 60 times a second?

bronze yoke
#

as long as you do it ontick it'll happen as often as the game renders

main pasture
#

I think it would be convincing enough when the speed is comically high, but not for the lane keeping

silent zealot
#

then coming to a dead stop as soon as the teleport finishes... sounds horrible, but might work

#

I think a better option is to just redo the texture for the dashbaord so instead of 0/30/60/90/120 it reads 0/60/120/180/240

maiden thistle
#

i am assuming that the speed limit is do to rendering because too fast and the world cant load quick enough?

silent zealot
#

I expect so, 120 "miles" per hours is already above whan can load & render smoothly in a lot of places.

#

Though B42 does do a lot better than B41

#

Also, if a 120 mph crash creates this moodle:

#

what will a 240 mph crash do? πŸ˜‚

#

oouch,

maiden thistle
#

and so ig that's why it normally set to 70 in multiplayer because of sever upload speed and all that

silent zealot
#

And extra-janky vehicle updates in MP

maiden thistle
#

also i think thats the normal not infected death moodle yes?

silent zealot
ebon jetty
#

i got a very interesting issue with custom item icon, so what im trying to do is to make a custom icon(32x32 72dpi index color 8 bit bit depth) that has the same property as the vanilla's for a modded item, but still, with inventory tetris view, there is a white border surround the icon, and it seems the resolution seems not correct, any tips guys?

tacit pebble
#

anti-aliasing?

ebon jetty
#

but i dont know how to remove it lol, it seems all good in the windows photo viewer

tacit pebble
#

can you share 32x32px re-sized png to me?
I can check if there's any anti-alasing

#

maybe thru zip or something..? (idk if it's allowed to share zip in here)

ebon jetty
#

here you are buddy

tacit pebble
#

seems fine to me :3

ebon jetty
#

really need someone who made mod icon to help with lol

bright fog
#

This can help

ebon jetty
tacit pebble
ebon jetty
#

so i look for the vanilla icon,and tried to remake it with similar property

#

and im stuck in this now lol

#

like this, really need to figure out how vanilla icon was made, its method, file property, data etc

bright fog
#

You can render the way you want in Blender, on a transparent background

#

Then pixelize it with this tool

ebon jetty
ebon jetty
#

there may be some options require to tweak in order to have auto upscale

tacit pebble
ebon jetty
#

yes, this blurry pistol icon is from the official icon file, i use it to test on the mod item

#

it should be clean, but its not lol

#

so i start to suspect on the mod itself

#

this weapon mod

tacit pebble
#

maybe vanilla icons are saved as .pack file however your icon is .png?
still everything is guessing :/

ebon jetty
#

yea its reallly interesting and annoying

#

i saw the vfe mod has its own pixel icon design, dont know how they solve it

#

or maybe it will have similar result

hard seal
#

got it into game but error'd a bunch

ebon jetty
#

i test vfe too, it definitely modding issue lol, for any reason we cant get a perfect pixel icon

#

they got blurry too

#

not problem about custom icon itself, well i guess im gonna give it up for this one

bright fog
ebon jetty
bright fog
#

Don't think so

bronze yoke
#

you can pack them

bright fog
#

Ah wasn't sure if you could pack stuff for your mods like that

#

I guess that's used for tiles anyway

ebon jetty
#

yea i never saw people do that too lol

bright fog
#

Also adds a few more steps for not much gain overall

silent zealot
#

What program is your source image in, and how it is handling matting for any semi-tranparent pixels?

#

I've seen that sort of halo when an image on trabnparent background is exported and teh the exporting program treats the half-visible pixels as if they were on a white background.

#

Seems fine though, disabling the alpha shows everything is black...

#

assuming Discord didn't mangle the uploaded file

#

It is indexed, not RGB... that's probably not correct

#

Can you zip up the original image file and post it so we can see it witghout Discord being helpful when rehosting images?

thin swan
bright fog
#

Nice !

#

This is clean

#

Good job with your mod, I think I'll link it as a UI mod example for the wiki page since it takes on multiple things related to UI

tacit pebble
# hard seal you should rewrite the magazine api for me, I've been struggling - its B42 but I...

sorry but I don't want to spend extra hours for b41 because I don't play anymore.
Also, since B41 has MP and I have NEVER played MP, that work will consume lots time because I have to study about mp system. (sync, server, anti cheat, etc)

so I will not officially support for B41 until B42 mp is out.

However, I will tell you everything in here for back port from b42 to b41.

  • You have to change all instanceItem to something. I already forget but keyword for search: itemfactory

  • You have to download B42 and see which code has been added for timedAction override.

  • And after comparing, back to B41, add all codes which added by me.

these are the necessary first step.
Also there's new functions in ISReloadWeaponAction.lua you will have to implement those functions too with B41 method.

after then, you can do literally anything with my API and upload as your own mod. (fine tune, MP Compatibility, Additional functions, etc...)

While you are modding this, if you encountered any error, just ask in here.
Not only me but also everybody will help you.
don't worry if your question is too-basic. everything is fine πŸ˜‰

storm trench
#

wtf lolll.

thin swan
#

Oh niiiice

storm trench
#

Glad to see no huge changes to core features this time. Still a little sad we haven't gotten our container capacity alternative yet tho.

#

But most mods should be fine, which is awesome to see.

thin swan
storm trench
#

Same hahaa.

thin swan
#

It's getting a bit scary now that I have over 1k users, I don't want to disappoint all these people 😬

queen oasis
#

well, 42.6 breaks everything I've done in 42

tacit pebble
queen oasis
#

You can drag a zombie with wal;k to now, so there's hope for that one

craggy nacelle
#

sry fc

queen oasis
#

the joys of modding the unstable branch

tacit pebble
#

really sad..
I haven't even pasted your code yet.. ugh
I was planning to do some study with that in this weekend 😭
because your code seems to be a fine example of what I asked before
#mod_development message

queen oasis
#

I'll dig in to it in a bit. It's prolly just bad coding on my part

storm trench
queen oasis
storm trench
#

Any hope for the capacity bypass?

queen oasis
storm trench
#

Fingers crossed!!! 🀞

main pasture
#

@primal schooner (Regarding your report about the linux mod loading issue) I run the native linux version and it loads mods from the user folder just fine. Symlinking mods to the folder causes loading to fail because incorrect path is generated (worked in B41). Have you checked what the path looks like where it tries to load the script from?

#

I'm not sure if this is the same issue you're having or not, so haven't reported it yet

primal schooner
main pasture
#

Same. I had mods symlinked from a git folder and B42 broke that workflow

primal schooner
#

I even went as far as trying different capitalization in symlinks haha.

main pasture
#

The issue might have something to do with capitalization. This is the path it tries to load my mod from /home/username/Zomboid/mods/home/username/zomboid/mods/modname/common/media/scripts/vehicles/vehiclename.txt

#

The mod name was also changed to lower case

primal schooner
#

yeah same, but i did try to have symlink as lowercase, didn't help

small topaz
#

Hi! Is it somehow possible to get older versions of Zomboid's B42 lua files? I am looking for 42.5.0 or 42.5.1.

main pasture
#

The game seems to fail loading the script even if I actually have it at the made up path

primal schooner
#

yep

fleet bridge
primal schooner
#

i don't understand why TIS didn't just go with all lowercase everywhere to avoid all of that all together
they do have toLowerCase in java almost everywhere when it comes to paths anyway

queen oasis
#

I see, I think they fixed a bug where it wasn't checking effective capacity
I kind of wish I had kept the 42.5 files to compare

fleet bridge
queen oasis
#

mainly just the 2 hasRoomFor functions

primal schooner
#

also @main pasture , this helps me a bit -modfolders steam,workshop,mods, not getting errors if I am subbed to the mods which I have locally because it prioritizes steam

small topaz
fleet bridge
#

trying to figure out if i had 42.4 or 42.5, i try not to open steam on this laptop lol

small topaz
#

For me, 42.4 would also be fine. Should just be a version before 42.6 ...

small topaz
#

maybe just backup-ing your files before do anything on steam??

fleet bridge
#

last saved 3/11, and i uploaded something on pz for b42 on 3/12, so i think its 42.5

#

backing it up now

main pasture
thin swan
#

Worst case, you could try to find a πŸ΄β€β˜ οΈ version of 42.5 just to get the old files

queen oasis
#

ok, it still works, I'm dumb. They changed the type name of the bag I was testing with

queen oasis
small topaz
#

In 42.6, they changed the size of the 3d character model in the character customisation screen. From what I see, they seem to have changed only the size 3d character model but not the size of the overall rectangular window where the character is displayed. Does anyone knows a way how to change the size of the 3d model without changing the size of the window?

grand gazelle
#

what's like, the feasability/practicality of reimplementing java object code in lua to bypass needing to alter java files with manual installations....

#

asking for a friend,,,, who is hellbent on messing with barricades for a mod,,,,,

ebon jetty
winter bolt
#

it takes up like a third of the char creation screen

ebon jetty
queen oasis
small topaz
# winter bolt im confused the window is massive now

I think that massive window at the center of the screen was already introduced before 42.6 (maybe 42.5 or even 42.4). In 42.6, they leaved the window as it is and just made the actual character model a bit smaller.

winter bolt
#

oh i thought you meant before

#

they probably just changed the zoom

small topaz
#

do you happen to know how the zoom can be changed in lua? I am working on a mod and would like to make the character a bit larger again, as it was in pre 42.6.

grand gazelle
# queen oasis It just depends on where the code you want to change is called from really. You ...

i mean, most of the code as far as i'm aware that needs changing is in the ISBarricade class, which mostly handles the creation, health, damage, and sprite logic, which is all hardcoded,,, and so i'm trying to make variants of barricades

I currently have custom ISBarricadeAction code, but to really surpass the hardcoded health values and sprite conditionals, I'd have to essentially reimplement the java, which would be called from the actionqueue after selecting it in the context menu

#

yeah i think i have to implement the entire class in lua lol

queen oasis
grand gazelle
#

unfortunately not

#

it's all handled in the java code

#

in the lua code, there are conditions for whether you can create each barricade, but the logic for deciding what the barricade's health will be is hardcoded based on carpentry/welding level, and also clamped to max values which are not exposed to the api

#

some examples of said hardcoding in the IsoBarricade class from the decompiled code

#

simply unlucky

winter bolt
#

my game hasnt updated yet so this should be the old zoom

#

im updating now so i can check though

small topaz
#

ok.. I see there is a setZoom() command but I didn't yet figure out how to make it work

grand gazelle
#

is the condition of an item clamped to a maximum value of 1? or could i set the condition to something above 1?

winter bolt
#

yeah i was right the new one is zoomed out more

small topaz
#

yeah, they changed from 1 to -3

#

btw, I am also working a bit on a compatiblity patch for your character customisation with my body mod

silent zealot
grand gazelle
#

any idea on like, equippable items, say, a plank?

silent zealot
#

Patch notes look good, now I'm going to check Reddit to find out why the devs hate us and are trying to ruin all our fun.

grand gazelle
#

the UseDelta is what getCondition() retrieves?

silent zealot
#

UseDelta is seperate, it's basically "how many charges"

#

Like how much fuel is in a blowtorch or lighter, charge in a battery, etc

grand gazelle
#

ahh

drifting ore
#

There is probably a check in the game to prevent item's condition from going over 1 like with stats

tacit pebble
#

condition is just a number.

So plank has 10 condition and
2 lower chance so
you can hit something avg 20 times before broken

#

while crowbar has 15 condition and 70 lower chance
(avg 735 hits)

vast pier
#

Wish it were possible to smash door windows the same way you can with cars to unlock them

queen oasis
#

hmm, something is changing the game speed after an action outside of ISTimedActionQueue.onTick

#

I have been just saving the getCore():setOptionTimedActionGameSpeedReset value and then setting it to false to prevent ISTimedActionQueue from resetting speed

queen oasis
grand gazelle
#

I’ll double back on it though

queen oasis
#

Not sure but this might be resetting the speed without my damn permission. updateInternal in AnimatedModel:

if (this.bAnimate) { gameTime.setMultiplier(1.0F)  ...
runic plover
#

Hey, I'm new to PZ modding and Lua language and got a couple of questions!

To follow the proper modding guidelines, I'm trying to overwrite as little as possible. The thing is, I'm not exactly sure about how to go about that.

If I go to media/lua/server/ClientCommands.lua, and modify a function there, that function is the only thing I have to have in my file of same name in my mod directory, right?

bronze yoke
#

no, if you have a file of the same name it will load instead of that file, so anything else will be removed

runic plover
#

OHHH I see

bright fog
#

A function which can be accessed from a different file (usually global for vanilla, or modules) can be modified from a completely different file

#

As long as the original function was loaded first, of course

#

Usually the go-to is not to overwrite a function however

#

If you are not forced to directly modify the internals of the function but simply add new behaviors to it, you can do decorations

#

Simply put, hook to the function

runic plover
#

Essentially I just want to change how much certain items are used in barricading etc

bright fog
#

So you hook to the timed action ?

runic plover
#

I now realise I actually have no idea what I'm doing

#

Thought this'd be as easy as just changing a couple of numbers in a function or two

bright fog
#

Hmm, depends

#

The hardest thing is usually finding what you need to change

#

In your case, what do you want to change exactly ?

#

You said how many items are used for barricading, but which items ?

runic plover
#

Well for the barricading for example, I want to change the amount of nails used

bright fog
#

First off, my first guess is to check ISBarricadeAction.lua

slim swan
#

The 42.6 update has modified the container highlighting mechanism, but the flickering issue hasn't been fixed yet.

bright fog
#

From the look of it, I think you'll have to overwrite the function sadly

#

Because removing the nails is done internally

runic plover
#

Aha! I'm not stupid, I'm just a bit blind. I completely missed that file

bright fog
#

Or if you REALLY don't want to overwrite it, you can technically readd nails in the player inventory I guess

quiet glacier
#

Hello all! peepoHey Is it possible to have multiple Intro Texts that the game could randomly select from?

bright fog
bronze yoke
#

you can hook RemoveAll to change the arguments when called

#

but that might just be overcomplicating it

runic plover
#

Thanks guys! I think I've got it now

queen oasis
#

you might want to muck with isValid too if you're going with the overwrite complete option

bright fog
#

True !

#

That's true

runic plover
#

Yeah Imma look through the entire thing to see what's up

bright fog
#

That's completely true, to make sure the players can build with only 1 nail (if you go from 2 to 1 nails needed)

runic plover
#

Right, very true! Imma make it 4 though, because it makes no sense to me to nail planks of wood with just two nails spiffo

bright fog
#

Oh you want to increase it lol ?

runic plover
#

Yeye

bright fog
#

Wait that makes it easier then

#

Bcs you don't have to overwrite the whole thing I guess ?

queen oasis
#

zombie coming in my house? imma use 25 nails

bright fog
#

Tho you do need to change the check

runic plover
#

Ah yeah

runic plover
bright fog
#

I hope you increase the health of barricades lol

runic plover
#

I absolutely will not!

bright fog
#

Figured lol

grizzled fable
#

hi all πŸ™‚ is this correct?
item 1 [Base.Pot]/tags[Bucket] flags[IsEmpty] mode:keep,

bright fog
#

No

#

You either give an item list of flags

#

Wait no

#

tags*

#

You can't give both an item and a tag

queen oasis
#

I'm struggling. How would I get the animated model of the player? I'm trying to keep my eye on isAnimate()

grizzled fable
queen oasis
queen oasis
#

me either but I think it's messing with the game speed

#

I was hoping I could keep my eye on that bAnimate var and see if that's my issue

bright fog
#

Most methods here seem to just be ones in IsoGameCharacter, IsoPlayer or IsoZombie

bright fog
queen oasis
hard seal
#

-ps didnt know she was your mod πŸ˜„

icy night
#

If I wanted to make books visible in-hand, how would I do that since they already have models but just don't show up when equipped

tranquil kindle
# icy night If I wanted to make books visible in-hand, how would I do that since they alread...

I found 2 ways, First one is in item script StaticModel = yourmodel or something like that (don't remember if its exacly like that and can't check right now, This one should be tried first, then second option which allows for more customization (though requires blender or other 3d software), you parent the model to armature, weight paint it to hands ( you can do 2 models, one for each hand), export them, make XML files and fileguid entries (so pretty much like you would do a clothing item) and then add :

ReplaceInSecondHand = YourClothingItemXMLLefthand holdingbagleft,
ReplaceInPrimaryHand = YourClothingItemXMLRighthand holdingbagright,
icy night
#

I'll start with the first method and see how it goes

distant inlet
#

I'm trying to add configurable hotkeys. Would I be adding to the global keyBinding table or use getCore():addKeyBinding(p1, p2)?

silent zealot
#

Are these extra hotkeys for your mod, and are you on B41 or B42?

#

For B42 I use Mod Options.

#
NepHB.options = {
    activationKey   = nil, -- NepHB.options.activationKey:getValue()

[...]

NepHB.initOptions = function()
    NepHB.options.activationKey = options:addKeyBind("activationKey", getText("UI_options_NepHB_activationKey"), Keyboard.KEY_PERIOD, getText("UI_options_NepHB_activationKey_tooltip"))

[...]

NepHB.onKeyPress = function (_keyPressed)
    if _keyPressed == NepHB.options.activationKey:getValue() then
        <do the thing>

#

That adds a keybind with default value period, and in Options -> Mods > High Beams the player can click on the setting and set a new keybind.

distant inlet
#

b42 - why not have the bindings in the main menu > key bindings section? more idiomatic to do it from modoptions?

silent zealot
#

Honestly: because it was easier for me to do it that way, putting everything in one place.

storm trench
#

So... I had some extra code messing with the context menus... and somehow missed hooking into the wrong events not once, but twice...

...I swear I'm an idiot. lolll.

silent zealot
#

Wasting hours because of a silly mistake is part of being a programmer.

storm trench
bright fog
#

Use Mod Options

#

Don't use anything else, it's the standardized method

#

If you do anything weird with adding keybinds in a different way, it might just confuse users overall

storm trench
#

Mod Options... my mortal enemy... lol

queen oasis
silent zealot
#

Silly mod idea: Japanese and Scottish alcohol. It's just a percentage chance to rename "whiskey" to "whisky"

queen oasis
#

I grew up in Kentucky. Whiskey is spelled "bourbon"

queen oasis
bright fog
queen oasis
#

the lua capacity over ride was updated to accept a table of types and weights so you can make more than one container weigh 500 lbs
#1070852229654917180 message

#

still need to figure out how to change the tooltip. starlit either didn't like it or more likely I don't know what I'm doing sometimes

#

would also like to have an "equipped" weight, ie like zupercart is 13 when it's equipped even if it's loaded down

ebon jetty
silent zealot
ebon jetty
#

and yes! @hidden compass big thx to you, i got inspiration from your mod about this lol

silent zealot
#

Maybe you could generate every single bit of the tooltip in lua by replacing 100% of the java, but that's a lot of effort.

queen oasis
silent zealot
#

What I did for Authentic Battery Charge Detection was create a fake battery item that looks like a battery but doesn't have a charge, and then in the inventory code I swap the actual item item with the fake battery/allow the tooltip to be generated/swap the items back.

#

Which works when I just need to make one instance of a fake item and use that, would be painful to do it when teh tooltips are not 100% the same every time like a cart.

queen oasis
#

I thought about trying to suppress the tooltips and just add my own

#

I haven't even checked if that's possible though

bronze yoke
#

container tooltips accidentally removed the part of the tooltip with the icons of the items in the container and everyone was bugging me so i disabled it until later

queen oasis
icy night
#

Can all three of these use the same model?

#
        WorldStaticModel = Bible,
        WeaponSprite = Journals.Bible,```
#

or does weaponsprite have to be different

bronze yoke
#

they can

icy night
#

Models need to be .fbx?

silent zealot
#

B42.6 borked my save so it's time to pick up everything that survived and move on...

icy night
#

Just taking this time to learn how to mod in a lot of different ways

silent zealot
#

It's fine, I'll take my favorite car/drive to a new place/delete the map to refresh everything.

#

Bye Bye Echo Creek One-Stop Post-Apocalyptic shop.

distant inlet
#

i got my key bindings to appear in the in-game "Game Options" menu, but not in the title screen's key bindings menu. Any ideas how to add key bindigs to the latter?

hard seal
# tacit pebble sorry but I don't want to spend extra hours for b41 because I don't play anymore...

So firstly I've tried to look for the instance items and was unable to fully understand what you mean by this: The item ids themselves?

as per the Timed and reload/radial api's I have no clue what those would be in B41 as I assume there is no template for B41 of this code- I do not have the skill to create a new lua with the same code but for a new version)

Any way you could put this a little simpler

  • I think I'll first learn this with B42 and see how it goes.
tacit pebble
#

#mod_development message

there should be instanceItem(something) in code
you have to change this into
InventoryItemFactory.CreateItem(something)

bronze yoke
#

they didn't add any tiles though

vast lion
#

Any good firearms mod suggestions? Im currently using the vanilla firearms expansion (b41)

silent zealot
#

Do you want a stupid amount of guns with half a dozen new mechanics, or something that keeps the feeling of vanilla weapons?

#

For the later, I think you already have the best mod.

#

For the former, Britas probably has what you want and 500 extra things you don't need.

#

Also, wrong channel - this is meant for writing mods.

ancient grail
vast pier
bright fog
bronze yoke
vast pier
brave bone
# vast pier

How are you guys making crisp pixel images mine looks like it was washed up by the rain or something lol. Tried gimp and boy i sucked at it.

vast pier
#

You make the pixel art then scale it up with interpolation turned off πŸ‘

brave bone
vast pier
# vast pier

just realized the trumpet shotgun says slamfire, lol. Good thing I haven't updated the mod yet.

bright fog
vast pier
#

I use a hidden test mod to set up layouts n' stuff

storm trench
#

No wonder there's animation issues with this mod. I'm starting to wonder how it functioned at all in B41. Tons of syntax errors, one of the XML's is even named wrong... just... smfh lolll.

thin swan
#

Damn it's so hard to stick to finishing one mod before I want to make a new one lol
Just realized that those foldable kick scooters were made in 1990 and now I really want to make a mod to add them

bright fog
storm trench
bright fog
#

This doesn't make much sense

#

How can you typo the name, in what way ? Because the name of the file really doesn't matter

#

Also there's typos as in wrongly written names for a bunch of vanilla stuff, like some animations

storm trench
#

It's an example of the issues with the XML's. There's typos EVERYWHERE. The typo in the name is just me pointing to the lack of entire care put into all of the XML's.

#

Say whatever you want about it, but fixing the typos fixed a ton of issues with the animations.

bright fog
queen oasis
broken briar
#

Does anyone have any idea on how to change the text especially for the TV and Radio news?

I'm trying to modify them so I can possibly make a mod where the news say smth like this

#

"From what we are hearing from the CDC, it appears that the Cordyceps has somehow managed to 'bypass' the FDA's detection systems."

#

"Several recalls have commenced throughout the nation as reports of people having 'food poisoning' and having 'seizures'."

#

Does anyone know how to do that?

#

I really wanna make it compatible with Week One

#

I wanna make this mod for those who wish to experience the development of the Outbreak, etc

bright fog
#

That'd be cool !

#

I'm unsure how you can do that. You can possibly modify the translations of radios

broken briar
broken briar
#

But I'm very new to modding so..

#

Kinda need some guidelines

heavy hare
#

How I started was just find and look at the code of mods that do something similar and go from there

bright fog
#

Also if you are interested I work on TLOU mods and I made a group for modders who are interested in making mods on the subject

#

Tho I haven't been modding for the past month and mostly have been documenting for the wiki

broken briar
#

I would like to get invited

queen oasis
#

vscode has the manners

queen oasis
#

phenomenal

vast pier
#

Like the unload animation xmls will reference the reload animation xmls

#

If the file is named wrong, it doesn’t reference it

buoyant valve
#

is there a mod that adds in the sounds the zombies make in black ops?

bright fog
buoyant valve
#

someone should do that

#

there's some from resident evil

bright fog
#

Then do it

buoyant valve
#

i don't mod

bright fog
#

Then don't ask lol. I'm going to be straight with you: your request will get lost

#

Unless you pay someone to do it, it is extremely unluckely you just gave someone an extraordinary idea to implement as a mod, and even if you did you need to get lucky to find someone who'd do it

vast pier
# buoyant valve i don't mod

It wouldn’t be difficult, just some sound replacements. Im sure even a first time beginner such as yourself could

#

Would be a decent introduction to the file structure too i think

#

Not trying to be snarky, trying to encourage you.

buoyant valve
#

i actually found a mod that does it but it hasn't been updated in several years

#

i'll probably have to look into it

vast pier
#

Does it still work?

buoyant valve
#

it's for 41.60

vast pier
#

Are you wanting it for 42?

buoyant valve
#

i mean i still use b41 im not sure if it functions for the stable build

vast pier
#

Could try, i dont think the sounds would break. Maybe file structure would be different tho

#

Worth a shot to see if it just works lol

buoyant valve
#

i'll have to make a new save to try

storm trench
#

Wait why is my text red? Or is that just me? Lmao.

vast pier
distant inlet
#

dark b42 debugger is the best

#

my .2 seconds of fame

bright fog
queen oasis
storm trench
storm trench
queen oasis
queen oasis
#

if it isn't working, it might be the type string you're using

#

I got it. Need to learn how to spell

slim swan
# vast pier

The feel of this style is awesome; it would be great if it could also be displayed like this in the game.

queen oasis
#

works with bags, crates, vehicle trucks, etc.
I'm a happy boy

vast pier
#

that would require working with ui elements and idk how to do all that

#

plus, where would it even display?

slim swan
#

Maybe in tooltips or somewhere else,Idk. It just looks really nice, lol

bright fog
#

Actually you could possibly easy render that in the item tooltip ...

#

Simply in the translation file, show the image

#

With rich tags

vast pier
#

seems a bit redundant tbh

bright fog
#

Yea agreed

#

It's overall a bad suggestion imo, at least to do it JUST for that mod

#

But if you wanted to do it, you possibly could do it

slim swan
#

I think the new XUIbuild might make future UI creation much easier, but for now, I’ve only seen the crafting panel using XUIbuild.

bright fog
#

Haven't seen anything about that thing actually

#

So no idea

storm trench
#

That and CleanUI just... chef kiss.

queen oasis
#

just curious if this is the way to go for making this an "api" for others to use or if there is a better way

local JB_MaxCapacityOverride = require("JB_MaxCapacityOverride")

-- { "type", weight, prevent nesting same container, override with an equipped weight } --
-- override with an equipped weight is a WIP

JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE = {
    { "Bag_ShotgunDblSawnoffBag", 125, false, 25 },
    { "Bag_TrashBag",             40,  true },
    { "militarycrate",            75,  false },
    { "TruckBedOpen",             500, false },
}

JB_MaxCapacityOverride.PREVENT_NESTING_ALL_CHANGED_CONTAINERS = true
#

I usually just make it global but thought I would maybe not do that this time

bright fog
#

Make a function

#

The way you just did it, everyone's going to overwrite CONTAINERS_TO_OVERRIDE

#

Make a function which appends an item with the desired config

queen oasis
#

shit, I didn't think of that

bright fog
#
JB_MaxCapacityOverride.addContainer = function(type, weight, allowNesting, _equiped_weight)
    ...
end
#

Add fail safes

#

So if the parameters are wrong, don't add the item

#

And throw an error

#

Or at least print in console that the added config is wrong

bronze yoke
#

using a helper function also lets you change the actual implementation later and not break mods using it

#

if you needed to add an extra field for example

bright fog
#

helper function ?

bronze yoke
#

i googled it and apparently that term means something specific that i am wrong to use here πŸ˜…

#

but i just mean that all this function will really do is insert its parameters into a table, it's not really strictly necessary to exist

bright fog
bright fog
bronze yoke
#

it creates an api which is good for future proofing + error checking

#

the utility is more that it creates a separation between the library's api and its actual workings than the function actually doing something particularly useful

queen oasis
bright fog
#

Jesus

queen oasis
#

lol

#

I know

#

I'm usually in a hurry and just "do it"

bright fog
#

At the very least don't use ipairs πŸ’€

queen oasis
#

better?

local function isContainerToChange(itemType)
    return JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE[itemType] ~= nil
end
#

πŸ™‚

bright fog
#

Better, if you change CONTAINERS_TO_OVERRIDE to a keytable

bronze yoke
#

remember that while it might be fine for a single mod to do things like that, for a library O(n) is really bad as the data could get massive due from many mods using it

bright fog
#

Exactly

queen oasis
# bright fog Better, if you change CONTAINERS_TO_OVERRIDE to a keytable

is this what you mean by a key table?

JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE = {
    ["Bag_ShotgunDblSawnoffBag"] = { capacity = 125, preventNesting = false, additionalField = 25 },
    ["Bag_TrashBag"] = { capacity = 40, preventNesting = true },
    ["militarycrate"] = { capacity = 75, preventNesting = false },
    ["TruckBedOpen"] = { capacity = 500, preventNesting = false },
}
queen oasis
queen oasis
#

cool, we're on the same page

#

ok, I'll get the function to stuff the key table done and then I can fix the rest

bright fog
#

Unsure if it'll matter much, depends how many times it's called

queen oasis
#

got it

bright fog
distant inlet
# bright fog uh ?

https://www.youtube.com/watch?v=I0w0BZAveVs&t=14s - blink and you'll miss it πŸ˜‚

In this video, we take a look at some of the best new mods for Build 42 in Project Zomboid! This video looks at new mods in March 2025 for Project Zomboid.

Enjoy!

πŸ”½πŸ”½πŸ”½ LINKS BELOW πŸ”½πŸ”½πŸ”½

πŸ‘‰ Mods In This Video: https://steamcommunity.com/sharedfiles/filedetails/?id=3447585615
πŸ‘‰ VOD Channel: https://www.youtube.com/@mratomicd...

β–Ά Play video
bright fog
#

What does that mean

#

What do you mean

#

I understood that your mod was in duck's video, that wasn't my question

distant inlet
#

files in debugger went from eye-searing to dark with some minor release version no?

#

b42.x

bright fog
#

what ?

#

You mean the dogshit debug UI which shows a Lua file on the write ?

distant inlet
#

yes that UI

#

it's a win in my book. Not perfect, but more usable

#

behold the win

queen oasis
#

it always looked like that for me?

distant inlet
#

in that case today i'm less foolish than yesterday

queen oasis
#

I mean, it might have been a setting I changed but can't remember

bright fog
#

No I think he's right, I think it was in white mode before

distant inlet
#

praise spiffo

queen oasis
#

well that's awful

#

ok, my add function:

JB_MaxCapacityOverride.addContainer = function(containerType, capacity, preventNesting, _equipped_weight)
    if capacity == nil or type(capacity) ~= "number" then
        print("JB_MaxCapacityOverride Error: weight not specified or was not a number")
        return
    end
    if preventNesting== nil or type(preventNesting) ~= "boolean" then
        print("JB_MaxCapacityOverride Error: allowNesting was not specified or was not true/false")
        return
    end
    if not JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE[containerType] then
        JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE[containerType] = {}
    end
    JB_MaxCapacityOverride.CONTAINERS_TO_OVERRIDE[containerType] = {
        capacity = capacity,
        preventNesting = preventNesting,
        equippedWeight = _equippedWeight -- or nil if not used?
    }
    print("JB_MaxCapacityOverride: Container override added succesfully: ", containerType)
end

can it be better?

bright fog
#

Verify containerType even exists in the scripts

#

Also

#

Dear god

#

Remove that last print

queen oasis
#

oh no

bright fog
#

For the SANITY of everyone

queen oasis
#

I was, it was for me

bright fog
#

Jeez thank god

queen oasis
#

I hate that shit

bright fog
#

Bcs that's what Item Tweaker did and it's the reason it wasn't very efficient

distant inlet
#

I guess allowNesting and weight are coming from outside the function?

#

(not args)

bright fog
#

What ?

#

They are args

queen oasis
#

no, I was messing around and forgot to change it

#

nah, he's right, I fixed it right before he mentioned it

bright fog
#

Also

#

For equipedWeight

queen oasis
#

_equippedWeight in the code because I can spell

bright fog
#

Wait give me a sec need to verify something

queen oasis
#

I left it last in case it's nil. I didn't know if it would care or not

bright fog
#

No it's good

queen oasis
#

I don't think it will but didn't feel like checking right now

bright fog
#

It will be good

#

You can leave as is

#

I wasn't sure if you could do that, but you can I just tested it

queen oasis
#

I think it's ignored but lua can be meh

bright fog
#

No Lua is consistent, as long as you follow the rules

#

Here it's not a problem

#

It is however a problem if it's an array

queen oasis
#

you seen my code, I am not consistent

bright fog
#

That's fine lol

#

Just need to make sure things are clean since it's a library

queen oasis
#

yea, usually I wouldn't ask but I figured I should for this one and I appreciate the help and advice big time

bright fog
#

When you release it, I'm interested in getting hold of it so I can make a Modding project wiki page for it for easier sharing

#

I'd advise you make a Github page too if you haven't already

#

Should help with handling the project or overall other modders reporting issues

#

I know a looot of people will appreciate a patch for the container capacity limit

queen oasis
#

I need to figure out why trunk damage isn't being factored in to the effectiveCapacity

bright fog
#

irrelevant to conversation above

#

wait I'm a dumbass

storm trench
queen oasis
bright fog
#

Lol wtf guys

#

We're all dumbass ?
Always have been.

queen oasis
#

who took the picture?

bright fog
#

The third dumbass

queen oasis
#

I don't think I can do anything with trunk / seat damage lowering capacity. It looks like it's all java side

raven cradle
#

Hey, everybody!
Dedicated servers have peculiarities of receiving messages from game to discord and sending from discord to game. But this feature is already outdated and has some kind of bugs 😦
I am currently developing a bot that could perform this functionality. I know that the bot looks at messages from logs, processes them and sends them to discord. But I ran into a problem:
How to send messages from discord to the game?
RCON is not suitable, because /all messages (to the main chat) are not supported in console commands, I tried to add support for such a function through modification, but I am not strong in kahlua, does anyone have any ideas how to send messages from discord to the game?
I write the bot in Python (no bugs so far).

bright fog
#

My guess is have a Lua script read server side in a file which receives Discord messages

#

ID Discord user to in-game players, if player is in-game or some shit, then send server command to client to Say the message

#

However I'm unsure if player:Say(message) writes in chat but I'd figure yes

raven cradle
queen oasis
#

hmm, how far do I go?

bronze yoke
bright fog
#

The mod will have the Lua part

#

There's possibly better ways of handling this

#

But I'm not familiar with file reading so can't give much informations on that sadly

#

I know it's possible however

#

I know it is done by some mods, some servers

queen oasis
raven cradle
bronze yoke
#

yeah basically any external communication needs both a mod and an external process

bright fog
#

Never heard of anyone using the forums for development

#

You're better off asking the modding community I feel like

raven cradle
bright fog
#

Your process involves a mod, that we can help you with

#

The bot part is your thing however

raven cradle
bronze yoke
#

usually what you'll do is write a file to the cache directory that a mod periodically reads to check for commands

#

we can't add more rcon commands with mods so you can only rely on it for the very limited things it can already do

raven cradle
#

Thank you for the consultation!
I'll be back as I start developing the modification, I've figured out which way I need to look

storm trench
bright fog
#

lol

#

fair enough

potent copper
#

Hey guys could you help me to find file in games folder that has animals paths script? Wanna figure out how does it work

bright fog
#

That way modders actually fix their fucking shit bcs they are forced to or their mod doesn't work, instead of leaving broken entries

queen oasis
#

I didn't know that

bronze yoke
#

i mean either way the result is the same since they return after the prints, it just gives it a an easier to debug red error + stack trace

distant inlet
bronze yoke
#

prints disappear in the sea really easily

bright fog
bright fog
bronze yoke
bright fog
#

It throws a manual red error

bright fog
#

I was pretty sure error would do it ?

#

There's something to do it right ?

storm trench
#

Isn't there guide on advanced workshop stuff? I have looked everywhere, and I'm sure my dumb butt just can't find it. Like, gif screenshots, better screenshots in general, etc.

bronze yoke
#

error does end the execution of the function, but since pz's kahlua is modified to call all functions in protected mode, that doesn't propagate out and basically just acts as a return

queen oasis
#

print("JB_MaxCapacityOverride: WUT? capacity not specified or was not a number")

bright fog
bronze yoke
#

in standard lua you'd expect the entire call chain to be halted

bright fog
#

Well anyway probably better to use error so they have a big marker of where the problem is

bronze yoke
#

yeah definitely

bright fog
#

Yeah now I remember that protected thing

bronze yoke
bright fog
#

How so ?

distant inlet
#

gotta have a hard stop somewhere

bronze yoke
#

imagine the consequences of the entire lua callstack halting every time you get a red error

distant inlet
#

typo causes whole game to crash

bronze yoke
#

when things error they'd take half the game with them

distant inlet
#

is there a way of controlling where the error is "caught"?

bronze yoke
#

if you've ever modded the main menu ui you'd know mistakes in there sometimes make the menu fail to load and softlock the game, that kind of thing would be much more common that way

bright fog
#

Hmm

#

Perhaps that would push people to fixing errors lol

distant inlet
#

like try-catch

bronze yoke
#

lua has pcall for that but it doesn't work well in pz for a couple reasons

#

since all function calls are protected anyway, if the function you're calling internally calls another function that errors, it won't reach your pcall

#

also, even if you do catch an error with it, it doesn't prevent the red error, so you'll get bug reports

bright fog
#

Amazing

#

Perhaps the best way is to always use pcall whenever you want to call a function, that way everything can get caught or some shit ? hahalol

bronze yoke
#

another troublesome thing is error is supposed to take an argument which blames a higher part of the callstack for the error (for example, if you do error(message, 2) the stack trace would blame the function that called this function and not this one: good for reporting errors with incorrect library usage, it isn't an error in the library, it's an error in the user) but pz just ignores it

vast pier
#

can you mark b41 mods as incompatible the same way you can with b42?

incompatible=RamshackleRecipes,``` doesn't seem to be working
I also tried it without the comma
distant inlet
#

so no passing error up the call stack

vast pier
#

πŸ˜”

bright fog
muted garnet
#

is it possible in vs code to enable displaying unknown as error?:

---@class SomeTable
SomeTable = {
    value1 = {
        type = "int",
        value = 1,
    },
    value2 = {
        type = "boolean",
        value = true,
    }
}

local normalValue1 = SomeTable.value1.value
local mustBeErrorValue1 = SomeTable.value1.someErrorType
local mustBeErrorValue2 = SomeTable.value1.someErrorType.sonsgsgasgdswgsdf.sdgdasgfgdg

Now only when hovering it says unknown but it doesn't show up as an error

bronze yoke
#

try ---@class (exact) SomeTable

#

i think there is also a setting somewhere to make this the default behaviour of all calsses

muted garnet
bronze yoke
#

yeah this is why i hate using it tired it needs every single field to be defined by an annotation

muted garnet
#

yep, I have a lot of fields and I don't want to declare each of them

#

and how do you deal with this problem?

bronze yoke
#

here i'd probably do something like this```lua
---@class (exact) SomeTableValue
---@field type string
---@field value any

---@type {string: SomeTableValue}
SomeTable = {
value1 = {
type = "int",
value = 1,
},
value2 = {
type = "boolean",
value = true,
}
}

#

SomeTable.value3 would not error here though if you want that too

#

i'm not sure if that is possible

#

without hardcoding a full list of fields

muted garnet
#

got it, thanks

main pasture
queen oasis
vast pier
muted garnet
# bronze yoke here i'd probably do something like this```lua ---@class (exact) SomeTableValue ...

please tell me, if instead of declaring fields I just make a lot of classes, does it give the same check, but there is no need to register fields, or is this a bad implementation?:

---@class _
    ScoutSkills = {
        type = "ScoutSkills",
        name = getText("UI_trait_scoutskills"),
        desc = getText("UI_trait_scoutskills_desc"),
        ---@class _
        xpBoosts = {},
        ---@class _
        freeRecipes = {
            "Herbalist",
            "MakePlantainPoultice",
            "MakeComfreyPoultice",
            "MakeWildGarlicPoultice",
            "Black Sage Growing Season",
            "Broadleaf Plantain Growing Season",
            "Comfrey Growing Season",
            "Common Mallow Growing Season",
            "Wild Garlic Growing Season",
        },
        ---@class _
        values = {
            defaultWalkSpeedIncreaseMultiplier = 1.2
        }
    },
queen oasis
#

besides the typo that broke everything that I had to fix already jeez

small topaz
#

Hi! In .txt files of the tranlate folder, how can I insert quotation marks in the UI text? I already tried

UI_myMod_myText = "Display \"quotation marks\" here." 

using backslash \ before the " but this doesn't work for me.

bronze yoke
#

i've seen vanilla use regular unescaped quotation marks

small topaz
#

oh XD I just try this!!

muted garnet
#

@bronze yoke please tell me, if instead of declaring fields I just make a lot of classes, does it give the same check, but there is no need to register fields, or is this a bad implementation?:

---@class _
    ScoutSkills = {
        type = "ScoutSkills",
        name = getText("UI_trait_scoutskills"),
        desc = getText("UI_trait_scoutskills_desc"),
        ---@class _
        xpBoosts = {},
        ---@class _
        freeRecipes = {
            "Herbalist",
            "MakePlantainPoultice",
            "MakeComfreyPoultice",
            "MakeWildGarlicPoultice",
            "Black Sage Growing Season",
            "Broadleaf Plantain Growing Season",
            "Comfrey Growing Season",
            "Common Mallow Growing Season",
            "Wild Garlic Growing Season",
        },
        ---@class _
        values = {
            defaultWalkSpeedIncreaseMultiplier = 1.2
        }
    },
bronze yoke
#

i've never tried this, i don't know

muted garnet
#

got it, thanks

bronze yoke
small topaz
muted garnet
#

why does calling refreshAnimSets(true) return the error nil: Object tried to call nil in ...

bronze yoke
#

good catch, it's not actually registered as a function

#

methods are supposed to have this LuaMethod annotation to actually expose them, that one doesn't have it

#

i think that's the only public method in the class to not have one

muted garnet
#

got it, thanks

grizzled fulcrum
# bronze yoke i'm not sure if that is possible

yeah you have to, I usually have 2 separate defs for it like

--- @class (exact) SomeTableValue
--- @field type string
--- @field value any

--- @class (exact) SomeTable
--- @field value1 SomeTableValue
--- @field value2 SomeTableValue
--- ...

I think it's the only way to do it sadly 😒

#

nvm I just looked above. wth does the class _ magic do?

frail yarrow
#

When parsing through
playerInv:getItems()
and looking at containers.
Which element is the maximum item encumbrance float

#

omg, found it. MaxItemSize

grizzled fable
#

is it possible to add a custom Crafting bench? (B42)

silent zealot
bronze yoke
silent zealot
#

That might be because what I think of as "Umbrella" is actually some generic lua stuff AND the zomboid-specific umbrella stuff.

#

Thanks for the link.

bronze yoke
#

umbrella is (mostly) definitions for zomboid's types, the actual annotations system is all the language server

slim swan
#

Is there any way to disable the display of the moodles UI?

broken oasis
#

How can I fix this, or which editor are you working in?

craggy nacelle
#

Hey, i dont know if i should ask this here, but starting today i have a strange problem with the editor displaying text when starting my pz to test a mod i am currently trying to create.

#

Does anyone know whats going on?

queen oasis
craggy nacelle
broken oasis
#

which editor are you working in?

craggy nacelle
#

Me? I use visual studio code to write my mod. Or did you talk about ingame? I only started with moding pz so i dont know if there are ingame debug mods like with the mod loader...

broken oasis
#

That's all, it's a survey.

broken oasis
craggy nacelle
#

Havnt done much with lua till now, so i still have to get a feel for the whole thing.

broken oasis
#

Thank you for the response.

vast pier
#

If anyone knows if you can, that would be really cool to have custom workstations with their own recipe menus

thin swan
#

I think it should be possible tbh, I've been messing around a lot with recipes and the crafting/building menu lately and they're pretty damn flexible

#

Time to do a deep dive into animations so I can get this bad boy working

winter bolt
#

you just have to check the console.txt and see where its happening and try to figure it out

#

the error is always really vague

bright fog
#

We use VSCode

bright fog
#

Very early error

broken oasis
#

Is this not enough?

#

I understand that VS Code doesn't recognize the parameters of Project Zomboid (API), or am I wrong?

drifting ore
#

Did you do the thing

potent copper
#

hey guys could you give me some advices
im wanna start making my own mods but idk which languages should i learn. ive heard that modders use Lua but im not sure this is enough

bright fog
#

You are not supposed to download an extension too

#

You need to use ctrl + shift + P if I remember that right

#

And search for addon manager or some shit

#

Simply follow the correct tutorial

broken oasis
#

Thank you all so much for your help, I appreciate it, but my problem is still not fixed."

thin swan
# potent copper hey guys could you give me some advices im wanna start making my own mods but id...

Lua is what PZ mods are (mostly) written in, so learning it will definitely help a lot, but more importantly you have to learn how to think like a coder.
For example I hadn't touched Lua at all until about two weeks ago, but I have experience in Python and JavaScript so picking up Lua wasn't very difficult.
I'd still suggest doing some Lua code course though since it will get you started with modding faster, but make sure it teaches the fundamentals of coding too, like data types, variables, control statements etc.

thin swan
thin swan
# broken oasis Thank you all so much for your help, I appreciate it, but my problem is still no...
broken oasis
#

I think I did everything you said, but it still doesn't detect.

slim swan
#

Where can I find the Moodle related content? I want to add an option to hide it from display.

#

I haven't touched Moodle before

bright fog
#

Also to generate random, it's suggested not to use ZombRand

broken oasis
#

It seems that it started offering the necessary parameters, and as for the errors after disabling 'EmmyLua', the problem is gone. Thank you all for your help.

broken oasis
thin swan
# slim swan Where can I find the Moodle related content? I want to add an option to hide it ...

I tried checking how exactly they work, but I don't have much time to dig deeper, but you're basically gonna have to mess around with MoodlesUI.
There is a setMoodleUI on the UIManager, so you should be able to pass an empty MoodlesUI element as the second param.
But it might not be as straight forward as that.
If that method doesn't work, try checking how some other Moodles mods are manipulating them

slim swan
craggy nacelle
# bright fog Very early error

Youre absolutly right. I tested it. Turned out i had the mod activated from the start menue on and when it loaded it throw an error and that was the result. Thx, that clears it up. Also: Dont activate unfinished mods. ^^ Thx again. πŸ™‚

vast pier
#

Hey I’m kinda desperate for food n stuff atm so I’m trying to do commissions.
If anyone is looking to commission any sort of gun/melee/armour mod it would really help me.
I also have some experience with lua and recipe scripting if you have other requests that don’t fit the previous stuff.
I’m not looking for a lot of money, just some to help me scrape by.
If anyone is interested, please DM so we can discuss details. I have a Kofi and PayPal.

muted garnet
#

what TimedAction is use for construction via buildingmenu?

queen oasis
muted garnet
#

thanks

thin swan
bright fog
#

I think something changed in B42

#

But still

storm trench
#

Oh, the sweet release of being able to play a game instead of modding. ❀️‍πŸ”₯

bright fog
#

lol

#

But I am indefinitely stuck in the loop of modding

storm trench
#

It's healthy to escape for a while, but you do you lolll.

bright fog
#

I enjoy modding almost more than playing the game tbh πŸ˜…

elfin jungle
thin swan
#

Yeah it doesn't seem to be directly exposed, but I figured since it extends UIElement it should still be possible to get the reference to it and manipulate it with the methods that are exposed, but I haven't really had to deal with anything that isn't exposed yet so not sure if it would work

bronze yoke
#

moodles are pure java + the most hardcoded thing in the entire game

#

to hide them i did```lua
local ui = UIManager.getUI()
for i = 0, 3 do
ui:remove(UIManager.getMoodleUI(i))
end

thin swan
#

Ah nice one, that makes sense

#

@slim swan check Albions message above if you haven't got it done already

bronze yoke
#

i think i tried setMoodleUI to nil first but that caused a bunch of null pointer exceptions, this just stops the ui manager from actually rendering the moodles

bright fog
#

What's the reason ?

elfin jungle
#

hello, can i ask, where are the files for characters talking? like text above their heads, i wanna make a mod that triggers a random piece of text when you eat something.

thin swan
elfin jungle
#

thank u so much dude

#

im new, i apologize, but mind telling me where do i find that in the files? and maybe a lil extra info? im watching a tutorial rn but i still have a hard time actually doing something

#

my goal: each time u finish eating, a gordon ramsay quote pops up.

whole yoke
#

ive always wondered about this, but, when making a clothing mod: how does the game know where to put the "scratch defense" or "bite defense"?

vast pier
elfin jungle
#

C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\actiongroups\player ?

vast pier
#

same way it knows where to put holes

elfin jungle
#

i cant really find the player object or :Say anywhere.. anyone help? again i apologize

slim swan
slim swan
frank elbow
bright fog
#

figured that was probably for that

small osprey
thin swan
bright fog
#

Hook to the perform method of it to trigger the player saying the quote

silent zealot
#

@elfin jungle How much prior experience do you have with programming/scripting?

merry saffron
#

Can I modify my mod files in real time through debug mode while the game is running?

bright fog
#

Some stuff react differently

#

Models usually reload

merry saffron
#

How?

bright fog
#

Animations and AnimSets too

#

Automatically

#

in the case of Lua files you need to reload the specific Lua files

#

Requires your files to be reloadable as depending on how you write your Lua you might not be able to reload

#

And some stuff won't even apply and still require hot reload of the Lua

#

Scripts don't reload

#

Need to reload Lua in the main menu or reboot game

bronze yoke
#

scripts can be reloaded in b42

#

in the in-game debug menu there's a script manager button which lets you view and reload scripts

bright fog
#

Really ? That's cool

#

Good to know

merry saffron
#

What's the keyboard shortcut to open this screen?

tacit pebble
bronze yoke
#

f11

strong jasper
#

Question. How can I create a garden gnome for a player to add to their inventory?

tacit pebble
merry saffron
#

How come between these two functions, the line local zombies = getWorld():getCell():getZombieList() always fails when called on whichever function appears second in the code? If I swap the placement of the functions, the first one will always work, and the second will always fail on that line. Is this a lua thing? I'm not super familiar with the language.

tacit pebble
#

what the error says?

bronze yoke
#

there shouldn't be any way that would happen yeah

merry saffron
#

Not sure, can I expand the callstack? I'm getting this in the debugger when freeze zombies is second for example. If I switch the locations of the functions, I get the same thing with the other function.

bronze yoke
#

at the top there should be an errors button, the one at the bottom is the most recent (it starts at the top πŸ™ƒ)

distant inlet
#

how do I get my icon to show up in the mods list?

#

i have icon.png in the same folder (/42) as mod.info, which has a line icon=icon.png

merry saffron
#

Is this what I'm looking for? Is this the whole thing, or is there more?

tacit pebble
bronze yoke
#

those look like the debugger crapping out πŸ˜… it does that a lot

#

one of those should point to the line that errored in your function, along with an actual error

bronze yoke
bronze yoke
#

you can try using this icon from one of my mods to see if the image is the issue

#

yeah

tacit pebble
#

oops thank you you were faster than me

#

I was just confused hehe and I was sure right after then.

silent zealot
tacit pebble
#

is there any file which including opening UI window function in vanilla PZ? I want to reference vanilla file but I have no idea.
I just want to create a window and write something inside. from the scratch. (studying)

merry saffron
#

Is there any way to quickly apply setUseless to every zombie in the entire world, including as they spawn in from the side of the screen? I tried one hour, and it wasn't nearly enough, and every ten minutes also feels like it might not be enough

silent zealot
#

@tacit pebble every bit of UI gets it's own code.

#

Some java, some lua, some mixed.

silent zealot
#

I have no idea what the exact behavior is for it, but it might be part of teh solution for you.

slim swan
#

setuseless sometimes makes zombies stop moving forever. I tried it when I made my first mod, but I didn’t dig deeper into it.

#

In my Mad Crafter mod, I set setUseless(true) after an attack and then set it to false after 1 second. However, this occasionally causes a low probability issue where some zombies stop moving forever.

slim swan
tacit pebble
silent zealot
#

Good luck, there is a reason no sane developer writes a UI engine from scratch instead of using a framework of some sort.

bright fog
#

Not common

#

Not common

silent zealot
#

He did say it was in /42

bright fog
#

Didn't see mb

wicked sonnet
# distant inlet how do I get my icon to show up in the mods list?

In my defense, I haven't made a mod, just considering to make one and stalking/reading through here and forums.
But looking at some other mods it looks like you need the icon png in your version directory like you have (i.e., /42) and update the mod.info file to include icon=[NAME OF ICON].png. Maybe you're missing the icon line in your mod.info file?

ancient grail
#

OnObjectAboutToBeRemoved

will this trigger multiple times i mean 1 per client?

bright fog
#

The wiki shows if it's client or server trigger

ancient grail
#

you might have missed the trigger

#

im aware that you added the trigger side but that event doesnt have that so,.. yeah..

bronze yoke
#

iirc that event is not fully documented

ancient grail
#

looks like its server sided

bronze yoke
#

if it doesn't specify that means both but i think in this case it was set that way because i didn't know

bronze yoke
#

i think the first trigger is clientsided

#

so it may actually be both

ancient grail
#

cuz im afraid of using it sorta. well i can test but it might act differently when its dedicated server
idk

#

i plan to use it to spawn an item on the ground based on the spritename of the obj

#

but if its client sidded then it will spawn x amount of items based on the players online that recieves the trigger maybe

#

ill try to
triggerEvent("OnObjectAboutToBeRemoved", obj)

bronze yoke
#

it might actually be client only in build 41, unless they were just moved to packet code (which is removed from the public build so we don't have it)

ancient grail
#

its server

ancient grail
#

which means i cant trigger it that way sinc eits a server event im about to find out

bronze yoke
#

the trigger in IsoGridSquare is shared, the method it's in is called in a lot of places including GameClient in one case

ancient grail
#

it works on both

#

oh snap my bad the other one was on shared and another was manual added using console.. but yeah since vanilla uses it on server then iits confirmed that its both.. ill just use it server sided to be safe

bright fog
bronze yoke
#

too late at this point, i wrote most of that stuff like two years ago

thin swan
#

Am I crazy or is it absolutely necessary to have custom animsets in ./42/media/AnimSets AND in ./media/AnimSets even if I'm just making the mod for b42?

merry saffron
#

When uploading a mod for the first time, do I have to give it a workshop.txt, or does the game do that?

bronze yoke
bronze yoke
thin swan
bronze yoke
#

the bug is that the game scans ./media/AnimSets for names of files to load, but when it actually loads them it uses the common/version folders correctly

#

so the contents of the one in ./media technically doesn't matter at all, it just needs to exist

thin swan
#

Aah okay that makes sense

bronze yoke
#

i remember telling people to just wait for TIS to fix it any day now before they make animation mods... that was about three months ago πŸ˜…

thin swan
#

Hahaha damn, hopefully whatever fix they put in won't break everyone's stuff when it comes πŸ˜„

merry saffron
#

Is there any easy way to make every zombie wear the same outfit?

bright fog
merry saffron
stiff gorge
#

If anyone on here accepts payment on fiverr or similar for modding please message me.

I'd like to see a mod that adds end game goals like repairing a dam, electrical station, or summoning bosses to collect their badges. Something that takes serious hours and forces the player into peril.

If this isn't allowed, please feel free to delete this.

#

B41

silent zealot
#

There's a commission channel on the Zomboid modding discord... Search for "commission" here and you should find a link.

#

Do you have the ideas for what you want sketched out in more detail than the very high level concept? That will help a lot of you're looking for a programmer, having specifics of what you want

#

And how it would actually work in game.

thin swan
#

Woohoo, making some good progress finally. Just need to make a kicking and a breaking animation, and get the transitions right

broken kayak
#

Hello there, I have a small question concerning Lua and InventoryItems in Build 42.

I'm having trouble choosing a way to differentiate between Bags and KeyRings.

I want to get all wearable items but as bags arn't clothing, I get all InventoryContainers, except well KeyRings are InventoryContainer too.

Right now I'm considering using something around the like of item:getDisplayCategory() == "Bag" to extract bags, but the display category seems to be pretty inconsistent.
So I've been thinking about matching a pattern against the item type as such item:getType():match("^Bag_") as they seems to be more consistent.

But still, I am wondering if there could be a better way to get all wearable items at once (Both clothing and bags) or was I on the right track ?
Thank you in advance.

bright fog
#

Replace by the type of java object you are checking

#

Each item types are a subclass of item

#

KeyRing is a subclass so check for it

broken kayak
#

Thanks for the quick answer !
Do I need something else to get the subclass of an InventoryItem to use with instanceof() ?
Right now using :
instanceof(item, "KeyRing"))
Where item is of instance InventoryItem doesn't work, which seems to be expected.

bright fog
broken kayak
#

Well there must be something wrong with my code then, let me triple check

bright fog
#

Alternatively don't use the display category but get the item category

broken kayak
#

Also maybe I should have precised, but I'm working on Build 42

broken kayak
# bright fog I think it should ?

Considering the following snippet

---Is the passed InventoryItem a KeyRing ?
---@param item InventoryItem
function IsKeyRing(item)
  return instanceof(item, "KeyRing");
end


---@param playerNum number
---@param context ISContextMenu
---@param worldObjects IsoObject[]
function DrawWearWorldItemMenu(playerNum, context, worldObjects)

  -- ... Code here ...

  for _, worldObject in ipairs(worldObjects) do
    -- Skip any object that is not an InventoryItem
    if instanceof(worldObject, "IsoWorldInventoryObject") then
      ---@type IsoWorldInventoryObject
      ---@diagnostic disable-next-line: assign-type-mismatch
      local worldInventoryItem = worldObject;
      local inventoryItem = worldInventoryItem:getItem();

      dprint("Is " .. inventoryItem:getName() .. " a KeyRing ? : " .. tostring(IsKeyRing(inventoryItem)));

    end
    -- ... Code here ...
  end
  -- ... Code here ...
end
bright fog
broken kayak
thin swan
#

Anyone happen to know why my animation is playing so quickly?
I tried adjusting the SpeedScale in the .xml but it's not making any difference. The animation is 186 total frames and I used Mystery's Rig. Playing it in blender at 60fps looks perfect, but I can't get it to slow down in-game.

bright fog
#

Wasn't there anything in the java doc ?

broken kayak
#

Well not that I found but I'll keep looking

bright fog
thin swan
thin swan
#

Hmm, it's got to be something else that I messed up, because no matter the fps I set in blender or how much I space out the keyframes it still plays super fast. Checking the animation in-game using the animation viewer have it looking correct.

#

Ah, I think it's being affected by walking increasing the speed of it, because if I make it my idle animation and stand still it's playing properly, but when I start moving it speeds up.

bright fog
thin swan
# bright fog Wait it's not a vehicle lol ?

Nah I made it an item that just attaches to the player, I looked at a wheelbarrow mod as reference. I figured trying to make it a vehicle would be way more difficult and impose some limitations

thin swan
#

Haha thanks! With it being an item I can also make it so it's foldable which decreases weight so you can attach it to/put it in your backpack and bring with you everywhere

thin swan
#

Yeah definitely the defaultWalk kicking in that's messing it up. I set the vanilla defaultWalk speedscale to 0.2 and now my animation plays nicely, but I'm moving super slow lol.
Guess I gotta figure out how to override the defaultWalk completely but still make it so my animation moves the character πŸ€”

bright fog
#

Mystery's rig is bugged

#

Use Paddlefruit's one

thin swan
thin swan
# bright fog Blend time ?

Not sure tbh, I got it to work so that my scooter kicking xml is overriding the defaultWalk, but now my character isn't moving, and even though it says the animation is playing in anim monitor, nothing happens. I'm guessing the animation is tied to the movement speed, so once I can get it to move the character maybe the animation will start working too

thin swan
# bright fog Use Paddlefruit's one

Is there a tutorial on that one? I kinda figured it out, but I liked how Mystery's was automatically adding keyframes when moving the limbs

bright fog
#

It's the button that looks like a record button

#

Also the rig has a tutorial on the Github page

thin swan
#

Ah yeah found it, thanks

bright fog
#

Paddlefruit was developped by Paddle and a few animators for the game that have some experience with PZ animations, the various issues with the available rigs etc

#

So overall it's Mystery's rig ++

#

Cleaner IK structure and fixed PZ default rig to be able to use mirroring and shit

thin swan
#

Ah sweet, yeah I can tell it looks cleaner, just gotta play around with it a bit to get used to it

#

I'm guessing from the readme that I'll have to mess around with the translation data too in order for my character to move.
Well, I know what I'm doing the next couple of hours lol

bright fog
#

Translation data needs to be used whenever the character needs to move yes

hollow cloud
#

Trying to find where to ask about a mod being created. Is this the place?

tranquil kindle
hollow cloud
#

Where?

#

I mean it should be simple enough. Pause if hit 50 health. I have died to many times while doing crafting for being overweight. Would be nice if there could be a safety in place.

#

Sorry. Playing PZ

tranquil kindle
hollow cloud
#

Was ripping clothing and weight went over 65 for some reason.

#

I'll check my mods so thanks for reminding me of that update.

bright fog
#

The modding Discord is actively looking for people who have experience with animations who can help animate horse animations for an upcoming mod managed by the modding community. A rig is already made for the horse in Blender and implementation of the horse animations in-game is already taken care of. We currently just lack the proper talents required to finish it !

If you are interested in becoming a contributor, join the modding Discord (https://discord.com/channels/136501320340209664/1125248330595848192) or DM me !

You can see the whole project and the current plans here:
https://trello.com/b/7qt7QpBM/horsey-time-zeehaw

polar solstice
#

Let's Cook
https://steamcommunity.com/sharedfiles/filedetails/?id=3446732380
Version 1.03:
Code clean up
Fixed; counting items already added to base item of evolve recipe
Fixed; open radial menu for specific item when right click and selecting "Lets Cook" menu item
Fixed; check if base item has enough water in it, if it needs water

To do; Press and hold (or right click) to add 2 or 3 items per ingredients
To do; Test using controller

New things learned:
The number of items already added to a base item:
local ingAlreadyUse = evoItem:getExtraItems()
The number of spices already added to a base item:
local spicesAlreadyUse = evoItem:getSpices()
Beware, for spices check if evoItem is of type Food:
instanceof(evoItem, "Food")

elfin jungle
#

is ANYONE so kind to personally coach me how to make mods? no need for call, but js a starter pack of what to do, (ideally including b42), i tried this: https://www.youtube.com/watch?v=-yrmCAwzTbY&t=153s but i think i need answers to some of my questions too, thanks beforehand πŸ˜„ enjoy yalls days

1:11 Step 1 - Know your file locations
4:06 Step 2 - Storyboard your ideas out
9:03 Step 3 - Get your files from the game or other mods
11:47 Step 4 - Build your mod files
1:01:54 Step 5 - Create the textures (mislabeled in the video, oops)
1:19:45 Step 6 - Put your mod files in the right structure
1:30:37 Step 7 - Test your mod (please back up ...

β–Ά Play video
vast pier
#

is there a b41 mod that makes well water tainted?

merry saffron
#

Would it be possible to make all zombies the loaded area around the player walk out of the loaded area and despawn?

queen oasis
bright fog
#

Brother codes with Notepad++ in his video, I've seen enough ohfuck

vast pier
#

Cuz I like the implication that b42 has with tainted well water.
It implies that the knox virus was/is water borne, but can be filtered using proper filtering methods (hence why plumbed water isn't tainted)
But I haven't seen a backport of this feature

bright fog
vast pier
#

This head canon is the only reason I'm okay with rain water being tainted

merry saffron
#

Rainwater isn't safe to drink IRL without boiling it

queen oasis
#

I've seen Bear Gryll's drink much worse and be ok-ish

vast pier
merry saffron
#

Is there any "easy" way to make zombies pathfind away from something?

bronze yoke
#

i've never really understood where TIS is going with water in general πŸ˜… rain water is tainted, but every tap in the entire game keeps 20+ litres of fresh water in it forever? also it seems like every other update tainted water flips between 'mild nuisance' and 'insanely lethal'

grand gazelle
#

maybe they don’t know either xd

queen oasis
#

I'm driving myself insane with this, which means it's probably simple.
How can I get the players currently selected "bag" in the inventory pane?

grand gazelle
#

just messing around I’d guess until some form of recyclable water is added as a possibility, like chemical filtering or whatever. Are piped sinks filled from rain still clean?

bronze yoke
#

yeah, the piped sink is always clean even if the thing they're piped to isn't clean

grand gazelle
#

that could always change but I can’t recall how high a priority water systems are on their roadmap, can’t imagine v high

vast pier
distant inlet
#

i wish lua was strongly-typed

vast pier
bronze yoke
#

wells never really bothered me because they're rarely in good spots anyway but getting rid of easy infinite fresh water sources is definitely in scope

grand gazelle
#

tainting any groundwater sources after x amount of rain cycles would be immersive

distant inlet
vast pier
grand gazelle
#

but like, also, chemical water filter systems could also be a potential add

#

tho idrk much about water contamination and the chemistry to know what would automate the process other than like, boiling it

#

to get rid of the bacteria

#

I guess a mod that focuses on more water filtration methods + no easy infinite water would be dope

merry saffron
#

Where does the game store outfit definitions?

bronze yoke
#

media/clothing/clothing.xml

merry saffron
#

Can I create a zombie outfit with a piece of clothing that is a particular color?

thin swan
#

Still struggling hard with this damn animation.
When it says to "animate the location of the 'CTRL_TranslationData' bone", is this what it means?

silent zealot
#

Then when you have a specific blocker ask here.

thin swan
# bright fog Should be that

Dang, I think it might be time to put this one on the shelf for a bit, I can't figure out how to get him to move.
I put my xml in AnimSets\player\movement and I can see that it triggers correctly in the anim monitor, but there's no movement and the animation doesn't play.

bright fog
#

Animation doesn't play ?

#

Then that must be a completely different problem

#

I suggest you ask in the modding Discord in the animation channel

thin swan
# bright fog Animation doesn't play ?

It plays if I put it as my animation in my idle anim xml, and it plays if I don't put the kick anim xml in the movement folder, but then the speed is all messed up instead

thin swan
silent zealot
#

I want to try plumbing a whiskey tap...

merry saffron
#

Can I disable entire lua files using sandbox options somehow?

queen oasis
#

what happens when you don't pay attention and just save all

queen oasis
silent zealot
tacit pebble
silent zealot
#

But sandbox variables are not available when the files load.

merry saffron
# silent zealot Can you describe your goal in more detail?

I have a zombie outfit and hair file that override every zombie's clothes and hair, and I want to be able to disable that with a sandbox option, but I don't know if the haircutOutfit insert needs to be done before loading the world, and if it does, what to do then

tacit pebble
silent zealot
#

OnInitGlobalModData is the earliest event you can use with sandbox variables.

#

So you can attach a function to that which starts with "if MySandboxSetting == false then return"

icy night
#

Does anyone know the weather iso for a storm?

#

Or where I can find it

silent zealot
#

What do you mean by "weather iso"?

#

If you want to affect the weather look into the climate manager, which can get using the global getClimateManager() function.

earnest remnant
#

Anyone know if there is a way for items in item scripts to inherit from another? For example, I decide to create a bunch of variants of an item like a security camera. They all have some consistent properties such as tags, but they might also have some properties that need overriden such as FOV. Basic OOP stuff with abstract objects and concrete ones.

silent zealot
#

I wish that feature existed!

#

Zomboid goes the opposite way - you often have to have more than one definition for an item becasue "black digital watch on left wrist" is a diferent item to "black digital watch on right wrist"

#

Then another two items for the red version, and another two items for the gold version.

earnest remnant
#

Oof

earnest remnant
#

Kind of assumed that but was hoping

bronze yoke
#

do not be tricked, scripts are not in any sense a scripting language

#

it's just raw data like json or xml

silent zealot
#

And I am once again missing rimworld's XML approach

earnest remnant
silent zealot
#

πŸ˜‚

bronze yoke
#

i hope they'll consider doing this in the future since both mods and vanilla have huge amounts of nearly identical items

silent zealot
#

There is some improvement n B42.

#

For example "torch" and "torch with no battery" are no longer two seperate items.

earnest remnant
#

Fancy is just a nice way us poor people say "obtuse and/or overly contrived"

earnest remnant
#

You have to give them at least some props for wanting to build it from the ground up. But @bronze yoke I agree, it would be a neat addition. From what I can follow on the changes from 41 to 43 they're starting to change the API structure to be a little less of a mess, so... Maybe?

silent zealot
#

I don't think it would even be a huge amount of effort to add "InheritFrom = Base.TemplateItem" to the parser, that just copies all the fields from the source template item.

#

(provided the source was loaded before the new item)

frank elbow
#

Ever since you mentioned the XML thing a part of me has dreamed they'll convert scripts to a format like that in the far future

#

But I know that is not likely to actually happen πŸ˜”

silent zealot
#

I don't think they will, but we can dream.

earnest remnant
#

Having it would make creation of frameworks a little cleaner

silent zealot
#

It would make a lot of thing much easier.

#

The rimworld "components" lets you add a comp to soemthing. Want a heater? Add the UsesPower and CrreatesHeat comps to something.

#

Zomboid has everything tied to monolithic java classes.

bronze yoke
#

they've pivoted to that in b42

frank elbow
#

At least for that part it seems like they're going in that direction

bronze yoke
#

but all legacy systems are unchanged

silent zealot
#

BUT... they have the very start of a better way in B42.

#

Like the fluid system being a fluidcontainer object attached to something.