#mod_development

1 messages ยท Page 254 of 1

grizzled fulcrum
#

Although its probably doable I jsut dont knoow how

#

wth why is the link cut off

#

it was because I put braces around it lol

zealous panther
#

Hey. I wanted to ask if someone could help me modify a mod.

There's a mod called "Zombie Harvester Redux" And I want to increase the area of effect of the Thresher infront of it. No idea of where to begin, looked around in the files, but I'm not sure where it declares the area

thick karma
#

So I would look for a for loop inside of another one

#

That appeared to track two similar indexes

#

And dealt with squares

unreal pewter
#

could someone help me out? im using the exact same methodology here to get these item icons working but half the time they just dont work and i dont know why

#

is there anything i need to know to get these to show up in-game?

#

nevermind im dumb

manic relic
#

anyone know how or what the Decalgroup is?

#

i wanted to make a t-shirt mod which "should" use custom decals

stone garden
#

@reef portal can we talk in dms

#

?

leaden star
#

Hi i'm currently working on Zombie Skin mode and managed to replace all the zombies with my zombie model, now i need to removed the zombie skin(cloth) and add 1 banana in small chance from zombie corps loot table. is anyone can advice me with that? just like occult and Dead Space zombie mod works but i can't figure out how it works.

vital karma
#

Anyone know a good guide on making a custom UI?

hardy drift
#

hey there, if anyone could help me out with figuring out why the mod I'm working on wont show up in my mod list please hmu!

bright fog
hardy drift
#

as of rn i think i figured it out

#

instead of .info

#

will report back if im wrong which is very probable

hallow girder
#

Where do I start to learn how to mod zomboid? I have a program installed that allows me to write LUA, but I don't even know how to properly use that. I'm pretty well out of my comfort zone, but I'd love to learn the process. Any pointers?

drifting ore
#

lf mod that increases the heating radius of fireplaces drunk

hallow girder
#

i wanna mod in mosquitos that can carry the infection and have to be repelled with bugspray or hairspay (something of the sort)

hardy drift
drifting ore
#

that sounds awesome

hallow girder
#

I'm not even sure how to start with modding though. Is there a way to connect SciTE to zomboid, like a pluggin or something? is it as simple as sifting through code to add/remove what I need?

#

i found a zomboid tutorial, gonna look that over

unreal pewter
#

so i followed the tutorial on the forums on how to make a custom map item, but im getting this error and the map shows up blank in-game. has anyone had this?

leaden star
#

does anyone know how to prevent to custom zombie skin to be lootable? it's keep remain in the corpses inventory as an item everytime when i kill my custom zombie

bronze yoke
unreal pewter
#

but how do i add an item to the loot pool to spawn on the ground?

#

like if i wanna spawn an item on the ground in a living room or bedroom or something

grizzled fulcrum
#

I am curious about ^^ too, for learning

drifting ore
#

imagine putting a huge sus looking obfuscated string in your mod, in order to generate a fake crashdump and put it in console.txt which contains an incredibly rude and snarky message to whatever poor user has to deal with someone else's bug

#

like JEGUS get a life

#

I was looking into the mod's source code because documentation simply doesn't exist, and this is THE VERY FIRST thing i find inside.

#

I mean look at this. Does this strikes you like something anyone whatsoever should put in their mod? Especially just to be mean to strangers? But in a backhanded way so that people who look at your code cannot tell? Which in itself is extremely poor look?

#

At first I even thought this was some kind of eval backdoor, but no it just displays super rude text disguised as PZ crash dump.

warm crown
#

I exported it as an fbx like it told me to

hollow lodge
#

it's more clear

grizzled fulcrum
#

yes its very ugly

#

well its a very very light obfuscation at best

drifting ore
#

it's not very sophisticated, no. But it bothers me that it exists at all, that it exists to hide the fact that the mod displays a very rude message, that it displays such a rude message at all, that it's disguised as a real crash dump, and that it displays a rude message instead of helpful tips

#

the message itself uses an euphemism to call the user an idiot, then patronizes, then emasculates, and then mocks the user

#

this is not ok. There is no scenario in which this is ok.

#

and perhaps worst of all, is that the user gets this message instead of a real crash dump (which is useful for debugging the issue) in case something is misconfigured

#

At face value it's pretty insignificant. It's just a snarky fake crash message replacing the real crash message. But the way I see it, it's just layer upon layer of being a complete douche.

drifting ore
#

wrong

bright fog
#

Oh you were quick on that one

#

Why wrong ?

drifting ore
#

i'm not a modpacker

#

like i said i was looking into mod's source code for the want of documentation, and it's what i find inside, right at the top of the file, front and center

bright fog
#

So what about the error ?

drifting ore
#

nothing, i never got it

bright fog
#

Exactly

#

So you're judging his console thing when that's a modpacking security

drifting ore
#

(X) doubt
it doesn't do anything whatsoever about modpacking and all it accomplishes is gives people grief

bright fog
#

lmao

#

For sure

raven smelt
#

I think you got emasculated little buddy

drifting ore
#

I mean, it's one thing if you want to print("lmao ur dum")

#

when you put that into a cipher so people couldn't see that you're doing this, it's where it crosses the line for me

bright fog
# drifting ore (X) doubt it doesn't do anything whatsoever about modpacking and all it accompli...
local function _check()
    local m, lCF = nil, getCoroutineCallframeStack(getCurrentCoroutine(),0)
    local fD = lCF ~= nil and lCF and getFilenameOfCallframe(lCF)
    m = fD and getModInfo(fD:match("(.-)media/"))
    local wID, mID = m and m:getWorkshopID(), m and m:getId() if wID then local wIDH, e = "", "fifmkhjkfi" for i=1, #wID do wIDH=wIDH..string.char(wID:sub(i,i)+100) end if e~=wIDH then toggleModActive(m, false) ECC_VC = {wID, mID} end end
end
Events.OnGameBoot.Add(_check)

Checks if the mod has the right ID. Else ECC_VC is set as existing. Then checks variable exists and creates a function and does your string thing

#

A quick read allows anyone to understand what's going on

drifting ore
#

it's like you have full intention to be an ass, but you don't want people to see that you have such a full intention

bright fog
#

And you're here acting like you're doubting it's for modpacking

#

He's counter acting against modpackers and you're just mad about it

#

Protecting his code

drifting ore
#

i don't do modpacks i could hardly care about that particular aspect

bright fog
#

Exactly, so why judge his anti modpack security ?

#

Why act like that ? Why do you care ? You shouldn't ?

drifting ore
#

who said it's the "anti modpack security" i'm judging?

grizzled fulcrum
bright fog
#

It is a security

grizzled fulcrum
#

well I guess that is for the better lol

bright fog
#

Of course a better security could exist that's for sure, but that's really good enough

drifting ore
#

you'll notice that i didn't said anything about the modpacking and i did said a lot about making a snarky condescending message and doing it in a shady way

bright fog
drifting ore
#

yes. None of it pertains to modpacking.

bright fog
drifting ore
#

the string thing is shady

bright fog
#

It's literally just a fucking string

#

That's it

drifting ore
#

please quit trying to make it look like i said anything about modpacking because i didn't

bright fog
#

You can't hack someone with this shit if that's what you think

grizzled fulcrum
#

While I think it would be bad if someone were to include this generally in a mod, it's included specifically for the case where a user decides to modpack so it's not like everyone will receive that error

#

Although this doesn't mean I don't agree with the fact that obfuscating/encrypting/trying to hide anything in a Lua script for a mod in a game is a bad practice

bright fog
#

His mod is explicitely said to not be allowed to be modpacked, if someone does it, he gets his console fucked or idfk what and he deserved it

#

He's not doing that to random users and shit like that

drifting ore
#

i can respect breaking people's modpacks as a personal choice, but breaking it in this way specifically is a douchebag kind of choice

#

instead of all that it should be just print("modpacking not supported")

bright fog
#

You're just nitpicking on stuff for your convenience

drifting ore
#

i don't even use that mod jegus

bright fog
#

Modpackers do not care about a print in the console

drifting ore
grizzled fulcrum
bright fog
#

It doesn't just print

#

It breaks the mod

drifting ore
#

you're missing the point

bright fog
#

You just can't

grizzled fulcrum
#

I mean like overflow stuff gets found seemingly weekly

drifting ore
#

more generally i think you're so intensively putting words in my mouth that it's difficult to hold a conversation

grizzled fulcrum
#

And it's not like the game's code has the greatest reputation overall (sorry TIS)
*as of latest public release

bright fog
drifting ore
#

because why would i do that

bright fog
#

You would deserve a fucking ban if I was a mod being such a rat

drifting ore
#

i'm not here to point fingers at anyone specifically

#

just to show this disgusting way this disgusting message is created

grizzled fulcrum
bright fog
#

"disgusting way"

#

Protecting his work by disabling his mod and printing some shit in the console

#

Is a disgusting way for you

drifting ore
#

dude

#

(or dudette)

#

i don't even object to the action of breaking the modpacks

