#mod_development

1 messages · Page 335 of 1

fresh lodge
#

but apparently i can't have it set up correctly to fire it up OnGameBoot

bright fog
#

Which getFluid ?

#

Bcs getFluid of a FluidInstance involves having a FluidInstance

bronze yoke
#

if you want the fluid's script you'd be wanting getScriptManager():getFluidDefinitionScript(name)

bright fog
#

Ah I see why I didn't find that lol

#

I didn't check in the script manager class and instead searched in GlobalObject hahalol

fresh lodge
#

ah jeeez

#

i wrote getFluidScript earlier on

silent zealot
#

The way Fluid definitions are handled is so weird.

fresh lodge
#

Yh mate

#

The code is very incoherent at points

silent zealot
#

The fluid list is also hard-coded in the java 😦

bronze yoke
#

only vanilla fluids

#

mods can use strings

#

it's more of a convenience than hardcoding

silent zealot
#

Modded is FluidType.Modded I guess

bronze yoke
#

i wonder what happened to fluids 25-63

bright fog
#

Maybe mixes ?

#

Also there's no orange juice but I remember some fruit juice in a devlog regarding automation

silent zealot
#

Mixes track each seperate fluid

bright fog
#

Yea figured

fresh lodge
#

Yes, any user added fluid falls into modded

silent zealot
#

I hope they implement a system that gives names to mixes.

#

If not I'll make a mod that will name fluid combos that match coktails.

fresh lodge
#

item:getFluidContainer():getPrimaryFluid():getFluidTypeString() through this you get its string name

#

(from a container)

silent zealot
#

primary fluid == the fluid type there is the most of, from memory

fresh lodge
#

It should

bright fog
#

Mixology

silent zealot
#

Good, I don't have to make the mod. 🙂

old ginkgo
#

Yup. Its got an API too so you can easily make addons for it.

#

Just gotta insert the ratios to a global table.

bronze yoke
#

remember that we're currently missing an entire brewing skill so these things may come later

old ginkgo
#

It’s such an easy thing it might be something TiS makes themselves.

bronze yoke
#

the fluid system is a little weird and limited because TIS haven't even added the main thing they wanted it for yet

fresh lodge
#

not very intuitive this stuff

bronze yoke
#

for base usually both work, but better to be explicit

#

a lot (all?) of the new script types are like that unfortunately

#

you might be able to use Load if it doesn't reset the object or do anything else strange like that

fresh lodge
#

ooooooooofff

#

Modding stuff at lua level is such a PITA

#

i'll leave it to TXT

#

thanks for the help

pulsar charm
#

What did you end up doing instead? I also need to trigger something when manually placing a tile with place item

silent zealot
#

How do you deal with the output of an API call that returns an Array? (NOT an ArrayList)

Function def/javadocs: public float[] getPolygonTriangles()

get the output: triangles=getWorld():getMetaGrid().Zones:get(2190):getPolylineOutlineTriangles()

