#mod_development

1 messages · Page 375 of 1

bleak remnant
#

Bro, is this documented? is it on the wiki of the game?

#

i started modding back on build 42.9, no shit i didn't know this

#

but fuck hahahaha

#

dude, i swear to god, if you were next to me in real life right now, i would pay you a beer

silent zealot
#

Yeah, I've been striggling with MP too... I didn't bother learning it in B41 for my mods, then waited for B42 MP and... it's not as simple as I would have liked.

bleak remnant
#

indeed, i am only doing this because people are begging me to

silent zealot
#

There is some stuff on teh wiki about it but I can never remember the page title to find it when asked.

bleak remnant
#

you have no idea how much of it i need right now

silent zealot
bleak remnant
#

thanks

#

dude, you are my here and shit. sleep tonight knowing that.

bright fog
bleak remnant
#

anyway, let me go back and mod

silent zealot
#

From my cheatsheet.

#

Trivial once you are used to their behavior, kept confusing me so much when I started.

bright fog
#

@bleak remnant ah I wanted to ask, do you have a video of your zombies in action ? Do they have any special behavior or currently they just use custom models / textures ?

bleak remnant
bright fog
#

Uses the same dataset I have made for my ZedScripts extension

bleak remnant
#

for now only those 2

silent zealot
#

In other news, I have developed the reinforced crowbar for people who think they break too easily.

bleak remnant
bright fog
#

The dataset still needs a bunch of work to explain what each parameters do

bleak remnant
#

yo, one last thing

#

i was planning to add custom animations to the zombies back when i was developing the mod

#

i faild

#

you made it on your mod

#

how? do you have a documentation?

#

about that

bright fog
#

no

bleak remnant
#

i want to do it on the necroa outbreak once i start making it

bleak remnant
bright fog
#

When the zombie spawns in, you assign a variable to them

#

zombie:setVariable('WhateverUniqueNameYouWant')

bleak remnant
bright fog
#

And create AnimNodes for your zombie with the different animation setups

bright fog
bleak remnant
#

i modded your mod back in the day and chenged the animations you made to mine just to check

#

didn't work well

bleak remnant
#

you help so dam much, no wonder why i added your name in my mod description

bright fog
#

@vivid imp the fact that wiki page will be plagued forever with a resized image and look crappy in Discord lmao

bright fog
bleak remnant
#

you are welcome

cyan locust
#

@jagged fulcrum Minor annoyances with the new TreeZ & Visibility: these trees on not-yet-seen squares won't fade. Or rather, they totally block the view even when moving right into the area covered by their tops. (North of Ekron Community College)

Also, a lot of trees are practically invisible when approaching from topside, causing risk of unknowingly running into them. Not sure if the latter is just vanilla behaviour.

jagged fulcrum
bleak remnant
#

@silent zealot Fuck dude, i was having a problem i coudn't solve for a weep, i just did it, because of you. YOU ARE A FUCKING HERO, you are a hero, holy shit.

silent zealot
#

Welcome to Zomboid modding! (and programming in general)

cyan locust
silent zealot
silent zealot
#

I also have my target reticle change from red to green when over a valid target (vanilla crosshair options) which helps when you think you have a shot lined up and the game think a door/car/whatever is in the way

jolly thorn
#

what are my choices if I want to render something below map symbols?

silent zealot
#

Is Crowbar With More Crowbar going too far?

knotty stone
bright fog
silent zealot
#

This is the ideal loadout. You may not like it, but this is what peak weapon durability looks like.

#

Featuring Crowbar with Sledgehead, Crowbar with Axehead, and Crowbar with More Crowbars.

paper ibex
#

- Localization clean-up. Translation files are now in json

shy mantle
#

I think you can leave the only text files in and it supports older versions just fine lol

dull moss
#
  • Localization clean-up. Translation files are now in json
#

bruh

dull moss
paper ibex
#

json is good

dull moss
#

except when you have to migrate 30 files

#

json is good

paper ibex
#

string replace on the fly

dull moss
paper ibex
#

i dont think adding more type of json is good yet, extra text mean extra byte, you can create your own jsonc and then convert it later

mellow frigate
#

Is there already a script to convert automatically translation files from Legacy to 42.15+ format ?

dull moss
#

brother you dont worry about extra line of text in 2026

#

when it can improve readability and answer questions that translators might have

paper ibex
#

anyway can we use json data in lua now? (vanilla support)

dull moss
#

chatgpt

$files = Get-ChildItem -Path . -Filter *.txt -Recurse

foreach ($file in $files) {
    $lines = Get-Content -LiteralPath $file.FullName -Encoding UTF8
    $result = [ordered]@{}

    foreach ($line in $lines) {
        $trimmed = $line.Trim()
        if (-not $trimmed) { continue }
        if ($trimmed -match '^[^=]+=\s*\{$') { continue }
        if ($trimmed -eq '}') { continue }

        $trimmed = $trimmed -replace ',\s*$',''

        if ($trimmed -match '^\s*([^=]+?)\s*=\s*"(.*)"\s*$') {
            $key = $matches[1].Trim()
            $value = $matches[2]
            $result[$key] = $value
        }
    }

    $jsonPath = [System.IO.Path]::ChangeExtension($file.FullName, '.json')

    $json = $result | ConvertTo-Json -Depth 10
    $json = $json -replace '\\u003c','<'
    $json = $json -replace '\\u003e','>'
    $json = $json -replace '\\u0027',"'"

    $utf8NoBom = New-Object System.Text.UTF8Encoding($false)
    [System.IO.File]::WriteAllText($jsonPath, $json, $utf8NoBom)

    Write-Host "Converted: $($file.FullName)"
}

Read-Host "Press Enter to exit"
#

checked and it works

#
  1. make new file in folder with translations
  2. change extension to .ps1
  3. right click -> run with powershell
  4. it converts all .txt in its folder and subfolders into jsons. It assumes that your stuff is already in UTF-8 so it'll work for most of translation files but not all. Good enough for me
#

if you find some other replaces needed to be done, just add them the the list

fervent oar
dull moss
paper ibex
#

So we need to create a new translation dir inside 42.15/ ; And the old common\media\lua\shared\translate dir still valid?

dull moss
#

im pretty sure you can keep both txt and json its jsut that pre-42.15 will be reading txt and post-42.15 will be reading jsons

paper ibex
#

The -modfolders launch arg is neat. -modfolders mods,workshop,steam

buoyant violet
tame lily
south bluff
buoyant violet
#

vanilla models in general feel a bit small

#

scaling them in blender around 1.2 should make them ok

dull moss
#

did anyone manage to get translation jsons to work? thonk

#

sandbox.txt

option EvolvingTraitsWorld.AffinitySystem
{
    type = boolean,
    default = true,
    page = ETWSettings,
    translation = ETW_AffinitySystem,
}

Contents\mods\Evolving Traits World\common\media\lua\shared\Translate\EN\Sandbox_EN.json

{
    "Sandbox_ETW_AffinitySystem": "Affinity System"
}
#

???

#

oh wait maybe we dont need to attach sandbox part anymore

#

no, it auto-attaches it

#

dafuq

#

yea no i got no idea

#

pls ping me if someone figures out how to use translation jsons, shit just ain't working KekW

mellow frigate
dull moss
#

oh i haven't tried that one yet

mellow frigate
dull moss
#

ah ye now it tries to load them and crashes the game KekW

#

progress

#

Caused by: org.json.JSONException: A JSONObject text must begin with '{' at 1 [character 2 line 1]
???
I validated all 3 jsons and they are all valid

mellow frigate
#

I had the same problem and did: remove BOM + restart PZ. one of made that error disappear

#

or was it the ending comma I forgot to remove, maybe? 😄

dull moss
#

nah its BOM cuz I also have BOM and it crashes the game

paper ibex
#

utf8 only pls