bright fog
drifting ore
#

would you PLEASE quit insisting that this is what it's all about?

grizzled fulcrum
#

ok modpacker put something in his mod so it doesnt load his mod when modpacking is found, its sus (only because something can be bad but not everything is bad) but in this case its not too bad, done

#

I dont even think theres more to debate about

bright fog
#

You've proven yourself to be a rat, people saw you as you are, I've brought it up to the attention of the public. No point in arguing with you in any way, you know what you do, you know your hatred, you don't even know what the code does while reading it for more than 2 minutes would have inted you towards the antimodpacking, which you never mentioned once

drifting ore
#

because modpacking here was never the point

#

jesus christ modpackers live rent free in your head

bright fog
#

Then there's nothing to bring up, he's not doing any shady shit

#

It's just a long string, that's it

grizzled fulcrum
bright fog
grizzled fulcrum
#

I do it somtime

bright fog
#

The code is for antimodpacking, that's it, end

bright fog
grizzled fulcrum
#

but only because I have a license on my code

drifting ore
#

yeah it's fine I thought it had nothing to do with it but i was wrong. Either way I don't judge them for intentionally breaking modpack compatibility since this creates a lot of issues for original modders.

bright fog
#

k

drifting ore
#

With that out of the way, can we appreciate at face value the fact that a) some very rude message is displayed to people instead of making a statement of fact that modpacking is not allowed b) the message is hidden in the file such that people who look at the source code cannot see the message and its rudeness to strangers

#

and perhaps c) that i never mentioned who made this

#

well in fact it doesn't matter who made this. I don't care if it's the president of america.

sour island
#

Alright, you both can stop now. We've reached the conclusion of the conversation.

sour island
#

The code is scary, and looks bad, but does good, like batman.

drifting ore
# bright fog

Hey I already said that I was wrong about previously saying "nothing to do with modpacking". I don't do modpacking so I have grand zero experience with it so should've known better than to say it in the first place. But it's not about modpacking, it's about the message and how it's put there.

#

If it was just do return end --modpacking detected, aborting i wouldn't even bat an eye.

drifting ore
#

but like, wouldn't the mods just crash anyway?

dry chasm
drifting ore
#

i mean it checks a variable to detect this. If it just uses this variable and the values are incompatible, it'll crash and not work, so even if you delete this check it wouldn't make it work

bright fog
#

No, I believe it might be more complicated than that but I'm not fully aware of how his security works

drifting ore
#

well now it's the same issue as me saying "nothing to do with it", which for me turned out completely wrong

sour island
#

I'm only skimming this dubious code, but it appears the security measure is separate from the error printing - perhaps to throw off would be mod editors.

#

I don't think it replaces an error, but I could be wrong. I don't really see how it's snarky or rude though.

drifting ore
#

it's not a replacement (i was wrong about that too) it generates a completely artificial error message when modpacking is detected

#

and well "error: low neuron count" isn't exactly subtle about calling people stupid

sour island
#

Ah you were able to translate it?

drifting ore
#

after verifying that it just prints a message, i copied that part and ran it in isolation. It printed something very close to a regular PZ stack trace (i was so confused for a few moments) but it's edited

sour island
#

So your chief complaint is that it's not very nice?

#

Looks more tongue in cheek

drifting ore
#

i could see how someone thought it was funny

sour island
#

Even includes helpful information along the error lines

grizzled fulcrum
#

ok thats not even extremely rude or slanderous as you made it seem (how I though it was being said)

#

it's literally a fellow modder just saying dont repack my mod, use udderly up to date with my original mod please

solar rover
drifting ore
#

if you look at it thinking that whoever is reading this message fully deserved everything that was coming. To me this looked super unwarranted and the bar for basic politeness was not quite so low.

grizzled fulcrum
#

I guess it was my misinterpretation but you said this " displays a very rude message, that it displays such a rude message at all" which made me switch my mindset to this is like really bad words

drifting ore
grizzled fulcrum
#

honestly if I got this error and didnt know what it mean i'd just ask someone here

drifting ore
#

i think i figured it out

drifting ore
bright fog
#

yea

#

That's kind of what I explained

drifting ore
#

does it only activates if this file is required from elsewhere?

#

well it doesn't matter, i have no intention of circumventing this block. I don't do modpacks.

#

it's just, this function alone already breaks modpacks

#

from what i can tell anyway

#

so the other part, which displays the message, is just to be rude to people

bright fog
#

The guy is a thief when the mod EXPLICITELY says to not modpack with a big ass sign that takes a quarter of the modpage

drifting ore
#

so technically there's no real reason it should be even included in that file

bright fog
#

Yes it should, make them confused

#

Also it's a fake error, so that can lead them to the wrong direction to delete the security

drifting ore
#

yeah IDK fam, alienating people who use your mods doesn't look to me like mentally sound thing to do

bright fog
#

And if they read the error they can quickly see it's a fake error

#

But since they won't properly read it, they'll be fucked

bright fog
#

Read for more than one second

drifting ore
#

i wouldn't be upset if i didn't read it ๐Ÿคท

bright fog
#

But it's an error that could say what broke the mod

#

And it's falsely leading the modpackers in other directions

#

It's just securities

#

Stop arguing about this part I swear, you yourself are the problem rn bcs you don't even read it and come shitting on it again and again

drifting ore
#

well it doesn't exactly do that now, does it? It doesn't make it look like something went wrong. It says "u dun goofed lmao".

bright fog
#

Stop you're making a clown yourself

frank elbow
#

I know this sort of message might come across as judging a topic without contributing but like... This really does not matter enough to warrant an hour long conversation

bright fog
#

yea

drifting ore
#

it's not, really. But Sir Doggy Jvla dragged it kicking and screaming into direction of modpacking.

frank elbow
#

Well fortunately we're all empowered to just stop & let this channel be for modding help like it's meant to be

drifting ore
#

And I don't think anyone here even disagrees on the subject so there's that.

bright fog
#

?

#

Wow

#

You're truly the master of clowns

#

You don't want to go and show who started throwing shit for a small part of a code that fucks modpackers do you ?

drifting ore
#

Frankly you're not in position to call anyone clowns when you've been making one huge strawman argument after another for an hour straight.

bright fog
#

Stop you're shit, we're starting to know you now, trying to fuck around, arguing about modders etc

sour island
frank elbow
#

Well, I tried

bright fog
#

You're not at your first

drifting ore
#

Yeah it's ought to stop. The original point was derailed so thoroughly that nobody even brings it up anymore.

sour island
#

Anyway

grizzled fulcrum
#

lol

sour island
#

Anyone know if a model can be displayed with out a gray background box?

grizzled fulcrum
sour island
#

Specifically on UI

drifting ore
#

Then again you can replace the entire thing, or its prerender function which actually renders the grey background.

#

i've modified mine to show bronze background to indicate incorrect configuration

#

darker grey wasn't doing it for me, and making it more yellow made it bronze

sour island
#

ISUI3DModel.new(self, x, y, width, height)

drifting ore
#

that stuff actually renders the model, it has no background or anything

sour island
#

That is the goal, I don't want a background

drifting ore
#

well i mean the default panel also does a little border. But yeah that's probably the way to go in order to just render a character model.

#

I'm actually not sure if this class can render anything else.

#

I've never tried but it appears to be coded specifically to display human characters.

#

attachment editor uses ISUI3DScene so that's probably the general purpose 3d viewer class

slow flax
#

Ok sooooo...

I made* a mod
But idk how to upload it
How do I do so?

(*I just took a level up sound mod and modified it)

drifting ore
#

in your user/zomboid/mods folder there's an example mod folder

slow flax
#

Wich one is it

drifting ore
#

for me it's C:\Users\coldsteel\Zomboid\mods\examplemod

#

in there there's preview and modinfo files, but importantly your modded files go into media folder inside it

#

if you just replacing the levelup sound, you can probably get away with something as simple as duplicating the folder path from the base game in your mod folder, and putting your modified sound in there with the same name as the original sound

#

when your mod is loaded, its contents will override the original game contents by the same folder/name.

#

(terms and conditions apply)

#

anyway in order to be able to upload it to steam, you should place that into C:\Users\XYZ\Zomboid\Workshop\YourMod

slow flax
drifting ore
#

there's a mod template folder which you can duplicate and edit

drifting ore
#

there should be media folder and modinfo file and poster image

#

and in the first folder with modname there's workshop.txt (you don't need to edit that outside of the game) and preview.png which should be exactly 256x256

#

by the way if you put your mod there, you can activate it without uploading to steam in order to make sure that everything works properly.

#

