#mod_development

1 messages Β· Page 381 of 1

silent zealot
#

Like the latest MS SQL Management Tools... I gave up and went back to 2019 after trying for a day to get 2022 installed offline

dry stone
#

I've always felt like, if you need a dependency, alternatively write 50 little lines of code? You should just write the code. If people did that, the world would have 98.74% less dependency hell

silent zealot
#

On March 22, 2016, programmer Azer KoΓ§ulu took down the left-pad package that he had published to npm (a package manager for JavaScript). KoΓ§ulu deleted all his packages after a dispute with Kik Messenger, in which the company forcibly took control of the package name kik. As a result, thousands of software projects that used left-pad as a dep...

#

It was 11 lines of code. it added spaces to the left of a string. Who thinks "I need to add spaces to the startt of my string, I'll install a custom module to do that"?

#

A lot of people apparently.

dry stone
#

As much as people complain about the guy who took his ball and went home.. I think he should be allowed to unless he's under contract or something. And I think EULA terms that give places indefinite distribution rights ought to be outlawed.

#

if his package is that important, those giant companies can make their own lol

#

instead they depend on the work of an individual who could slip malware in there at any moment

silent zealot
#

left-pad crypto miner.

dry stone
#

the "guy snuck malware in popular package" story is like an endless movie on repeat

#

my warning about hte latest python one .. its a bigger package, but this just keeps happening

#

or if you prefer, there's the second version

#

and lol left pad is in there

neon cargo
#

The worst part of modding this game is that I can spend an hour trying to figure out why a function call is throwing an error only to find out the underlying Java code that I can't see is borked in some way.

dry stone
#

Yeah.. I spent like 4 hours the other day trying to figure out why my world name was "null" .. they added a new api and broke the old one.

neon cargo
#

Not a statement on PZ stability, just on working with black box dependencies

dry stone
#

and the further I get into this, the more I realize just how little of PZ is visible to LUA

bronze yoke
#

this is why i strongly recommend just decompiling the game

#

with no documentation, without a decompile you're basically just hoping that everything means what you assume it does, and that's with the added assumption that everything actually works how it's supposed to

dry stone
#

failing that, chatgpt can read bytecode as if it were legible...

#

there's also console commands to dump bytecode for specific functions

#

in a way, this is also just decompiling, but for the lazy

#

Are there any mods that let you see mod data on items in like a tool tip or something?

#

because I'm making 100s of items with unique mod data and it's painful... 😭

bronze yoke
#

i think the community modding tools has a mod data inspector

dry stone
#

looking at it, it does .. but I think its out of date for the current version

#

...and then I realized it's actually not that hard to just add a right click -> show mod data that dumps it to the lua console heh

#

that'll save me some pain

#

I'm totally going to forget and leave this in the release version

silent zealot
silent zealot
#

There goes my plan for a proposition 65 mod that adds "This item contains chemicals known to the state of California to cause cancer or reproductive harm" to every item.

dry stone
#

Next you'll be talking about how we need to strip out all this asbestos and to quit eating lead paint

silent zealot
#

That's how sledgehammers can be balanced - every time you destroy a wall, chance of Mesothelioma

dry stone
#

You'll find its cure in the same drawer as the cure for the zombie infection

silent zealot
#

Then a few years later your max exhaustion starts to drop and when it hits zero you die

cinder storm
#

did b42 update the mod context again

#

my mod went poof from my view

#

and im getting random crashes again

#

mods or no mods

bronze yoke
#

nope

cinder storm
#

ok well

#

condition inheritor is fucking me again

#

alright, that didnt crash the game though

#
local item = instanceItem("Base.CrateOfPlanks") -- create a specific item of that type
item:setWeight(5)
local item2 = instanceItem("Base.BoxOfScrapWood") -- create a specific item of that type
item2:setWeight(1.5)
local item3 = instanceItem("Base.CrateOfTreeBranches") -- create a specific item of that type
item3:setWeight(5)```
#

my problem now though is that i have submods that fix things with other mods, namely weights in this instance

#

problem is that it isnt working

#

even on SP

#

its in the shared folder

#
local item = instanceItem("Base.CrateOfPlanks") -- create a specific item of that type
item:setActualWeight(5)
local item2 = instanceItem("Base.BoxOfScrapWood") -- create a specific item of that type
item2:setActualWeight(1.5)
local item3 = instanceItem("Base.CrateOfTreeBranches") -- create a specific item of that type
item3:setActualWeight(5)```
#

also this one in the server folder

#

they might be cancelling out or neither one works

willow tulip
vast pier
#

I feel dissatisfied with the leather texture, and I'm not sure what I could do to make it more appealing

silent zealot
#

Try to add definition with wear patterns?

#

Not easy when the proper answer is a normal map with leather texture...

#

You could do it up all fancy in blender and bake it to a static texture.

vast pier
#

I quite like how they are turning out

vast pier
#

Gonna leave the tarp version very plain

silent zealot
#

If they look too good they won't match the rest of the game πŸ˜‚

vast pier
#

haha, well I'm glad you think they look good

#

Idk what to name the mod currently, it started as a bone glue mod but now it has craftable umbrellas

#

and duck tape

#

can't forget the duck tape

silent zealot
#

Can Steam mods use emojis in the title? Call it " πŸ¦† 🦴 β˜‚οΈ"

wintry tree
#

Does anyone know if the developers have written down how they decide the price of skills?

neon saffron
#

@silent zealot fixed the issue.

turns out the gold bar mesh line was missing a "," πŸ˜…

#

the smallest mistakes require the simplest solutions

silent zealot
neon saffron
#

hey guys , what rotation/position do i need set to make so it's held like in the 2nd picture?

bright fog
neon saffron
#

thanks

silent zealot
#

Speaking of the attachment editor: in B42 is it completely broken when trying to see player model, or is that something I'm doing wrong?

#

I can select two objects, parent one to the other, do attachment stuff but if I select the player male/female model to be displayed there are lua errors and the entire UI breaks.

#

Has been like that for months, I just never remember to ask if it was a general problem πŸ˜›

neon saffron
#

stupid question , but how do i rotate things in the attachment editor?

#

nevermind

bright fog
#

But I haven't tested it either deeply

#

Last time I used it was to test the Horse model in it and I had to make a sort of manual install patch to be able to use it, and even then it was unusable

neon saffron
#

well , for now i managed to get it to lay down properly

#

but i still hold it horizontally , i have no clue which attachment is responsible for holding the bar

#

πŸ˜”

bright fog
#

As always the solution here is to look at existing vanilla scripts

#

Learn from that

#

Go dig in the files

neon saffron
#

hm

bright fog
#

Bip01_Prop2

#

That's left hand

#

Bip01_Prop1 that's right hand

#

@knotty stone hey, you make vehicle scripts right ? The part block can have a door block, but the ID is optional ?

neon saffron
bright fog
neon saffron
#

i reload the game everytime i adjust it

bright fog
#

Did you test that in the attachment editor ?

neon saffron
#

i think so yeah

bright fog
#

You think so ? You should know if you used the attachment editor lol

neon saffron
#

i have no clue how the attachment editor works tbh 😭 can't tell when the attachment is in the right position

bright fog
#

Did you read the wiki page ?

#

Wait I didn't send to you ?

#

ups

neon saffron
#

hm , there isn't any Bip_Prop Attachments.

bright fog
#

uh

bright fog
#

I think it's because it sorts the names, but the first letter is in caps

#

So it might sort under lower cases

neon saffron
#

there's only non-caps attachments

bright fog
#

hmmmmmmmm

#

I haven't used that tool in a while

#

Select the item

#

I'll have time to check in depth a bit later

neon saffron
#

i think that's what you meant

bright fog
neon saffron
#

or if you meant in-game it looks like this

bright fog
#

It might just be different in B41

neon saffron
#

well , the mod is meant for B41.

bright fog
bright fog
#

That's why I'm saying that

#

But the name of the attachment might just be different idk

#

Then go check existing items in B41

#

See which attachment point they use

neon saffron
bright fog
#

Maybe it's not in set parent

neon saffron
#

where else would it be?

knotty stone
neon saffron
knotty stone
#

There is a yellow version with black stripes ^^

cinder storm
neon saffron
forest mortar
#

Thanks for this, super helpful! I've re-implemented the mod the way you intended, and I also incorporated the data you had for vehicles that I missed (might not have been in the collection I'm using).

I reduced the weight I had for the heavy ones to your figure (10251kg) to hopefully avoid any weird ragdoll behaviour, but have kept the HP values as they were for now, will see how that goes. I have a couple cars that fall into the <2000KG >300HP category but they're performance/muscle cars so kinda fit the bill. Most of the others I've gone with most commonly used/mid range engines/as suitable for the model so hopefully should be about right.

Still got one issue I haven't solved yet, but don't know that it's related to RCP necessarily. In SP the trunk capacity is working as expected, but in MP, the trunk displays correct capacity (450 * 1.3 organised trait bonus = 585) as taken from my data, but not allowing me to add more items beyond 100.

neon saffron
mellow frigate
neon saffron
#

someone tell me whether this recipe would work? I'm making a recipe to exchange money (vanilla) for gold bars (modded) , B41.

#

if not , why?

mellow frigate
#

What is this startup option ? -XX:+UseZGC

umbral totem
willow tulip
shadow edge
#

is there are up to date documentary on to how to make cars?

knotty stone
#

nope

vast pier
vast pier
#

I am removing the scissor requirement, as I want these to be craftable without metallurgy

#

which also brings to my attention the lack of ceramic cooking pots in game

buoyant violet
#

Very Salty Umbrellas

forest mortar
dry stone
#

I'm up to 88 item definitions now, almost all various retro computer parts... Special fields for release date, retail price, inflation price, description, and other details needed for implementation

#

Made a python script to parse all my definitions, check for several kinds of mistakes in them, and format a LUA file so I can access my full item DB trivially without needing zomboid APIs to get in my way and constantly break as B42 progresses

dry stone
#

Just what I said heh. Like when I implement generating a random computer from parts, I'll need to do things like "find all parts that fit here by this tag" .. and zomboid just doesn't have good APIs to do that with.

bright fog
#