mellow frigate
#

some editors consider "utf-8 without BOM" & "utf-8". for those, select utf-8 without BOM.

dull moss
#

xd

buoyant violet
#

of the game file

#

check vanilla files and look how the translation files are set up

trim yacht
#

Will updating translations to .json break the lua checksum? I seem to recall that removing a file from a mod could historically do that.

paper ibex
#

what do you mean, lua checksum check .txt or .json now ?

trim yacht
#

Oh. Duh. So it only checksums the lua files. Makes sense. I was over thinking I guess

paper ibex
#

tbh, i'll hop on 42.15 after a week.

crystal flicker
#
        zombie.Lua.LuaManager$GlobalObject.getClassField(LuaManager.java:6450)```
I guess `getClassField` is `-debug` only now?
bronze yoke
#

yes

vast pier
#

nikkkkkkkkkkkkkk can I mess with your lever action animset pz_smiling_face_with_3_hearts

vast pier
# tranquil kindle

could you possibly pass me the alternative animset as well?
The one where they twirl it ? :3c

tranquil kindle
#

I don't have files on me localy anymore

#

All i can offer is to sub to mod and search to your heart's content

vast pier
#

I thought you had this specific one local ?

buoyant violet
#

im looking at the update buttom like this for my mods

dull moss
#

question: say i have

local bool = false

Something = {}

function Something.ABC()
    bool = true
end

if bool then
    Events.EveryHours.Add(someFunc)
end

how does it behave exactly? ThinkNitro

say other mod does

require("file1")
Something.ABC()

will event be added or not?

buoyant violet
#

I know for a fact I will get complains from 42.14.1 users

bronze yoke
#

it's just plain order of execution

buoyant violet
dull moss
#

k

#

ye, it returns, was pseudocoding

#

xd

bronze yoke
#

by the time require() returns, the entire file is guaranteed to have run already

tranquil kindle
buoyant violet
#

Nik when are you gonna teach me how to animate?

bronze yoke
#

just think of files as functions... because that's *literally* what they are in lua, this isn't a metaphor, they are the same thing

tranquil kindle
#

By having that i mean that i still have DM open with Rainmaker, where i send her the anim

#

But it hinda hurts to go through it, as there is lots of insults

buoyant violet
#

oh that where that person got the racking anim

tranquil kindle
#

Or just not good language

placid bobcat
#

Is there any idear why the %s and %s%% placeholder currenly appear with the new Translation?

dull moss
#

hmm, ok. Then I can just inside func unregister events if not bool that way I do add events but if they are not needed they are removed

vast pier
placid bobcat
tranquil kindle
#

It probably includes player model, thats why its bigger than usuall, but it works

buoyant violet
#

Nik will teach me the skillz

crystal pier
#

i just wanna ask if updating the mods to current version is easy for modders

buoyant violet
#

depends

bronze yoke
#

most mods are fine, however in most cases mods that used field reflection are impossible to fix

swift niche
dull moss
#

nevermind, was some game shenanigans, it works

sleek belfry
#

Friends! I want to learn how to create mods and try my first game mod. Could you tell me where to start and how to learn? I'm a beginner, but I'm really interested in this area. Sorry, I'm using a translator. I'm really happy to discuss mod creation in private messages.

bright fog
#

42.15 modding changes

Translation changes

A pdf file and an example zip are provided. mod.info can now have translations.
The translation wiki page is now updated for 42.15 too

dull moss
bright fog
dull moss
#

msg under

#

converted my 25+ files without problems

#

except that gotta remove language prefix at the end, so it's Sandbox.json and not Sandbox_EN.json but imma just manually do that later, as long as I dont have to manually convert thousands of lines into json KekW

bright fog
#

Ah that's powershell

bronze yoke
#

i've been using it, it works well

bright fog
dull moss
#

yep

#

that's why I said "most"

bright fog
#

I think I'll make a small Python script lol

dull moss
#

go for it, didn't wanna bother with it myself :)

neat walrus
#

am I correct to believe with versioning I can put my entirety of 42.13 in common and my 42.15 can have just the translation folder? I don't need to duplicate my lua/ folder, right?

dull moss
#

you can leave everything in 42.13 as long as its not limited by max ver

bronze yoke
#

you can just add the new translations if you didn't have to make any code changes, they don't conflict with the old ones

dull moss
#

and put json translations alongside txt translations

dull moss
#

game will read txt or json depending on game ver

mellow frigate
bright fog
#

@dull moss wait but every translations use UTF8 now ?

bright fog
dull moss
#

i think not?

#

turkish and some others are still in diff encodings, no?

bright fog
#

I mean

#

Why is converting needed

dull moss
#

hm

#

if all are utf-8 then its great

#

no more fuckery with encodings

bright fog
#

I'll check the vanilla files

#

Yup seems to be all UTF8

dull moss
#

yippie

bright fog
#

I haven't checked ALL the languages, but I know some that used other encoding and they are UTF8 rn

#

I'll do a better check sec

#

Yup

bleak remnant
#

after this update i can transfer items that are hidden if i click "trnasfer all", anyone how what the problem is?

bright fog
mellow frigate
bright fog
#

Of course

bronze yoke
bright fog
#

I'll change it to that then

bleak remnant
#

there no other way to transfer it

#

only when you click "transfer all"

bright fog
bleak remnant
#

i can only take those items if i click "take all" from the ground/container

#

it started to happen after the update 42.14.1 i guess

#

not sure

#

it is the 4th time that they break this fucking thing, i don't know why they like to mess around with the items scripts so dam much

willow tulip
#

@sour island did you need all of parsescript or does load() work for your usecase?

#

Im honestly not sure what parsescript does differently.

sour island
#

Parsescript let's me feed an entire script.

Load to my knowledge requires an existing script, and the load is additive - to overwrite requires exposed access to clear

willow tulip
#

Im pretty sure there are some people managing to clear and fully reload scripts but the API calls they are using to do it give me pause

#
    local recipe = getScriptManager():getCraftRecipe("PressOil");
    recipe:PreReload()
    recipe:Load("PressOil", new_recipe_as_script);
    recipe:OnScriptsLoaded(nil)
    recipe:OnPostWorldDictionaryInit()

    CraftRecipeManager.Reset()
    CraftRecipeManager.Init()
#

this.

willow tulip
#

I feel like ```
CraftRecipeManager.Reset()
CraftRecipeManager.Init()

oak python
#

is there a way to store movingobjects as a reference to teleport them once the chunk is deloaded?
if im using rv interior i want to bring a pig with me but i cant reference the pig anymore upon chunk deloading

willow tulip
#

I also haven't tracked down what OnScriptsLoaded or OnPostWorldDictionaryInit does.

#

I feel the whole codepath is either crazy, genius or AI nonsense.

sour island
willow tulip
#

ah.

sour island
#

Or one of those

willow tulip
#

PreReload() seems to just clear every indivual member/member array/etc

dull moss
#

boom

#

epic embedd failure waaaa

willow tulip
dull moss
#

as a traits modder setting weight haunts me in my dreams cuz there other trait mods and clothes and sandbox and whatever fuck else KekW

#

now ican jsut tell ppl to complain to other mod authors to use the framework instead of adding compatability on my end to everything

willow tulip
#

Yeaaa.

dull moss
#

and then it getting overwritten anyway

willow tulip
#

And the dumb 50 limit -_- (That Total Capacity Overhaul allows adjusting, lol)

dull moss
#

TIS remove the hardcap

#

dont make me visit your offices

willow tulip
#

bro no threats.

bleak remnant
willow tulip
#

not even as a joke

dull moss
#

if you consider that a threat thats on your end

lavish gulch
#