stick it into print(triangles): [F@242bdf40

It's as if [F is the object class. Which might be some weird Kahlua name for an array of floats? Except I can't do anything with it. It's not a table so no lua-table style commands work, :size() :length() :get() all fail.

bronze yoke
#

are you in b42?

silent zealot
#

Even weirder: there's a public float[] I can access directly: triangles2=getWorld():getMetaGrid().Zones:get(2190).points

if I print that I can see the data: {13835, 1847, 13846, 1847, 13856, 1852, 13859, 1855, 13864, 1865, 13864, 1875}

But again, I can't figure out any way to access the data

#

Startlit's Reflection.getClassName says triangles is a [F and triangles2 is a nil

silent zealot
bronze yoke
#

basically, when you get an array, all you can do with it is pass it around

#

b42 added this utility class that you can construct from it and use to read from the array

silent zealot
#

hos do you read from it?
a=Array.new(getWorld():getMetaGrid().Zones:get(2190).points)
then print(a:get(0)) throw an error

bronze yoke
#

oh, that's not an array

silent zealot
#

ah, should have been getWorld():getMetaGrid().Zones:get(2190).polylineOutlinePoints

#

that makes it behave the same as :getPolylineOutlineTriangles()

#

so a=Array.new(getWorld():getMetaGrid().Zones:get(2190).polylineOutlinePoints)

#

so a is a Class Array<T>, that utility class you mentioned

bronze yoke
#

yeah

silent zealot
#

OK, with that I can get... empty arrays. lol

#

but they are working empty arrays

#

So I'm guessing the raw data gets processed as-needed into polylineOutlinePoints[] and triangles[]

#

And I will need to deal with the TIntArrayList that is points

#

which is likely the same as the raw numbers in the map zone data, e.g.:
{ name = "", type = "Nav", z = 0, geometry = "polygon", points = { 8100, 14253, 8100, 14264, 8221, 14143, 8215, 14138 } },
so if I can't figure it out from the TIntArrayList because that class isn't working with Kahlua I can copy-paste the map's data into a lua file and so my own processing on it.

bronze yoke
#

you're fucked

ancient grail
silent zealot
#

You make a java mod to convert float[] to ArrayList<float>

ancient grail
#

its fine if its all string or numbers i guess
i can parse it

but if its objects then im stuck

bronze yoke
#

raw arrays aren't used very commonly anyway

silent zealot
#

so none of the TIntArrayList methods work, but print(tinta) works, so I can convert the integers to a string with tostring(tinta) and then process that string back into ints.

ancient grail
#

tint for clothing?

silent zealot
#

no, TIntArrayList

#

it's an array of integers but special.

#

It's used within the java, but it seems nothing about it gets exposed through Kahlua.

red tiger
#

I might spend some time and fiddle with Suno and make a True Music pack that's themed around fighting and apocalyptic music.

#

🤔

#

Would be a lot of bluegrass and rock.

silent zealot
#

Is there a way to tell VSCode/Umbrella(unstable) that a specific thing is actually a legit global? I don't want to disable the "unknown variable" detection altogether because it picks up my typos.

bright fog
#

I think so

#

@bronze yoke should know but it's some special typings

#

--@global perhaps ?

bronze yoke
#

you can add it in the extension settings i think

silent zealot
#

I'll worry about it later, thanks for pointing me to the correct place

bronze yoke
#

that's weird, i haven't had to use it personally

#

is that a vanilla global missing from umbrella?

silent zealot
#

I see the issue, the settings json is missing a comma

#

VSCode can't even write it's own settings lol

bronze yoke
#

the notoriously difficult to parse json

silent zealot
#

I had a co-worker give me a json config file this week

#

full of C style comments

#

WTF

#

No

#

that's like something TIS would do in their "lua" config files.

#

json is intended 100% for computers, 0% for humans and does not support comments. Which makes it a bad choice for config files humans are supposed to configure.

ancient grail
silent zealot
#

Zombie sonar?

ancient grail
silent zealot
#

Start Knowing Roads progress.

ancient grail
silent zealot
#

You know how you normally wake up a complete amnesiac who doesn't know anything about their local town?

#

The goal is to let you start with map knowledge of the roads, at least the major ones.

#

Alternative use: a Kentucky Road Atlas item that reveals roads, instead of of 100% revealing a rectangle.

#

probably sandbox options for always start knowing roads/enable a trait to start knowing roads/enable road atlas spawns.

frank elbow
ancient grail
silent zealot
#

It's not the MapAPI, it's the forage zone data

#

It's not meant to be used like this, but all zones of type "Nav" are roads

#

But the map knowledge function only accepts a rectangle, and the data is a mix of rectangle/polyline/polygon so there is some horrible hackery going on

#

Especially since it's impossible to access the actual methods of the Zone object because they don't covert the list of points into triangles or anything until they are accessed, and the functions are all about "what zones is this square in?" or "draw on a map that supports lines and polygons"

terse delta
#

Dawg that sounds like rocket science

compact sluice
#

guys i got a question about key binding and how they work in lua , for exemple i want to make a console test about the keybinds to be printed whenever i click one
i will use this function , but the issue idk how the keys are called in lua is it by numbers or by something else

local function OnKeyKeepPressed(key)
-- your code here
end

Events.OnKeyKeepPressed.Add(OnKeyKeepPressed)

terse delta
#

You should start with some basic map knowledge

bright fog
#

A sort of index

#

It's a number associated to a key

#

Which you can retrieve with the keyboard class

compact sluice
dark galleon
#

is there any documentation about how to convert a mod from b41 to 42? I've got a custom player model I'm trying to port over. The fact I can't use it is like half the reason I still play b41 single player.

bright fog
#

Regarding mod structure

dark galleon
wet monolith
#

hey guys, what's up?

i'm a filmmaker, i work with audiovisuals, but every time i try to play with code i fail. even so, i wanted to throw an idea out here, maybe someone will come up with it.

i do zomboid livestreams, and in a livestream everything happens very quickly. there's no time to clip the right moments.

so i thought, what if there was a mod that identified critical events and automatically sent a !clip in the chat? something like: being bitten, catching fire, dying, setting off an alarm, crashing the car, collapsing from hunger or sleep?

those things that mark the gameplay and would make great clips if they were recorded on the spot.

i don't know how to program, but if anyone likes the idea and wants to try creating it, i'm here. it would be great to see it working

bright fog
wet monolith
#

yes, I tried to use it with a lot of patience and vibe coding, but without success 😂

#

I'm playing on b42 to try to bring the new generation hype to the community, so I believe that running ISOs locally wouldn't be a problem. I just don't really know how to do it, in fact I have no idea.

frank elbow
#

May be worth throwing it in the mod ideas thread, although I've no idea whether people really pick up ideas from there

wet monolith
terse delta
#

But they probably won't, since Java code is unsafe

#

(Can't be read without external tools, has no sandbox to protect system)

delicate wave
#

Anyone know if it’s plausible to get a weapon to be considered two classes? So one weapon would give say both short blade and axe skills?

bright fog
#

Nah I don't think so

tranquil reef
#

Is there any way to turn a vanilla tile into a container without overwriting the tile

silent zealot
# delicate wave Anyone know if it’s plausible to get a weapon to be considered two classes? So o...

You can't make a weapon two types, but you may be able to code a mod that gives extra experience in a different skill when you use it.

Start by identifying where the xp gain is, if that's in Lua you can modify it. Otherwise attach an event to the EveryMinute function that checks if a player is using the weapon, checks if the weapon skill has increased, and if it has increases the other skill too.

silent zealot
#

And why changing underpants to a container let's you store stuff in your undies but also deletes all existing underpants in the world.

tranquil reef
#

I figured it was just a property in tilezed. No idea how it works

silent zealot
#

What matters is how the backend works, if you want to change existing tiles and not break things badly. But I don't know the classes involved.

#

And I'm in bed and it's nice and warm so I can't check 🙂

tranquil reef
#

. hm

terse delta
#

If I was a game developer I'd make lua bridge for modding too just out of spite

daring finch
#

how do you basically make a true music mod

#

tryna add songs

frank elbow
silent zealot
#

If a mod is for personal use in single player you don't even need to upload to steam

silent zealot
#

Decided to learn some lua "object oriented" stuff to clean up the mess of code going into converting piles of numbers to map revealing data.

hidden compass
#

I would like to add a setting of type string in sandbox-options.txt and specify “comma delimited string” as the default value.
However, if I do the following, “only up to the first comma is displayed” (and double quotes are also treated as strings) as shown in the attached image, is there any better way?

option P4SeesawGame.ExcludedSkillCap
{
    type = string,
    default = "Fitness,Strength,Lightfoot,Nimble,Sprinting,Sneak",
    page = P4SeesawGame,
    translation = P4SeesawGame_ExcludedSkillCap,
}
plush salmon
#

what's a good simple project to start with if i'm trying to get into modding? adding an item or something like that?

plush salmon
#

also what software do I need to open the model files?? i've never seen ".x" before

#

guess i'll try blender

#

no... blender doesnt recognize it

obtuse aurora
#

you can use it with blender with custom exporters

#

or with directX SDK plugins

south bluff
#

this isnt really a question for developing mods but a technical question
what are the colors for moodles in b42? i need to get the hex color codes but i dont know where the game handles it

silent zealot
hidden compass
silent zealot
#

Fixed up the implementation of polygons/polylines, added a probability-per-map-unit so it's not overly filled in around cities/the disjointed bits don't stand out.

#

And a circle of knowledge intended to be around your starting location, on the basis that you know where you live/work.

mellow frigate
# hidden compass I would like to add a setting of type string in sandbox-options.txt and specify ...

I used a sandbox string parameter for Architect mod that does the same + a key:value association. option Architect.ItemCostPerSquare { type = string, default = Base.Plank:0.25;Base.Nails:1.0001, page = Architect, translation = Architect_ItemCostPerSquare, } ```lua
function Arc.extractAssociationListFromString(sandboxAssociationString)
local associationList = {}
for association in string.gmatch(sandboxAssociationString, "[^;]+") do
if association then
local key = nil
local value = nil
for result in string.gmatch(association, "[^:]+") do
if key == nil then
key = result
elseif value == nil then
value = result
break;
end
end
if key ~= nil and value ~= nil then
associationList[key] = value
--todo else log error
end
end
end
return associationList
end

frank elbow
#

The reason commas don't work is that the parser for mod options looks for a comma to get the next parameter & doesn't actually read strings with quotes (i.e., the quotes are considered part of the value for the default)

#

I've done similar with semicolons. The default just can't have commas, unless there's some hacky solution but it'd likely still involve a comma placeholder

fleet bridge
silent zealot
#

If only there were well documented file formats with pre-existing libraries for every major programming language that could be used instead of custom coding something unique every time you want a new type of thing in a config file.

fleet bridge
#

local function splitString(sandboxvar, delimiter)
    local ztable = {}
    for match in sandboxvar:gmatch(delimiter) do
        table.insert(ztable, match)
    end
    return ztable
end
#

Use the appropriate delimiter based on what you like

manic forum
#

Why is the range of component CraftBench so big, is there a way to set the range down (screen is range)

simple bluff
#

Hey everyone!
I try to add a new box of ammo (7.62x49mm). So far everything works great, the item appears in the inventory.
The only issue is: I can’t get it to open like regular vanilla ammo boxes (with the “Open Box” context menu option).
I’m wondering: do I actually need a custom Lua script to make the box open, or is there a base-game system that handles that automatically if set up correctly?
Thanks

bronze yoke
#

you need a recipe

#

basically everything like that is implemented with crafting

terse delta
#

Everything is a recipe now smh

plush salmon
#

yeah like these guys said, you need to create a recipe that just turns the box of ammo into a certain amount of individual bullets

simple bluff
#

Oh ok thanks !

jagged zodiac
#

i have an idea for a trait

#

(negative)

#

so hmo

#

ptsd trait

simple bluff
#

Hello again ! 👋
I'm working on a custom weapon mod that uses 7.62x39mm ammo, and I'm trying to make multiple types of bullets for it (standard, FMJ, HP).
I managed to create different items and boxes for each type, and I can open/close the boxes just fine.

But here's the issue:
I want my magazines to accept all three types of bullets, but currently, it only accepts the standard ones. FMJ and HP bullets won’t load into the magazine.
Any ideas ? I can give more infos if it's not enough.
Thanks

bright fog
#

It would require some more complexe Lua codes to handle it

simple bluff
#

oh ok...i'll try the more complexe Lua code...but Thanks

brave bone
#

anyone wanna try my mod? need some feedback.

silent zealot
# simple bluff oh ok...i'll try the more complexe Lua code...but Thanks

At minimum you need to patch:

Puting bullets into a magazine
Removing bullets from a magazine
Loading magazine into gun
Unloading magazine from gun
Racking gun

If a magazine can have mixed bullets, it's even more work. If you care about the bullet in the chamber being different to the ones in the magazine after a change of mags, more work. You also need an interface for the user to select what they want to do.

#

To be honest, the gun fighting in Zomboid is so simplified that I don't think it's worth having multiple bullet types.

#

If you're on B41 if consider making Britas guns/gunfighter mod dependencies and using their code, which does have multiple ammo types per calibre implemented.

half knot
#

Guys, I created some great builds on my server. Is there a way to take the local files and turn them into a map mod?

simple bluff
#

@silent zealot Thank you!

late hound
#

Mirror Mirror on the wall....which mod has broken my game after all?

bright fog
#

You could perhaps create a tool that output a file which is formated for building mapping

bright fog
#

@slim swan Hey do you have a git of your NeatUI lib ?

#

Also do you have a github wiki for it ?

#

Or an equivalent

slim swan
bright fog
#

So having links to every resources your mod gives available online can help me document it even better, but that can be added later

slim swan
bright fog
#

Alright np

tribal light
#

heyo!

#

if i wanted to make a mod

#

that adds a new foragable item and some crafting recipes

#

how would i do that?

silent zealot
#

Including recipes (note that B42 craftrecipes are very different to B41 recipes)

#

For adding items to foraging tables, have a look at media/lua/shared/Foraging/forageSystem.lua

#

I wouldn't 100% trust instructions in a vanilla lua file, but the comments at the top shoudl help you get started

quaint delta
#

Ive changed the file stucture to try to make my mod work on b42 and now when i try to start a save in debug i get this, b42.9.0

bright fog
quaint delta
#

looking at the console.txt but ngl idk what half this stuff means

#

just want my silly potions on b42 x3

bright fog
#

You should get an error message of some kind in your console

#

Start from the bottom going up

finite scroll
#

does anyone know of a way to detect whether you're in the character customization menu? (specifically the appearance/clothing one)

winter bolt
tight elm
bright fog
#

Definitely possible

#

Most UI stuff are Lua sided

#

And that's one of them

silent zealot
silent zealot
#

Otherwise, like Sir Doggy said look at console.txt starting from the bottom and going up, looking for problems (with the caveat that there are plenty of error messages when Zomboid does work properly!)

The word "exception" is usually a good search term, it picks up places where lua breaks.

mint reef
#

Hello Madams/Sirs. If there is no trunk capacity in the script of the car it means its vanilla? and If I want to increase the capacity I should add new script line to increase the capacity?

main pasture
#

If the trunk is from a template, the capacity is defined there. You can change values of the used template for the script it's included in by creating a part with the same name and defining just the values you want to edit```template = Trunk/part/TruckBed,

part TruckBed
{
...
container
{
capacity = 100,```

mint reef
#

Thanks ive got it there are other cars with the same script line and some doesnt have

slim swan
#

This new XUI debug window already seems to include many features that make customization easier, but for some reason, it was never completed.

jolly goblet
#

Greetings everyone. Friends, I have a question: how do I configure the map so that it has a thumbnail view at the bottom and so that it focuses on the space where my map is located?

#

Sorry if you see the message repeated. But I asked on another channel and they told me it's more likely to receive help this way.

bright fog
#

It's defined in your map.info if I remember right

#

Yes

#

ZoomX

#

ZoomY

#

ZoomS

candid egret
#

Recently someone has asked me on one of my moodle mods if I could make a mod that adds moodles dependent on the severity of the stats (e.g., as pain stat increases to a threshold, a different sprite for a pain moodle shows, in which there is more wincing). The user didn't specify B41 or B42. As someone with basically no coding experience, I was wondering if this is even feasible? This sounds like a really cool idea I would like to pursue, but I don't know how and even if this is something that could be made. Theoretically, if this was possible, I would most likely need someone with experience in coding in order to make this a possibility.

In short, this seems like a cool idea, but I want to know if this is something that could even be made, and work in-game.

bright fog
#

Just to be sure, you mean showing basically which direction the stat evolves ? If it's increasing or decreasing ?

candid egret
bright fog
#

But that's already the case

#

No ?

#

There's already a different sprite at the different levels ?

#

Level 1 to 4 usually ?

candid egret
#

I don't think so, it's usually the same moodle for every level, and a modder sometimes includes different colored backgrounds representing each level

bright fog
#

Oh no you're right it doesn't change

#

Well that's probably doable with the moodle framework

bronze yoke
#

you'd have to replace the moodles with a custom implementation, there's a few mods that do that

#

moodles aren't really moddable at all

#

moodle framework wouldn't be good as afaik it can't replace vanilla moodles

#

that lua moodles mod probably can do this

candid egret
bronze yoke
#

i think so

#

i don't know much about it, the only reason i know about this mod is i worried they'd stolen my code since i'd done this already 😅 but they didn't, completely different codebase

bright fog
#

Yea I remember that mod

#

I feel like it's not enough used

#

Might be a better alternative than the moodle framework from tcherno, tho I guess both do different things in a way

#

Also both might be incompatible ?

candid egret
#

Thanks for the help, guys. Both of you

mint reef
compact sluice
#

i am blind i got it 🙃

chrome veldt
#

Hey everyone! I recently made a mod that allows you to attach bags to a sheet rope to lift them up afterward, I'm using the setters from the extended 3D placement (setWorldX/Y/ZRotation and setOffX/Y/Z) to create attachment slots for the bags. I'd love to port it to build 41 but the extended 3D placement is from build 42. Is there any way to reproduce a similar behavior in build 41? (ideally setters for translations / rotations)

silent zealot
mint reef
silent zealot
#

It's been a while since I've done it but you should be able to add capacity = 300 to a specific car's trunk, which overrides the template

#

Just be aware some KI5 vehicles have a trunk which is normally hidden and a special K15trunk with nicer graphics on the UI that is the actual one to edit.

#

Otherwise you end up with two trunks.

mint reef
silent zealot
#

no, don't copy any files

#

just edit the one you want changed

#

This will get overwritten if the mod is updated, but KI5 does not update often (at all?) once released

mint reef
#

they have the same part the rwb and turbo wouldnt it also change the turbo?

silent zealot
mint reef
#

they have one specific script which is the

silent zealot
#

that is the template

#

that gets used here

#

I think you can override settings under that, or just change the template so both 911s get the change, or you could make a new template PRS82TrunkCompartmentBig in the template file and change one of the cars to use that.

#

You may also find you need to spawn a new car or repair the trunk to update capacity before the change takes effect

mint reef
#

ah Ill try

silent zealot
#

at least the tiny capacity makes sense for a 911

#

If you've ever looked at the storage space it's tiny. Unlike, say, a full sized station wagon (100 units) or pickup truck (110)

mint reef
#

Like this?

silent zealot
#

Might be limited to 500

#

but give it a go

#

Zomboid has really wierd ideas on limiting container sizes

mint reef
#

The trunk disappears

#

This what I did

#

oh I didnt change the template txt file

#

I did it but the other parts gone missing lol

silent zealot
#

is that template file all you changed? looks like something else was altered by accident, check the timestamps on the files.

#

Not sure which file you changes there - my suggestion is copy the PRS82TrunkCompartment as PRS82TrunkCompartmentBig in the template_PRS82_trunk.txt

#

then in 82porsche911rwb.txt change line 238, template = PRS82TrunkCompartment, -> template = PRS82TrunkCompartmentBig,

#

And then hope the part models aren't tied to the template names somehow

mint reef
#

apparently theres an extra bracket and ive removed it and its working perfectly fine now thanks

crystal idol
#

Hi, I'm new to modding and Blender. I took the pouch legs from the Scrap Armor mod (2658619264). I respected the position and size to change the image to a plushie, but when I equipped it, the texture covers the entire screen. Do you have a guide to verify where the error might be?

I don't have any error messages in the game. As a container, it's working fine; it's just the texture that's failing.

#

OOOh forget it, I replace de .FBX files with .X files and now its working

silent zealot
#

Probably an issue with the item scale - Zomboid has weird quirks about how the model needs to be set up in terms of both size AND the scale parameters.

#

.fbx will work, but if export to .x hides the issue - that's easy.

bright fog
#

.fbx >>>> .x

#

And I can bet you just did a mistake somewhere

#

Jesus why do the devs keep using this freaking format, modders keep thinking they need to use it facepalm

crystal idol
#

Of course, I could have made a mistake. I have less than 10 hours of experience with Blender. Where do you recommend I start looking? Because I don't want to have to export to OBJ and then export with FragMotion to X. It would be much easier to export directly from Blender to FBX.

bright fog
rich dagger
#

Hi was wondering if someone could help me out? for some reason I cannot get the jacket and my pants to appear in my mod - I tested them and it worked fine but for some reason now that im getting ready for release its not showing up 😩

silent zealot
#

Blender has a concept of transforming an object (rotate, scale, location) that doesnt' actually change the object - just where it is/what size it is in the scene.

#

Zomboid has... lets say "quirky" interactions with this.

#

I'm not certain what the values need to be for clothing meshes, but it's worth applying any the transformations (Ctrl-A Apply all/apply scale/etc) and re-exporting the fbx.

#

Also, make sure you select the mech to export and then click "only selected" when exporting since you can really confuse Zomboid if there are other meshes/other items included.

crystal idol
terse delta
#

What's the function for adding item into inventory?

silent zealot
#

addItem, AddItem, AddItems, AddItems or AddItems.

#

Depends if you are adding an InventoryItem, giving the name of the object and a new one will be created, or giving an arrayList of InventoryItems,

#

If you need to get the player inventory, something like getPlayer():getInventory():AddItem(...)

terse delta
main pasture
#
inv:AddItem(flashlight)```
silent zealot
#

OnNewGame only fires once per character, so the getHoursSurvived check isn;t needed.

#

Unless there is wierdness with that event and multiplayer.

#

Or B41 is different to B42.

#

I was curious how DoAddItem and DoAddItemBlind differed from AddItem so I looked them up.

terse delta
#
  1. Doesn't works
  2. It also broke mod that used the same function lol
main pasture
#
inv:AddItem("Base.HandTorch")``` works for me. What function?
heady kiln
#

does anyone know if the devs are planning to expand upon explosives and bombs in PZ? i've started planning out a mod but i don't want to dedicate myself to this if its all going to be added anyway before i finish

terse delta
#

Mod I ripped code from

#

When my mode is activated, NoStarterPistol ceases to work

#

but functions and variables are local, so they shoudn't conflict, I think

main pasture
#

Maybe the earlier function in the event is replaced with the new. I'm not sure how they are saved, but maybe worth testing renaming OnNewGame

solar rover
#

Could use a hand with a trait check. I cant find "Angler" in https://projectzomboid.com/modding/zombie/characters/IsoGameCharacter.CharacterTraits.html or in https://demiurgequantified.github.io/ProjectZomboidJavaDocs/zombie/characters/traits/CharacterTraits.html#

I'm trying to have my fishing UI check for the trait to know how much info to display.

Hope to release this fishing rebuild soon. Any help would be great, thanks all!

bright fog
#

This should have a section on how to do it

bright fog
# terse delta

You're mistake here is assuming the module + item ID is referenced to in Lua like that but that's different

#

Module.ItemID needs to be a string

#

And you need to instanciate an InventoryItem which then gets added to the inventory

terse delta
#

So, just writing out item id isn't enough?

bright fog
#

No that's just not a thing

compact sluice
#

can someone explain to me what is "derive" used for in lua coding?

bright fog
#

Which is usually the same name as the variable you associate it to

#

So basically the new class will inherit the methods from the parent and create a whole new class that you can add other extra stuff to

#

And classes in Lua are not exactly classes but they are tables

terse delta
#

I just dip when I see parenting lol

compact sluice
solar rover
#

I'm wondering if "Angler" does have a different name and that's why it's not in the github or triggering for me >_>

#

I just want to be finished with this mod and I think Im close lol. My poor players Im sure want me to move on.

bronze yoke
bronze yoke
terse delta
#

so why this shi doesn't works?

#

What I did wrong?

bronze yoke
#

traits just use string identifiers, you can see traits being created in the vanilla lua

solar rover
#
    local hasAnglerTrait = self.player:HasTrait("Angler")
    if hasAnglerTrait then
        panel.height = 120  -- Full height with all details
    else
        panel.height = 45   -- Shorter height with just basic conditions
    end
bronze yoke
#

probably, they don't always line up with the translated name though

solar rover
#

Ahh gotcha, I'll go digging

bronze yoke
#

the file they're created in is called something like MainCreationMethods

solar rover
#

Good memory thats exactly it

#
    local fisher = TraitFactory.addTrait("Fishing", getText("UI_trait_Fishing"), 4, getText("UI_trait_FishingDesc"), false);
    fisher:addXPBoost(Perks.Fishing, 1)
    fisher:getFreeRecipes():add("Make Fishing Rod");
    fisher:getFreeRecipes():add("Fix Fishing Rod");```
#

Thanks albion!

#

I'm ready to be done with this rebuild... now my players remind me that they cant do anything with a 160lb paddlefish in their inventory lol

#

Time to build a fishing journal that adds the fish and removes the item.

#

Works like a charm! Woo

bright fog
bright fog
#

And it derives classes NOT functions

#

Basically it derives tables in a way

#

So it sort of makes a copy of the table which holds functions

#

As for modifying existing functions without overriding it, see decorations

bronze yoke
bright fog
bronze yoke
#

metatables are obviously directly designed to allow you to implement OOP with them and the way lua classes typically end up working is fairly similar to how compilers actually implement classes

bright fog
#

So we offficially call them classes ?

bronze yoke
#

i don't see any reason not to basically

#

the only real distinction between lua and 'OOP languages' is that lua doesn't have a language level concept of classes, but you absolutely can create classes in it

bright fog
#

Alright

#

So classes

frank elbow
#

I think a lot of people would benefit from a deeper understanding of metatables, esp. if the PZAPI.UI pattern is used more—better to know what's happening imo

#

But I agree that it isn't all that useful for newcomers. I guess this is just me wishing metatables didn't seem like dark magic to everyone lol

bronze yoke
#

yeah people are really scared of them 😅

compact sluice
chrome veldt
arctic stag
bright fog
#

Make a git repository

agile nacelle
#

ScrapCases (2).zip

silent zealot
# arctic stag

You'll get a better response if you describe the problem in more detail - "there's no button to open the case" isn't very clear.

#

There isn't anything in vanilla zomboid I'd describe as "you press a button and a case opens." This may be a language barrier, but it's not practical to look at a mod without any idea of what it is meant to do or how it is broken.

agile nacelle
#

About my vehicle collision destruction mod, been a little busy lately... But anyways i don't think i want to predict vehicile collision using raycast anymore, I've been wondering if it's possible to simply create an Object the size of the car and Position that object ahead of time according to the vehicle velocity, and using that new Object to detect what other objects intersected with it... I don't want to use raycasts because they get terribly laggy and am having a lot of difficulties with using it.

chrome veldt
#

You'll have to search through the worldobjects in front of the car and guess which one you hit tho.

rich dagger
#

For some reason I cannot get my clothing icons to appear. I have all of the icons in the texture dirrectory and they are properly named in the script.

steady fable
#

nepenthe i see the easy distributions mod is doing well

silent zealot
#

@agile nacelle do you need to know before the crash happens, or just that a collision of sonem type did happen?

steady fable
#

i havent updated box more in a while but im happy i helped you

rich dagger
#

nvm ffs I think I figured it out.

steady fable
#

survival rifle is also cool but after the great plane crash into my house it was the only thing left

#

miraculously

steady fable
agile nacelle
silent zealot
silent zealot
agile nacelle
#

Before

steady fable
#

i didnt have the survivor rifle equipped at the time and by that point i put it in my car

silent zealot
#

The dashboard flickering effect on damage in cars is just a check every 10 ticks to see if the condition has gone down.

agile nacelle
#

The reason why i need to predict a crash is to prevent the vehicle from coming to a full stop because of an actual collision

silent zealot
#

Good luck; I think most of what you'd ideally use is hidden away in the java bullet physics libraries.

agile nacelle
#

I looked at the decompiled pz code how it detects a collision and i didn't really get far to find out how it detects object intersecting

agile nacelle
#

But i also would like to know if it's possible to create an invisible object just for checking intersections

silent zealot
silent zealot
#

What sort fo plane was that!

grizzled fulcrum
#

them not using events for stuff is not a first tho

silent zealot
steady fable
#

i do it for all zombies on singleplayer at least because my PC can handle it

#

multiplayer it depends

#

if i like the loot i drop it

#

if i dont i leave it

silent zealot
#

Fair enough

steady fable
#

no more hoarding unhappy

#

last save i spent hours putting shit in warehouses by myself

#

next time its gonna be on multiplayer with new players

#

tell them "this is how you play" and see how long it takes for them to figure it out

#

while im in the dev channel so i gotta get on topic

#

what stuff do yall think should be boxable?

#

i know liquids and stuff like colas or water should be boxable

#

but thats tricky

#

i asked that here before and there wasnt anything conclusive

#

and on my own efforts it didnt work out

agile nacelle
silent zealot
arctic stag
steady fable
#

problem: the liquid water counts as both seltzer water and just water

#

so when i tried to make a box of water it spat out 6 seltzer 6 regular

silent zealot
#

SpecialLootSpawns.lua

steady fable
#

savior

arctic stag
silent zealot
#

You could hack that, or just set all bottle back to water after it is done.

arctic stag
#

I'm just a beginner modder and I wanted to create this mod for myself.
Please let me know what I did wrong or what needs to be fixed.

steady fable
silent zealot
#

And the item name is generated dynamically based on the contained fluid.

steady fable
silent zealot
#

that function is actually disabled

#

it's a property of the Base.WaterBottle's FluidContainer

steady fable
#

so i just need a function to change the fluidcontainer upon it opening the box

silent zealot
#

yes, let it make 12 bottle/for each get the fluidcontainer, set it to be full of water.

#

using an OnCreate in the recipe

silent zealot
arctic stag
#

+🤣

silent zealot
#

Post the function that adds the context menu option

arctic stag
#

I already realized that I made some mistakes in the code.

steady fable
#

i'll work on it at a later date when it is demanded

#

as is with alot of modders

silent zealot
#

That's a lot easier to help with than "here's a mod, fix it"

arctic stag
#

I'm gonna go explore the internet and learn a bit more

silent zealot
#

My big oops for the week: despite deliberately checking to make sure I didn't have an accidental dependency on Starlit, I uploaded a mod with an accidental dependency on Starlit.

#

Either Starlit's field exposing feature keeps working after reloading lua, or (more likely) I screwed up when testing the mod without starlit active.

#

But on the plus side I learned more about metables fixing it so it works without starlit!

#

My summary of lua metatables: "What if anything could be anything? That's a great feature that I'm sure users will not cause loads of confusion with!"

bronze yoke
#

it probably isn't possible for anything i do to persist after lua reload

arctic stag
#

Is it not a menu call?

silent zealot
#

OnFillInventoryObjectContextMenu is the correct event, what is the code in that function?

#

Usual approach is get the "primary item" in case items is a table of items, check if it's your item type, and if it iss use context:addOption() to add the context menu

#
local doDIYContextMenu = function(playerNum, context, items)
    local primaryItem = items[1]
    if not instanceof(primaryItem, "InventoryItem") then
        primaryItem = primaryItem.items[1]
    end

    if primaryItem:hasTag("DIYSchematic") then
        local playerObj = getSpecificPlayer(playerNum)
        readOption = context:addOption(getText("ContextMenu_ReadDIY"), items, DIYonLiteratureItems, playerObj);
    end
end

Events.OnFillInventoryObjectContextMenu.Add(doDIYContextMenu)
slim swan
#

anyone know where is the loading screen script

#

i want to know how to make this apng work

sonic needle
#

so how this ^ works, is using PZ's new state Engine.

IE, its always "Moving" just PZ itself controls it, sort of like how keyframe's are controlled in animations > FBX

TL:DR, you might succeed in playing one, but you wont have control over it, fine tuning wise

bright fog
agile nacelle
#

how am i supposed to... get a class in lua???

bright fog
agile nacelle
agile nacelle
#

in java all you have to do is just import Directory.Goes.Here

#

import is not a thing in lua so

bronze yoke
#

if this class is exposed you can just access it, no need for anything like importing, kahlua dumps everything in the global namespace

#

i don't expect something like this to be exposed though

agile nacelle
#

like do i just type its name

#

how can i be sure if its accessible

bronze yoke
#

if you have a decompile you can check LuaManager.Exposer#exposeAll

#

and if it is exposed then you just type its name yeah

agile nacelle
#

didnt find it

#

well

#

great

#

gonna have to keep searching

bright fog
#

And also not casting thousand of rays every tile you raycast

#

Tho the new method you described looks scuffed

agile nacelle
#

i just thought maybe making an invisible object for collision detection would be easier and more efficient... so far it seems like that is far from the truth

bronze yoke
#

collision detection just isn't something we have much access to, so something that should be easier may actually be impossible or more complex 😅

solar rover
#

happen to have a replacment update on this? I get really confused when Im using moddata vs global and making sure I dont send the data to a local players files instead of the host files. Mostly I just keep reading MrBounty's page and hoping I get it right

bronze yoke
solar rover
#

Thanks boss!

wet dune
#

Wacky probably stupid question but why do my animsets crash the game?

umbral raptor
#

hello hello

wet dune
#

But it no work

umbral raptor
#

i hope u guys dont mind if i share my mod, havent released in a while due to being busy 🙂

wet dune
#

Sorry for the delay

#

I can send the full anim sets folder if you wabt

stone garden
#

he must be a beta tester he leaked it

quiet spoke
#

Hi im new to making mods, is it possible to make a clothing item attachable to the belt? i mean i just managed to do that but the model of the item does not show when worn on the belt, only when i equip it in the face. I made multiple masks and i want them to also be able to hang by the waist.

#

Also i kinda already did that but only by making a new item that gets worn in the thigh and then adding a context menu to swich between both items. But since i have 9 different masks i dont feel like making 9 extra items and having to edit each one of the models to be at leg height since each mask is different.

eager dagger
arctic stag
# silent zealot OnFillInventoryObjectContextMenu is the correct event, what is the code in that ...

I wrote it like this, and it worked for me..

require "ScrapLootTable"

local function getDropResult(caseType)
local lootTable = ScrapLootTable[caseType]
if not lootTable then
print("Нет таблицы лута для кейса: " .. tostring(caseType))
return nil
end

local totalWeight = 0
for _, entry in ipairs(lootTable) do
    totalWeight = totalWeight + entry.chance
end

local roll = ZombRand(totalWeight)
local cumulative = 0
for _, entry in ipairs(lootTable) do
    cumulative = cumulative + entry.chance
    if roll < cumulative then
        return entry.item
    end
end

return nil

end

local function onOpenScrapCase(player, item)
if not item or not item.getFullType or not player then return end

local caseType = item:getFullType()
print("Открытие кейса: " .. tostring(caseType))
player:Say("Открываю скраб...")

player:playSound("OpenScrap")

local dropItem = getDropResult(caseType)
if dropItem then
    print("Выпал предмет: " .. dropItem)
    player:getInventory():AddItem(dropItem)
    player:Say("Выпал: " .. dropItem)
else
    print("Ничего не выпало из кейса.")
    player:Say("Ничего не выпало.")
end

player:getInventory():Remove(item)

end

local function buildScrapContextMenu(playerIndex, context, items)
local player = getSpecificPlayer(playerIndex)
if not player then return end

for _, entry in ipairs(items) do
    local item = entry
    if not instanceof(item, "InventoryItem") and item.items then
        item = item.items[1]
    end

    if item and type(item.getFullType) == "function" then
        local fullType = item:getFullType()
        if fullType:contains("ScrapCases.Scrap") then
            context:addOption("Открыть скраб", nil, onOpenScrapCase, player, item)
        end
    end
end

end

Events.OnFillInventoryObjectContextMenu.Add(buildScrapContextMenu)

bright fog
#

Check the red warning in this wiki page

wet dune
bright fog
# wet dune What does it mean make copies?

Basically you need a copy of your animsets inside the B41 mod structure so B42 can detect your animsets, but the animsets from the the B42 mod structure only are really used

#

This is a recuring bug which the devs have yet to fix ...

#

And quite an important one

icy night
#

Does anyone know if setChance, in relation to Randomized Buildings, controls the chance for a building to appear as certain type? Such as RBLooted. Or is it used to control the chance of a RB's in general?

terse delta
#

What's the way to delete all corpses from the save?

wet dune
solar rover
#

Hmmm I'm having a hard time getting a font color change on ISScrollingListBox, it doesnt seem to work the same as ISLabel?

silent zealot
#

But some "random" stories will always trigger when a new chunk is loaded

#

However I do think the immediate answer is the chance is just the weighting that a specific story will be chosen once the game decided to use a random building story.

#

But if you change that then you need to also rebuild the hashmap and somewhere else it calculates the totalchance (sum of all chance values) so that needs to be redone too

#

bonus from my notes: here's how to manually force Kate and Baldspot to show up; just run this when close enough to their house that it is loaded in the active cell.

kb=RBKateAndBaldspot.new()
kb:randomizeBuilding(IsoCell.getInstance():getGridSquare(10744,9409,0):getBuilding():getDef())
mint reef
#

in the car script which line is responsible for stronger ramming of zeds.. like number of zeds can stop you before your car stops moving?

silent zealot
#

It's probably a combination of mass and speed. Do some experimenting - boost a vehicles mass & engine power, see how you do ramming zombies.

terse delta
quiet spoke
#

hey im checking the hammer item and i have a question, where does it say what model to use? or is it specified somewhere else?

    {
        DisplayCategory = ToolWeapon,
        MaxRange    =    1.1,
        WeaponSprite    =    Hammer,
        MinAngle    =    0.67,
        Type    =    Weapon,
        MinimumSwingTime    =    3,
        KnockBackOnNoDeath    =    TRUE,
        SwingAmountBeforeImpact    =    0.02,
        Categories    =    SmallBlunt,
        ConditionLowerChanceOneIn    =    30,
        Weight    =    1,
        SplatNumber    =    1,
        PushBackMod    =    0.5,
        SubCategory    =    Swinging,
        ConditionMax    =    10,
        MaxHitCount    =    1,
        DoorDamage    =    9,
        CanBarricade    =    TRUE,
        SwingAnim    =    Bat,
        DisplayName    =    Hammer,
        MinRange    =    0.61,
        SwingTime    =    3,
        KnockdownMod    =    0,
        SplatBloodOnNoDeath    =    TRUE,
        Icon    =    Hammer,
        RunAnim    =    Run_Weapon2,
        IdleAnim    =    Idle_Weapon2,
        BreakSound  =   HammerBreak,
        DoorHitSound = HammerHit,
        HitSound = HammerHit,
        HitFloorSound = HammerHit,
        SwingSound = HammerSwing,
        TreeDamage  =   0,
        MetalValue = 25,
        CriticalChance    =    20,
        CritDmgMultiplier = 3,
        MinDamage    =    0.5,
        MaxDamage    =    1,
        BaseSpeed = 1,
        WeaponLength = 0.23,
        AttachmentType = Hammer,
        Tags = Hammer;RemoveBarricade,
      }
atomic oracle
#

Trying to upload a mod to steam workshop and it is saying I have no mod.info file when I have one in C:\Users\REDACTED\Zomboid\Workshop\MODNAME\Contents\mods

#

Mod works in game so must have the file organization wrong

atomic oracle
#

The file path location of mod.info is in my initial message

solar rover
#

well... if youre saying that mod.info is in the mods folder that is incorrect if youre saying its in C:\Users\REDACTED\Zomboid\Workshop\MODNAME\Contents\mods\MODNAME then that is correct

atomic oracle
#

K Ill do that

arctic stag
silent zealot
#

"But a sprite is not a 3D model!" I hear you cry.

solar rover
#

we all cry

silent zealot
#

You are correct.

quiet spoke
#

i am crying

silent zealot
#

But it's a holdover from Zomboid being a 100% sprite based game.

#
    model Hammer
    {
        
        mesh = Weapons/1Handed/Hammer_Forged_Hand,
        texture = Weapons/1Handed/Hammer_New,

        attachment world
        {
            offset = 0.0150 0.1100 0.0000,
            rotate = 180.0000 0.0000 180.0000,
        }

        attachment Bip01_Prop2
        {
            offset = -0.0131 -0.0221 0.0007,
            rotate = 0.0000 -86.9102 0.0000,
        }
    }
``` the model definition then looks like that
quiet spoke
#

i think that is what im looking for

#

where is that file located?

silent zealot
solar rover
#

I dont want to give up on my UI Font color fight but Im not sure what to try next. Does anyone know if you just cannot color ISScrollingListBox font?

silent zealot
#

What are you looking to change?

quiet spoke
silent zealot
# quiet spoke me?

Yes, with the hammer - depending on what you're after we may have more specific pointers

solar rover
#

oh my bad lol

silent zealot
quiet spoke
#

i will try to make it short

solar rover
#

I can post it later but dont want to spam 32's help

quiet spoke
#

im making a mask mod that adds masks as my first mod, i was able to do everything so far, but i also want them to be attachable to the belt

#

i was able to do that too, but they look like this

#

facing down and at knee height

silent zealot
#

And somwhere in the hotbar slot definiton it defines the transform to use for attaching that type of item to that slot.

solar rover
#

You can simply rotate items in blender and export them at the angle you want when its in game. I had to do that a few times with my new fishing rods and my custom mega-wrench for another mod.

#

The nice part is, if you export/overwrite the item it will update in game live so you can test in blender

silent zealot
quiet spoke
solar rover
#

Yeah, my method works if you are using the same code for another base item so the bones/model line up.

silent zealot
#

or 2) it's something zomboid is fussy about, like weapons which have to be done just right or attachments won't work and teh bullets come out of empty space

solar rover
#

Getting the fishing rods aligned into the "normal" position also had it correct in hand/back

silent zealot
#

How are you attaching to the belt? Attachmenttype & hotbar slot?

quiet spoke
#

im doing this

    {
        DisplayCategory = Clothing,
        Type = Clothing,
        DisplayName = Orange Korp Mask,
        ClothingItem = ElBabiMasks_Orange_Korp_Mask,
        Icon = Orange_Korp_Mask,
        BodyLocation = MaskEyes,
        CanHaveHoles = false,
        BloodLocation = Head,
        BiteDefense = 10,
        ScratchDefense = 20,
    BulletDefense = 100,
        Insulation = 0.3,
        WindResistance = 0.3,
        WaterResistance = 0.2,
        Weight = 0.1,
        WorldStaticModel = Orange_Ground,
        StaticModel = Orange_Ground,
        AttachmentType = Hammer,
     ToolTip = Tooltip_item_MaskOrange,  


    }
#

the item is both a clothing and attachable to the belt

silent zealot
#

try attachment type=Walkie

#

more likely to work than hammer.

#

Since that is for walkie-talkies are similar, while a hammer is intended to be held by teh bottom of teh handle but is very different when on a belt

solar rover
#

Also has a bit to do with the origin point/0,0,0 position of the model file

quiet spoke
#

almost there, the height is good but still facing down (ignore the texture looking weird, i forgot to fix that)

solar rover
#

I got frustrated when testing mine because if I export something in a position I like it would work, but if I "apply all transforms" It locks in the new zero point and the model in game loads differently

silent zealot
#

you can aply just scale, just rotation etc

#

Ctrl-A and select from menu

quiet spoke
#

i was thinking of making a static model with the rigth rotation, but it would only look good on one side

#

unless it is posible to only make it so that it can be attached to one side of the belt

solar rover
#

scale is fun when you forget you had 3 settings and missed one >_>

quiet spoke
#

yeah, that does look like a custom mega wrench

silent zealot
#

Knife = "Belt Right Upside",
NotKnife = "Belt Right Upside",
Hammer = "Belt Right",
HammerRotated = "Belt Rotated Right",
Nightstick = "Nightstick Right",
Screwdriver = "Belt Right Screwdriver",
Wrench = "Wrench Right",
MeatCleaver = "MeatCleaver Belt Right",
Walkie = "Walkie Belt Right",
Sword= "Belt Right Upside",
Holster = "Holster Left",
HolsterSmall = "Holster Left",

#

see if any of those work better than Walkie. for AttachmentType

quiet spoke
#

will do

#

nope, walkie still looks the best

#

the others are either too up or too down, also either facing up or down

#

where are the AttachmentTypes at? maybe i can make a custom one for the mask and tell it the rotations from there? or make it so that it can only be worn on the left side and make a model with the fixed rotation?

solar rover
#

errr I thought there was a rotation setting on items attached to zeds like the machete in the gut or screwdriver in the head. I dont remember off hand though sorry

quiet spoke
#

well if it exists then i will start looking for it

silent zealot
#

That defines some new points

solar rover
#

So who is our most knowledgeable UI modder?

silent zealot
#

media/scripts/KS_Attachments.txt has the numbers for the new attachments point offsets/rotations

quiet spoke
#

thanks i will look into that

mellow frigate
solar rover
#

for now it looks like I can go without the scrollbox and the font color takes.

atomic oracle
#

Quick other question about workshop page. How do I get this image to show that links to the indie stone permisions page?

#

The link shown is what I have currently

bright fog
#

You can mix b41 and b42 mod structure

#

See the Mod structure wiki page

terse delta
solar rover
#

Think I'm just about ready to publish.

silent zealot
# terse delta You can't make custom one?

You can, but's more effort than finding a default one that works since you need to define the new attachment them programatically update existing hotbar slots to support the new attachment type

silent zealot
silent zealot
bright fog
#

Interesting

solar rover
#

Thanks guys. It's a big rework of fishing in general . Seasons, moon phases, weather and skill can all change catch rates or rod and line breaks. Water tiles are counted in the 40x scan zone to determine how man fish are in the pool 0-40 depending on the setting instead of 25. A fourth size category Legendary which is not only rare but difficult to land. Rod as well as line has a break chance and rods can now be configured with their own stats. Some rods work better on some fish or sizes, bait too can help target a set of fish. I added ten new fish, two new worm types and a plastic lure. Large fish and the trophy fish need a larger size of water and population to catch. Added four rods with different settings but new ones can be configured. The angler trait will show the different fishing condition factors in the casting UI. The Fish journal can be treated a bit like a container of it's own and can be crafted. It can hold up to ten fish per book and removes the fish from your inventory. The fish can be "returned" to your inventory, "Prepared" cut into fillets (some fish can weigh a lot more than your inventory) "Catch and Release" will generate the record of the fish in the Catch Record item.

I hope to tie the items in this mod to Soulfiltchers quest system for tournaments and rod quests.

simple bluff
#

Hello everyone, i try to create a mod for B42 but i don't see it in my game, are the file paths in my mod correctly set up?

Contents/
└── mods/
└── Escape From Knox County/
├── 42/
│ ├── mod.info
│ └── media/...
└── common/
└── media/...

or is it my mod.info ?

name=Escape From Knox County
id=EscapeFromKnoxCounty
author=Baba Yaga
description=a mod.

any ideas ? thanks.

bright fog
#

I don't think it matters

#

Which folder did you place your mod in ?

simple bluff
#

Ahh Its What is was thinking about

#

42

bright fog
bright fog
#

Which pz folder

#

In the cache folder ?

brave bone
brisk remnant
#

Yh good job bro that mods going to be top tier and I think it’ll have a lot of people using it lol

simple bluff
#

@bright fog C user zomboid mods etc

solar rover
brave bone
solar rover
#

Would you be mad if I added a rare random chance to spawn a zombie? instead of catching a fish you caught a body?

#

Something to plague my AFK fishing players hahahah

brisk remnant
solar rover
brisk remnant
solar rover
#

I want people to be able to PvP if they like and not get set back. Lose your items not your time.. kinda?

brisk remnant
green notch
#

Anyone has a way to fix the bridges with invisible walls ?

#

Its annoying as hell

queen oasis
#

have I been using "require=" in the mod.info for B42 wrong this whole time?

dark galleon
#

anyone have tips on how to pull models/textures from the game? I'm trying to rig up my zomboid model as a vtuber, and I need to pull some clothing assets to do it

#

NEVER tried to do this before so I'm pretty stumped

bronze yoke
#

without the \ would be for b41

#

remember that if you used it wrong, the game wouldn't even let you load your mod

green notch
#

Please, for the love of god

#

I need help to cross the bridges

#

Those invisible walls are annoying af

queen oasis
bright fog
simple bluff
#

Yeah i read it and it says go in the c user zomboid mods if you are creating the mod no ?

solar rover
bright fog
#

You have a whole mod structure example at the bottom of the page too

#

It's explicitely said in the guide that the workshop folder mod structure should be used bcs it gives more possibility and overall reduce the risk of multiple mod copies

simple bluff
#

Ok

green notch
#

Massive bug that makes basically all bridges unusable

#

Besides the main road ones

solar rover
#

Ahh shoot ok sorry, I dont know b42. Good luck!

true nova
terse delta
#

DM @silk wren, he had same issue with Raven creek bridges

slim swan
#

anyone know how to change the game music,like i want to replace the music when fighting etc.

solar rover
#

looking through the plumbing mod and counting up the print statements... thats gotta go.

queen oasis
#

uh oh, I'm making more notes. I gonna need the "learn how to make isometric pixel art" crash course plugged in to my brain

whole spade
#

Guys, do you know all the names of vanilla loot zones? If yes, can you list them?

mellow coral
terse delta
#

Don't let TIS know that furniture can be painted...

quaint tartan
#

If I wanted to create my own custom evolved recipe template how would I go about doing that? Is it as simple as naming a new template and then giving the items I want as options to add that tag in evolvedrecipe = ?

mortal escarp
#

Anyone have tips for adding custom animation clip to either B41 or B42? I keep getting "anim not found" errors. I need to be using a ".x" files placed within "anims_X", correct? Along with a custom new .xml file defined under "AnimSets", right?

#

I see B41 mods on workshop using .fbx files, which confuses me. I thought only B42 could use .fbx? Maybe neither can? Animation is kicking my butt lol

bronze yoke
#

both can

#

if you're getting 'anim not found' then the issue is with the animation file

#

i recommend using fbx since the exporter for that will work more consistently

#

the name of the animation track in the animation file is what you need to reference, not the name of the file, so if those don't match that could be the cause of the issue

quiet spoke
#

hey does anyone know what is wrong with my model? it looks like it has a bunch of tiny holes all arround it and is invisible in blender if you look it from a certain side

bright fog
quiet spoke
#

yeah, its like its like its filled with infinite holes

bright fog
#

Where did you get this model from ?

#

Also for modeling specific questions, ask in #modeling or in the case of your issue you can most likely find resources online to fix your problem by just searching your issue on internet

quiet spoke
#

a friend of mine has a friend that makes models for mods, he made a mod and tossed me his files to add more masks

quiet spoke
bright fog
civic fog
#

hey guys can anyone tell me how to change the icon? (im new sorry)

bright fog
#

That's an existing item ? Or it's one in your mod ?

mint reef
#

does anyone have a mod for scaffold side to make it breakable by zeds?

silent zealot
quiet spoke
#

ok so for my mask mod i managed to do everything, and everything works exept one thing

#

when i set the blood location to "UpperLeg_L" so that the game gives protection when i have the mask worn on the leg the item refuses to work

item ElBabiMasks_Blue_Korp_Mask_Leg
    {
        DisplayCategory = Clothing,
        Type = Clothing,
        DisplayName = Blue Korp Mask,
        ClothingItem = ElBabiMasks_Blue_Korp_Mask_Leg,
        Icon = Blue_Korp_Mask,
        BodyLocation = Mask,
        BloodLocation = UpperLeg_L,
        BiteDefense = 10,
        ScratchDefense = 20,
        BulletDefense = 100,
        Insulation = 0.3,
        WindResistance = 0.3,
        WaterResistance = 0.2,
        Weight = 0.1,
        WorldStaticModel = Blue_Ground,
        ClothingItemExtra = ElBabiMasks_Blue_Korp_Mask,
        ClothingItemExtraOption = Wearonface,
        ClothingExtraSubmenu = Wearonleg,
        ToolTip = Tooltip_item_MaskRed,


    }
#

it just wont load in the world, and if i try to spawn it i get an error and nothing happens

bright fog
quiet spoke
#

i got it from there

frozen vessel
#

Guys, how do I update a mod for Build 42? I'm trying, but it keeps saying that the mod.info file is missing. Even when I test with the template, I get the same error. I've already placed a mod.info file in the Build 42 folder, the common folder, and in the mod's folder.

#

I've placed it in every location that's required in the Build 42 structure, but it still gives the same error. Even the template throws the same error.

bold quail
#

Hey, bit of a long explanation and question(s). If this isnt the correct place to post, I will apologize and repost elsewhere.

Hey, I had a question about mods, modding and what is and is not possible to do with mods. I have no real experience modding, but I'm working on creating a server and have some ideas for things I might like to add (either requests or commission) and I want to have an idea of how troublesome it would be to do before I start seeking prices. (mostly so i don't get ripped off or ripping off others. If there is anyone out there who might be able to assist, it would be appreciated.

  1. With build 42, is it possible to set "zones of effect" for mod activation? Let's say, for instance, I want to have an asset with a right click option to reactivate power or water in an area (not radius).
  2. Is it possible to set new assets to a specific location, without creating a whole new map? For example, subway entrances, electrical junction boxes, or even add a right click option to hydrants and telephone poles.
  3. Is it possible to a global replace of all assets meeting a specific name; for example, all bathtub assets on the map are replaced with a new asset image? For stuff like cleaning the bathtub, toilets, sinks, doors and other tiles that should be cleanable with mechanics like clean dirt?
#

Sorry if the text was long, and I will likely have follow-up questions. Again, if this isnt the right place or if DM is better for this sort of thing, please let me know.

sour island
terse delta
#

I've never seen coding language based on enchantment table

brisk remnant
bright fog
# bold quail Hey, bit of a long explanation and question(s). If this isnt the correct place ...
  1. I believe some recent changes added that
  2. Adding right click options to tiles is possible yes, and not hard at all, tho depends what you want too
    Adding new tiles without creating a map is possible, you can place sprites on the map via Lua but the area needs to be loaded
  3. you can make texture packs I believe, some mods do that on the workshop, and you can modify tiles from Lua too when doing an action
frozen vessel
bright fog
frozen vessel
#

its working fine

sour island
#

May you share the error (if its still occurring)?

frozen vessel
terse delta
#

Lmao

bright fog
#

If you remove these from the cache folder, do you still get the problem ?

#

Are you on Linux ?

#

Nah

#

Wibdows

#

I could have seen that with the screenshots :|

bronze yoke
#

you have no mod folder

#

yours is Workshop/'94 Honda Civic EX/Contents/mods/42/mod.info, should be Workshop/'94 Honda Civic EX/Contents/mods/YOURMODNAME/42/mod.info

bright fog
#

Oh yea

#

Nice catch

frozen vessel
#

oh man, nice!!!! i'll try that

quaint tartan
#

(B42) If I wanted to create my own custom evolved recipe template how would I go about doing that? Would you think its something that would be too much for a beginner?

simple bluff
#

Hello, Is there anything about 3D weapon models in the PZ modding wiki?

bright fog
bright fog
#

Idk if the wiki page regarding these is good enough to understand them

simple bluff
#

Ill try to explain it, so, i try to create a weapon and everything works properly but until now i was using the assault rifle weapon sprite, but now i want to use another weapon sprite but the gun is now transparent

#

Im sorry im new so idk if i explain it well

#

And this part is quite difficult for me

arctic fiber
#

Hi guys, do anybody knows where to find the code part of the zombies logic?
and is it possible to mod it with lua?

#

on b41 and b42

ancient grail
#

how exactly did you apply the new the texture

ancient grail
#

it depends on what you want to do exactly
if you could provide more details

ancient grail
ancient grail
ancient grail
ancient grail
quiet spoke
#

thanks for the answers, i just made it not give defence when worn on the leg and the model was fixed but i still dont know how

#

the good thing is that everything works and i will be posting it tomorrow or the day after

quaint tartan
arctic fiber
ancient grail
#

inventory spawn when the zed turns to corpse item
you can only fetch visual or add items you wish to spawn when it dies

to set target
you use setTarget()

to prevent damage you use the zombies ln hit event and nullify the damage

to prevent then from attacking its tricky
you can use the cheats but thats not adviseable
or set useless but that has issues too
or you spam setTarget(nil)

trail ibex
#

Hi, I'm trying to write a mod to spawn my character at specific coordinates. I have gotten it to show up in the world selection and spawn location; but when I use my spawn, my character spawns in seemingly random locations like the prison. My best guess is that it is skipping over my spawn list. I'm not really sure how to remedy this.

trail ibex
#

I don’t think so. How would I do that?

bright fog
trail ibex
#

I referenced the example mod.

bright fog
#

If it's a for map spawnpoints, use this system, not a teleport

trail ibex
bright fog
trail ibex
#

i used another mod,

bright fog
#

You didn't modify the coordinates...?

#

:|

trail ibex
#

no

bright fog
#

What did you expect exactly ? 😭

trail ibex
#

That it would put me in a consistant place

bright fog
#

But you have multiple coordinates here

trail ibex
#

Oh

bright fog
#

Oh wait no you don't

#

I'm unsure how these coordinates are used but they don't look like x y coordinates

#

Check the mapping Discord

trail ibex
#

They look the same to the ones on the example mod

bright fog
#

They should have some resources regarding custom spawn points

trail ibex
#

I think I forgot to ad a z position

bright fog
#

Nah

#

Don't think it matters ?

#

Anyway

#

Check the mapping Discord

frank elbow
#

Not able to double-check at the moment

trail ibex
silent zealot
#

In B42 you can do

  unemployed = {
    { posX = 3905, posY = 12254, posZ = 0 }

But I'm not sure if that's a N42 change or yo coudl always use both syntaxes

trail ibex
#

Do I need to add posZ?

silent zealot
#

First: Are you on B41 or B42

trail ibex
#

B42

silent zealot
#

You only need to do unemployed if you don't have profession specific locations, and you can use posX/posY/posZ

#
function SpawnPoints()
return {
  unemployed = {
    { posX = 3905, posY = 12254, posZ = 0 }
  }
}
end

#

replace the co-orinates with where you want to spawn

trail ibex
#

Okay, I was wondering if I could just put unemployed. Just out of curiosity, could I drop my character if I change the Z position?

silent zealot
#

You can start on the upper levels of a building though

trail ibex
#

Okay, thanks

south bear
#

When I try the following, it adds the axe on the tile at the player's feet, but there is no axe sprite visual to indicate an axe is there... I can only tell it is there because it shows up in the world tile's inventory UI box...

local square = player:getCurrentSquare()
square:AddWorldInventoryItem("Base.Axe",playerX,playerY,playerZ)

I also tried instancing the axe using

local axe = instanceItem("Base.Axe")
local square = player:getCurrentSquare()
square:AddWorldInventoryItem(axe,playerX,playerY,playerZ)

and got the same result!

Does anyone know why this may be/how to fix it? I'm on B42.9 and this is in debug mode.

#

(trying in non-debug now just to see if this issue will duplicate)

#

Same result!

south bear
# south bear

Don't mind the axe to the left - that was one I picked up from the stack and manually dropped over there

silent zealot
#

There is probably an extra step to place the world model in the world. Look up the timed action for putting stuff on the floor, or dropping stuff; that should have the steps you need in the complete() step

simple bluff
#

@ancient grail i put a models file in 42.0.0/media , an fbx file in common/media/model_x and a png image of the weapons 3D texture in media/textures and in the models file i'm lost with this part :

    mesh = weapons/firearms/AK47,
    texture = weapons/firearms/AK,

i'm sorry if i did wrong i don't really understand this part for the moment

foggy bronze
#

Does anyone know where I would find the base game models for the long gloves and long boots? I'm trying to retexture them for use in another mod

foggy bronze
#

Is it just a retexture of the base model?

bright fog
#

And do not use models themselves

#

That's the case of tshirts for example

#

Or even pants

ancient grail
foggy bronze
#

What would be the best way to create multiple new boots/gloves if that's the case then? I need custom rainboots looking boots and long gloves

bright fog
foggy bronze
#

Working on a power rangers mod and the gloves/boots are seperate from the jumpsuit

#

Right, but normally for models that'd use a related fbx and texture and whatnot

foggy bronze
#

meh, guess I need to do more digging

bright fog
#

Just check how the clothing items that do not use a model work

#

Go check the scripts of tshirts

tranquil kindle
simple bluff
#

@bright fog i im creating a weapon just to do some test and to learn too , but i dont understand how to add a custom 3D model to my weapon

bright fog
simple bluff
#

Oh thank you Ill Check that

foggy bronze
#

So each .xml in clothingItems needs to correspond to a matching entry in fileGuidTable?

bronze yoke
#

yeah

foggy bronze
#

Does that include weapons?

#

or would that be a different file

bright fog
#

No

#

That's completely different

#

Read the guide above for firearms

foggy bronze
#

no worries, adding each colors power weapon, still plugging away at all of this lol

#

I retextured the boiler suits though

foggy bronze
#

Does fileGuidTable.xml allow comments? // doesnt seem to work

bright fog
#

It's XML comments

#

Look it up

bronze yoke
#

in XML comments look like this <!-- comment -->

agile nacelle
#

jesus christ am just spending days wasting my time on figuring out how to make the raycast work

#

am geneuinly pissed off

bright fog
#

What's the issue ?

agile nacelle
#

it doesnt detect the objects

#

the raycast goes to the designated position

bright fog
#

You're trying to use my raycast or you wrote one from scratch ?

agile nacelle
#

well i just

#

sampled from you

#

and wrote the rest

#

basically wrote according to what i understood

#

_checkForIntersectedObject keeps returning nil

#

all my problems could probably be solved just by visualizing the raycast ngl

bright fog
#

Didn't I leave in stuff like this ?

agile nacelle
#

i didnt notice anything for visualizing the raycast in your code

bright fog
#

Sec

#

Also, you shouldn't copy my code in your own mod, tho I should also probably provide better tools to customize the raycast, more than what I already did

#

VisualMarkers.AddLine({x=minX,y=minY,z=0}, {x=maxX,y=maxY,z=0}, 1, 1, 0, 0.2)

#

When you have debug mode activated

#

And you need to activate a thing in the context menu debug option

#

Tho you don't have my whole addon

agile nacelle
bright fog
#

So you can't use these tools

bright fog
#

I would suggest just making a local copy of my mod framework, and modifying directly the code in this copy if you want to test things

#

That way you can use the line drawing debug tool to show the ray cast

#

@bronze yoke is this new to Umbrella ?

agile nacelle
#

noted

bronze yoke
#

yes, we use (exact) classes now - but if you're getting this error that just means you forgot to declare a class

bright fog
#

I mean "forgot" 😅

#

How am I supposed to use ---@class exactly ? I never used it so idk how it works

bronze yoke
#
local MyObject = ISBaseObject:derive("MyObject")

-- error: you are adding a new field to an instance of ISBaseObject returned by derive
function MyObject:myFunc()
    ...
end

---@class MyObject : ISBaseObject
local MyObject = ISBaseObject:derive("MyObject")

-- no error: you are allowed to modify MyObject, a subclass of ISBaseObject
function MyObject:myFunc()
    ...
end
bright fog
#

There's no way to just detect that automatically ? Bcs derive means we are creating a new class anyway ?

bronze yoke
#

there's no way

#

it wouldn't give much benefit anyway since you still need to declare things like fields in the class declaration

bright fog
#

I hope this doesn't confuse new modders regarding their own use of derive since not adding ---@class should have 0 impact on their code anyway

bronze yoke
#

all type annotations have 0 impact on code 🤷‍♀️

bright fog
#

I mean yea but isn't this one intrusive ? Showing a potential mistake when in reality there isn't ?

#

What's the reason to having this error in the first place ?

bronze yoke
#

you made a mistake when you forgot to declare a class

bright fog
#

But I never declared any class

bronze yoke
#

and that's bad

bright fog
#

How is it bad ?

bronze yoke
#

the language server won't understand your class

#

it thinks RayBeam2D *is* ISBaseObject

bronze yoke
bright fog
#

Why is it an issue writing to fields that do not exist ?

bronze yoke
#

it's usually a mistake

bright fog
#

Eh

bronze yoke
#

there's no point writing to a field that doesn't do anything

bright fog
#

I mean that sure okay

bronze yoke
#

if it does do anything, you should have written a field annotation for it

#

otherwise there is literally no way to give a warning for typos, because any typo could be a new field you're making right now

bright fog
#

Like this ?

bronze yoke
#

yeah

bright fog
#

So I should declare fields early under the class declaration ? Or when the field gets created ?

bronze yoke
#

in your class declaration you want```lua
---@class RayBeam2D : ISBaseObject
---@field ignoredObjects type description

bright fog
#

Bcs for example this field is created in new

#

But what about fields that are "unique", as in sometimes defined in an instance, sometimes no ?

bronze yoke
#

just add | nil to the type

#

i advise against having too much variance in types though

bright fog
#

Makes sense

bronze yoke
#

however | nil is generally fine

bright fog
#

Which is messy overall

#

I had tried that once and was horrible to handle lol

bronze yoke
#

for that reason i'd prefer to use a null value of the same type when it makes sense to (empty string, -1 or 0), nil usually would take the place of an object

bright fog
#

In my case here I don't have a need for |nil bcs I have default values

---Create a new RayBeam2D instance.
---@param startPoint table
---@param vectorBeam Vector2
---@param _ignoredObjects? table|nil
---@param _deltaLength? number|nil
---@return table
function RayBeam2D:new(startPoint, vectorBeam, _ignoredObjects, _deltaLength)
    local o = {}
    setmetatable(o, self)
    self.__index = self

    -- parameters
    o.deltaLength = _deltaLength or 0.01
    o.startPoint = startPoint
    o.vectorBeam = vectorBeam
    o.ignoredObjects = _ignoredObjects or {}

    -- initialize vectors and values used in casting the ray
    o:initialize()

    return o
end
bronze yoke
#

but you can't always do that because sometimes you want all possible numbers/all strings to be valid values, then | nil makes sense

bright fog
#

Also idk what the typing for that would look like

bronze yoke
#

just string or number

bright fog
#

I think I need to make a wiki page explaining the typings

bright fog
bronze yoke
#

for strings it's a safe assumption that it will always be the empty string, for numbers it's usually -1 but you can use a constant if you want it to be clearer

bright fog
#

Like ---@param _deltaLength? number|nil
How would I write the typing that the null value should be 0 ?

bronze yoke
#

i just wouldn't try to represent it with annotations, but you could technically do number | 0

bright fog
#

Not defining it with annotations sounds cursed as shit bcs it would lack proper indications

bronze yoke
#

then you can put it in the comment

#

the benefit of a null object is generally that you don't have to check it as often as if it was actually nil though

bright fog
#

It's really a per case application tho

bright fog
#

Tho if you can do |0 then that's good

#

No idea for strings tho ?

bronze yoke
#

string | "" i guess

bright fog
#

Does that work ?

bronze yoke
#

yeah?

bright fog
#

Interesting

#

Yea it does

bronze yoke
#

it's not really meant to be used for this though, to the language server string | "" means literally nothing because "" is already included in string

#

it's mostly used to annotate when there's a specific set of possible literal values (e.g. 0 | 1 | 2, "one" | "two" | "three")

bright fog
#

Like for tables ?

bronze yoke
#
---Returns a wall on a specific side on the square.
---@param square IsoGridSquare The square to search.
---@param side "north" | "west" | "northwest" | "southeast" The side wall to find.
---@return IsoObject? wall The wall, if any.
---@nodiscard
IsoObjectUtils.getWall = function(square, side)
bright fog
#

Ah yea

#

nodiscard, interesting

#

Lots of typings I'm not familiar with

#

Also isn't there some typings that are just fake typings ?

#

Like @private, there's no real way to do that in Lua is there ?

bronze yoke
#

nodiscard basically means 'if you call this function you have to store the result', useful for functions that don't have side effects

bronze yoke
bright fog
#

Yea it's just a warning

bronze yoke
#

i don't personally find mimicing accessibility very useful so i don't use it, but i do use the _ prefix as convention for 'things that are not api'

bright fog
#

Yea I used it in RayBeam2D

#

For internal functions of the class

bronze yoke
#

i don't really care if people access internals so i don't want it to give a warning, but i do want them clearly marked so they know i can change them whenever i want and they can't get mad at me for it

bright fog
#

Yea if they try to access it it's probably that they know what they are doing I guess

#

Have something in mind

bronze yoke
bright fog
#

Of course, but some do base themselves on actual stuff in the Lua

#

Or at least have a logical sense to be present in a way, like defining types for functions, classes etc it's just warnings sure. But my remark regarding nodiscard was mostly if something like that was actually doable in the Lua language

#

Also I think I finally understood that I missnamed my mod drunk

bronze yoke
#

type annotations just describe the way things are, even something like 'this variable can only be this type' is not really doable

bright fog
#

Yea I guess

#

Also see I had properly used it here hahalol

#

Didn't even remember I had done that

bronze yoke
#

raw table is a bit scary though

bright fog
#

For the fields on the bottom ?

bronze yoke
#

yeah, usually you would annotate what is actually in those tables