Items ? It does tbh

dry stone
#

but my auto-generated item DB in lua you can just instantly look that up from a list

#

It does for items you have .. it does NOT as far as I can tell have a way to find item definitions matching a tag for items that do not yet exist

bright fog
#

You can implement that

#

That API is stable

dry stone
#

I just did, though πŸ™‚

#

after like 3-4 hours of trying to get it to print out a list of items with a tag via lua console the other day.. its just not worth the effort.

bright fog
#

You could also just not pass through a Python script, which means only your mod would use that or require weird stuff for modders to mod your mod if that's something you want

bright fog
dry stone
#

Its fine, no one is going to mod my mod lol

bronze yoke
#

i just don't really get what the python is doing there πŸ˜…

#

sounds like a really excessive layer of complexity for something so straightforward

dry stone
bright fog
#
local sm = getScriptManager()
local items = sm:getAllItems
local valid = {}
for i = 0, items:size() - 1 do
    local item = items:get(i)
    if item:hasTag(YOURTAGSHERE) then
        valid[#valid+1] = item
    end
end
#

Done

dry stone
#

The python's doing a lot more than just this though. It's also validating a gigantic database for all kinds of crap. Even things like inflation prices are checked against a calculator

bright fog
#

I may have fucked some syntax, I haven't written Lua for a week and mostly being doing Python and TypeScript the last few days, but that should be it

#

All of this is just a question of knowing the API but also searching the JavaDocs

#

From your registries file, you can retrieve your tag you stored in a global table for your mod too, feed that in the tag spot

dry stone
#

I may well be messing this up. I tried with and without quotes on my tag since I don't know what that function expects

bright fog
#

PZDos:Isa16 first off that won't even work

#

Also that won't print anything

#

Bcs the console doesn't print anything if you don't tell it to

#

I gave you a code that does basically what you want, now it's your job to read that code and understand how you are supposed to use that and what it outputs

It gives you an array of items with your tag, it won't magically show its content unless you add that in

dry stone
#

Here's an example of one I've been using to get mod data from the item in my hand:

local md = getPlayer():getPrimaryHandItem():getModData(); for k,v in pairs(md) do print(k.." = "..tostring(v)) end

bright fog
#

You can easily modify that code to print the item in the console

dry stone
#

But I added a hacky right click to my mod so I can just inspect full data on any item to help me debug

bright fog
#

Isn't that already a thing ? Or I guess that's in the community debug tools already

#
local sm = getScriptManager()
local items = sm:getAllItems()
local valid = {}
for i = 0, items:size() - 1 do
    local item = items:get(i)
    if item:hasTag(YOURTAGSHERE) then
        valid[#valid+1] = item
        print(item:getFullName())
    end
end
#

That should print the items

#

nvm wait

bronze yoke
#

line 2 needs a ()

bright fog
#

ah yea

#

Good catch

dry stone
#

I ended up with this:

local sm = getScriptManager()
local items = sm:getAllItems()
local valid = {}

for i = 0, items:size() - 1 do
    local item = items:get(i)

    if item:hasTag("PZDos:Item") then
        valid[#valid + 1] = item
        print(item:getName())
    end
end```

but I end up at the lua debug console on hasTag .. this is what stopped me every time I tried last time
bronze yoke
#

that's just not how tags work πŸ˜…

bright fog
#

Yea

#

You don't pass the tag name

bronze yoke
#

you need the ItemTag object created when you registered it

bright fog
#

Do you know about the JavaDocs

#

If not I invite you to check these out

#

They will teach you all you need to know

dry stone
#

looks like you need to pass it an ItemTag object or something

#

not sure how to set those up either

bright fog
#

Registries

#

For your custom tags, you have defined a registry entry for your tag

#

You pass the object your tag definition gave you to this function

#

I haven't documented that exact process on the wiki page for registries yet

#

Guess I'll do that quickly

dry stone
#

Well, I was able to print it out using my LUA script that just bakes the data in...

bright fog
#

bruh

dry stone
#

I know, it's not the perfect way. But it DOES work just fine.

bright fog
#

Do whatever you want man, but if you don't learn the API, you will always be stuck with shitty ways like that to mod the game

#

Your items are already defined, already have all the information you need

dry stone
#

Here's the thing.. Every time I dig in the API I run into shit like "oh that lua function isn't exposed by java anymore"

#

and it's just an endless drag on development

bright fog
#

But because you are not willing to put the effort in learning to use the tools provided by the game, you end up making a Python script that will parse your mod files just to define a table in a Lua file of data you already have
On top of adding extra steps for basically nothing
You end up adding something which could possibly fucked your mod in the future because you end up with two files that should have the same information

bright fog
#

Only very technical stuff are not exposed

dry stone
#

Dude, I had to dig through byte code just ot figure out the proper way to get the world's save name... None of this is trivial "just learn"

bright fog
#

Byte code ???

#

You mean like retrieving the Java stuff ?

dry stone
#

Yes. There's an object in zomboid that helps you get paths and stuff, which is the first thing you'll stumble on if you need path names. Afaik, it worked in B41, but it's no longer exposed to lua in B42. They added a new api, so I had to dig through their jar to find the method names, dump out the byte code, and figure out how to use it. And I did get it to work the textbook way to do it.

#

It's just a total pain heh..

bright fog
#

But the name of the save is already shown in the game UI

dry stone
#

Java side I'm able to get at it much easier

bright fog
#

Ok but sharing a Java mod is a pain in the ass

dry stone
#

I dug through the game's LUA files .. it's listing saves, but you won't find the lua to get the current save name in there.

bright fog
#

Sure you can do everything you want but you end up making your life way worse when it comes to sharing your mod

#

Man if I go look into that and I find it, like lol

#

Give me a minute

dry stone
#

Check this

#

That's why it's a Java mod

bronze yoke
#

yeah it sucks that there's not a lot of documentation, but nobody but you is doing anything nearly as manual as 'digging through the jar' and 'dumping out bytecode' πŸ˜…

dry stone
#

I'm not a java person =\ but I am a very technical person

#

am also not experienced in lua, like, at all. Java is semi-new to me, only a few old projects a decade ago. LUA is totally new.

bright fog
#
local dirs = getFullSaveDirectoryTable()
for i, k in ipairs(dirs) do
    local info = getSaveInfo(k)
    print(info.saveName)
end

#
function LoadGameScreen:setSaveGamesList()
    self.listbox:clear();
    self.listCache = {}
    local dirs = getFullSaveDirectoryTable();
    for i, k in ipairs(dirs) do
        local newSave = {};
        -- we create an item with somes info, like the last time we played that save
        local info = getSaveInfo(k)
        newSave.lastPlayed = getLastPlayedDate(k);
        newSave.worldVersion = info.worldVersion or 'unknown'
        newSave.mapName = info.mapName or 'Muldraugh, KY'
        newSave.activeMods = info.activeMods
        newSave.saveName = info.saveName;
        newSave.gameMode = info.gameMode;
        newSave.playerAlive = info.playerAlive
        newSave.players = info.players
        self.listbox:addItem(k, newSave);--{age = self:getWorldAge(k)});
        self.listCache[k] = newSave
    end
    self.searchEntry:setText("")
end
dry stone
#

and it's my first zomboid mod... have a bit of mercy on me if I'm not doing everything just right, that's all I ask

bright fog
#

What we're basically telling you is to take the advise to learn the tools for modding

#

The JavaDocs and decompiling the game code will do the majority of it

bright fog
#

also naming the value variable of the ipairs k is kind of fucking cursed lol

dry stone
#

Sadly, the LUA snippet I had that retreives the current world save name is lost and I'm now realizing it didn't even make it into my git tree. That whole bit of code ended up getting moved Java-side through another API. I'm pretty sure it was something on the level of a one-liner in LUA, too, it was just really hard to find.

Java side you can use something like:

String dir = ZomboidFileSystem.instance.getCurrentSaveDir();

But that ZomboidFileSystem isn't usable from lua anymore

bright fog
# dry stone and it's my first zomboid mod... have a bit of mercy on me if I'm not doing eve...

Also we're not telling you like to do all of that in a minute like I did, but what you need to understand is that PZ API is quite open and really suited for modding for the majority of stuff, only very specifically technical stuff need to pass through Java. Like running Doom in PZ ? You could technically do that in the Lua (tho the performances would be awful), it just requires you to be knowledgeable about the API

bright fog
dry stone
#

To me its all just a means to an end. If I can find a trivial bit of lua code to do the job, of course I'd go for it. It's more future-proof, it's more maintainable, it's more trivial.

bright fog
#

That's not really what you said before, because you said you are passing through a Python script to have a code that is bulletproof from future Builds

dry stone
#

The python script is NOT part of my mod.. no user needs to run python for anything

#

it's a script for me to convert my item definitions into an auto-generated lua file. that file is part of the mod

bright fog
#

But the reality is that the community is somehow convinced that a new build = broken mods, when in reality what gets broken is often a single function, a single method of doing things and the recent updates have been pushing modding in the right direction

bronze yoke
bright fog
#

The reality is that the Lua code I sent to find every items with a specific tag is already bulletproof, bcs they won't change that system in the next builds

dry stone
bright fog
dry stone
#

And yeah, I AM worried about getting rug-pulled when they redo another api, that's the drawback of using the api side. How much of a drawback you see that as.. in a way that depends on how good you are at digging through what's available

bright fog
#

But if you need dig the code correctly, you will never trust it

#

If you never learn the Lua API, you will never trust it

bronze yoke
#

the API doesn't really change as often as you think

bright fog
#

The reality is that the Lua API hasn't moved that much in the past builds

bronze yoke
#

there's been some core changes lately but even they were fairly easy to adapt to

bright fog
dry stone
#

Well, this is the lua code I've got:

local sm = getScriptManager()
local items = sm:getAllItems()
local valid = {}

for i = 0, items:size() - 1 do
    local item = items:get(i)

    if item:hasTag("PZDos:Item") then
        valid[#valid + 1] = item
        print(item:getName())
    end
end```
We know that the "PZDos:Item" is totally wrong and there's some object I think that needs to go there instead
#

how do I figure out what to pass it and how to make it?

bright fog
bronze yoke
#

i've been modding this game for a little over four years now, and i would say that the API now and the API back then are more or less exactly the same

bright fog
# dry stone how do I figure out what to pass it and how to make it?

And that's here the real issue of modding: documentation. The cool thing is that this was partially documented by TIS themselves but you also kind of have to ask around here
But that's also where I come in, because I make documentation and organize the PZ wiki for modding to try and document, but I'm alone on the process and so this wasn't documented yet

bronze yoke
#

there's been improvements and expansions of course, but there's never an overall api 'overhaul'

bright fog
#

And still, I invite you to dig through the wiki

dry stone
#

Believe it or not guys I do appreciate the advice. I am looking through the page you linked on ItemTag.. I'm not seeing like a constructor or anything, and I also don't fully grasp how it maps to LUA.

bright fog
#

The only real breaking change recently in the Lua API was field reflection

bronze yoke
#

the only time the API changes so much you would need to rewrite a mod entirely is if they redo the entire feature you're modding, and that's just because of game changes that are fundamentally not compatible with older mods

bright fog
#

The registries file you can store that tag in a global table for your mod, and then access that from anywhere

bronze yoke
#

your registries.lua should basically look like```lua
MyModName = {}

MyModName.ItemTag = {}
MyModName.ItemTag.MY_TAG = ItemTag.register("mymodname:my_tag")
```and then you reference MyModName.ItemTag.MY_TAG wherever you need the tag

dry stone
#

its still blowing up on hasTag.. I might have bungled this. I'm just using the lUA console to test things, hopefully that isn't the whole problem...

local ItemTag = zombie.scripting.objects.ItemTag
local sm = getScriptManager()
local items = sm:getAllItems()
local wantedTag = ItemTag.register("PZDos:Isa16")

for i = 0, items:size() - 1 do
    local item = items:get(i)

    if item:hasTag(wantedTag) then
        print(item:getFullName())
    end
end```
bronze yoke
#

you can't register them in the console

#

even if it worked, the items wouldn't have the tag, the tag didn't exist when the item loaded

dry stone
#

It seems a bit weird, though.. why aren't tags on valid item definitions already registered on startup..

bright fog
#

Regsitrying tags needs to be done in a registries file

#

See the page I sent

digital osprey
#

Client Sends: sendClientCommand(player, module, command, args)
Server Receives: function(module, command, player, args)

thanks TIS! πŸ˜„

bronze yoke
#

TIS has been moving away from using strings for things like this and towards pre-registered objects due to various benefits

digital osprey
#

would be handy, at least i know now, it has been a few hours haha

bright fog
#

The JavaDocs is your friend as always

dry stone
#

I got it to work...

This lua snippet pasted in console: ```lua
local sm = getScriptManager()
local items = sm:getAllItems()

for i = 0, items:size() - 1 do
local item = items:get(i)

if item:hasTag(PZDos.ItemTag.TEST_TAG) then
    print(item:getFullName())
end

end```

And I created this 42/media/registries.lua

PZDos = {}
PZDos.ItemTag = {}
PZDos.ItemTag.TEST_TAG = ItemTag.register("PZDos:Isa16")
bright fog
#

Also the networking page might interest you

dry stone
#

And you guys will HATE this.. now I just need to tweak my python script to auto-generate the registries with ALL of my tags.

bronze yoke
bright fog
digital osprey
bright fog
bright fog
dry stone
#

I suppose my registry would populate a map of tag name key strings to ItemTag things, but if a modder DID want to add items, they won't be able to update my mapping either

bright fog
#

Other mappers shouldn't need to touch your tags anyway

dry stone
#

Not my tags, they may need to add their own

bright fog
#

If they want to make an item that is valid for your system, they just add the tag to their item and done

bright fog
dry stone
#

It's a complex system for building custom PCs. Say someone wants to add a PCI slot, there needs to be a new tag made for it, and it gets called out in the item definition that a part has the slot.

bright fog
#

If that matters to you, your function to retrieve the items with your tags could take from a table of ItemTags that modders can add onto

dry stone
#

Basically in my mod you collect computer parts, build a computer, find shareware disks to install and play games on it. Dosbox simulates the computer you built to the specs you have. The rest of my code juggles filesystems between client/server for MP persistence

bronze yoke
#

i'd probably just try and get used to ItemTags, they were introduced because they provide benefits over strings (specifically that referencing them incorrectly is a runtime error instead of a silent failure, perfomance benefit that they have an identity, easier to find usages in the codebase, etc), and you're just coming up with workarounds to treat tags as strings again πŸ˜…

#

do what you want of course, but i would be surprised if this isn't making your code more complex for no benefit

dry stone
#

I mean, I in some way need to have an item definition say "this part has these slots" and also "this part fits in these slots" .. There's the need of "I need to generate a random part to fit this slot with these specifications". The way I've designed it, all of that is simply in the item definition

#

I did it that way so I'm not scattering the logic all over the place... which would lead to me making mistakes endlessly

#

tags might not be the best option. When I first read about it, it sounded like a way to identify an item as having some property (like "fits in this kind of slot"). Not being able to use strings does mess the whole concept up.

#

But that alone doesn't make it a bad design - there'd need to be a stronger alternative design.

bright fog
#

You can still retrieve ItemTags with strings anyway

dry stone
#

Because slots need to list what item tags they allow in the item definition as strings

bright fog
#

But what this whole thing does is that your tags have fixed definitions, and as such Typings work really well with them

bright fog
bronze yoke
#

i still feel it would've been better to use a global lookup for these properties rather than mod data

dry stone
#

That's what my auto-generated lua file did ..

bright fog
#

Probably yea

dry stone
#

it was a global lookup

#

one that I couldn't break because it was generated automatically

bright fog
dry stone
#

the idea that it makes it hard to mod my mod is an issue i hadn't thought of you pointed out

bright fog
#

This kind of stuff will in fact tend to break way more easily

bright fog
dry stone
#

Then it's down to a bug in that python script to fix.. but that script does other things too - since it's scanning my full set of item definitions, it's also double-checking every little detail and throwing warnings

#

If I miss a comma in my item defs somewhere, that script yells at me heh

bright fog
#

But what makes you think the game won't break ?

dry stone
#

what makes you think it would?

bright fog
#

Sorry I meant what makes you think the game will break the API of tags ?

bright fog
dry stone
#

The tag api isn't necessarily going to break due to updates, it's just a potential. From what you guys ahve been saying it seems like a very LOW potential though, so I'm less worried now

bright fog
#

The problem with your current system is that it doesn't really implement well with the game API

#

It makes it awkward to use for modders and to implement in general in the game

#

Because you don't rely on the systems of the game

dry stone
bright fog
#

And you THINK it makes it bullet proof but I'd argue it's the other way around, because the moment something is wrong, you might not realize it with such a system you are using, but the moment the API changed, it doesn't break silently or anything

bronze yoke
#

i don't hate an approach that uses external tooling for scripts, scripts are a horrible format to work with and the game doesn't error check them very well

bright fog
#

Win win situation if you end up using a Python script that verifies your scripts are well formatted

dry stone
#

Well, the thing is, with the way registries work, I'd have to register all my tags so my mod is able to look up items that use them. So even if we go the "use the real api" route, I'm still needing this script to create ItemTag lookups instead of my full database.

That, and now that I have a validation script unique to my setup, why stop using it.. its a bug-finder even if I don't need anything auto-generated

bright fog
#

You're not going to define hundreds of these every updates

#

And even dozens of them

dry stone
#

I could do it by hand but that's more error prone

bright fog
#

I wouldn't even expect you to define a new one every updates or in 10 updates or it seriously sounds a flaw of design

bronze yoke
#

honestly it wouldn't be terrible to just not use tags for this

bright fog
#

And if you fuck up the script files definition by doing a mistake, then you should JUST have a test script to verify formats and that's about it

#

So it stops you from updating your mod with mistakes

dry stone
#

right now I think a better system would use python to let me construct my database in a more sane format, then just auto-generate my full set of item definitions and any lua-side stuff I end up needing to hook it up. Using item defs as the source of ground truth might be a design error

bronze yoke
#

one of the big ideas behind tag registration is that it's less error prone because everything has to reference the single declaration in the main registration file, rather than strings all over the place that may be mistyped or become outdated etc -- this does not apply as cleanly to modders, because we write our scripts by hand (whereas TIS's scripts are generated by java code that directly references the registry)

dry stone
#

They abstracted it to reduce errors, but the abstraction is also more clunky to deal with. Nothing is easier than simple strings, and in my case, the clunk actually lands in a bad spot

bright fog
#

Yea I still can't agree with that tbh, you can always have the lookup tables directly take the string and refer to the ItemTag object

dry stone
#

yep, and that's the new complexity added by the abstraction

bronze yoke
bright fog
#

I agree

dry stone
#

You can check for existence first.. buuut if people actually did that, they wouldn't have needed to make ItemTag registries in the first place lol

bright fog
wintry tree
#

Can some help me understand what's going on with my mods? I have a mod that adds a trait to all occupations not a fisherman. I have a similar mod that's doing the same thing but by the time that one runs, the only thing left in the CharacterProfessionDefinition is fisherman

bright fog
#

Need more detail here

wintry tree
#

proAnglerTraitsLock.lockAnglerTraits = function()
local allProfs = CharacterProfessionDefinition:getProfessions()

for i = 0, allProfs:size() - 1 do 
    local prof = allProfs:get(i)
    if prof and prof:getType() ~= CharacterProfession.FISHERMAN then
        local lockFinder = prof:getGrantedTraits()
        if not lockFinder:contains(NOTANGLERGV) then
            prof:addGrantedTrait(NOTANGLERGV)
        end
    end 
end

end

#

This gives any occupation not fisherman a specific trait. In the second mod, it does the same for Chef but when that mod runs the list only contains fisherman

#

So I guess, the only unmodified occupation is gotten

#

I'm going to try something...

vast pier
wintry tree
#

I don't know if I'm explaining this right. Since I used CharacterProfessionDefinition:getProfessions() and then addGrantedTrait. Those professions are "pending update" and hidden from that list. so if a second mod does the same thing, I have to access "pending updates" and modify that...if that's even possible I have no idea.

dry stone
#

Is there any resource to help me work with UI windows specifically? I'm trying to figure out if there's any real widgets for scrollbars, panels and stuff I can look at using.

vast pier
#

gonna be changing the mask to not include the cap

wintry tree
#

I think my mods are gonna need a framework mod. Why did I do it to myself

wintry tree
#

addGrantedTrait cannot add more than one trait at once..can it?

calm scaffold
#

is there any way to programm a mod for quick save and load? that doesnt require outside workshop programms or patched java files? (just a simple subscribe and it works)

wintry tree
silent zealot
#

Second, the game constantly loads chunks of the maps when near and then saves them to disk when you move away. It's not like most games that will save the entire world state in one go.

#

So you'd have to come up with some complicated versioning system for that and deal with the bloat in filesize.

silent zealot
#

You can easily back up your saves up external to the game (I use Robocopy so it only copies changed files and saves a lot of time) but Zomboid isn't getting a multipel saves feature without a big rework.

willow tulip
silent zealot
#

Glad I have a decent SSD then

willow tulip
#

Also, my SSD can only read/write the 3kbyte files that PZ saves are made outta at like 1.2mbyte/second (likely due to windows)

#

(Vs the 4000mbyte/second benchmarks using several megabyte files achive)

silent zealot
#

...and unbanned. Don't make a typo typing "chunk"

neon saffron
#

hey guys , where can i find specific structures and their IDs?

willow tulip
#

my NTFS file system is not your 100,000 entry database.

#

.. And it makes the saves considerably bigger, even just assuming 4k cluster sizes (I pitty anyone with like 64kbyte cluster sizes, their PZ savegames would be 20x larger

#

a proper DB could even have journaling and let you revert to different autosave points.... (Read as: Not corrupt your save if you crash) And being 1 file, it would only take a modern SSD 0.025 seconds to copy a 100meg save to make a backup, instead of the 60+ seconds it takes to copy 100,000+ 3kbyte files on windows

#

(actual benchmarked times)

silent zealot
neon saffron
#

vases, chairs , etc.

silent zealot
#

world items? As in, the sprites that make up the tiles of teh worl/objects on them?

#

First thing to know is this is a confusing mess and there might be a better a way than what I picked up.

#

If you are looking at something in game, activate the brush tool cheat and right click.

#

the names are the tilesheet the sprite is from followedby a number on that sheet

#

Yes, that means a green stove has four different names depending on which direction it is facing

#

Four for red stove, four for silver stove, four for white stove...

vast pier
dry stone
#

My build UI is coming together. Top panel needs a lot of work, bottom panel I haven't started. You can add/remove parts to computers, everything uses timed actions, it works in MP

calm scaffold
icy night
#

Heya, does anyone know how to make the player automatically jump a tall fence when pathfinding? Or is it even possible to make them do that

formal carbon
#

the ability to starch your jeans like cowboy jeans would be cool

#

idea for a mod chat

#

example

#

they also become harder to tear thru

neon saffron
digital osprey
#

hey guys how are things, could someone explain how item variants are created and how do i access that list? whenever i try to do something with newspapers or magazines when i get the item reference from script manager (getAllItems()) all the variants ignore my calls.

bright fog
#

Those don't have their own item actually, they all use the same item but add some sort of media properties to the item instance to tell what media it is

digital osprey
#

yeah when i want to add a flag to a flier, the variants ignore it

#

setUnwanted in this example

#

even though they share the full name Base.Brochure for example, the scriptmanager only has one item for brochure

vast pier
silent zealot
#

I've seen ATMs that sell gold.

#

At a terrible conversion rate.

#

Taking advantage of people swapping cash for previous metal without knowing WTF they are doing.

#

Not entire full sized ingots.

#

Tiny little ones, I think about $100ish

neon saffron
queen oasis
# neon saffron doesn't tell me much regarding interactions

https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md#onfillworldobjectcontextmenu

this event fires when you right click. you check for your atm and do what you need to do. idk if it's changed recently but don't rely on worldObjects. get the square and iterate through them yourself.

GitHub

Generates documentation for Project Zomboid events and hooks - demiurgeQuantified/PZEventDoc

digital osprey
#

hmm can i not hook into functions from the java class files at all? i found the function that creates the variants (ItemConfigurator.ConfigureItemOnCreate(InventoryItem item)) but having no luck messing with it

bright fog
#

Functions which are called Java side can't be hooked on

red tiger
#

It's totally possible from the Java code to do sort of what you want to do here but it'd take modifications to their engine.

#

I was discussing how controller-adapter functions for overriding car loop logic / simulation inputs to the Bullet simulation would be insanely useful.

digital osprey
red tiger
bright fog
digital osprey
# bright fog What are you trying to do exactly here ?

i have lists of items that are used to dynamically build filter settings based on user... settings πŸ™‚ whenever the item in the scriptmanager allItems is a base (for what seems to be a gameentity conversion through the functions) for a variant like the new books newspapers etc which all have a unique name. the filter does not pick up on the variant

bright fog
#

So you simply want to add the ability to filter unique media's (name/media id, I don't remember what is defined for these) alongside unique items (fulltype) ?

digital osprey
#

however the game can communicate this to me πŸ™‚ currently i use "Base.Magazine_" lookup for magazines for example and the variants get ignored even though it works for every other item

bright fog
#

Bcs like I explained earlier, variants are NOT unique items

#

They all use the same item

digital osprey
#

let me dig up my function one sec

bright fog
#

Now as to how to do that, you definitely shouldn't need to hook to any OnCreate

digital osprey
#

the problem is even though the item shares the full type i can print it no problem, when i run the final step to flag the items as unwanted, the engine ignores any item that is a variant

bright fog
#

Print what ?

#

You can't identify medias by their full type

digital osprey
#

print the full type, i got a debug print when i click an item it prints all sort of things

bright fog
#

Media items have the same ID

#

That's like the third time I've been telling you that now 😭

#

I invite you to look at how those medias are defined in the first place

#

There's a table which holds all of them, all of their data

#

There's a guide on how to make those on the wiki but it's outdated I believe, but you can still check it out if it's still stored in the same table

digital osprey
#

ah see this should be exactly what i need thank you, i was googling newspapers

#

is there a table in the game that holds these variants already? do we have a table fliers?

bright fog
#

Yes that's what I just told you man

#

I don't remember the table name tho

#

But you need to read what I'm telling you and sending you πŸ˜…

digital osprey
digital osprey
#

yeah PrintMediaDefinitions.Fliers thanks πŸ™‚

#

but i need MOOORE! πŸ˜„

bright fog
#

I mean what do you need more ?

#

Go check what that table holds

digital osprey
#

i need one for magazines books i assume

bright fog
#

Then don't go in the Fliers one

#

Go in the other media tables

#

PrintMediaDefinitions.Fliers is a subtable

digital osprey
#

yeah ill find them now that i know what one is called

bright fog
#

PrintMediaDefinitions is what you want

digital osprey
#

cheers man πŸ™‚

neon cargo
#

I couldn't find a documented answer on this... are you only able to access classes in another mod if they are in the "shared" folder, or can you require any .lua file in the client folders as well?

bronze yoke
#

you can require them in any folder

#

shared means shared between the client and the server, not shared between mods

neon cargo
dry stone
#

Finally, I think I'm past this hurdle.. You can fully build a custom PC, window scrolls, description text word wraps, system is validated and tells you if you're missing parts, it's got timed actions, works in MP, and it generates a machine profile for the entire build to send along to my Dosbox side for proper emulation... Phew.

#

And you can see that the crappy ancient monitor cost $2634 if adjusted for inflation... If you think prices suck now... heh, it's become a bit educational.

silent zealot
#

Well done!

dry stone
#

The "polish phase" ... it's always the long stretch

silent zealot
dry stone
#

heh, it's a LOT even if I try to really limit it and cut most big ideas like that.

#

At some point I need to put together a library of freeware/shareware, and it does kinda have to be massive or what's the point..

silent zealot
#

You can probably get some community help with that

dry stone
#

But most likely it'll probably be me spending a couple hours after work every day to add 5 more titles, then crunching on weekends until I've got at least a couple hundred

#

Right now, each computer has a "hard drive id" ... I'm refactoring a ton of stuff so each physical drive / disk gets one. Tons of tasks like this left still too

#

So if you're moving bases, you can just take your hard drive with you and it should work

silent zealot
dry stone
#

Thanks, I somehow missed that when I was looking for places to find stuff - bookmarked πŸ‘

#

That's another thing to do as well. I need to make sure people can use their own files. If someones got the full registered ultima underworld who am I to say he can't play it inside zomboid.

silent zealot
#

in 1993 I was living overseas and had 100% pirated software. There were stores you'd walk into with a stack of floppy disks, choose some stuff from a catalogue, and they'd use disk duplicators to copy it for you with a cost per-disk. Photocopied manuals often available for extra cost, if you needed to bypass copy protection by giving the third word on page 45 of the manual sort of protection.

#

Also local dial up BBSs... I remember downloading the full release of DOOM at one hour per disk on a 2400 baud modem

dry stone
#

lol I had the opposite experience. I mean, everyone still pirated software, but it was by-hand from friend-to-friend. My local BBS once complained at me for uploading "commercial" software (it was the shareware version of a game though, I knew better, but the BBS admin did not)

silent zealot
#

When I returned to Australia it was all hand-to-hand piracy, but Saudi Arabia gave approximately zero <can't say due to fear of overzealous ban-bot>s about copyright law.

dry stone
#

Ever play BBS games? I remember "Food Fight" and I think the other was "Operation Overkill"

#

Usually text based, one player logged in to the bbs at a time, but your characters persisted when other people played

mellow frigate
#

Hello there, does someone know how to make this code work for a custom Perk ? following code extracted from XP class from IsoGameCharacter gives an error for a custom perk when SandboxOptions.instance.multipliersConfig.xpMultiplierGlobalToggle.getValue() is false. java if (SandboxOptions.instance.multipliersConfig.xpMultiplierGlobalToggle.getValue()) { amount *= (float)SandboxOptions.instance.multipliersConfig.xpMultiplierGlobal.getValue(); } else { amount *= Float.parseFloat( SandboxOptions.instance.getOptionByName("MultiplierConfig." + perk.getType()).asConfigOption().getValueAsString() ); }

#

associated error log: ```
Callframe at: AddXP
function: addXP -- file: ThrowingHit.lua line # 8 | MOD: Throwing Weapons
ERROR: General f:3316, t:1774832347723> ExceptionLogger.logException> Exception thrown
java.lang.reflect.InvocationTargetException at DirectMethodHandleAccessor.invoke(null:-1).
Stack trace:
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
java.base/java.lang.reflect.Method.invoke(Unknown Source)
[...]
Caused by: java.lang.NullPointerException: Cannot invoke "zombie.SandboxOptions$SandboxOption.asConfigOption()" because the return value of "zombie.SandboxOptions.getOptionByName(String)" is null
zombie.characters.IsoGameCharacter$XP.AddXP(IsoGameCharacter.java:14270)
zombie.characters.IsoGameCharacter$XP.AddXP(IsoGameCharacter.java:14180)
zombie.characters.IsoGameCharacter$XP.AddXP(IsoGameCharacter.java:14146)
... 24 more

mellow frigate
willow tulip
#

goes to upload mod... proceeds to have seizure upon reading new warning text

#

thats uh, some pretty good flashing on that warning.

silent zealot
#

Cheeck out those graphics!

willow tulip
#

@knotty stone New RCP update (Optional for now) that fixes vehicle collisions and a few other tweaks

#

I really should have a nag that tells people "You could update the install.. its not super important to" though..

knotty stone
#

Yea I saw it, thx πŸ‘

dry stone
#

seriously though I swear I've seen that image before.. I used to love those sci-fi ascii things some games did; that was a whole style at the time

silent zealot
dry stone
#

I've seen a LOT of people with cars halfway stuck in the ground on youtube and stuff lately...

#

Even people playing mostly vanilla

#

just assumed it was the latest b42 quirk they'll iron out

silent zealot
#

Yeah, I asked why he thought my mod was causing a bug that also happened in vanilla and got no response.

#

Thanks again for making cars work!

bright fog
willow tulip
#

And people wonder why I turn steam comments off: My blood pressure.

dry stone
#

a long time ago on my vrik mod for skyrimvr.. I had a really angry user going off on me for removing hand-tracking. They couldn't see their RL hands moving in VR anymore. This was long before I added any form of that feature to the mod...

silent zealot
#

But your mod was the first thing they thought of when the problem happened so it's your fault!

willow tulip
#

How dare you be thought of!

rich dagger
#

I'm looking to make a simple model and texture replacer for vanilla items? Is there a guide on how to go about it? Because its not working as intended 😩

#

I cannot place the item and icon does not change (replacer for vanilla gasmask)

bright fog
#

Overwrite the item model and texture

#

actually probably don't do that

rich dagger
bright fog
#

Then do a soft overwrite of the parameter that references the clothing item for this item script

#

And define a new clothing item for the mask which is your own

#

That way you don't fuck with any of the vanilla files

rich dagger
#

I am like, profoundly stupid, is there any guide for this?

rich dagger
pseudo echo
#

Hi guys, is there any documentation on changing translation files?

#

Its from txt to json right? and something changed in the file formatting as well no?

silent zealot
#

Though you can have a comma after the last element even though that is a violation of the JSON standard and your editor may complain.

mellow frigate
bright fog
#

Just make sure to do it in the same module as the item you soft overwrite

bright fog
#

The new format is documented

#

Also TIS official guide

hollow oriole
#

Hi, greetings. Im having an issue while updating an old mod from B41 to B42. The main issue im having is with the items.txt file, i tried to set up a new mod with just the mere minimum with the items.txt file, and still, it refuses to show up in the game. I imagine is due to a syntax error somewhere and maybe something missing, but right now im exhausted of options of what it could be. The following is the code and an image of the file structure of the mod. If anyone could help me out it would be great, good day!

buoyant violet
#

happy that I got a flow to make models into sprites for the icons

peak remnant
#

Hi guys, I'm trying to recreate the Knock Knock Horror mod for B42 but ill be a million percent, I don't have a clue how to code. I have so far been able to do the print ('Hello World!') but besides that I've got no knowledge. I feel ashamed but I went to ChatGPT to try and learn how to code so I didn't have to pay any money and decided just to try and learn by doing but I'm stumped. I'm just trying to make a basic mod.info file just to start and I'm failing gloriously. According to ChatGPT I've got the file in the right place.

blissful seal
#

Hi peeps, I uploaded a tooltip framework to the workshop:
Tooltiplib β€” it manages the tooltip hooks for you, maybe folks decide it’s worth using or soft depending on.

#

Regardless my mods won’t be fighting any more tooltip wars 😁

bright fog
bright fog
#

Also share the link

blissful seal
#

Indeed

coarse hearth
hollow oriole
vast pier
peak remnant
#

Thank you guys! I really do appreciate it! I finally got my mod showing up in zomboid! I wen through the workshop folder and followed this tutorial: https://youtu.be/yFMLmgM20xc?si=nxt1xPqoBolHbG68. Ill definetly check out the info you fellas shared with me! Thank you so much!

My Discord can be joined with: T4FhKzxUJj
My Steam Workshop Mods: steamcommunity.com/id/RAlNMAKER/myworkshopfiles/

If you'd like to support me or commission a mod from me, head on to: ko-fi.com/rainmakerpz

A quick and simple tutorial for making a new mod for Build 42!

I might make more in-depth tutorials or showcases of how some of my B42 mod...

β–Ά Play video
bright fog
#

Jeez I forgot that b**** had made a guide

queen oasis
bright fog
#

Tbh I haven't made a step by step guide on how to add a new item yet lol

buoyant violet
#

Im quite happy with my icons, nothing compared to a professional spriter, but close enough for someone doing everything lol

buoyant violet
queen oasis
hollow oriole
#

Hi again, I'm having some issues regarding translations for recipes. In game, all my translations for the rest of the items show up without any issues, however, the recipes section wont receive the programmed translations for some reason. Is there something that im missing? Thanks in advance

bronze yoke
#

the file should be named Recipes.json

hollow oriole
digital osprey
#

hello hello, i hit a bit of a brick wall with my way of getting literatureTitle values for book, photo, magazine and all the other variants from mod data. when a variant is created, it gets a unique literatureTitle and this value is being used to determine if a variant of an item will get added to the unwanted list using the vanilla functions. the values are far from unified though, each class of variant items (Flier, Brochure, Magazine etc) has a slightly different naming convention, for example Knox Knews - July 6 1993 gets a Print_Media_KnoxKnews_July6_title, a magazine then is IGUI_MagazineTitle_Telltale_1_1992, but then photos are OldPhoto_IGUI_Photo_aSportsGame_858780 with the seemingly random numbers added making it literally impossible for me to correctly assign those items when i need to.

my question would be, is there any way i could intercept those configs somehow so the game reports to me every single config it is adding so i can then add it to my table for processing without all this code to guess those names based on classes enums and other magic?

#

i tried using getAllConfigs and some other things but i had no success finding what i need, i can only assign those things correctly as the player is looking at a container that has those items inside currently, but that creates extra logic on every frame the player is moving so i really want to avoid that

digital osprey
#

id really appreciate it if someone could shed some light on this, id rather go the lua route if i can, but if someone thinks this can be easily achieved by modding the java function that handles this and would be willing to give me some tips on how to go about it, id gladly give a shoutout on the mod page. id rather do it correctly if i attempt this route and dont want to experiment as much as i usually do here.

bright fog
queen oasis
digital osprey
# queen oasis it's all java side from what I see. The Photos do have a random number appended ...

i see some methods in scriptmanager in the javadocs named similarily to the ones the java class uses (ItemConfigurator.java ConfigureItemOnCreate i think is where this happens right?). im trying to get getItemConfig() and getAllItemConfigs() to work for me and i am getting somewhere actually. ill be back with an update soon, but yeah its been three days, im slowly getting ready to stop being polite πŸ˜„

queen oasis
#

ya, my least intrusive thought was to change the script onCreate method at game start so you could grab the item and then run the ItemCodeOnCreate. I was gonna give it a test here in a minute because idk if it'll work

silent zealot
digital osprey
# silent zealot > for me to correctly assign those items when i need to. I think you told us b...

setting them as unwanted, but during loading i am creating tables of items, to put them in categories, so the user can set up the filter themselves in game and the unwanted list can get rebuilt. this part already works well for all the items that are not variants. i want the heavy logic to happen either during loading or when the user changes settings. while my hook on OnRefreshInventoryWindowContainers should only have: isUnwanted? hide logic. i dont want to additionaly query every item to ask are you a magazine? are you a newspaper? are the settings on?

silent zealot
#

So you have a table of strings, and basically say "if the object == string then set category to<foo>"?

#

But the photos etc/ have the random names that are throwing off your pre-generated table of items?

#

Are the categories shoudl be "all magazines", "all newpapers", etc?

digital osprey
#

just as an update about the vanilla ScriptManager methods, unfortunately using getAllItemConfigs on scriptmanager returns an empty list, and the getItemConfig() gives me an error no idea what string it expects tried full name name, the item reference in SM itself but i tried all three with no results.

digital osprey
# silent zealot So you have a table of strings, and basically say "if the object == string then ...

yes basically, table of categories each of them with their own list of strings for when the vanilla setUnwanted() function runs. this is it for reference:

        if (this.isRecordedMedia()) {
            player.setUnwanted(this.getMediaData().getId(), unwanted);
        } else if (this.getModData().rawget("literatureTitle") != null) {
            player.setUnwanted(this.getModData().rawget("literatureTitle").toString(), unwanted);
        } else if (this.getModData().rawget("printMedia") != null) {
            player.setUnwanted(this.getModData().rawget("printMedia").toString(), unwanted);
        } else if (this.getModData().rawget("collectibleKey") != null) {
            player.setUnwanted(this.getModData().rawget("collectibleKey").toString(), unwanted);
        } else if (this.scriptItem != null) {
            this.scriptItem.setUnwanted(player, unwanted);
        }
  }```
in the case of literature variants, it does not accept the full type value as that points to the base template item that doesnt spawn. instead using the literatureTitle to determine if it needs to be added. with the wild naming convention swings in these, its basically impossible for me to create a function that guesses these names based on certain lists i do know how to access from lua (such as the classes containing the enum values for variants which is how i handle a few of these variant classes currently) thus i am looking for a way to intercept the creation of these in the first place so i save the name there and then to my list. or find the relevant configs in lua to rebuild these names when the game is loading. hope that makes sense
silent zealot
#

Because the vanilla unwqanted function is per specific book/title, not for a whole category.

#

with the wild naming convention swings in these, its basically impossible for me to create a function that guesses these names

There shoudl be one title format for each literature type, like all magazines start with IGUI_MagazineTitle_

digital osprey
#

_Paws_1_1993

#

no way to get dates range spawning currently

silent zealot
#

All oldphotos with OldPhoto_IGUI_Photo_ etc

digital osprey
#

and a random number added

#

i explain all of this above

silent zealot
#

sure, but - don't you just need to test if an item is a magazine?

#

So instead of a full match on the title, you can can say "if title starts with... "

digital osprey
#

no, that adds the base item, non variant which doesnt spawn

#

and to add to the unwanted list via vanilla i need the full full literatureTitle

silent zealot
#

You need to add the items before they exist?

digital osprey
#

including date including random number

#

yes

#

not when looking through containers

queen oasis
#

yea I was trying to grab the item immediately after it was created but it wasn't happy

#

then I crashed the game

silent zealot
#

You're using this table to decide what to hide from the inventory window, correct?

queen oasis
#
function newPhotoOnCreate(item)
    ItemCodeOnCreate.onCreatePhoto(item)
    print(item) -- was trying to print the item
end

Events.OnGameStart.Add(function()
    local itemScript = getScriptManager():getItem("Base.Photo")
    if itemScript then
        itemScript:DoParam("OnCreate = newPhotoOnCreate")
    end
end)```
does not like the ItemCodeOnCreate
silent zealot
#

try usinga a soft override instead of DoPAram

digital osprey
#

to decide what to hide, the only logic that fires is if an item is unwanted hide it

silent zealot
#

Might be one of those things that gets ignored if updated.

queen oasis
#

I tried setting a lua on create and that did the thing too but same result

#

throws an error and creates a "blank" photo

silent zealot
digital osprey
#

currently i am doing what u suggest but i really dont like this approach, i dont want to query every item in addition every time the container updates to ask if its a variant, then add it to unwanted if it is, then add it to my list for the settings to work etc etc

#

i want the on container update to be clean

#

cos its not only magazines, id need to make a case for photos for doodles for books comics

#

there are a lot of different variant classes in the game turns out

silent zealot
#

Be warned you've got a pile of extra challenges in multiplayer if you track each literature item on creation/or use set unwanted

silent zealot
#

Sometimes there is no nice elegant solution

#

Sometimes the answer is a brute force logic statement

digital osprey
#

i hear you πŸ™‚ but i woke up today and was like fuck it one last try

silent zealot
#

Happens all the time in vanilla code

queen oasis
#

I don't see a way to get the title until after it's created without a java mod

digital osprey
#

thanks for the interest guys i hope at some stage they will add some vanilla function or just a list of those variants for access in lua.

queen oasis
#

no worries, I like breaking stuff

digital osprey
#

just out of curiosity how hard would it be to make a java mod

#

since the task seems simple

bright fog
#

Not that hard, the problem is distributing it

#

It's usually not recommended to make Java mods unless YOU SERIOUSLY NEED IT

digital osprey
#

workshop doesnt support it right

bright fog
#

Needs manual install

digital osprey
#

i see makes sense

bright fog
#

Tho I haven't read what you need it for

digital osprey
#

i just need the function to save a name to a table as its creating the item variant

#

literatureName from ModData

#

for item variants like magazines photos etc

bright fog
#

Are you still at that fucking thing :|

digital osprey
#

haha stop

#

πŸ˜„

bright fog
#

Why do you need to retrieve items when they are being created ?

digital osprey
#

i have lists of items for the purpose of dynamic settings

bright fog
#

Also there's already events that detect loot being generated in containers

digital osprey
#

i need this to happen during loading

bright fog
#

Dynamic setting of what ? WHY do you need to access loot when it's being created ?

#

If you do any kind of filters like you mentioned, why do you need to know every items that exist

digital osprey
#

i am using setUnwanted vanilla function and it needs those complete values to function

bright fog
#

Also you are fucked bcs once items are loaded, they won't be considered as "being created"

digital osprey
#

literatureTitles i pasted the vanilla function a bit above

bright fog
#

Also that still doesn't explain why you need item references and not names

digital osprey
#

because thats how the devs programmed it

#

names i need literatureTitle values

bright fog
#

And even if you needed an instance of the item to filter specific types of items, you still aren't dependent on a world item and could just temporary instance one

digital osprey
#
public void setUnwanted(IsoPlayer player, boolean unwanted) {
        if (this.isRecordedMedia()) {
            player.setUnwanted(this.getMediaData().getId(), unwanted);
        } else if (this.getModData().rawget("literatureTitle") != null) {
            player.setUnwanted(this.getModData().rawget("literatureTitle").toString(), unwanted);
        } else if (this.getModData().rawget("printMedia") != null) {
            player.setUnwanted(this.getModData().rawget("printMedia").toString(), unwanted);
        } else if (this.getModData().rawget("collectibleKey") != null) {
            player.setUnwanted(this.getModData().rawget("collectibleKey").toString(), unwanted);
        } else if (this.scriptItem != null) {
            this.scriptItem.setUnwanted(player, unwanted);
        }
  }```
bright fog
#

Format with Java please

digital osprey
#

how?

bright fog
#

Write java after the first three `

#

Also have you even checked the Java docs ? It runs on an Item instance, not InventoryItem

#

Like I swear what you are trying to do, retrieving every items being created is the worst way to handle this whole thing and tbh a seriously wrongly designed mod

#

When you setUnwanted, it marks every items of this type as unwanted

digital osprey
#

setUnwanted? i am using the one in the IsoPlayer this one was for reference

#

that it wants literatureTitle

#

i just want a list of those titles man

#

i dont care if its when its created

bright fog
#

But I already told you where to find those titles holy shit

digital osprey
#

but from what i see thats the only way to get them

bright fog
#

I told you yesterday you need to read stuff we say and that we send

digital osprey
#

no man you dont understand sorry. this function only works when you see an item

#

when you use the one in IsoPlayer you add the item directlyu

bright fog
#

But why do you give a shit about this function in the first place when that's clearly not how you should retrieve literature items ?

digital osprey
#

because i need to mark items as unwanted

bright fog
#

You want a list of all available literature, then retrieve all literature refs, not the items themselves or idfk what from a create

digital osprey
#

and thats the value the function takes

#

when i provide it it works when i dont it doesnt

bright fog
#

Ok let me ask you one question, are you aware that the information of all available medias is SOMEWHERE ?

#

Right ?

#

The game stores them right ? It doesn't come out of nowhere right ?

digital osprey
#

see thats what i was here for

bright fog
#

Then why don't you look for that ??

digital osprey
#

i cant find it anywhere unless i am looking at an item

bright fog
#

"literatureTitle"

#

You already got your clue here

#

Search where the game sets that for items

#

Trace back to the source

digital osprey
#

ItemConfigurator.java

#

weve been through this

bright fog
#

Idk why you share that class, because that's clearly not where it's stored

upbeat harness
#

Hi all. How can I add my own command to be called from the server console (like a "players" or "help" in original game), for example to forcefully call one of my mods?

digital osprey
#

thats where its assigned i have no idea where its stored but i assume nowhere

#

PrintMediaDefinitions doesnt even hold information for newspapers just fliers

#

it seems to me like its an unfinished system

bright fog
#

They moved it

#

It seems

#
    private static void setMagazineName(InventoryItem item, String type, String name, RecipeCodeHelper.DateResult dateResult) {
        String title = Translator.getText("IGUI_MagazineName", name, Translator.getText("Sandbox_StartMonth_option" + dateResult.month()), dateResult.year());
        String literatureTitle = String.format("%s_%d_%d", type, dateResult.month(), dateResult.year());
        setMediaName(item, title, "literatureTitle", literatureTitle);
    }
#

Like dude, like I said, trace back where they set the "literatureTitle" mod data entry

#

Most likely what stores magazines

#

Here you go

digital osprey
#

ooh amazing thank you

bright fog
#

From there you have all the tools necessary to retrieve every available magazines

digital osprey
#

i shouldve went into that class from the decompiled files was just looking at javadocs

bright fog
#

And stop going in deep shit like that for dear god

silent zealot
#

It's going to be a huge amount of bloat to put every possible piece of literature that could exist in a table.

bright fog
#

Everytime I help you, the next day I see you going deep in something you shouldn't even be looked through

bright fog
digital osprey
#

and i salute you for being there for me lol

bright fog
#

That's what the game does it seems

#
    public static void onCreateSubjectMagazine(InventoryItem item) {
        Magazine magazine = item.getMagazineSubjects().isEmpty() ? Rand.Next(Registries.MAGAZINE.values()) : Rand.Next(Magazine.getMagazineBySubject(item));
        setMagazineName(item, magazine.translationKey(), Translator.getText(magazine.translationKey()), getDate(item, item.hasTag(ItemTag.NEW) ? 1993 : 1970));
    }
queen oasis
#

I keep my deep shit to myself

#

usually. yesterday was an outlier and I paid the price

silent zealot
#

The titles include randomized dates.

digital osprey
#

proper tyvm all, i will eat something now before i sit down to it, starving

bright fog
digital osprey
#

yeah man these names are insane yoou shoould see my code to crack some of them πŸ˜„

bright fog
#

In the screenshot of the Magazine class I sent above, they have set dates no ?

digital osprey
#

yeah the range is there should be all i need

silent zealot
digital osprey
#

yea many magazines

#

but thats what the game does too

#

when you right click add to unwanted

#

it does exactly the same thing

#

so u end up with this massive list

silent zealot
#

the game sets one specific date of the magazine to unwanted, not the entire magazine.

#

So you can collect them all

#

...also what happened to just "hide items set to unwanted"?

digital osprey
#

yea thats what im saying, so its not like my lists will be larger than what the game is doing anyway

bright fog
#

Wait from the code I'm reading it seems even for the exact same magazine, you can end up with two magazines with different dates, even if they are the exact same ones ?

silent zealot
bright fog
#

Also I don't think that's a problem tbf, you could probably just have an option with date XXXX for users to filter out, and then it will filter out every dates

#

Kind of fucked up tho

silent zealot
#

that's what getDate does, picks a month in the starting year or later

digital osprey
#

when i was testing, having multiple copies of the same mag it would hide them all, but didnt test with all, but yes different date means a different item for the purpose of the unwanted system

bright fog
#

But retrieving the title from mod data of generated items is still absolutely not an option and not the way to go

silent zealot
#

OK but why does the mod need such granular options as "exclude TV magaizines from 1972 to 1984"

bright fog
#

Wait that kind of means the game doesn't give a shit then and handles the dates

#

Bcs it gets fed a title with a random date

digital osprey
#

whenever i run it from the console i just need a complete literatureTitle

#

and it works

bright fog
#

But if it hides other magazines with different dates, that means you don't have to bother with that

digital osprey
#

no no it only hides the same one, i meant if i had multiple copies of the same date

#

i spawned like a 1000 mags in debug

silent zealot
digital osprey
#

ah i see i need to test more with tv mags then

#

since i mostly focused on normal ones

silent zealot
#

I still think trying to list every possible title is excessive and tracking generated items will be a massive pain since you need to save the list and sync it through multiplayer and the mod cannot be added mid-save

bright fog
#

Based on what he shared

#

You feed it a title

#

So based on what I said, feeding a title will handle that as a literature item for the unwanted, and not unwanted every items with that full type

silent zealot
#

that's what the vanilla set unwanted does

#

To back up a bit: what exactly is the option(s) you want users to select t o choose what to hide when it coems to magazines/books/videos/etc

digital osprey
#

i have categories, and a ui, select or deselect a category and it would add or remove those items from the unwanted list. for speed i have the lists ready to go with full names for what the setUnwanted function is expecting, and in the case of variant items i need to provide that literatureTitle. so if i the user selects to hide magazines, i want those variants added to the list in the player object

#

so you would only mess with that in your safehouse for example, and then when actually playing the game i want a fast and simple if unwanted hide logic

silent zealot
#

What exactly is the option?

#

All literature? All magazines? All TV magazines?

digital osprey
#

i gave an example, magazines

#

all the other categories work just fine

#

just the ones that have the variants

silent zealot
#

Then you need to revisit how the mod works becasuse setting thousands of potential items as unwanted is not practical

digital osprey
#

but you understand thats what would naturally happen if you play the game and add things as you go?

silent zealot
#

Hence the somment about expanding the logic where it takes action

#

But you didn't want to write an if statement

digital osprey
#

what do you mean

silent zealot
digital osprey
#

to make it work when the player is looking at the item instead?

#

did you even read my answer to you?

#

this is how it currently works

#

i dont like it

silent zealot
#

yeah, you want it to be "clean"

digital osprey
#

i dont want extra logic in onrefreshcontainerinventory or whatever its called

#

since its called so often

silent zealot
#

So cache it

#

when the inventory window is populated and dirty the cache if it is reopened/items move/etc

#

Surely that is better than making setunwanted search through a massive list of items that don't even exist, but that could exist

digital osprey
#

isnt that what onrefreshcontainerinventory does?

#

id rather it search though that list when the user changes the settings and expects calculatioons to happen rather than during gameplay

silent zealot
#

if it already caches (instead of doing it's thing on each frame) then even easier

digital osprey
#

it still fires when you move even if the container doesnt change

silent zealot
#

but the game has to do isUnwanted every time an item is shown

digital osprey
#

no..

silent zealot
#

yes

#

it does

digital osprey
#

it does it when you change the setting

#

and then the check is if unwanted hide

#

only check i want in that update

silent zealot
#

The vanuilla isUnwanted has to run for every item

digital osprey
#

in a perfect world

silent zealot
#

so it knows if it will be wite or grey

#

that is not part of your mod

#

that is how the vanilla game works

#

so if you make isUnwanted slow, that affects that

digital osprey
#

hmm true, but would be nice to test since if the list grows and on top of that im querying every item whether its a magazine has a literatureTitle etc it wont be good either

#

im learning here too but checking these flags have been lightning fast for me even with hundreds of entries

#

comparing strings will not be

silent zealot
#

Starlit updated, Proposition 65 mod is go!

queen oasis
#

my company has less than 10 employees. I can cause as much cancer and reproductive harm as my cold heart desires

bright fog
vast pier
#

What code affects sewing up deep wounds?
I don't like that suture needles are single use items

vast pier
#
if self.character:getInventory():contains("SutureNeedleHolder") or (self.item and self.item:getType() == "SutureNeedle") then
        baseTime = 150;
    end```
Wait does the game not recognize ```Forceps_Forged``` for sewing deep wounds ?
#

Why does it search for the ItemType instead of a tag

bronze yoke
#

probably slipped through the cracks because they do fuck all anyway

vast pier
#

God the medical system is so neglected

#

This started as me just wanting to make suture needles not disintegrate from doing their job,,,, I have opened Pandora's box of medical mishaps

bronze yoke
#

tags weren't implemented until b41 iirc, so anything older than that is likely to not use them

vast pier
#

also
-- a suture needle or a suture needle holder make it faster and less painy
Having a suture needle and forceps does not decrease suture time more than just having one ?

#

I would assume having both would make it faster than just having one

#

otherwise, why have forceps

#

??

#

How does a zombie survival game neglect its own medical system so harshly

vast pier
#

This pains me

#

well I'm gonna try to ignore the impulses telling me to try to fix this, and just do what I originally planned

bronze yoke
#

they don't touch medical much, not much reason to

vast pier
#

Well I still disagree in the choice to have forceps be useless if you are using a suture needle

#

I feel like it should be additional benefit instead of an if or situation

vast pier
silent zealot
#

The entire medical system needs an overhaul.

#

But so do many other systems that just.. exist, untouched, for years

vast pier
#

I wonder how many of these hours are from bug testing and general mod development

bronze yoke
#

this comes up a lot and it always circles back to 'medical is inherently pointless because of the overall design of the game'

#

it sounds good in isolation to have an in-depth medical system but i think it would actually only be annoying

vast pier
vast pier
# vast pier well I'm gonna try to ignore the impulses telling me to try to fix this, and jus...

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

Suture Needles are for Sewing (Flesh).
Just makes it so suture needles are classified as sewing needles.

They do not lose any benefits for suturing deep wounds or anything of the sort, they simply gain the ability to sew and tailor.

Irl suture needles get used for tailoring, and some people even prefer using them.
I see no reason why they couldn't be used for tailoring in game, so I made it so they can.```
#

Very low effort mod, just adds base:sewingneedle to the item's tags

wintry tree
#

Something just isn't falling into place for me. I dunno if it's because I don't feel well tonight or what but I'm not understanding how to simulate a click in Profession select screen. I'm looking through CharacterCreationProfession.lua and trying to do something that is effectively - If profession is Unemployed and the reset traits button is select, move down one profession selection and then reset traits.

silent zealot
#

So if you are "unemployed" and click reset traits it turns you into a ... whatever the first profession is in B41?

#

I'd look for the UI widget that displays the professions and see what it does OnClick.

#

Then mimic that, or just call the OnClick for the desired professions's selection thingy.

glacial moth
#

Regarding the B42.15 -> B42.16 save-break: Is there (or will there be) a technical breakdown of what specifically breaks compatibility? I'm interested in writing a migration utility/mod to help move word save/player data from .15 to .16 because at this point it sounds easier than to reset my MP world πŸ˜… πŸ™ˆ

bronze yoke
#

there isn't, and they've never released something like that before, so i wouldn't expect it

#

the game is java so you can decompile both versions of the save/load code and compare, but it'll likely be a lot to go over

cinder light
#

that would be my solution as well, decompile both versions with vineflower, compare the file sizes / file hashes to see where the differences are, use something like text-compare or notepad++'s text comparison tool to see the differences

hollow oriole
#

Is there any documentation about BodyLocations for build 42? Im trying to make some custom body locations but when i use the syntax of B41 i get errors

wintry tree
# silent zealot So if you are "unemployed" and click reset traits it turns you into a ... whatev...

It's for build 42 actually. I tried but I can't get it to do anything. On click just refreshes a list with whatever occupation you clicked on. It seems me telling it if this occupation is in the list it's actually the next one doesn't do anything. So I'm looking into...creating an invisible button that maybe can use forceClick like for the next and back buttons that moves to the next occupation but I dont' know if it'll work. I haven't gotten it to work yet anyway. This is all that silly occupation locked traits thing that keeps getting more complicated. When I use "reset traits" the rules traits aren't enforced for unemployed occupation unless I click off to any other occupation, then I can click back and it's fixed. Instead of fixing..whatever that is with unemployed I've just decided to try and move to the next occupation. If I can figure that out maybe I can move it back after and have the rules traits enfored for unemployed.

silent zealot
#

In that case, be aware that Build 42.16 is redoing professions

#

So you might want to hold off on teh mod until then to see what changes.

wintry tree
#

I'm aware, I've just worked so much at this I wanted to try and get it working even if I had to redo parts with the new incoming build.

#

Maybe...42.16 will handle unemployed differently

silent zealot
#

It's probably easier to fix whatever the bug is than come up with a crazy workaround involving weird UI behavior.

bronze yoke
#

you likely won't need to change much, it's a balancing pass but not a rewrite

wintry tree
#

It just doesn't make sense to me that the rules trait wouldn't be there after hitting reset traits on unemployed but there after I click off and back again. So I don't really know where to start with that. What I understand is that it can be made to work if I click off and back again

hollow oriole
wintry tree
#

Here's reset traits, not sure why it wouldn't get the profession info the first time - function CharacterCreationProfession:resetTraits()
self:onSelectProf(self.listboxProf.items[1].item);
while #self.listboxTraitSelected.items > 0 do
self:removeTrait(1);
end
self:onSelectProf(self:getSelectedProf());
end

#

And it's only unemployed, it works fine for all other occupations even modded ones.

silent zealot
#

Have you looked into what onSelectProf does?

#

Oh I think I see the problem

#

self:onSelectProf(self.listboxProf.items[1].item);
that sets the select to the first item i.e.:L unemployed

#

that means the next onSelectProf does nothing because self.profession == characterProfessionDefinition

#

Which is fine for vanilla, but not fine when you've added special code in

wintry tree
#

I'm processing, I've already taken my sleeping medication

#

Man I can't even think. Thank you @silent zealot , I will look tomorrow. I'm gonna fall asleep in my chair.

silent zealot
#

I too like to mod far beyond the ability of my body to sustain this. Get some sleep!

cunning kestrel
#

Okey so I need some help:

cannot read field "projectilered" because "isobullettracereffectsconfigoption" is null at isobullettracereffects.createeffect(isobullettracereffects.java:204)

I can't figure this out and there are like 4 mentions across the whole internet and 0 solutions. (Happens when firing custom guns, crashes game.)
Any leads or ideas welcome πŸ™

silent zealot
#

back up slightly - you're making a gun mod?

#

And this happens when you fire your gun?

cunning kestrel
#

Correct, correct

silent zealot
#

First, is there any lua code in your mod or just item script/model/etc

bronze yoke
#

i swear i've heard other people talk about this issue either here or in the modding discord but i don't remember what the solution was

silent zealot
#

was it "no muzzle attachment point"?

cunning kestrel
silent zealot
cunning kestrel
silent zealot
#

So does your mod have lua scripts (other than loot distribution) or not?

silent zealot
#

If you remove the custom functionality, do you still have this issue?

#

we're trying to isolate the problem here; custom lua can do all sorts of crazy stuff, but it might just be a mistake in a script.

cunning kestrel
#

Huh why didn't I think of that... So focused / blind sighted.

silent zealot
#

And, just in case my vague memory is correct... does the gun's model script include a muzzle attachment point?

#

it's easy to get stuck when you're deep in the code

cunning kestrel
#

The thing is I know other gun mods didn't have this issue and for example the vanilla 9mm can shoot fine, but custom gun 9mm crashes

#

Even though it's suppose so use/reference the same tracer_effect file from vanilla

silent zealot
#

normally you have no need to touch anything related to tracer.

cunning kestrel
#

I have no specific code related to any tracer or like missed shot effect.

silent zealot
#

try this then: make your custom gun an exact copy of a vanilla gun except thr the item name.

#

Confirm it works. Then piece by piece, turn it into your custom gun.

#

And see where it starts to have issues.

silent zealot
#

Like the way random mods will cometimes cause an error when you get into a car and the dashboard doesn't work, even though the mods have nothing to do with cars.

#

Anyway, I've found the best way for weird errors that don't seem to apply to your code (even though your mod causes them) is to just try and isolate which thing in your mod causes it to a smaller and smaller subset of the mod.

cunning kestrel
#

Hmm, yeah,I'm aware(I like and try to keep clean code though). I should indeed take a step back and actually do some root cause analysis, instead of being sucked in and Lazer focused on fixing. Would have been nice to just find a solution and move on
But I'm sure finding the cause is the right way. Just odd it's so rare/unknown.
Thanks for grounding me πŸ‘Œ

#

It's just that it makes no sense... Why would it work differently with the same code in 2 nearly identical situations...

silent zealot
#

If it'ss nearly identical, focus on the differences.

cunning kestrel
#

Watch it's gonna be something stupid. It always is haha.

silent zealot
#

And eliminate them until it works, and it was probably the last difference you removed.

silent zealot
cunning kestrel
#

Yeah... I'm also struggling with a recipe or 2 that's "not finding it's item" might be an order of loading thing... Tbd

cunning kestrel
rich reef
#

Hey all, I'm modding for B41 Still, and while using InventorytemFactory to create an item and then place it in an inventory, it seems that other players on our server cannot see that created item. Is there a missing sync function I need with this, or an alternate way to instantiate the new item? Please let me know, thanks!

#

Correction, this is not a player inventory, it's a worldObject's inventory.

cunning kestrel
#

Question: Does load order matter for items and recipes ?

Or does it fix that in the backend like read first and instantiate recipes as last or something.

rich reef
#

I'ved used AddItem, and just tired addItemOnServer. if I use AddItem, it shows for myself/the other client directly, but not for anyone else. if I use addItemOnServer, it does not show until I leave/re-enter the area. Seems like a sync issue.

#

Albion has a distinct definition of how load order works. As far as I've seen, it's based on the file name, and any requires you use.

cunning kestrel
spiral granite
alpine zenith
#

is there a source of tutorials for developing mods for build 42 so i can get the hang of it i have a dream mod i wanna create but i first need to get the proper skills and experience

bleak remnant
#

did the 42.16 break something on most mods?

bright fog
azure girder
#

The mods I use seem to be working just fine. It feels like the update is going light on mods this time

alpine zenith
fleet bridge
#

just look at vanilla lua code

#

those are the best references at the moment

knotty stone
#

really interested where these false positives come from, console is silent

bright fog
#

Notably the Scripts page which documents methods to define different elements in the game

silent zealot
#

Huuuuuuge number of java file changes in 42.16.

#

Far too many to go through, so I guess I'll just go to bed and check my mods tomorrow

#

Raccoon kits can now be killed by hand 😒 🦝

bronze skiff
#

Help a confused guy out please πŸ™‚ Im trying to change some B41 recipes, but I end up with duplicates when creating a mod with later load order, instead of overriding the existing one. What am I doing wrong?

Take this for example:
recipe Make KZ1K Windshield
{
category:KI5,
\Ingame names:Mechanics,
SkillRequired:Mechanics=1,
keep Scalpel,
Windshield3,
Result:KZ1Kwindshield3,
Time:200,
}

I want it to require Mechanics, say 6
recipe Make KZ1K Windshield
{
category:KI5,
\Ingame names:Mechanics,
SkillRequired:Mechanics=6,
keep Scalpel,
Windshield3,
Result:KZ1Kwindshield3,
Time:200,
}

But then I end up with both showing in the crafting menu.. why? 😭

Thank you!

thin swan
hollow oriole
#

Hi good morning, im trying to set up some new body locations using the new registries method, but im having a little of hard time to make it work, if anyone have any ideas or further documentation about how can i properly code it, it would be deeply appreciated, thanks in advance!

spiral granite
#

Hi, I'm creating a mod that adds a can of beer, but for some reason it doesn't spawn in the game (even though it did before, and I didn't make any changes), Does anyone know what the reason is?

spiral granite
stuck tapir
#

Didn't see any changes listed in the devlog that would affect animations. Any ideas on what caused so many to break?

bright fog
#

The only animation change I know of rn is the 180 turn animations are in their own AnimSets

stuck tapir
#

A lot of vanilla animations for crafting, bandaging, etc no longer play when sitting. Couple of modded animations also just default to the 'hands up' emote as well.

willow tulip
#

Major version update that... Doesn't brick with the old version of realistic car physics installed?

#

Very sus.

bright fog
willow tulip
#

thats what usally happens anyway.

#

Bonus fun when the PZ bug report forum/steam discussions are full of people reporting java errors my mod causes to TIS, in functions that don't exist in the vanilla java.

buoyant violet
willow tulip
#

checks bug report forum for latest fun

#

[42.16.0]Infinite Trait Points Seems legit.

dull moss
#

How can one grab current tick/time or something. In a similar way how print puts this stuff in console

LOG  : Lua          f:4266, t:1774897444100, st:25,074,888>
bright fog
#

What's your goal with that ?

dull moss
#

to have my prints in separate file

#

to not clutter the console

bright fog
#

I invite you to my remark about prints on the wiki

cloud marten
#

Im looking for way to upscale tiles, tried in b41 with no success maybe something changed in b42 ?

bright fog
#

And anyway if you REALLY want to do that AFTER reading that, I suppose you should search in their logging system itself

dull moss
#

thats why my pritns are behind a sandbox option

bright fog
dull moss
#

its server prints

#

not lcient prints

#

tldr i know what im doing

bright fog
#

What are those prints for ?

cloud marten
bright fog
dull moss
cloud marten
bright fog
#

By design that's impossible

#

Allowing it would most likely require major rewrites

bright fog
dull moss
#

so i can get bug reports and not spend extra time figuring whats wrong

bright fog
#

But what do you print ?

dull moss
#

like what do you want? to see my print lines? This is not XY problem, the qeustion is precisely how to grab current tick/frame

#

There are dozens of prints that helped me before and made me see problems in reports in 30s

bright fog
#

I already answered you on that but like I mentioned in the link I sent you, prints are inherently bad because of the impact on performance they have

dull moss
#

I am aware that they can impact performance, this is why they are disabled by default, and thats why I have options to enable them so when something is wrong people can submit proper bug reports

bright fog
#

What's the reason for it be server sided ? Is it a server sided mod only ?

cloud marten
dull moss
cloud marten
bronze yoke
#

it's obviously *possible* to change but i don't see them having any interest

bright fog
#

B34 πŸ’€

bronze yoke
#

it's a lot of technical work, in b42 they even removed 1x textures because of the complexity of supporting both

bright fog
#

Another reason they likely will never is because of the style

bronze yoke
#

a commonly reported bug was... accidentally turning on 1x textures and not knowing why the game looks like shit now πŸ˜…

cloud marten
cloud marten
bright fog
bright fog
#

Even B42 got graphic updates, did you forget about lighting ?
Did you forget about models for items ? That's B41 no ? Or was it B40 ?

bronze yoke
#

i realise most people started playing in build 41 so they don't know how abysmal build 40 looked

#

switching between stable and unstable felt like playing entirely different games

bright fog
#

Yea but even me I'm aware of the massive gap in graphics that happened around these time

#

Saying there hasn't been a graphic update in 10 years is absolutely fucking insane lmao