Quick question, I just woke up (it's 7am here in Australia)
TLDR we run a big MP server; did new update break most mods yes or no?

willow tulip
#

Yea im saying don't even joke about it. its not cool.

#

even obvious jokes, not cool

#

its bad enough that steam community is.. such a charming and non-toxic place.

dull moss
#

can u like move on with minimodding, ty

#

barely said anything

lavish gulch
#

but does that stop a mod from working

dull moss
#

no

willow tulip
#

How did it not break Realistic Car physics is my big question -_-;

dull moss
#

I heard it broke some more technical mods, dunno the details

willow tulip
#

Like im sure i have to update something in that mod

dull moss
willow tulip
#

Yes and?

#

I r developer of realistic car physics.

dull moss
#

no i mean Chad

bleak remnant
vast pier
#

I like to keep material colors consistent in my mod icons

tranquil kindle
formal aurora
willow tulip
formal aurora
#

Ah, that was Project summer car, which uses yours, my bad

vast pier
#

working on a chopper attachment

vast pier
willow tulip
#

So uh, is there some pinned post or something on how to do translation files now?

vast pier
#

Yeah it sure would be nice if there was like, a pinned post or something.
Especially for this new update.
A pinned guide would be very useful.

bright fog
#

YOU GUYS REALLY ?

#

READ THE PINNED MESSAGES OMG

vast pier
#

hehehehehe

bright fog
vast pier
#

Guess I'll just have to wait until a guide is made

#

and hopefully it gets pinned

#

to this channel

#

in particular

#

a pin that is.

bright fog
#

If only someone listed all possible ways to get the official TIS guides for that new awesome update

vast pier
#

Nah that's asking too much

#

nobody would ever do that

bright fog
#

Definitely

vast pier
#

waste of time

bright fog
#

Should ping Nasko to do that

#

Surely that'd be useful to someone

vast pier
#

@ nasKo

vast pier
#

Also, the improvised attachments will have rusty variants

silent zealot
#

Opens steam. sighs Type-type-type. Ctrl-C Ctrl-V. Ctrl-V. Ctrl-V.

When people complain about a mod not working because a mod-breaking update came out a few hours ago I lose a little bit more motivation and all my mod updates are delayed a bit longer.
Also I'm just going to delete those comments instead of making grumpy and inappropriate personal responses.

willow tulip
#

Today it was.. reading the throttle value for fuel consumption in project summer car.

#

And realistic car physics broke sinks due to some Soap API it didn't have 🙂

silent zealot
#

They impleneted SOAP somewhere in zomboid?

#

And the translation files are JSON?

#

Holy $#@^% we're getting some industry standard systems!

willow tulip
#

PS by soap API, I mean literally an API to get the amount of soap a player had... don't get your hopes up 😛

silent zealot
#

oh

#

...

#

damn.

#

A soap API, not a SOAP API lol

#

still, json translation files is nice. Or at least better than the not-lua text files.

willow tulip
#

Monkeys paw: Translation files are now JSON, but the slightest error stops the game from loading and doesn't tell you what filename the error occured in, only what line.

silent zealot
#

I'll take it, there are plenty of json validation toals available. 😛

bronze yoke
#

just stop using notepad 😭 json validation is possibly one of the most solved issues in computing history

#

every language has 5 json libraries, and none of them serialise things the way you want them to, but most of them are good enough

willow tulip
#

Considering it will cause the game to just crash to desktop at 'loading translations' phase lol.

silent zealot
#

Maybe the Monkey's Paws will be: config files are all in JSON, but the JSON is interpreted by TIS's custom hand-written JSON parser.

#

Then we get XML for items but it's parsed with a pile of java regexps.

willow tulip
#

.... First it was sunny and nice out, then I got a weather alert.. for snow. then it was dark. then hail. Now sunny and hard rain.

jolly thorn
#

soap wasn't working right in multiplayer, so they decided to make a whole api for it 😎

willow tulip
#

plz help, my local weather is very poorly simulated -_-; (Real life)

silent zealot
#

I need someone to change the sandbox settings for the local weather and lower the max humidity.

willow tulip
#

speaking of I need to empty my dehumidifer

silent zealot
#

OK, morning meeting finished so now I get tio start Zomboid and see how much it explodes.

#

ooooh.... Added support 512x512 preview image for Workshop Item.

#

Is this new and I'd just never heard of it before?

willow tulip
#

Neat.

bronze yoke
#

so that part might be new, or i was wrong

vast pier
#

and fish ofc

bright fog
mellow frigate
bronze yoke
#

sadly no, the locations are hardcoded

willow tulip
#

@sour island Don't forget your getter() requests for your mods. Best to get em in early incase they might make it to a hotfix drop or something 🙂

silent zealot
# vast pier and fish ofc

I'm not sure if you mean spears can also stab fish, or that fish can also stab through fences because TIS defined them as a short bladed weapon.

vast pier
#

what

#

I'm using spear stats, and have the spearfishing tag on the weapon

vast pier
#

somebody should make that

silent zealot
#

"Can't find a sledgehammer? Use a hammerhead shark!"

silent zealot
#

Tip: if you want to find every single badly formatted json (because you updated 15 mods at once and now the game will not load and will nott tell you which file is bad) you can use powershell (6.4 or later):

Get-ChildItem -Recurse -Filter '*.json' | ForEach-Object {if (-not (Get-Content $_.FullName -Raw | Test-Json -ErrorAction SilentlyContinue)) {$_.FullName}}
#

Also, @willow tulip you have commas after the last element in your jsons, which is against the json spec though I wouldn't be suprised if Zomboid does not care.

#

BTW> Thanks for the super quick update of Realistic Car physics

azure girder
mellow frigate
azure girder
#

🙄

willow tulip
silent zealot
#

For me only IG_UI.json has the extra comma, the other vanilla files do not.

#

Also, this does not work.

shy mantle
#

Damnit jason...

willow tulip
willow tulip
#

Bro is just happy to be included.

silent zealot
#

My guess, the script they use to generate the files leaves the last , in and they have to manually remove it and they missed one.

willow tulip
silent zealot
#

It's not a stray comma.. THE SECRET TRANSLATION KEYS HAVE BEEN STOLEN!

pastel wolf
#

Can Item names not have numbers in them or something?

#

usually i have a problem at other stages of adding clothing items but this wont even show up in the item list

bronze yoke
#

item should be lowercase

pastel wolf
#

oop

#

ty!

silent zealot
#

I am amused by the thought that you created an item which is a pile of exactly 93 boots.

pastel wolf
#

I barricaded myself in the shop after robbing the shoe store and need my pile of exactly 93 boots

#

93 just to imply yknow, contemporary with the game's date

pastel wolf
#

that's also probably why my gas masks weren't working! i'll try and get those reimplemented, and return to working on the modern swat outfit and bundle those up and release the mod!

willow tulip
pastel wolf
#

I was but it seems like the issue at this exact moment is I just imported the fbx incorrectly since its not rendering!

willow tulip
#

Ah

pastel wolf
#

so I'll sort that out and come back around later if I keep having issues with it

willow tulip
#

if you need to figure out the crafting recipe/etc, only make the 'has filters' variant, don't make a 'nofilters' variant

#

and make your crafting recipe call this oncreate:

#
function MakeImprovisedGasMaskOnCreate(craftRecipeData, character)
    local mask = craftRecipeData:getAllCreatedItems();
    mask:get(0):setNoFilter();
end
pastel wolf
#

Ahhh okay, I did make two,

#

so I only need the one and that creates a no filtered variant when its drained?

willow tulip
#

yea, vanilla uses modData now instead.

pastel wolf
#

ahh okay cool

#

gotcha, I'll get some Z's for now and when I wake up dive back into that!

willow tulip
#

I think the name changes via some API thing?

#

But basically, the vanilla 'create improvised gas mask' recipe doesn't work, because its missing the above onCreate and creates the no-filter variant that isn't used anymore

#

You could also just craft a mask with filters by requiring filters as ingredients

#

and I believe that'll do the whole filter thing properly by being spawned with filters

#

if loot tabling, just always spawn with filters, lol

pastel wolf
#

Yeah, gotcha! thanks

#

if I wanted to make said filters last longer would there be an easy way to do that?

willow tulip
#

I dunno, I didn't look into the time mechanism of it. Id kinda suspect its in java but might be worth making a java patch or something to make all filters last longer (or sandbox configurable time?), it seems kinda lame how short they last now

#

(Could be optional part of your mod for people who want it?)

pastel wolf
#

I just wanted to make this be like, an older heavy duty gas mask, heavier and more discomfort but makes filters last longer

#

but theres probably some other upside I can do for it

willow tulip
#

Maybe you could have some kinda event triggered 'everyminute' and 'restore' some of the filter?

#

doable in LUA at least, and likely not exploitable if the player doesn't figure out how your doing it 😛

pastel wolf
#

Or I could maybe make it take its own propriatary filters that are a bit cheaper to craft maybe?

willow tulip
#

yea that could be an option

pastel wolf
#

true true, I do wanna avoid player exploitation, Sidegrades good, busted bad

willow tulip
#

or cheaper to refill at least, the vanilla filters arnt that cheap IIRC

pastel wolf
#

Yeah I might do that then, heavy and crappy to wear but cheap to run

willow tulip
#

like only takes more charcoal to refill instead of (I think vanilla needs fresh glue/rags/sponge/tape for every recharge?)

#

fresh charcoal+rags would be fine

#

sponge/tape/glue isn't very renewable

pastel wolf
#

yeah, its essentially a coffee can full of activated charcoal

#

So I'm cool with that, heavy but cheap

willow tulip
#

Yea that'd be cool, especially for people running mods that make filters essential to not getting infected

#

loot for the epic light pre-zombie filters, or DIY the lame attach 2lbs of charcoal to your face way.

pastel wolf
#

yeah exactly, choices, in your gameplay?!?!?! how strange!

willow tulip
tranquil kindle
pastel wolf
#

Oh! i had a feeling that might have been what determined it since 3 seemed very low

#

I'll give that a try too, thanks!

silent zealot
#

Important note: filters decay based on how many corpses you are near, which is why you always need extras when do you go to silly places liek Guns Unlimited/Crossroads mall.

pastel wolf
#

okay! and does usedelta go UP or down? im guessing Down decreases the rate of drain?

silent zealot
#

Smaller == last longer.

#

A full item is 1.0, use delta is how much each use takes away.

sleek belfry
#

Friends. Did the mods break with the update? The mods work for the translators, and they've disappeared. Can you tell me how to update them? I'm a newbie?

#

Also, the text used to be fine, but now it's all messed up. How can this be fixed? I'm guessing the button descriptions are simply gone.

dull moss
#

All translations broke with 42.15

sleek belfry
dull moss
#

check pins for a tool

sleek belfry
#

Damn, I'm new to this and I don't understand anything 🙁
Do I need to do everything as per the link above?

upbeat harness
sleek belfry
willow tulip
#

You should include both, TBH

sleek belfry
willow tulip
#

Use one of the many converters in #translation in the zomboid modding PZ, or do it manually by copying the file, removeing the _EN or whatever postfix, renaming to .json and then converting the entries yourself

#

(theres like 4 or 5 converters now though lol so if your doing more then a couple translation entries id grab one)

bright fog
#

I'l archive those tools in a repo later today

willow tulip
# sleek belfry

if the blue icons are .json, yea? you forgot itemName though.

#

in the file itself, remove everything before the first { on the first line

sleek belfry
willow tulip
#

do note, PZ will slap you with a fish if you miss one " or , or : etc.

willow tulip
#

btw, when you edit itemName

#

you actually end up removing itemName

#

errr

sleek belfry
willow tulip
#

in the json file, just of ItemName.json

#

"ItemName_Base.Crankshaft1_1": "Crankshaft", so you might think your file should look like that

#

but it should actually be

#

"Base.Crankshaft1_1": "Crankshaft",

#

they removed the ItemName_ part of each tag, inside of just ItemName.json

#

(maybe others I dunno)

sleek belfry
#

I need to change the ItemName in the json - ItemName_Base.AVCSClaimOrb To the next text -
Base.AVCSClaimOrb?

sleek belfry
sleek belfry
willow tulip
willow tulip
willow tulip
# sleek belfry ?

I feel very safe in knowing that PZ will likely crash on you for this crime against... whatever it is against.

#

just...
{

sleek belfry
#

I'm a beginner and this is a bit difficult for me. Am I doing something wrong?

I have to delete everything before { in txt files, right?

willow tulip
#

ok post your .txt file with just like, 1 translation tag k?

#

or 2

#

I'll convert it for you, you follow along

#

please post it as normal text and not an image

#

surround it by three ` (tidal key.. ~)

sleek belfry
# willow tulip ok post your .txt file with just like, 1 translation tag k?
    ContextMenu_AVCS_ClaimVehicle = "Заприватить авто",
    ContextMenu_AVCS_UnclaimVehicle = "Снять приват с авто",
    ContextMenu_AVCS_UnsupportedVehicle = "Ошибка привата авто",
    ContextMenu_AVCS_ClientUserUI = "Список заприваченых автомобилей"
    ContextMenu_AVCS_AdminUserUI = "Админ список заприваченых автомобилей",

}```
willow tulip
#

Ok for context menu, AFAIK you don't need to remove the prefix ContextMenu_ on the indivual tags

#

so it becomes:

#
{
    "ContextMenu_AVCS_ClaimVehicle": "Заприватить авто",
    "ContextMenu_AVCS_UnclaimVehicle": "Снять приват с авто",
    "ContextMenu_AVCS_UnsupportedVehicle": "Ошибка привата авто",
    "ContextMenu_AVCS_ClientUserUI": "Список заприваченых автомобилей",
    "ContextMenu_AVCS_AdminUserUI": "Админ список заприваченых автомобилей",
}
sleek belfry
#

So, it doesn't need to be deleted everywhere? But where should it be? 🙂

willow tulip
#

(note the added , on the end of clientUserUI line, SUPER IMPORTANT json is picky)

willow tulip
upbeat harness
#

"Админ список заприваченых автомобилей", - > "Админ список заприваченых автомобилей"

upbeat harness
#

the last comma is extra

willow tulip
#

oh, that one is fine actually

#

1 vanilla file has it too shrugs

#

technically shouldn't be there, but yea

#

Needs to be on that 2nd to last one though

upbeat harness
#

In my case, the comma was removed everywhere before the closing bracket }

willow tulip
#

From my experience either is fine on the last line

silent zealot
#

@willow tulip Realistic car physics is breaking ragdolls; zombies just freeze in place when shot. B42.15 added a getBulletFrameNo() to zombie.core.physics.WorldSimulation which is not present in the java files with the mod, and it's something to do with Ragdolls. (I tested with just that mod running, after doing a file validation)

ERROR: General      f:3261, t:1773132784528> ExceptionLogger.logException> Exception thrown
    java.lang.NoSuchMethodError: 'int zombie.core.physics.WorldSimulation.getBulletFrameNo()' at RagdollController.addToWorld(RagdollController.java:266).
willow tulip
silent zealot
#

I was lucky with the Java High Beams mod I could just re-copy the updated decompiled java and copy-paste the three functions I changed, and that was still a hassle. No idea how you stay sane after putting out a much more involved Java mod!

willow tulip
#

sigh I missed that in the diff

silent zealot
#

It would have also been easy to miss in testing, since you probably didn't shoot anyone when testing a car mod

willow tulip
#

Nothing updates that stupid value and its just -1 all the time

willow tulip
silent zealot
#

But an API to get -1 would match the large number of item parameters in scripts that are only in the code in save and load functions

willow tulip
#

ah.

silent zealot
#
    public int getNegativeOne() {
        return 2;
    }
willow tulip
#

too tired to release patch, will fix tomorrow

silent zealot
#

And everything breaks if you change it.

#

If you want a quick solution to post on teh mod page:

sleek belfry
#

@willow tulip Friend. I did everything correctly and decided to check if everything worked. As a result, when I log into the server, I see the main menu image and nothing happens. Is this somehow related to a file change?

silent zealot
#

turn that off.

silent zealot
willow tulip
silent zealot
#

You could also put the .jsons into an online json validator.

willow tulip
#

^

silent zealot
#

Or use powershell's test-json , or any other json validation tool.

#

Even opening them up in Visual Studio Code will help with proper syntax highlighting/detection of format errors.

willow tulip
#

im sure i'll only get 1~2 downvotes for not updating everything within 24 hours

silent zealot
#

people need to learn patience. Or how to fix mods themselves.

#

Plus they will appreciate the mod even more after a day of playing without it. 😛

willow tulip
#

wanted more accurate collisions between cars and stuff.

silent zealot
#

A bit like this.

willow tulip
#

yep been working all day on PZ and shaving down knives

silent zealot
#

I hate it when my knives get hairy.

willow tulip
#

shoulda also glued some together or wrapped em but got distracted by things.

#

also, I get to take a break from making knives for schools.

#

Now, I get to make knives... for prisons!

#

I have no idea whats going on with this timeline and at this point im too afraid to ask questions.

silent zealot
#

...so you're making shivs?

#

...after arming school children?

willow tulip
silent zealot
#

Classiv shiv style! Something small and pointy with a handle so you can hold it.

#

Also, nice looking tools.

willow tulip
#

Thanks.

#

Still not even sharpened yet 😛

#

(or laser engraved logo on handle, for that matter)

buoyant violet
#

so we know what controls the spawn of items outside of containers?

sleek belfry
#

@willow tulip Am I correct in understanding that the items are now Base.text instead of ItemName_Base.text? I'm guessing the translation failed because of the ItemName_Base in the JSON.

buoyant violet
#

brass

buoyant violet
#

wanna do that with my guns lol

#

I am not replacing anything vanilla

#

but I do remove from spawn tables

#

which they dont spawn in containers

#

but in the world idk

#

unless they are added directly into the world???

bright fog
buoyant violet
bright fog
#

That's amazing

buoyant violet
#

its super cool

#

gotta find a way to inject my weapons and remove vanilla ones

tranquil kindle
# buoyant violet

Not feeling like making mine anymore. You got ones I wanted and more GenieCry_SinbadStardust

lavish gulch
buoyant violet
#

work in progress one

buoyant violet
lavish gulch
#

I feel like with the new vanilla weapons there's a real opportunity out there for a mod developer to create a new weapon attachments pack. Add in silencers, slings, better scopes, etc. But no new guns and no new ammo. I reckon a mod like that would be really popular.

buoyant violet
#

would be cool, but myself I started this pack long a while back

#

rather than vast amount of weapons I am more focus on modular and features rich

#

without right click interation to install them

silent zealot
buoyant violet
#

I... I am already doing mag swaps haha

#

but yes, those functions indeed

silent zealot
#

With right click?

buoyant violet
#

without right click

#

I am making a seemless integration

silent zealot
#

ah, I thought from your comment that's what you wanted to do.

buoyant violet
#

which is implemented already

silent zealot
#

But you have already done it!

buoyant violet
#

ah no, sorry. I precisely want to avoid right click context interations

#

and thats why we implemented this magazine profiles system

silent zealot
#

Yeah, figureing out the UI is probably the hardest part

#

Or you go full Britas with 37 keybinds to control your weapon

#

(please don't do that)

buoyant violet
#

no no

#

the only thing where I am using keybinds is for underbarrel attachments

#

which was the only way I though would give control to players

silent zealot
#

Looks like it takes the loot from counters/display cases and if it is a certain type moves it on top

#

fewer guns in my test world than yours, so I don't get the see teh wall displays!

#

I lied. They are additional spawns from a list hardcoded in java.

buoyant violet
#

Yeah I was speaking with other in the modding discord

#

I have to find a way to handle it

silent zealot
#

The new vanilla lever action rifles use bolt-action animations. 🙁

#

Still, nice to have them round out the weapon range. Also, I thought the JS-2000 held 7 shells but apparently thatt because it's been so long since I saw an unmodded one.

#

When they mentioned higher capacity shotgun I thought they adde one of those crazy 15 round or 25 round pieces.

viral zinc
buoyant violet
#

this is the only lever so far on my pack

silent zealot
# buoyant violet I have to find a way to handle it

You can spawn items at a set location in the world by making a table fo stuff to spawn, every 10 minutes check if the squares are in range, and if so spawn stuff & remove that entry from the the table. Excalibar is a mod that is a good example of this, with specifc items/zombies.corpses at set locations. You could also use the same logic to clear out any existing world placed items on a square.

So you code up the gunstores so the game periodically checks if they player is close enough for them to be loaded, and if so it goes trhough each tile in a list, removes any placed items and regenerates placed items using your tables.

buoyant violet
#

I was gonna try an approach of attaching a custom oncreate to vanilla weapons to replace themselves wit ha random item from a list

#

but that second approach is what I had in mind

#

its a bit more intrusive I thinl?

torn igloo
#

For 42.15.0, is the global moddata ModData broken?

broken briar
small topaz
#

So they converted all their translations to json files in the recent update? How are the translations for mods are supposed to work now?

#

So. it's essentially just renaming or translate files to .json instead of .txt? EDIT: solved, I see how it works.

#

... hmm and replacing "=" by ":" and adding additional quotation marks ... refactoring hell is going on 😭 😅

small topaz
#

Haha! Good tool! Even thought about writing a small script by myself to do it automatically! Thanks for the link!

paper ibex
#

can request @bright fog update the ZedScripts vscode extension to have the convert function too

bright fog
#

I already have all the tools needed to do so, I just need to write the data to json files

#

Tho with all the tools available, I'll see how hard it is for me to do it

paper ibex
#

i think the script will support with json soon 👀

bright fog
#

The problem is that the extension doesn't retrieve the diagnostics of files you haven't opened yet

paper ibex
#

at this rate

bright fog
dusky quiver
#

the HTML translation converter one is good tool, and sees to do all in JS

paper ibex
#

and then they have json schema

bright fog
silent zealot
#

I just want to say it's really nice being able to use standard tools to validate syntax and I hope the rest of Zomboid's scripts also move to json.

bright fog
#

For sure

upbeat harness
bright fog
#

Json doesn't allow that by default if I'm not mistaken

#

So maybe smthg to look into myself later in ZedScripts

silent zealot
#

It's like that old proverb, "The best time to plan your syntax was ten years ago, the second best time is today"

bright fog
#

You are literally in unstable

#

If not now

#

When ?????

#

That's the exact moment to be doing such improvements to the core game code

silent zealot
#

It's like the Simpsons, no matter how much time passes it's still 1993

#

An eternal moment of endless early access

prisma pelican
#

hi guys, im making a small mod, where i can find one of characters voice in game sound banks?

#

i mean, character voice when he screams, or injured

mellow frigate
#

If you've found a reliable way to predict the future, many of us are interested. If not, like the rest of us, you may wanna consider changes will be required forever.

prisma pelican
mellow frigate
#

I am sorry for taunting you.

paper ibex
#

Hello guys! Here is how you can use the new translation JSON format with built-in schema validation.

File Path: ..\media\lua\shared\Translate\EN\ItemName.json

{
    "$schema": "https://raw.githubusercontent.com/escapepz/pz_translation_json_schema/42.15.0/schemas/ItemName.schema.json",
    "Base.Apple": "Apple",
    "Base.Hammer": "Hammer"
}

Why use this?
This method automatically validates your JSON keys against the official vanilla keys in Project Zomboid, preventing typos and broken translations.

Full details & Documentation:
https://github.com/escapepz/pz_translation_json_schema

#

yes IG_UI.json only, can check vanilla folder or Ex-Translation.zip in pinned messages

bright fog
#

I didn't knew that

paper ibex
#

Yes, JSON Schema is awesome. 😎

bright fog
#

In the same dataset as scripts

#

Wait setting up those schemas seem a bit rough ...

#

I need to look deeper into it later

paper ibex
#

for ZedScripts ?

#

you can give me the github link so i can check what i can do atm

bright fog
#

The updated version for 42.15 is in the dev branch until I update ZedScripts to be able to version control

paper ibex
#

json schema can not validates the file name, only the json key, your .yaml version is better

bright fog
#

But I use these datasets in ZedScripts, and now in the ScriptsDocs and I used it to make the updated translation page

#

Also the filename is a bit complex bcs map translation files need to be named after the map

#

So any .json named file can exist in the translate folder anyway

paper ibex
#

What can i do to make it compatible with ZedScripts in the future?

#

So I can make a PR..

#

For short: Refactor to a single source of truth with legacy support for older versions.

paper ibex
bright fog
#

Your stuff is already compatible

#

Ah you wanted to contribute ?

bright fog
#

I just need to add an option to control the version of the scripts data you use

#

Lots of ideas but I need to take time to do it

#

The thing here is that I need to make sure to be smart about it so users can setup different scripts data versions

#

I might also need to split translation data into separate repos

#

Yea that might just be the solution ...

paper ibex
bronze yoke
#

@bright fog do you know if this was valid for the old format?

ItemName_IT = {
    ItemName_RepairableWindows.GlassPane = Pannello di vetro di grandi dimensioni,
}
#

tcherno's converter dropped it but it's formatted weird so i want to check if that's even valid before i report that as a bug 😅

#

i know the quotation marks and commas are both optional but i've never seen no quotation marks with comma

bright fog
#

Quotes are mandatory

#

Wait wtf quotes are optional ?

bronze yoke
#

i think they were anyway, i always used them so i couldn't say for sure

bright fog
#

I'm pretty sure they aren't else that would cause problems with that last comma ?

#

Like should it take that comma or not ?

bright fog
bronze yoke
#

@mellow frigate your converter seems to misname PTBR files

#

thanks for the itemname update though, you've saved me a bunch of time

stray dew
#

Have they found a solution for the buggy moddata?

main pasture
#

I'm trying to post a request (only text) to the mod_portal, but the automod is blocking it. Is there any way to see what is not allowed, or do I just have to guess what is triggering it?

bronze yoke
#

the main thing it doesn't like is embedded links

#

otherwise i've seen it occasionally get weird about code before, presumably seeing a . and thinking it's a link

main pasture
#

I only have code blocks and unformatted text

bronze yoke
#

there might be things i'm not aware of, i'm pretty sure it's a lot stricter on plungers

stray dew
#

ModData.transmit(key)
ModData.request(key) + OnReceiveGlobalModData

Broken!!!

main pasture
#

I was certain it would be that Transform.origin is a valid URL format, after you pointed that might be an issue, but changing that didn't help either

#

How does the role thing even work? Is it based on the message count?

bronze yoke
#

yeah

rustic void
#

Hey guys, quick question to all the modders here, i had an idea for a mod which some people seemed to love, and i wanted to ask how difficult it would be to impliment such an idea

#

Im not a modder btw

#

but any help would be greatly appreciated

main pasture
#

I was able to post it now. It didn't like me using formatting for the header...

mellow frigate
bronze yoke
#

i don't have a PT translation unfortunately, but PTBR is working as expected now, thanks!

rustic void
#

anyone?

mellow frigate
rustic void
#

Posted my idea here, some said it could be easy to do.. lmk

bronze yoke
#

i don't think the zoom effect is possible

mellow frigate
mellow frigate
rustic void
#

Alright, ill give it a shot

willow tulip
#

@main pasture oh so thats how flying vehicles worked lol

main pasture
#

Yes. They get the jniTransform of the vehicle and change the origin of it every tick

willow tulip
#

so cursed lol

#

"Getter? looks like a setter to me!"

main pasture
#

Setting the position constantly works surprisingly well. You just have to get the controls right

mellow frigate
#

Anyone knows in what folder we can store the profession picture referenced by a modded profession in B42 ? => media/textures folder

crystal flicker
#

Sometimes the support just makes things worth it.

#

First time modding PZ, but not the first time an update has caused mods to break... so I decided to fix a bunch of them so I could keep playing. Fortunately the lions share has just been translation updates.

vale timber
#

does anyone know how complicated it would be to create a mod that undoes the vehicle damage to zombies changs from B42.14?

main pasture
willow tulip
#

Don't forget noisemakers

silent zealot
bright fog
shy mantle
#

A noise maker drone to bait a horde would go crazy

silent zealot
#

Have noise makers been fixed? Last time I tried them they seemed to have a lower radius than my watch alarm going off

#

It would also be fair to make the drone itself into a loud noise source... those things are not quiet and they drive dogs crazy. (or be nice and make "engine noise radius" an option for players to change)

shy mantle
#

Idk, but the character emitter isn't working (for inside a vehicle at least, vanilla hotwire noise is broken to confirm), spam honking a vehicle horn immediately stops all music, sounds in general are fucked.

jolly thorn
silent zealot
#

Can you make your renderstuff() function happen before the symbol's renderstuff()?

jolly thorn
#

afaik it's not possible to touch symbol rendering directly and every place I tried to hook on to map rendering it seems to already be too late

noble shell
#

when updating the translation, does deleting old translation file cause checksum error like the lua files?

bright fog
#

I won't bother making a converter within ZedScripts, I don't have the structure to automatically detect every script files in the workspace rn, so it would be file by file, while there's already plenty of tools made by some other people to do that

#

Lot of work for not much gain, for a tool which I'd have to remove like a month later from ZedScripts anyway

prisma wren
#

im trying to rename the guns and make a mod based on personal preference and i was wondering if this was a way that would work

#

as in

#

is ItemName_Base.Pistol a valid way to do it?

#

or would i just do Base.Pistol

silent zealot
#

the new syntax is just "Base.Pistol" as the key

#

no trailing comma, and add {} around it to make valid json

prisma wren
#

thanks

willow tulip
#

(One vanilla file has a last comma)

#

(But your right in that PROPER json doesn't have the last comma)

silent zealot
#

Also not having it means I can use powershell's Test-json without false positives.

willow tulip
#

sure 🙂

swift niche
silent zealot
#

What is broken with modData?

bronze yoke
#

ModData.transmit does not work, everything else is fine

silent zealot
#

That sounds like it could cause all sorts of hilarious fun.

pastel wolf
#

Have any of you messed around with non-weapons very much? I'm trying to make a flashlight but it takes both staticmodel and worldstaticmodel? I think I just might have messed up the syntax in my model file?

prisma pelican
#

i have a trouble creating custom voice mod, it doesn't work right, i can choose voice type in game but it silent, anyone know how to make correct player sound script?

vast pier
#

100 randomly generated rifles (again)

willow tulip
#

@sour island Maybe the english translations for what each sandbox value is for dropdowns too?

#

(I dunno how to phrase that)

#

(Mod_portal request)

#

like when its 1= shamblers, 2= fast shamblers, 3= sprinters

#

that like REALLY needs some clarification for server setting editors.

vast pier
# vast pier 100 randomly generated rifles (again)

if I counted correctly, that's 8/100 times that a chopper spawned, and 1/100 times that a bayonet spawned.
Chopper technically has the same spawn rate roll chance, but the bayonet will often get skipped on spawns due to there not being an end cap on the rifle

willow tulip
willow tulip
#

totally not gonna abuse it

willow tulip
vast pier
#

spawning the rifle runs a lua function to randomize the attachments

willow tulip
#

yes, but also placing em down in a patten like that, lol

vast pier
#

ah

willow tulip
#

for uh reasons.

vast pier
#

I manually placed em lol

willow tulip
#

Understandable, doing gods work lol

vast pier
#

I just opened the debug menu, spawned 100 into my inventory, then placed each one like a funky lil game of tetris

stray dew
willow tulip
#

So lame when all the guns in town have the same 2 attachments!

#

if I find another JS2000 I swear im going to use it on myself.

#

GO B42.15 ADDITION OF NEW GUNS

vast pier
willow tulip
#

Back to basics. Lets focus on the core PZ features. Like guns, melee weapons, zombies, food, cars.

#

Iv been so looking forward to balancing passes on B42.

vast pier
#

I plan to expand this further with converting ammo type, and also possibly burst n' lever action

vast pier
#

The mod was originally going to have multiple core types with different item IDs, but I have ideas for how I could make more of this work off of a singular item ID

#

Like yes, your drum mag fed bolt action rifle shooting 38 special is treated the same as your neighbor's lever action shotgun

vast pier
vast pier
normal copper
#

Yo guys is there any mod for washing machine fix?

paper ibex
bright fog
paper ibex
#

ok ive forgot the single file, my bad

vast pier
torn igloo
bright fog
#

Bcs your repo rn is a whole documentation in itself which is kind of sad considering the wiki covered/covers most of that

#

You can also cover the schemas on the translation page now that'd be good too

#

And since people don't really have to step in the repo itself to access the schemas that's perfect

torn igloo
#

If ModData.get works then I will just use sendServerCommand as workaround.

paper ibex
#

That said, I'd be happy to contribute to the pzwiki when I have some free time. I'll check out what needs to be done. Thanks for the suggestion! 😀

silent zealot
normal copper
#

Is there washing Machine fix mod?

buoyant violet
bright fog
#

Especially since the structure is already there to provide docs about translations

left needle
#

Hello i am a beginner in lua . I want to add a second (or third) item to the mod blackJack to play it.I have copied the code below and replace the item carddeck with a new item ,but it dont work.Have anyone a advice for me to solve this?

sleek belfry
#

Friends! I'm trying to translate a mod, but when I join a server with it, the game freezes in the main menu, and nothing happens after loading. The problem is due to the UI file. How can I fix it? 🙂

normal moth
#

So, my mod broke for 42.15.

What went wrong? And how can I update them for the new build?

sour island
#

There was someone going around claiming TIS announced something related to the caught (unexploited) security issue- but this post is from February. shrug

#

Upon further inspection (someone telling me to read the description) it appears the mod is just an example, and the "tool" is on GitHub and what was most likely pay-walled(?) at the time.

buoyant violet
#

I did see that mod in the update tracker

sour island
#

Seems misreported - but if they're just installing tools off GitHub yes

#

Even if they packed the tool with the workshop item it would require you to run it

#

Unless it used the exploit but that's doubtful considering their tool is just a mod builder for music packs

torn igloo
#

I think is a 3rd party tool. More like a script, can just use AI to make the tool anyway. AI can do all small personal project nowadays.

#

I asked AI to make me a tool that can reverse engineer the pz map, and it literally did that. Kek.

fleet bridge
#

Looks like they fixed global mod data

torn igloo
normal moth
torn igloo
normal moth
#

Idk. I'm getting bug reports that it's not working, and the update says they changed the translation system from .txt to .json.

So I have to update it I think.

torn igloo
torn igloo
#

The versioning thingy within the mod structure doesn't work in the way I thought it would, very disappointing.
I thought it would goes like load common then load 42 then load 42.1 then load 42.2, unless mod.info explicitly says versionMax. Yet nope, it simply load the common and the latest 42.

sour island
#

I'm more concerned people will run with this narrative and I'll eventually get comments about malware or some such when their unstable saves break with updates pain

willow tulip
warped valve
silent zealot
paper ibex
shy mantle
bright fog
#

That's a sign of world corruption

#

We had such a problem in the horse mod at some point

#

Did they reset when you left the world and came back ?

shy mantle
#

Erm, that original image was taken ~6 months ago, I've completely scrapped that method and world at this point ha ha

#

I don't remember what happened if I reloaded the world

#

I wonder how that world corruption is triggered then

warped valve
normal moth
normal moth
paper ibex
vast pier
dull moss
#

in b41 there used to be setStressFromCigarettes(x) function but it's gone, do we have alternatives? ThinkNitro

bronze yoke
#

probably CharacterStat.NICOTINE_WITHDRAWAL

dull moss
#

ah, was lookign for cigarettes

#

ty, will investigate

normal copper
#

Yo guys did anyone had washing machine bug problems if yes can enyone make a mod fix please

dull moss
#

Quite general question: did something change with permissions or whatever? In b41 you could've added traits to player on client side, but I'm getting some random reports that it doesn't work anymore in MP and I'm not sure if something changed or am I doing sth wrong ThinkNitro

bronze yoke
#

yes

#

most things are server auth now

dull moss
#

how "most" are we talking about

bronze yoke
#

in b42 mp i haven't yet seen anything that made me go 'why isn't that server auth'

silent zealot
dull moss
#

lemme rephrase, I mostly

  • update CharacterStat
  • add/remove traits
    were those moved to server side?
#

add/remove traits I guess you already answered, what about stats

#

oh and carry weight updates ThinkNitro

silent zealot
dull moss
#

hmmm

#

so i will have to bounce commands pretty much back and forth sadeg

normal copper
# silent zealot You will need to be more specific: what washing machine bug?

Hi thanks for answering i played with my friend washing machine works normal in our base and in random moment it bugged up when we click turn on caracter goes to machine "klick it" and nothing happens we cant even switch from washer to drier or other way arround... (power and water still on everywhere) and when we go out of our chunk of map in other houses all machines work normally but houses in our chunk are bugged still..... hope this will help

silent zealot
#

Client:

local function ToggleSpeedDemonTrait(active)
    local player = getPlayer();
    local traits = player:getCharacterTraits()
    local hasSpeedDemon = player:hasTrait(CharacterTrait.SPEED_DEMON);
    if active and not hasSpeedDemon then
        
        if isClient() then
            sendClientCommand(player, "overdrive", "addSpeedDemon", { })
            DebugSay("Request to ADD SpeedDemon sent to server")
        else
            traits:add(CharacterTrait.SPEED_DEMON)
            DebugSay("SpeedDemon ADDED")
        end

    elseif not active and hasSpeedDemon then

        if isClient() then
            sendClientCommand(player, "overdrive", "removeSpeedDemon", { })
            DebugSay("Request to REMOVE SpeedDemon sent to server")
        else
            traits:remove(CharacterTrait.SPEED_DEMON)
            DebugSay("SpeedDemon REMOVED")
        end        
    else
        DebugSay("SpeedDemon no change")
    end
end

Server:

if not isServer() then return end


Overdrive_OnClientCommand = function(module, command, player, args)
    if module == "overdrive" then
        --print("Overdrive: Received command "..command.." fpr player "..tostring(player))
        local traits = player:getCharacterTraits()
        if traits == nil then print("Overdrive: ERROR: unable to get traits"); return; end
        if command == "addSpeedDemon" then
            traits:add(CharacterTrait.SPEED_DEMON)
            --print("Overdrive: Server: Added trait."..command)
        elseif command == "removeSpeedDemon" then
            traits:remove(CharacterTrait.SPEED_DEMON)
            --print("Overdrive: Server: removed trait."..command)
        else
            --print("Overdrive: ERROR: unknown command: "..command)
        end
    end
end
Events.OnClientCommand.Add(Overdrive_OnClientCommand)
bronze yoke
#

in a lot of cases, you can probably just move your code to the server entirely rather than using commands

dull moss
#

uuh

#

but how would it grab a player?

silent zealot
dull moss
#

like what does getPlayer() return

bronze yoke
#

nothing, you'd use getOnlinePlayers() instead to get the server's player list

dull moss
silent zealot
#

Some of those events will include the player involved in them. Others like every10minutes you'd just loop through all active players

#

And if there is a trigger that is client only, see the example code I posted for a way to make that work.

willow tulip
#

Yea, if the player is important to an event its passed in

willow tulip
#

So glad they didn't try to peicemeal B41 MP into something that worked

normal copper
#

@silent zealot Hi thanks for answering i played with my friend washing machine works normal in our base and in random moment it bugged up when we click turn on caracter goes to machine "klick it" and nothing happens we cant even switch from washer to drier or other way arround... (power and water still on everywhere) and when we go out of our chunk of map in other houses all machines work normally but houses in our chunk are bugged still..... hope this will help

bronze yoke
#

b41 mp was more like a piecemeal of b42 mp into something that worked

#

it wasn't really intended to be like that ever

willow tulip
#

Daww cute new PFP @bronze yoke

bronze yoke
#

thank you!

dull moss
#

what if i run my stuff on client and send command to server with player object?

bronze yoke
#

you can also do that, but it's less secure and likely more complicated

willow tulip
stray dew
dull moss
# bronze yoke you can also do that, but it's less secure and likely more complicated

im having hard time wrapping my head around this change, I'm too used with my stuff running on a client, need to get used to this change. Like let's say I have

function UnifiedCarryWeightFramework.recomputeAll(player)
    player = getPlayer()
    -- some code
    player:setMaxWeightDelta(deltaToSet)
end

local function recomputeCarryWeight_EveryHours()
    UnifiedCarryWeightFramework.recomputeAll(nil)
end

Events.EveryHours.Add(recomputeCarryWeight_EveryHours)

well it now needs to run on the server, so do i jsut loop over all players and do it for each? will it work for SP as well or do I need to add separate support for it

#

wait but isnt it just worse from performance standpoint? Like instead of having each client running its own code now server has to loop over players and run code for each?

bronze yoke
#

it's the same total amount of work

dull moss
#

total? yes

#

concurrent? no

bronze yoke
#

you probably aren't doing anything that expensive, and even if you are, you do it every hour, it would be trivial to do it for fewer players more often which would result in better frame times

dull moss
#

k, I'm slowly starting to imagine what needs to be done

#

can a lua in client folder require a file in server?

#

or in that case server file supposed to be in shared (i mean probably)

bronze yoke
#

there are workarounds to do this, but if you need server code in client you are probably doing something wrong

dull moss
#

I have a lotta prints that are togglable in mod options so moving stuff to server is a bit annoying PepeLaugh

local function initializeModOptions(playerIndex, player)
    modOptions = PZAPI.ModOptions:getOptions("UCWFModOptions")
end

Events.OnCreatePlayer.Remove(initializeModOptions)
Events.OnCreatePlayer.Add(initializeModOptions)

local log = function(...)
    if modOptions and modOptions:getOption("GatherDetailedDebugUCWF"):getValue() then
        print("UCWF | " .. ...)
    end
end
#

this won't fly on the server KekW

dull moss
#

is it possible to load localserver with mod not from workshop but from my Zomboid folder?

bronze yoke
#

yeah

willow tulip
dull moss
#

cheaters

dull moss
#

so if i got code in server folder (which runs in SP, and therefore I can utilize mod options in SP), i need to require a client file in server folder

#

or do you jsut put return into mod options so it doesnt run the file if it's not SP ThinkNitro

bright fog
bright fog
#

@paper ibex I saw you linked your schema at the bottom of the translations page, I'll see to straight up make a section on how to use it directly in the wiki. But also what would you think of merging your work with the pz-translations-data repo I've made ? (aka you becoming a contributor to it)

ornate spade
#

What do you need to now and do to make a simple gun mod?

#

I have a very original idea, more vaniller guns

bright fog
ornate spade
bright fog
#

Good luck soldier, if you ever need more help, don't hesitate to ask around here and #modeling

paper ibex
bright fog
#

I think generating these from the dataset would be nice, I could have looked into making that myself but since you already kind of worked on that I figured it's more fair to propose you that

paper ibex
#

A PR will be simple.
I just need to edit translation_files/*.yaml, translationFiles.json, and schemas/translation_files.json.
Then I'll verify it with pre-commit and it's all set, without setting up pz-scripts-data or ZedScripts?

bright fog
# paper ibex A PR will be simple. I just need to edit `translation_files/*.yaml`, `translatio...

So ZedScripts won't use that dataset anymore since translation files are json based now, I'll deprecate anything related to translation files for modders that mod older versions (and remove it completely when those old translation systems are lost to unavailable unstable versions)
As for what you should update, that's up to you but the data I have setup is already good for B42.15 in the main branch, pre-42.15 data are marked with a tag with that name
The schema folder I have rn is to verify the syntax of my own yaml data files, so they aren't used for the translations themselves actually

#

So we should probably rename that folder from "schema" to something most modders won't look into since it's just to validate the dataset

#

My idea would be to make an extra pre-commit which formats the actual schema files used for translations automatically with the latest information (tho it's also very overkill since those translation files are unlikely to move)

#

Tho if you have other ideas, don't hesitate as pre-commits is what I found to handle setting up the data properly

paper ibex
rich reef
#

Hello all. I have a question about modData for a WorldObject vs an Inventory Item. It seems that the modData stays for a world object unless it's removed from the world, or you exit the cell and re-enter. I've tried saving the data to the item's modData itself, and then resyncing those values to the worldObject modData afterwards, but I was wondering if there was an easier way to keep this info persistent for items that may be placed in the world. Does anyone have information on this?

bright fog
#

Can do both tho I'm not a fan of shipping the game files in the repo

#

I'd rather not do that if that's not necessary

#

Or change it to check locally on your computer

fleet bridge
paper ibex
bright fog
#

Renaming the folder was simply about organization

#

Bcs that schema folder is NOT for the translation schemas

rich reef
bright fog
#

They are for the repository dataset schemas which validate the parameters used to define the data

rich reef
paper ibex
fleet bridge
rich reef
#

This is for object modData, correct? Not global mod data?

fleet bridge
#

its the mod data that you mule onto the object

rich reef
#

Okay, great. I'll have to try this out. Thank you!

fleet bridge
#

global mod data is called differently

bright fog
paper ibex
bright fog
paper ibex
#

Just .schemas/Attributes.schema.json . Because pz-translation-data repo only contains translation-related schemas. Unless you have a different design for the file names and language codes.

bright fog
#

I'm wondering if there's a missunderstanding here

paper ibex
#

No lol pls explain

bright fog
#

This is NOT a schema for modders

#

This is a schema to verify that the data of the repository are well structured

#

Tho I'm realizing now that my schema references in the data itself got nuked when I ran a Python script on it drunk

#

This is how it is used for example

#
# yaml-language-server: $schema=../../schemas/translation_files.json

version: 1
name: Attributes
description: ''
fileName: Attributes
fileStarter: Attributes_
function: getText
paper ibex
#

So the .yaml file is used for ZedScripts to validate the filename and lang code

#

btw JSON schema can not validate the filename, if your idea is use single json file for ZedScripts

bright fog
#

So with all the individual files for scripts data and translations, we would easily go over that limit

paper ibex
#

nvm i have not been looking at the ZedScripts ext source

bright fog
#

And I wanted to extension to work on the go

paper ibex
#

cmon' git and IDE is the world standards

bright fog
paper ibex
#

or do you wanna make the extension fully web-based, like vscode.dev