(might seem obvious but for example one of my modder buddies didn't knew, so due to workflow separation he ended up sending to his dev team members for upload a completely broken version and he only found out after subscribing to it)

drifting ore
#

While closing extraneous editor tabs I looked at the security code again, and I was wondering. Is the point to break it for people who make modpacks incorrectly but allow it to those who know what they're doing, or to break it for all modpacks? Since it checks for steam ID which AFAIK has no bearing on mod confligts, but doesn't check for modID which is what PZ uses to determine what to load. And the function literally just says add(_check) which is, like, right there. It could be fixed with any amount of coding skill. But it could be something like _G[a][b][c](d) and that'd make it way harder to change anything without breaking everything else.

#

somewhat related, loadstring works in PZ but that's probably taking it too far

drifting ore
#

@sweet mirage that is the my used vehicles IDs

#

I'm making a military base, Rosewood to St Paulo's. to west in Rosewood road. the road on my map will have a stop made by the army and if I were you I would be careful about going too fast with your car

#

a 5 tiles garage door LOL

topaz tangle
#

hey!
would anyone know why my wheel models arent appearing in game? (error message that appears in logs attached)

slow flax
#

Ok so

I got the level sound to work
Now I just gotta upload it

But the game tells me preview images cant be bigger than 1mb

topaz tangle
#

lower the photo resolution

slow flax
#

Ok

-# And how do I do so?

topaz tangle
#

website

#

or bing if you swing that way

slow flax
#

google

topaz tangle
#

yes, just look up file condenser or something

slow flax
#

I reduced the preview file size but the workshop keeps telling me its bigger than 1mb

Its not
Its 954kb

topaz tangle
#

why is your photo file so large?

slow flax
#

Maybe its the image size

topaz tangle
#

image size must be 256x256

slow flax
#

Alright,thanks

topaz tangle
#

np

#

i had troubl a few days ago uploading my mod too i get it

slow flax
#

Im still getting the issue

What the fuck

topaz tangle
#

make the file size smaller

slow flax
#

Its 151kb

#

I dont get it

topaz tangle
#

make sure the right file is there and the name is right

slow flax
#

Its name right and its the right frile(PNG)

topaz tangle
#

i dunno then sorry

drifting ore
#

there are 2 different picture files

#

make sure you edited the right one

#

you can just use the same file for both pictures

#

one is a workshop preview, and another is modinfo poster

drifting ore
#

What do you think of this roof?

slow flax
#

Looks nice

#

Can you break it?

dull bear
#

Hi, is there a way to override vanilla items without having to specify the entire object and its properties in the items file? I am looking to add a new attachments slot. Instead of redefining the entire block:

    item Hat_Army
    {
        DisplayCategory = Accessory,
        Type = Clothing,
        ... many properties ...
        AttachmentsProvided = ANewAttachment,
    }

I would like to do something like this

    item Hat_Army
    {
          AttachmentsProvided = ANewAttachment // only add the attachment slot, dont touch the other properties
    }
bronze yoke
#

you can do it with lua but not with just scripts

dull bear
bronze yoke
#
local item = ScriptManager.instance:getItem("Base.Hat_Army")
if item then
    item:DoParam("AttachmentsProvided = ANewAttachment")
end
```i'm not sure if that'll nuke the existing attachments though, some properties will just let you add stuff like this and some will get overwritten
#

but this is how you'd generally modify just one property of an item

dull bear
drifting ore
#

it does offer some anti-modpacking protection, as per namesake. But really not much, also per namesake.

tacit carbon
#

what is the command to delete an item? cant seem to find it here

#

the only one I see is isDisappearOnUse()

drifting ore
#

what do you mean "delete"? From the game? Or from inventory?

tacit carbon
#

from the inventory

drifting ore
#

you can simply remove it from the inventory object

#

getInventory():remove(index)

#

pretty sure there's a way to pass the object itself so you don't have to find its index

tacit carbon
#

if you do that, the item seizes to exist right?

#

I want to make an item consumable but not by using it the normal way

drifting ore
#

it's removed from inventory and not inserted anywhere else, so it exists in Java memory limbo until it gets garbage collected

#

so effectively it's gone

tacit carbon
#

if I do
isDisappearOnUse() and Use() will it do the same?

drifting ore
#

that I don't know

tacit carbon
#

ill try to do your version

drifting ore
#

yeah you have a handle on the item itself, you can straight up pass it into the remove function
getInventory():remove(inventoryitem)

tacit carbon
#

do I pass the index number or the item itself?

drifting ore
#

the item

tacit carbon
#

okay

drifting ore
#

there's also RemoveOneOfโ€‹ by item name if that fits the application

hardy drift
#

media\lua\shared\Translate\EN\ContextMenu_EN.txt

    ContextMenu_PopAnUppyDecky = "Pop an uppy decky",
}```


```    item JYTCitrusBurst
    {
        DisplayName = JYT Citrus Burst,
        Type = Food,
        EatType = can,
        ThirstChange = 5,
        Weight = 0.1,
        Icon = JYTCitrusBurst,
        UnhappyChange = -10,
        FatigueChange = -30,
        DaysFresh = 9999,
        UseDelta = 0.05,
        UseWhileEquipped = FALSE,
        UseSound = OpenCan,
        ReplaceOnUse = JYTEmpty,
        CustomContextMenu = PopAnUppyDecky,
        Tooltip = Tooltip_JYT,
    }```
#

can't for the life of me figure this out

#

CustomContextMenu not working

mellow frigate
hardy drift
#

i am noob no clue what that means

mellow frigate
#

try replacing CustomContextMenu = PopAnUppyDecky, with ```
CustomContextMenu = Drink,

hardy drift
#

will try, give me one sec

#

Drink is already in the games translation files so I don't need to add it to my mod's right? @mellow frigate

mellow frigate
hardy drift
#

gotchu thanks gonna do that rn

mellow frigate
# hardy drift i am noob no clue what that means

we all are before being stuck with encoding problems https://en.wikipedia.org/wiki/Character_encoding

Character encoding is the process of assigning numbers to graphical characters, especially the written characters of human language, allowing them to be stored, transmitted, and transformed using digital computers. The numerical values that make up a character encoding are known as "code points" and collectively comprise a "code space", a "code ...

#

in the end you want utf-8 without BOM for your txt files for eng translations as well as internals descriptions (but you want other encoding for other language translations like Brazilian and Cyrillic)

#

what editor are you using to write / edit ContextMenu_EN.txt ?

hardy drift
#

notepad++

#

loading game rn with it changed to CustomContextMenu = Drink,

mellow frigate
hardy drift
#

how would I encode it in notepad++?

#

ill look around for it

#

it's already UTF-8 without bom

#

@mellow frigate

#

works with drink

#

so it's GOTTA be my ContextMenu_EN file

#

idk what could be wrong with it though

sour island
topaz tangle
topaz tangle
#

hey!
would anyone be able to help me figure out why my wheel models arent appearing? (ik i asked earlier but im still having issues)

hardy drift
bronze yoke
hardy drift
#

trying to find an EatType with a really short eat time, I found popcan in the AnimSets .xml files and itโ€™s speedscale is set to .64

#

but popcan is a foodtype

#

would i just set FoodType = popcan instead of EatType?

bronze yoke
#

eattype is just the script name for foodtype

hardy drift
#

oh shit ok cool thank you

#

that worked thanks a lot @bronze yoke

#

it's coming along ๐Ÿ˜ค

#

with help from the original Zyn mod creator, needed help with the function to decrease the weight every time u pop one

uneven ore
#

Hello, im new to modding, how can i delete an consumable after a player uses it?

Currently having an issue where people are cheesing the mechanics of a healing item by cancelling the animation half way through, so the item stays in their inventory, but the effects of the item are still applied

How would I stop players from doing that?

hardy drift
#

@uneven ore
DisappearOnUse = TRUE,

uneven ore
hardy drift
#

๐Ÿซก

uneven ore
# hardy drift ๐Ÿซก

it seems like the same issue is occurring unfortunately, is it influenced by the fact its classified as a food item?

hardy drift
#

@uneven ore the issue where players can stop the eating animation and still recieve the effects? or it doesn't disappear after you let your character eat the whole thing

mystic vessel
#

Guys one tick in zomboid, is how many seconds?

bronze yoke
#

it's not a set amount

#

on the client ticks will fire as fast as the game can, if the player has set a framerate limit it'll be that unless they're lagging, on the server it'll target 10 per second unless it lags

mystic vessel
#

so, how i do to make my crafting a certain amount of time

Example: if i want to make a crafting lasts one hour in-game. How much should i put it?

bronze yoke
#

oh, crafting uses its own time, 48 units is one real second

mystic vessel
drifting ore
limber onyx
#

Hey guys. Can anyone lend me a hand with a quick mod?
I made a mod some time ago that would allow the player to craft spears out of sturdy sticks, but instead of replacing the vanilla recipe, it appears to have added another option in the drop down menu and now there are 2 "Create Spear" options to choose from. How can I just replace the vanilla recipe instead?

drifting ore
#

make your recipe named exactly the same as the original, but add sturdy stick into "use one of" ingredients table

#

SOMW just adds a different spear

bronze yoke
#

i don't think it correlates to anything specific in game time but it might scale with day length regardless

drifting ore
limber onyx
bronze yoke
limber onyx
#

Vanilla recipe, made from tree branch or plank

#

Then the modded one which allows sturdy stick as an ingredient. Still 2 context menu options

#

I must point out that my mod is quite old, made it almost a year ago. I don't know if the devs changed something, and im such a newbie coding i wouldn't know what it is that could have changed

bronze yoke
#

does the recipe have the same internal name as the one you're trying to replace?

limber onyx
#

I think so...
Remind me how you paste code in discord please???

drifting ore
#

enclose it in triple graves

bronze yoke
#

enclose it like
```
paste here
```

limber onyx
#

thx

#
module ChippedStone
{ 
    imports
    {
        Base
    }

    recipe Make Stone Knife
    {
        
        TreeBranch/WoodenStick,
        SharpedStone,
        RippedSheets/Twine/RippedSheetsDirty,

        Result:FlintKnife,
        Time:80.0,
        Category:Survivalist,
        Override:true,
    }
    
    recipe Make Stone Axe
    {
        TreeBranch/WoodenStick,
        SharpedStone,
        RippedSheets/Twine/RippedSheetsDirty,

        Result:AxeStone,
        Time:80.0,
        Category:Survivalist,
        Override:true,
    }

    recipe Make Stone Hammer
    {
        TreeBranch/WoodenStick,
        Stone,
        RippedSheets/Twine/RippedSheetsDirty,

        Result:HammerStone,
        Time:80.0,
        Category:Survivalist,
        Override:true,
    }
    
    recipe Create Spear
    {
        Plank/TreeBranch/WoodenStick,
        keep [Recipe.GetItemTypes.SharpKnife]/SharpedStone/MeatCleaver,

        Result:SpearCrafted,
        Time:100.0,
        OnCreate:Recipe.OnCreate.CreateSpear,
        Category:Survivalist,
        OnGiveXP:Recipe.OnGiveXP.WoodWork5,
        Override:true,
    }
}
bronze yoke
#

ah, it's because your recipe is in module ChippedStone

#

it needs to match the original recipe's module and name to override

limber onyx
#

i feel silly now, lol
Thanks

#

Sorry to annoy you all with my noob questions...
Where should I look for to find out which module the original recipe might be in?

#

According to the Wiki, it says that the spear is located in

ProjectZomboid\media\scripts\items_weapons.txt

Is "items_weapons" the module? I'm confused

#

Gonna go in blind and try with Module Base and see what happens

#

Sorry, just rambling. Starting to remember what I was supposed to do and where to look. It seems I was indeed correct regarding the Base Module

drifting ore
#

everything in the base game is in the Base module

#

It's basically just an item name prefix, which was given its own infrastricture to insert it automatically (pretty needlessly IMO).

bronze yoke
#

not everything

#

it also uses farming, camping, radio, maybe some others too

hardy drift
#

finished my snus mod today

#

first mod ๐Ÿ˜ค

limber onyx
#

Thanks for pointing in the right direction guys, the mod works as it should now.

#

Have a good weekend

drifting ore
#

I have a request for you. I made a big workshop collection for the zomboid project and I put a lot of effort into it and I will be happy if you look at it and rate it and best if you give this also to help that this exists about the world. Thank you in advance for your willingness and I appreciate every review. you can also try it, the entire procedure for setting up the game is in the collection.. ๐Ÿ™‚

https://steamcommunity.com/sharedfiles/filedetails/?id=3302020133

Steam Workshop: Project Zomboid. [b]Workshop collection that will change the game by 180 degrees. Everything is harder and at the same time more unexplored, the game is full of surprises. Such as new zombie variants, better graphics,

solar rover
#

For some reason I cant get my cleaning books to load in with distributions lua
Followed the basics from the wiki, its in lua\server\item folder but I cant get it to pop up on lootzed in bookstore tables.
`require 'Items/Distributions'
require 'Items/ProceduralDistributions'

table.insert(ProceduralDistributions.list["BookstoreBooks"].items, "Coot.BookCleaning1");
table.insert(ProceduralDistributions.list["BookstoreBooks"].items, 4);
`
the item and mod names are correct also*

bronze yoke
solar rover
#

yeah been using lootzed to test

bronze yoke
#

what you've posted looks exactly correct to me so i have to suspect the issue is something like that

solar rover
#

changed to

local bookstoreBooks = ProceduralDistributions.list["BookstoreBooks"].items
table.insert(bookstoreBooks, "Coot.BookCleaning1")
table.insert(bookstoreBooks, 4)
and that works

bronze yoke
#

huh! glad you got it worked out

solar rover
#

just got it, but man.. I really dont want to rebuild the entire table ๐Ÿ˜ฆ time for find/replace

robust briar
#

Quick Question. Is there a mechanism to render a items "WorldStaticModel" in the UI somehow? Kind of like how the character can be rendered?

solar rover
#

neat idea, could probably check out what lifestyle does with the haircut/appearance menu

robust briar
#

Hmmm

sour island
#

Haven't looked into it

robust briar
#

UI3dScene, will dig

#

holy crap this thing is confusing

sour island
#

It's a UI object, so you're dealing with UI which partners up with a java object

robust briar
#

I get that.. but yeah, its not like the other UI objects...

#

its a bit more raw

#

going to take me a bit to sus out wtf is going on

bronze yoke
#

๐Ÿคข

robust briar
#

looking at it though, I should be able to figure it out

#

Want to make the "Hiring" of a new "NPC Salesmen Shop" to show a preview of what the NPC looks like. There will be like 20 different models to choose from, and I want to give a little preview.

sour island
#

Neat

#

How far along are you on this project? Maybe you'd like to collab on shops and traders?

robust briar
#

I am basically done. It's very very simple.

#

No purchasing, nothing fancy.

#

The only thing left is to implement a bunch more models for different kind of salespersons, like a farmer, survivalist, doctor, etc

#

then the upgrade path, to allow you to sell more stuff

uneven ore
solar rover
#

I have another one, and I'm probably missing something basic. I want a warning at 23:00 every day on my server as from 00:00 - 01:00 all zeds turn to sprinters. This is what I tried and failed with lol:

local function checkTimeAndPrintMessage()
    local gameTime = getGameTime()
    local currentHour = gameTime:getHour()

    if currentHour == targetHour then
        sendServerMessage("What a horrible night to have a curse...find shelter")
    end
end

Events.EveryDays.Add(checkTimeAndPrintMessage)
topaz tangle
#

hey!
would anyone be able to help me figure out why my wheel models arent appearing? (ik i asked earlier but im still having issues)

#

both parts of the script that reference the wheels

bronze yoke
#

are they in the same module?

#

a couple things i notice: why do you have them doubled up? and there's no comma on your scale line in any of them which might cause them to fail to parse

topaz tangle
#

doubled up?
also not sure what module is reffering to

bronze yoke
#

you have two vehicles_wheels and two vehicles_wheels_dualy

topaz tangle
#

yeah because there needs to be two of each, thats how wheels work

#

(that was meaner then i ment im sorry)

bronze yoke
#

i mean for the model scripts, both wheels are probably going to use the same model script?

topaz tangle
#

oh true....

bronze yoke
#

i think the issue is probably having no comma on the scale = 0.004 lines though

topaz tangle
#

i added a comma, changed nothing

bronze yoke
#

for module i mean at the start of your script you should have module ModuleName {, if they're in different ones it can be more complicated to reference them

topaz tangle
#

oh its all in the same one

bronze yoke
#

is there anything else in the file with the model scripts? a common issue here is that a script further up is broken and that causes the rest of the file to be skipped

topaz tangle
#

the only other part is the scripts for the truck, and it all works fine

#

same error message

reef umbra
#

how would i make it so you can use paint to change your skin color?

#

cause i wanna make it so you can have pink skin

bright fog
#

Makeup ?

topaz tangle
#

so, i did something and the wheels are gone now, same error appears

gusty thunder
#

Hello, I'm new to the entire Project Zomboid scene in its intierty. But I've been reading up and it seems like its possible to make mods in both Lua or Java. Is there a benifit to using one or the other?

bronze yoke
#

java mods require manual installation by users, they aren't common at all and you won't find very much help for making them

#

but lua mods are somewhat restricted in what they can do

hardy drift
#

table.insert(ProceduralDistributions["list"]["GasStorageCombo"].items, 18)

18 is the spawn rate ofc, but what is 18 out of? 100?

bronze yoke
#

sort of

#

there's a lot of factors that go into spawnrate, technically it is out of 100 but the default settings aren't 100%, they're 40%

unreal pewter
#

does anyone know how i can add an item to the loot pool of items that spawn on the ground of a room?

bronze yoke
#

so technically it's out of 250, but it's modified heavily by the zombie population in the area of the container - it's not really predictable what the spawnrate will be so it's better to base it on other items than try and work it out mathematically

hardy drift
#

so basically if I have my spawnrate set to 50, it's 50%, but 50% of the spawnrate % in sandbox settings?

#

kinda?

bronze yoke
#

yeah, so 50% * 0.4 = 20%, but with zombie population it's really hard to say what the actual effective spawn rate would end up being

finite patio
#

Hello, does anyone know how to execute the option of an item in the inventory through a function, like eating, smoking and other things?

hardy drift
finite patio
#

yep

hardy drift
#

you want it to say something specific?

#

not sure what u mean by execute

finite patio
#

a type of cigarette.Smoke()

#

if I assign a function to F10, for example, it pulls that smoke function from the contextmenu automatically, you know?

hardy drift
#

ohhhhhh im dumb i just realized what ur original question meant

#

you wanna basically make a macro to utilize an item in your inventory without going into your inventory to use it

finite patio
#

exactly

hardy drift
#

lemme try something real quck ill tell u if it works

hardy drift
#

can't figure it out lol shit sorry @finite patio

finite patio
#

no worries

thick karma
gusty thunder
bronze yoke
#

the game doesn't actually have a mechanism to load mods on the server only but if you make a mod that runs lua files from the cache directory then the server can run anything they want without the clients needing to have it

bronze yoke
muted garnet
#

Please tell me, is it possible to make other players hear the player's say? Or is there any way to display a message like with Say, only so that other players can see this message?

muted garnet
thick karma
#

No (unless using chat attracts zombies mod)

#

You could also send a /say chat command on MP

muted garnet
#

then please tell me why the SayWhisper method is needed?

thick karma
#

That's direct to specific players iirc

muted garnet
#

iirc?

thick karma
#

Iirc = if I recall correctly

#

If my memory is right

muted garnet
#

Oh, now I got it, thank you!

hardy drift
#

what the heck is the difference between WorldStaticModel and PlacedSprite

#

ik obv ones a sprite ones a model but how do I know which one I should do

drifting ore
#

do the model if you can help it

hardy drift
#

canBePlaced would make you see the WorldStaticModel right?

#

im assuming WorldStaticModel is the model when you drop/place something on the ground

#

and then PlacedSprite is just the img version of WSM?

hardy drift
#

sick thank you

#

I plan on using the same model for my StaticModel but I gotta make this shit way smaller

#

any tips on scale for my model

#

set it to .0001

thick karma
#

May not be scaling at all

hardy drift
#

i mean when exporting the model from blender I set the scale to .0001, however if I can just set the model scale in my code I wil def do that

thick karma
#

Yes you can add a scale line to the model def

hardy drift
#

you know what it's called?

thick karma
#

scale = FLOAT,

hardy drift
#

thanks bro

thick karma
#

Won't work without closing comma in that model def

#

That's why I asked

#

Thought you were using it

hardy drift
#

I'd add that scale line to my items.txt right

#

wait nah

#

dumbass question

thick karma
#

Usually. Some people seem to use separate files for models

#

But regardless it goes in a model def in a script

hardy drift
#

yeah lol gonna add it to my models.txt

thick karma
#

There are often model defs in item script files

#

Idk about yours

#

But it doesn't go in the item script

#

It goes in the item's model's script

hardy drift
#
    {
            mesh = WorldItems/jyttin,
            texture = WorldItems/original,
            scale = FLOAT,
    }```
thick karma
#

Float you change to a number of course

hardy drift
#

you know how the scaling works? like whats max scale

#

so i can get a reference

thick karma
#

1 is the default scale of the item

#

So the way it looks in game now

drifting ore
#

scale makes it bigger or smaller

hardy drift
#

ok ok cool that helps a lot

drifting ore
#

well you asked ๐Ÿ™‚

hardy drift
#

i meant like how much is big and how much is small haha but ur all good im just kiddin

drifting ore
#

anyway if you need it to be like 5 times smaller you put it as scale = 0.2

hardy drift
#

5 times smaller sounds like a good start

#

i'll try that rn thank you

drifting ore
#

woes of making 3d models for flatscreen games

#

in VR this problem doesn't exist - absolutely everyone uses the same measuring system of 1 unit of distance = 1 real life meter

hardy drift
#

yeah it took me way too long to make a god damn cylinder with my image on the top of it smfh

#

first time using blender

#

or any 3d software

#

@frail violet was very helpful

drifting ore
#

stuff's way harder than people on youtube make it look

hardy drift
#

nah fr i hate it when the tutorial guys are clicking thru shit at the speed of light too

drifting ore
#

well anyway what i meant to say is that it would be easier to scale the models if the game 3d units had a hard reference with real life units

#

which it kinda does by default but you know what i'm saying

hardy drift
#

yeah i get u fs

#

nice much smaller now and u can place them

#

just gotta figure out how to rotate it to be flat

drifting ore
#

you can rotate the model in blender

hardy drift
#

ah yk what

#

probably set z and y as the wrong things

#

I made Z up and -Y forward

#

not sure the proper orientation

drifting ore
#

that would be hte same as rotating it so yeah sure

hardy drift
#

apparently Z is forward and Y is up

#

in blender it's flipped

drifting ore
#

that's how it's commonly done yeah. X is right, Y is up. The only direction left when you add Z is forwar.d

hardy drift
#

yeah makes sense idk why I thought it was flipped the other way

drifting ore
#

mainly because all of this is completely arbitrary since the cross products & everything else works the same, and at some points in time different people chose different default orientations, even though as far as math goes it's all set in stone

#

in math X is always right, and Y is always up. You build Z by taking a cross product of X and Y, and that direction is forward.

#

(fun fact: cross product only exists in 3 and 7 dimensions)

#

in godot Z is back (or X is left depending on how you want to look at it)

tranquil kindle
hardy drift
#

I don't know what attachment editor is tbh

drifting ore
#

it's in debug menu, you press one of the F buttons i don't remember which

#

you gotta start the game in debug mode, pass -debug as exe start parameter.

shrewd cedar
#

Does anyone know if it's possible to change a recipe's name (as in the name displayed in-game) via lua script? I saw there is setOriginalname() but that doesn't do it, and I'm not even sure what that might be used for.

drifting ore
#

Does it needs to be via Lua specifically? You can simply change the translation entry for it.

sour island
solar rover
#

@hardy drift If you keep blender up while using PZ you can export/overwrite the mod file and it will adjust live in game. I use this to align car parts and size objects. Now... sometimes the item will get "stuck" at a size and you need to reload the game but this method is safe and saves time.

bright fog
#

yeah

#

Works for animations, AnimSets

#

Textures I'm not sure, models yes, even for clothings

solar rover
#

Doesnt debug have a reload texture option? or was that just for cars?

bright fog
#

No idea

young orchid
#

how is that Zomboid 3D Project going on, someone worked on in the past?

sour island
young orchid
#

hmmm

hardy drift
#

btw debug mode breaks my game for some reason. i open it and i donโ€™t get the regular menu i get a bunch of random shit and it doesnโ€™t let me get to the menu

sour island
#

That's probably the breakpoint screen you're staring at lol

#

Hit the play button at the top

#

And check the box up there if the errors are continuous.

drifting ore
#

i would suggest fixing the errors that cause it rather than ignoring it

#

thought i found the built in lua debugger to be remarkably unhelpful as well as straight up broken in places

#

the one place where it would be most useful to know the information, it shows wrong information (the locals panel at the point of crash)

#

and bizarrely the debug panel's error log doesn't show what was the actual error, only the stack trace

#

maybe that's just visibility settings but that's bizarre defaults to have either way

bronze yoke
#

wdym it doesn't show the error?

tacit carbon
#

how do I have a player say something? I used player:Say("string") and gave me an error

bronze yoke
#

what error? that should work

tacit carbon
#

I made a typo on the string lmao, sorry

bronze yoke
#

glad you got it working!

tacit carbon
#

btw anyone know how do I use math.floor() but with one decimal number? instead of zero decimals

bronze yoke
#

multiply by ten before and divide by ten after

tacit carbon
#

thats cleaver hahaha

hardy drift
#

apparently I fucked something up in my mod and now contextmenu's for certain other modded items don't show up

#

but they still show up for my mod

#

I should see a couple other options here from Vehicle Repair Overhaul to salvage these brakes

#

but since I added my mod, I can't

#

w8 maybe i fixed

#

yeah in my models.txt i had module Base not module NameOfMyMod

hardy drift
#

nevermind

#

that didnt fix it

#

what the hell

bright fog
dry chasm
hardy drift
#

well ik for sure it's something with the context menu

#

by means of deductive reasoning

#

what the fuckkkkkkkk?

#

the errors are perpetual

#

just keeps going up

#

i dont know how i fucked up so bad

#

NOTHING in my mod should be doing this ๐Ÿ˜ญ

frank elbow
#

console.txt will usually let you know

solar rover
#

Is there any way I can make a mod for a silent generator? The wiki code is just for the placed item, not the power code. I'm tired of doing hored events for my players and having to turn off powered areas so that the zeds dont gather under the sound sources.

hardy drift
#

u could probably make function that takes the sound files of vanilla generators and replace it with either nothing or a blank sound file maybe?

#

alr this makes no sense at all

#

somehow my mod prevents you from using recipes from other mods

#

my mod doesn't even add recipes

#

doesn't do anything with recipes

#

doesn't touch other mod's recipes

#

but then my mod works perfectly fine

vagrant zenith
#

Hi, I'm newer to the game but was interested in modding. Is there any form of documentation(official or unofficial) that I could read to get started?

hardy drift
#

I FIXED IT

#

MY ITEMS SCRIPT WAS CALLED ITEMS.TXT

#

AND OVERRODE A BUNCH OF SHIT

#

CHANGED THE FILE NAME AND WE ARE GOOOOOOOOD

hardy drift
#

anyone know where I'd find the foraging loot tables

tranquil kindle
hardy drift
#

I looked in there but maybe I'm trying the wrong thing, I'll look again

#

ahhhhhh yeah the zoneChances thanks @tranquil kindle

muted garnet
#

Is there a way to change the chance of a player falling when colliding with a zombie while running or sprinting?

onyx aspen
#

anyone know if theres a mod that can properly display a mannequin head item / clothing item in general.
Example, if u try equip a Spiffo head on it , it doesnt show.

hardy drift
#

@onyx aspen Ik of a craftable manequin mod and i remember in the description it said you could use it as an armor stand but I'm not sure if they changed anything to make head items show

onyx aspen
hardy drift
#

yeah idk i haven't used this one

#

just remember it's all i found when i was looking for armor stand mods a while back

clever inlet
#

Heya, guys. I'm trying to edit a vehicle mod. Specifically the trunk's capacity. Where can I find rthat?

#

Looking at the files in "mods\89def110\media\scripts\vehicles"

#

I guess here

#

That didn't work, changing capacity from 100 to 500 there

#

Or do I need to create a new game for the changes to appear?

clever inlet
valid wyvern
#

just a small question is it possible to have multiple result items from one recipe ?

#

i want to be able to take "carrots" (the perishable one) out of "canned carrots" ( the not perishable one) and i was going to make a recipe that basically let me craft carrots using the canned carrot but i want the empty tin can to be a resulting item aswell

drifting ore
#

IIRC no, you have to use an auxiliary Lua function which adds additional results

valid wyvern
#

i see

#

( i didnt understand batshit )

#

thanks still

#

i havce never done modding and it probably shows

drifting ore
valid wyvern
#

yep those are some big words for my small brain

#

thanks still

drifting ore
#

so if i understand this correctly, you want to have a recipe like "open can of carrots" but which directly spills the carrots and the tin can into your inventory, rather than producing an opened can of carrots?

drifting ore
#

in that case you'll need to add such recipe that takes a can of carrots (maybe an already opened can?) and produces carrots, and use OnCreate function to add an empty tin can.

#
    player:getInventory():AddItem("Base.TinCanEmpty")
end```
#

that goes into a /media/lua/server/MYMOD_recipecode.lua

#

and in your extract carrots recipe you add OnCreate:Recipe.OnCreate.MYMOD_OpenTinCan

dull bear
#

Hi. Is it safe to use getPlayer() when writing client-side lua ( files in /media/client/) or do i need to use getSpecificPlayer()? It is my assumption that given it is client-side, the game always has the correct reference to the local player so using getPlayer() should be fine? So only in /media/server do i need to use getSpecificPlayer?

drifting ore
#

files in /server/ run in all cases

#

i.e. on server, on client and in singleplayer

#

not sure about /client/

dull bear
#

Right. I have added a function to the OnKeyPressed event in a /client file, and i am trying to extract the player that pressed the key, since the event does not provide the player parameter. Right now i am using getPlayer(). Perhaps there is a better way?

drifting ore
#

i'm not sure about getPlayer specifically but OnKeyPressed is relating to the game window, not even any player in particular

#

so you can make an assumption that only 1 player is associated with the window

#

but it's not necessarily true

dull bear
#

sounds like i need to boot up a multiplayer session with somebody and test it out ๐Ÿ™‚

drifting ore
#

or you can look in the game's decompiled code

#

by the way

#

OnKeyPressed actually activates when the key is released

muted garnet
#

Is there any way to get value of script item? I know that with DoParam you can replace item values, but is there any way to get original value?

drifting ore
#

define "original value"

grizzled fulcrum
#

Like wants to get the value like uhh

tranquil kindle
grizzled fulcrum
#

WorldStaticModel = myModel wants to get myModel

drifting ore
#

pretty sure that's not possible

#

it only stores 1 value and if it's overwritten then it's overwritten

muted garnet
grizzled fulcrum
#

-_-

tranquil kindle
grizzled fulcrum
#

I think they want InventoryItem:getMaxCapacity() or InventoryItem:getItemCapacity()

#

not sure what the difference is, one is integer one is float

#

ill check rn

drifting ore
#

anyway a lot of the stuff is available as a read-only field

#

doparam gives you ability to write to write to some of them

#

i think by default kahlua exposes everything public of the class, except with fields they're read only unless you manually define a setter

#

so if you have an item parameter in mind, you can just do something like local foodtype = item.FoodType

muted garnet
grizzled fulcrum
#

hwat even is script item class, my intellisense tells me its just an Item

muted garnet
#

yep

drifting ore
#

Item is an abstract description of an item, InventoryItem is an actual in-game item created off of Item

grizzled fulcrum
#

I use instanceItem for the script item ;-;

#

and since candle tells you getAllItems returns ArrayList but not what in the list lol

#

it is Item

muted garnet
grizzled fulcrum
#

I don't even think it exposed

drifting ore
#

well some of it works

grizzled fulcrum
#

wait it is public ur right wth

drifting ore
#

when i was messing with clothing items, i could read some of these fields but to set them i had to use doparam

grizzled fulcrum
muted garnet
grizzled fulcrum
#

how do you get your item

muted garnet
# grizzled fulcrum how do you get your item
    local items = ScriptManager.instance:getAllItems()
    for i = 0, items:size()-1 do
        local item = items:get(i)
        if item:getTypeString() == "Container" then

            print(item)
            print(item.Capacity)

            -- item:DoParam("Capacity".." = ".."120")
        end
    end
drifting ore
muted garnet
grizzled fulcrum
#
local item_inst = instanceItem(item)
local capacity = item_inst:getMaxCapacity()
drifting ore
grizzled fulcrum
#

wat

#

getAllItems() returns ArrayList<Item> so item is Item

drifting ore
#

then how is it a Container

grizzled fulcrum
#

oh nvm he check Item type is container lol

#

I have no idea

drifting ore
#

well there's only 2 ways it could work: everything in that array is an Item so the code never runs, or the element in question is type Container which doesn't have this field

grizzled fulcrum
#

well Item.type is stuff like:

drifting ore
#

I'm guessing this means it's a combo item. I think vast majority of items are combo items.

grizzled fulcrum
#

I have never seen a Container type item

#

must be

muted garnet
grizzled fulcrum
drifting ore
#

huh, the more you know

#

well in any case i haven't had much luck modifying Items like this, they always came out broken one way or another. And in particular I couldn't fill up the clothing masks because they must be integers and when you add items, they're added as doubles.

muted garnet
#

oh

#

this truly working

grizzled fulcrum
#

when you call instanceItem it creates the correct information like InventoryContainer for Container item type or Food for food item

grizzled fulcrum
muted garnet
#
            local item_inst = instanceItem(item)
            print(item_inst)


            local capacity = item_inst:getInventory():getCapacity()

            print(capacity)
grizzled fulcrum
#

yes that is correct nice

muted garnet
#

fucking methods shortage

drifting ore
#

right? encapsulation is cancer

grizzled fulcrum
#

the more you know

grizzled fulcrum
drifting ore
#

yeah well the way I see it, the whole feature serves no purpose other than trying to pretend like you know better than other coders

muted garnet
#

@drifting ore @grizzled fulcrum thanks guys!

grizzled fulcrum
#

like if you made a whole game in Main class it would be a mess, even though all methods are there

drifting ore
#

no that's classes. Encapsulation literally just cuts visibility and adds nothing.

grizzled fulcrum
#

on reading more, I guess its true but idk on the specifics

drifting ore
#

and by the way you don't really need classes. C programs never had anything like it and people write in C just fine, separate files and all. The one and only issue I have with C is that you you need to type out the entire function name which includes its own namespace. If the compiler could just automatically figure out the shorthands, it would be close to perfect.

grizzled fulcrum
#

like I come from C++ where theres never like getThis getThat

#

you just do MyClass.value = 4

grizzled fulcrum
drifting ore
#

granted in C++ there's literally no overhead for using these and they can be generated automatically for you.

grizzled fulcrum
#

constexpr inline my beloved

drifting ore
#

i'm super rusty with C++ and i don't keep up with the new standards though. Is it a thing yet that when you access fields that have getters and setters, these functions execute transparently?

#

i.e. class.foo = bar compiles to class.setFoo(bar)

grizzled fulcrum
#

I think not but I am similar position

#

I do less and less C++ than I'd like to because uni never has C++ stuff. Most of my uni work is Java and SQL which I really am annoyed

#

I''d rather read asm than SQL it feels like someone programmed it while having a migraine

drifting ore
#

oh boy, the sql

#

it's something that should be so extremely simple, becomes so extremely complicated because it doesn't want to acknowledge that it's not a programming language

grizzled fulcrum
#

in real world application I just use wrapper like in python or I just stack overflow

drifting ore
#

good thing i guess that nosql becomes popular

grizzled fulcrum
#

ye

bronze yoke
drifting ore
bronze yoke
#

quite common

#

pz loves rewriting parts of kahlua for little reason and intentionally or unintentionally removing features in the process

drifting ore
#

severely mental case of NIH

#

it also does this with java Calendar class

grizzled fulcrum
#

schizophrenia moment

muted garnet
#

Is any way to set Moodle.Type level?

green fable
#

is there an archive of all versions of the pz modding tools? Specifically alpha 0.1.5d

#

I wanted to make a map for it.

bronze yoke
muted garnet
#

if I set an onTick event, won't it interrupt the vanilla calculations?

#

like with walking speed in trees

bronze yoke
#

i think the vanilla calculation happens before rendering so the change won't be visible

muted garnet
bronze yoke
#

Moodle() is not a function

#

it's a constructor, you would call it as Moodle.new(MoodleType.FoodEaten, character) but that would just create a new moodle, not find the existing one

muted garnet
#

and how do I call an existing one?

drifting ore
#

let's back up. Are you trying to render a fake moodle, or affect the character status that's represented by a moodle?

#

because the latter can be done through a variety of status setter functions

muted garnet
#

I want to influence the existing moodle of the character's saturation

drifting ore
#

elaborate

bronze yoke
#

it is much easier to influence the underlying stat the moodle represents than to modify the moodle itself

muted garnet
#

what do you mean about?

drifting ore
#

you can increase or decrease characater's hunger and that will change what the moodle displays

bronze yoke
#

moodles have literally zero support for modding

muted garnet
#

It's not working this way

bronze yoke
#

they're completely hardcoded and intentionally locked off from lua aside from reading their levels

drifting ore
muted garnet
drifting ore
#

so which is it

#

do you want to affect the character or not

#

cuz you say it like you want neither and both at the same time

bronze yoke
#

the saturation moodle is not governed by hunger

#

it's a separate stat

muted garnet
bronze yoke
#

mostly because it'd require them to rewrite a lot of it

#

if you need better modding support tcherno's moodle framework and my statsapi kind of cover most of it

#

the saturation moodle is based on BodyDamage:getHealthFromFoodTimer(), if you modify that value you can mess with it

#
byte1 = 0;
if (this.Parent.getBodyDamage().getHealth() != 0.0F) {
    if (this.Parent.getBodyDamage().getHealthFromFoodTimer() > 0.0F) {
        byte1 = 1;
    }

    if (this.Parent.getBodyDamage().getHealthFromFoodTimer() > (float)this.Parent.getBodyDamage().getStandardHealthFromFoodTime()) {
        byte1 = 2;
    }

    if (this.Parent.getBodyDamage().getHealthFromFoodTimer() > (float)this.Parent.getBodyDamage().getStandardHealthFromFoodTime() * 2.0F) {
        byte1 = 3;
    }

    if (this.Parent.getBodyDamage().getHealthFromFoodTimer() > (float)this.Parent.getBodyDamage().getStandardHealthFromFoodTime() * 3.0F) {
        byte1 = 4;
    }
}

if (byte1 != this.getLevel()) {
    this.SetLevel(byte1);
    boolean1 = true;
}
muted garnet
#

thanks!

grizzled fulcrum
muted garnet
#

where are the game's UI files stored? Like trait icons?

#

and I'm talking not about 4 traits in the ui/traits folder

bronze yoke
#

in the ui texture packs

muted garnet
#

thanks

muted garnet
bronze yoke
#

i think tileed does it, you can get it from project zomboid modding tools on steam

muted garnet
bronze yoke
#

if you search that in your steam library you should see it

#

it's added to your account as long as you own project zomboid

muted garnet
#

first time I learned about the existence of this thing, thanks

bronze yoke
#

iirc it's pretty much just mapping stuff

hardy drift
#
require "Foraging/forageSystem"
require "TimedActions/ISBaseTimedAction"

local function increaseStoneChance()
    if not forageSystem.isInitialised then
        return
    end

    local stoneDef = forageSystem.forageDefinitions["Stones"]
    if stoneDef then
        stoneDef.lootTables = {
            { item = "Base.Stone", chance = 5000 }, -- Increase the chance significantly
        }
        stoneDef.zoneChance = {
            DeepForest = 200,
            Forest = 200,
            Vegitation = 200,
            FarmLand = 200,
            Farm = 200,
            TrailerPark = 200,
            TownZone = 200,
            Nav = 200,
        }
    end
end

local originalInit = forageSystem.init
forageSystem.init = function()
    originalInit()
    increaseStoneChance()
end

Events.OnGameStart.Add(increaseStoneChance)

anyone know why this might not be working

#

numbers are turned up to an ungodly amount cause I was trying to see if it was actually doing anything

bright fog
grizzled fulcrum
#

is it possible it is having trouble initing?

#

because you hook it for apparently no reason (from me just reading the code)
Why don'y you just call forageSystem.init() and then your increaseStoneChance() func

hardy drift
#

luarequire "Foraging/forageSystem" require "TimedActions/ISBaseTimedAction"

#

huh didnt work

hardy drift
bronze yoke
#

```lua
your code here
```

hardy drift
#

oh im smart huh

#

text

#

cool

grizzled fulcrum
#

also you call your increaseStoneChance twice, once when game starts and once when forageSystem.init is called (your callback)

#

personally I'd remove the callback and figure out when you want to call it, probably onGameBoot

#

Check your if statements too, I have a hunch that either forageSystem.isInitialised is false or stoneDef is nil

hardy drift
#

thank you @grizzled fulcrum I'll see of those things work

compact tinsel
#

Hello! I wanted to ask if anyone has worked with animated objects. I am referring to 3D objects as for example a dog

I could not think of any object that has been animated, but was hoping someone else would remember a mod or something that is making use of animations for objects.

hardy drift
#

@grizzled fulcrum i just said f it and made a mod that lets you use 5 chipped stones and some glue to make a stone lmfao

grizzled fulcrum
#

If it works, the it works ๐Ÿ˜„

chrome veldt
#

Hey, do you guys know how the OnFillWorldObjectContextMenu worldObjects params is constructed? Upon right clicking the square, there is a list of worldObjects (tiles names like "blends_natural_01_16") but I can't figure out how to get them from outside the event. I can get the gridSquare but the getObjects() method result is empty and I tried a few others like getWorldObjects() which were empty as well.

bronze yoke
#

getObjects shouldn't be empty, what did you try?

chrome veldt
#

I'm trying to do something when the player press a key near a tile I just created.
Here is the code:

local function OnKeyPressed(key)
    local isoPlayer = IsoPlayer:getInstance()
    if (key == 18) then -- 18 = 'e'
        MyMod.OnPlayerUpdate(isoPlayer)
    end
end

Events.OnKeyPressed.Add(OnKeyPressed)

function MyMod.OnPlayerUpdate(isoPlayer)
    if not isoPlayer then return end
    local square = isoPlayer:getSquare()
    if not square then return end

    local charOrientationAngle = isoPlayer:getAnimAngleRadians();
    local forwardDist = 0.5
    local forwardX = isoPlayer:getX() + math.cos(charOrientationAngle) * forwardDist
    local forwardY = isoPlayer:getY() + math.sin(charOrientationAngle) * forwardDist
    local targetSquare = getCell():getGridSquare(forwardX, forwardY, isoPlayer:getZ() + 1)
    local worldObjects = targetSquare and targetSquare:getSpecialObjects()
    -- print world objects
    for index = 0, worldObjects:size() - 1 do
        print(index, worldObjects:get(index))
    end
end
#

Here I tried with getSpecialObjects which is also empty

#

I made sure the targetSquare has the same coordinates as the one that display what I want when right clicking, so I know it is the correct gridSquare

chrome veldt
#

Am I making a stupid mistake here?

hardy drift
drifting ore
chrome veldt
drifting ore
#

I'm asking because you're using player:getZ() + 1 which selects one tile above

#

and usually there's absolutely nothing so the rest of the code doesn't run

#

or at least that's how i see it without actually running a debugger

chrome veldt
#

I forgot about that +1, damn, I canโ€™t test it rn but it seems like thatโ€™s why.. I was trying to check if the tile above was free earlier and forgot to change it and my brain somehow ignored it. Sorry about that, thanks

gleaming sorrel
#

I have a idea I've been thinking about for quite some time

I want tips on how to make any tainted water in Zomboid cause the Knox infection
I have little experience but I doubt this would be extremely complicated

drifting ore
#

InventoryItem:setTaintedWater(true)

#

item { Poison = true, }

compact tinsel
#

I don't know whether it really is a lua function though, maybe someone else knows more about that

valid wyvern
#

is there a way to add rv interior to vehicles that dont support it

#

"Base.88w900scarletdist"

#

this is the vehicle

drifting ore
#

hi guys i'ts my first time making a mod but i created a custom clothing and i want to ask how can i make it naturally spawn in the world

muted garnet
#

Is OnGameStart event calling to player when this player not host and joining server?

muted garnet
#

Is there any way other than ghost mode to make the player transparent to zombies?

bright fog
#

This will make them not have a target

muted garnet
drifting ore
#

server doesn't calls it when loading the game and client doesn't calls it when joining a server

bright fog
muted garnet
drifting ore
#

well i distinctly remember having to hook up my mod setup code through a different event if the file ran on the server because the OnGameStart didn't fire

#

in fact here it is

#

i've experienced a similar issue on the client side (i probably just messed it up, OnGameStart works either way)

muted garnet
#

I use like this code and it works correct on both the client and the server

Events.OnGameStart.Add(function()
    firstLevelValue = SandboxVars.LongerSaturation.firstLevelValue
    secondLevelValue = SandboxVars.LongerSaturation.secondLevelValue
    thirdLevelValue = SandboxVars.LongerSaturation.thirdLevelValue
    Multiplier = SandboxVars.LongerSaturation.Multiplier

print("1")

    if Multiplier == 1 then return end

print("2")
    

end)
drifting ore
#

do you mean by that it runs the same way if you put it in lua/client/ or lua/server/ folders, or that if coop-console.txt prints the same entries as console.txt when you host a game and join that server?

#

because what I had to do there didn't come out of nowhere. I didn't think this would even be an issue, it's why I remember this quirk existing.

muted garnet
#

Of course not! I originally wanted to know if it would run on the client the client side of the code that connects to the server.

#

As I understand it, your code is publicly available and you run the code on both sides at once?

drifting ore
#

well you can tell if it runs on the client by using isClient() and for server there's isServer(), and for singleplayer there's a combination of not (isServer() or isClient())

muted garnet
#

I need to know about running the code only on the client side, but since the event is called OnGameStart, I asked if it would work for players who logged into the server after the host.

drifting ore
muted garnet
drifting ore
#

the /shared/ folder runs everywhere, even in the menu

#

it's a bit of a mess so you just have to learn what's what

#

i think it's like this: files in /client/ run in menu and client game, files in /server/ run in server and client game, and files in /shared/ run everywhere, and all of them run in singleplayer game. And you can require files form /shared/ in both /server/ and /client/, but files in /shared/ cannot require from /server/ or /client/.

oak thunder
#

Im using ShopX and im trying to find out how to code in modded map like for Riverside its :
Shop.Items["Base.RiversideMap"] = {
tab = Tab.Trips, price = 1,
}
but i cant find out where to find the code

gleaming sorrel
compact tinsel
#

this is the code I used
though you really would just need the setInfected(true)

gleaming sorrel
compact tinsel
#

0 is not feeling sick at all, 1 is zombie

gleaming sorrel
#

Quesy, nauseous, sick

bright fog
#

Check the event name in the list and it's written where it runs

bright fog
#

OnGameStart launches for the client whenever he loads a world

#

So joining a server loads a world and thus it runs

#

Usually you can safely assume that client only Events will run for your client when the conditions for that event are met, that's it

drifting ore
bright fog
#

I know it does bcs I actively used OnGameStart and it does

drifting ore
#

Well then I must have did something wrong.

bright fog
#

If it didn't I would have gotten a fuck ton of error spam from players that use my mod, but they don't

#

What did you do ?

bright fog
#

Bcs you're applying it server side

drifting ore
#

I used it to run "setup" function which mainly just reads a bunch of sandbox options, passes them through functions and caches results

bright fog
#

But that can't work server side

bright fog
# drifting ore

In fact, a lot of the events you use here are client side only I believe, but you're trying to add them server side with your isClient() check

drifting ore
bright fog
#

You're caching server side with this code ?

drifting ore
#

specifically I do this

#

i don't recall what EXACTLY was wrong when I was using OnGameStart, but it prompted me to use OnServerStart which worked properly.

#

i think it straight up did not run

#

same deal with the client code

#

the client version of this function is much of the same, but some of it is cut because these variables are never used there

drifting ore
#

i can explain what every single one of those functions does on the server and how I know it does works

drifting ore
#

I run a test and here's the results.

singleplayer:

ClientServerTest server OnGameStart isServer=false isClient=false```
client:
```ClientServerTest client OnConnected isServer=false isClient=true
ClientServerTest client OnGameStart isServer=false isClient=true
ClientServerTest server OnGameStart isServer=false isClient=true```
server:
```ClientServerTest server OnServerStarted isServer=true isClient=false```
#

I can't for the life of me remember what was wrong with OnGameStart client-side which made me use OnConnected, because it wasn't my first option.

#

Could've been a negative confirmation bias? I remember I had an issue where one of the sides had gameSpeed twice as fast as the other, because I thought it was executing before sandbox options are loaded. But it could've been the other way around all along?

gleaming sorrel
drifting ore
#

were you meant to use it in an item script as OnCreate:WaterGoesBad.onDrinkTaintedWater ?

gleaming sorrel
drifting ore
#

hmmmmmmmmm

gleaming sorrel
#

I'm just doing this completely blind I have no idea what I'm doing

drifting ore
#

i think you might get the desired result by hacking into eating timed action class

muted garnet
muted garnet
bronze yoke
#

specifically they are ISTakeWaterAction.perform and ISDrinkFromBottle.drink

#

you can look at watergoesbad to see how it hooks those actions if water is tainted

mystic vessel
drifting ore
drifting ore
mystic vessel
#

Apparently the purpose worked. lol

unreal pewter
#

i am so insanely stumped on how to add items to floor loot pools

#

i cant find anything related in Distributions or ProceduralDistributions

#

and i cant find any file names that seem related either

hardy drift
#

@unreal pewter throw a bunch of game files into blackboxai and tell it to look for what u need

#

thats how i find a lotta stuff

unreal pewter
#

ah, thank you

hardy drift
#

you can drag and drop files it's pretty useful for different things

drifting ore
#

not to be confused with the totally random loot spawning in certain types of containers which are manually placed on the map

#

(certain containers are assigned certain types of loot however)

drifting ore
#

unless you mean like foraging spawns

unreal pewter
#

how you can find paper or books on the floor sometimes in certain rooms

frank elbow
keen silo
#

Hey, I need some help with something. does anybody know how to check if the game is at x2, x3, x4 speed?

#

I just need a bool that returns true or false depending if the game is sped up or not

gleaming sorrel
bronze yoke
#

here's what water goes bad does to detect drinking tainted water, with all the other stuff cut out:```lua
local onDrinkTaintedWater = function(player, amount)
-- do something when the player drinks tainted water
end

local old_ISTakeWaterAction_perform = ISTakeWaterAction.perform

ISTakeWaterAction.perform = function(self)
old_ISTakeWaterAction_perform(self)
if not self.item and self.waterObject:isTaintedWater() then
onDrinkTaintedWater(self.character, self.waterUnit)
end
end

local old_ISDrinkFromBottle_drink = ISDrinkFromBottle.drink

ISDrinkFromBottle.drink = function(self, _, percentage)
old_ISDrinkFromBottle_drink(self, _, percentage)
if self.item:isTaintedWater() then
if percentage > 0.95 then
percentage = 1.0
end
local uses = math.floor(self.uses * percentage + 0.001)
onDrinkTaintedWater(self.character, uses)
end
end
```you can copy paste this and edit the onDrinkTaintedWater function if you like

gleaming sorrel
bronze yoke
#

this should go in a .lua file in yourMod/media/lua/client/ , name doesn't matter

gleaming sorrel
#

Alright thank you for the clarification

I believe I'm supposed to just edit the code to this (with semicolons to end the string)
Correct?

chrome veldt
#

I've seen that you can't rotate tiles, but you can rotate chairs, microwaves and many other objects that are defined as tiles. I don't understand the difference.
You can place items freely within a square, but a chair snaps onto the grid and can rotate. So, is a chair an item that snaps onto the grid and can be rotated or is it a tile that can be rotated?

bronze yoke
bronze yoke
#

what the code i just posted does is create a function called onDrinkTaintedWater that will be triggered when drinking tainted water - water goes bad does the same thing further down the file, but it's more difficult to understand there

chrome veldt
#

So I must have missed something, I've created a tile with 4 textures for each directions, I've defined each face for each texture in TileZed, but I still can't change the direction. I can pick it up, but I can't rotate it -_-

gleaming sorrel
bronze yoke
#

ah, you made a typo on the second line, Body should be body since that's what you called it on the first line

#

but apart from that i think it's correct

gleaming sorrel
bronze yoke
#

i'm happy i could help!

red tiger
#

It begins..

#

๐Ÿ ๐Ÿ‘€

gleaming sorrel