#mod_development

1 messages Β· Page 492 of 1

weary matrix
#

but I don't think normal food items have it IIRC

blazing radish
#

like in the sleeping pills, afaik you can die if you eat too much

#

but there is no poison levle on them

weary matrix
#

no clue really, you'd have to dig the java sources

blazing radish
#

I need to decompile them?

#

or I can open them in notepad ++?

willow estuary
#

medical is for the loot scarcity settings in sandbox settings, alwaysWelcomeGift is old NPC code, eatType is for custom "eating actions"

blazing radish
weary matrix
#

@blazing radish no source code without decompiling

blazing radish
#

I thought the wiki was wrong but I've eventually found all the vanilla items and Iw as really susprised to see pontential poison stuff like sleeping pills without posion values

#

I guess I'll have to equip my minning outfit and start digging files πŸ˜…

weary matrix
#

@blazing radish only reference I can find for "medical" in java source is this:

zombie/randomizedWorld/randomizedBuilding/RBShopLooted.java:      this.buildingList.add("medicaloffice");
blazing radish
#

uhm...

weary matrix
#

so it;s probably as blair algol said, just used for distribution

blazing radish
#

so, how the hell the game determines which item can lethally poison you if you consume too much or if you are drunk?

#

πŸ‘€

weary matrix
#

probably in the java source

#

have to go now, will be back in an hour or two

blazing radish
#

I hope I can have some answer to share with you at that time πŸ˜…

hollow shadow
#

anyone know where to find the injuries in the pz files that go onto this uI?

#

I checked textures / bodydmg but im not sure if that is UI or the textures for the playermodels

ruby urchin
#

UsegetModData() if you want add a variable to a entity

blazing radish
#

this is ok?

#

h... How I do a "coconsole" on discord?

#

πŸ˜…

#

hello

#

ah yes

#
 item HydrogenPeroxide
    {
        UnhappyChange    =    20,
        Type    =    Drainable,
        ThirstChange    =    -10,
        UseDelta    =    0.1,
        UseWhileEquipped    =    FALSE,
        DisplayName    =    Bottle of Diluted Hydrogen Peroxide,
        DisplayCategory    =    Item,
        CantBeFrozen    =    TRUE,
        Icon    =    WaterBottle_Full,
        Weight    =    0.9,
        AlcoholPower    =    5,
        Tooltip = 
        Medical    =    TRUE,
        Poison    =    true,
        PoisonPower    =    1,
        PoisonDetectionLevel    =    7,
        CustomContextMenu    =    Drink,
        ReplaceOnDeplete    =    WaterBottleEmpty,
        EatType    =    WaterBottle,
        StaticModel = WaterBottle,
        WorldStaticModel = WaterBottleFull,
        CustomEatSound = DrinkingFromBottlePlastic,
    } ```
#

ah no

#

πŸ˜‚

#

well, supossedly that item should work like bleach/alcohol right?

hollow shadow
#

from the look at the script, yes

blazing radish
#

nice

hollow shadow
weary matrix
#

@blazing radish mmm I guess I Would use BleachBottle instead of WaterBottle, just in case some code is acting differently if it's a water bottle, also for visual guess it would be best

hollow shadow
#

you forgot to add tooltip

blazing radish
#

oh I know

hollow shadow
blazing radish
#

I haven't writte anything yet

hollow shadow
#

no sure if that might cause issues

blazing radish
#

I need to do a realistic but fantastic description at the same time

#

and I'm still not sure on which name I'll use for the fantastic item

#

so I'll left it blank for now

willow estuary
#

Yeah, just don't leave empty fields like that in a script when you test things because it can make the game go all sorts of haywire,
you can comment them out as such
/*Tooltip = */

#

Formatting is very, very fussy with some aspects of scripts, and it can be a real headache when the game chokes on bad scripts.

blazing radish
#

oh I see

#

I haven't imade the script yet, I wanted to be sure I wasn't missing somehting important for the functionallity part

blazing radish
#

I've had some runs without finding bleach in a long time

#

and hydrogen peroxide is safe to consume in low quantities under 5% of purity/concentration

#

so the idea is getting a little non lethal poison

#

I guess I'll have to tweak the values by trial/error later

#

to become queasy but not much further into the poisoning

weary matrix
#

@blazing radish oh ok then, makes sense, don't listen to me πŸ˜‚

#

I was just thinking out loud

blazing radish
#

nah don't worry, anything helps

ruby urchin
#
local source = getPlayer()
local Player = EasyModdingAPI.Player(source)
Player:setTimeAction({
    time = 100,
    stopOnWalk = true,
    stopOnRun = true,
    start = function(action)
        action:setActionAnim("Loot");
        action:setAnimVariable("LootPosition", "Low");
        action:setOverrideHandModels(nil, nil);
        print("Start")
    end,
    perform = function(action)
        print("Finish")
    end
})
weary matrix
#

nice

exotic ember
#

Anyone familiar with the '82 Oshkosh M911 + Military Semi-Trailers mod?

weary matrix
#

wording might not be perfect, feel free to tell me about it too

willow estuary
weary matrix
#

@willow estuary well, idiots can still have knowledge. Not calling you an idiot though, you did πŸ˜…

willow estuary
#

πŸ€ͺ

#

But yeah, looks good and useful for sure!

errant meteor
exotic ember
exotic ember
# bold cobalt yeah

you had any trouble finding the parts? Ive only ever found the fuel tanker and front on different playthroughs and teleporting between different car parks.

Is there a particular place theyre likely to spawn? And is there any other issues, saw some stuff on the steam comments about it conflicting with other mods like better towing

hollow shadow
#

never used that mod before

bold cobalt
exotic ember
#

tbh im more just interested to see if it works right before just adding it without knowing

bold cobalt
#

@exotic ember they do work, just not sure of the actual chance one will spawn.

exotic ember
sour island
#

Did you manually describe each event?

weary matrix
#

@sour island yes I did! No pressure man, take your time, nothing urgent, I just need review at some point. For some events, even if I checked the source it was sitll a bit of a guesswork

#

This is the JSON file I use to generate the wiki pages automatically πŸ˜‰

sour island
#

Ooh nice

weary matrix
dusty moat
#

Someone knows a hunting mod?

blazing radish
dusty moat
#

So.. you dont know one?

blazing radish
#

there is the whole list of hunting mods wdym?

#

pick whatever you like more based on description and user feedback

ruby urchin
#

Wait for fauna update

dusty moat
weary matrix
#

πŸ˜‚

ruby urchin
#

that's what there are, in PZ doesn't exist the conventional hunting

weary matrix
#

but I've read somewhere it's going to be added right?

#

after MP IIRC

ruby urchin
#

Yeah, in some update, I don't remember which one lmao

blazing radish
#

that looks absolutely beautiful

#

I wonder if zeds will be interested on them

#

I... Wonder if they can get infected too

drifting ore
#

anyone know why this happens?

#

i have a custom sound but it doesn't play and instead loads 556 single-shot and burst sounds

hot patrol
#

anyone know what unhappyness is called in the code? Like if I want something to decrease depression how do I write it?

#

for example boredom is "BoredomChange ="

#

nevermind I found it

#

UnhappyChange =

blazing radish
#

I was looking out to help you out and noticed somehting, again

#
  • wait a sec
#
    {
        Weight    =    0.2,
        Type    =    Drainable,
        UseDelta    =    0.1,
        UseWhileEquipped    =    FALSE,
        DisplayName    =    Antidepressants,
        Icon    =    PillsAntidepressant,
        Tooltip = Tooltip_PillsAntidepressant,
        StaticModel = PillBottle,
        WorldStaticModel = PillBottleGround,
        Medical = TRUE,
    ```
#

ehere the hell is the value to decrease depression there?

#

πŸ‘€

#

or that's done in another script and not in the item itself?

willow estuary
#

The pill stuff is done in the java, and just uses the pill name as the parameter to determine effects, I believe.

The PZ code is not consistent with this stuff, in that different systems were made at different points in the development by different people.
It's getting more consistent, but there's a lot of rough edges like this.

blazing radish
#

but it would be perfectly fine to make that kind of stuff work with the item script?

#

I mean, adding the "unhapiness" reduction on the item itself in this case

willow estuary
#

I wouldn't think so, but that's just my off the cuff estimation? Really, for anything ambitious it really comes down to combing through the lua and java yourself?
I mean, just in that once you get it down you;ll get answers that way, people's opinions are unreliable, etc.

If you can forgive a weird metaphor, I take the approach that the code itself is the Torah and I'm a Rabbi, if that makes sense? The true answers are in the code itself.

blazing radish
#

Yeah I understand

willow estuary
#

Myself, I don't ask or look at documentation anymore, I get better results from combing through the code itself. Granted, it's a process to learn how to understand it.

ruby urchin
#

Item.java says you can

else if (trim.trim().equalsIgnoreCase("UnhappyChange")) {
    this.UnhappyChange = (float)Integer.parseInt(trim2);
}

try UnhappyChange = -10.0

willow estuary
#

...and also, when I say that, my "consulting the Torah" method works for me, that's me? But different individuals learn differently, so what works for one person might not work for another? I just feel like that once you know how to look at the code, you get better and faster answers that way?

#

Well, not only consulting the code, but also extensive trial and error.

blazing radish
willow estuary
#

Bleach is a food category item, whereas Pills are not food category items, but drainables.

#

food =/= drainables

blazing radish
#

base don decriptions on steam I thought it was the same here

#

but I'll take tjat approach from now on

hot patrol
blazing radish
#

in fact I share the logic on the mod page itself if I can

willow estuary
#

Now yes, if you make your "pills" food items and not pills, those paramters will work.

blazing radish
hot patrol
#

Oh I had already figured it out. I was making a magizine. using the comic as a base got me the answer since that adds happiness

#

but thanks anyways

blazing radish
#

np, sorry for not giving a propper answer on time πŸ˜…

hot patrol
#

all good.

zealous wing
#

So I am trying to figure out how to get lua to check if an item is cooked or not, and I can't quite get this lua to work:

function Recipe.OnTest.BreadDough(sourceItem, result)
    if sourceItem:getFullType() == "AAApoc.BreadDough" then
        return not sourceItem:isCooked()
    end
    return true
end```
What am I doing wrong?
#

I thought return not would work but it didn't. πŸ˜›

blazing radish
#

πŸ‘€

willow estuary
#

I don't see the print statements....

weary matrix
zealous wing
#

So I figured it out, return not does work. I just forgot that the item I created I removed, so AAApoc.BreadDough should be Base.BreadDough.

willow estuary
#

Oh you!

zealous wing
#

Yeah, my brain was in a bad place last night.

blazing radish
willow estuary
willow estuary
# zealous wing Yeah, my brain was in a bad place last night.

Anyways, just as a note, when you get more comfortable with that sort of logic, you can do something like

local doughNotCooked = ( sourceItem:getFullType() == "AAApoc.BreadDough" and not sourceItem:isCooked() )
print ("Is it uncooked Bread Dough? - " .. tostring(doughNotCooked) ) -- comment out later, just for evaluating the code while devleoping 
return doughNotCooked or false

Also, didn't we figure out ReplaceOnCooked would work for this?

hot patrol
#

when making clothing icons is there a way to have the game change the color tint for other varients automatically or do I need to make each one individually?

drifting ore
#

i'm guessing the workaround for my sounds issue would to be to make a new ammunition type, so i'll try that first

zealous wing
#

Most other items I wouldn't have a problem with.

#

And yeah, that implementation's a bit more elegant I think. πŸ˜„

hot patrol
#

when making clothing how do I choose the locations it protects and how damage resistant it is? I'm not seeing that anywhere

hot patrol
#

nice, thanks.

#

and I assume neck protection is it's own think since that is how it looks

#

and what about damage? I'm trying to make something highly protective but very fragile. Like 1 save and ruined.

drifting ore
ruby urchin
#

You define that

ScratchDefense = 50
biteDefense = 50
bulletDefense = 50

all protection in 50%

hot patrol
#

I know the protection but not the damage zeds do to it

#

like when they attack you what determines how much it gets ruined

ruby urchin
#

from what I see those variables are inaccessible, they cannot be changed

hot patrol
#

damn

#

that sucks

#

guess my goofy ass pillow armor is gonna be a bit better than I intended

#

so wait what is NeckProtectionModifier = 0.5,

#

if neck is a blood location

ruby urchin
#

it's just what it is, if you set for example ScratchDefense = 20 to a clothes included with BloodLocation = Neck and then add NeckProtectionModifier = 0.5, now your neck protection should be 10%

#

20*0.5 = 10

hot patrol
#

ah ok. So if I don't include it then neck is fully protected i assume

ruby urchin
#

exactly

hot patrol
#

nice

#

thank you

drowsy needle
#

Oh. Is that why stuff like bulletproof vests don’t completely protect from torso bites?

zealous wing
#
        {
            Weight                =    0.6,
            Type                =    Food,
            DisplayName            =    Pan of Raw Burger Buns,
            Icon                =    AAABurgerBunPanPrepRaw,
            IsCookable            =    TRUE,
            DangerousUncooked    =    TRUE,
            MinutesToCook        =    10,
            MinutesToBurn        =    20,
            DaysFresh            =    2,
            DaysTotallyRotten    =    4,
            HungerChange        =    -15,
            ThirstChange        =    15,
            UnhappyChange        =    10,
            Carbohydrates         =     99.0,
            Proteins             =     17.7,
            Lipids                 =     6.66,
            Calories             =     532.0,
            //ReplaceOnCooked        =    AAApoc.AAABurgerBunPanPrepCooked,
            ReplaceOnCooked        =    AAApoc.AAABurgerBunPan;AAApoc.AAABurgerBun;AAApoc.AAABurgerBun;AAApoc.AAABurgerBun;AAApoc.AAABurgerBun,
            ReplaceOnUse        =    AAABurgerBunPan,
            WorldStaticModel    =    AAABurgerBunPanPrepRaw,
        }```
So credit to Algol at pointing out that the ReplaceOnCooked function has some extra functionality in that it can return multiple items. My burg pans can now be effectively streamlined in terms of steps needed to make food.
willow estuary
#

Huh, never thought to use it to make "batches" but that's giving me some ideas!

zealous wing
#

Batches is a good way to put it, yeah.

#

It's kinda situational though. πŸ˜„

plush bone
#

is better lockpicking good?

zealous wing
#

It has minigames like the ones in Elder Scrolls and Fallout. πŸ˜„

drifting ore
#

anyone know where to find the icons for things?

#

i'm going to replace the ones for my mod, i just need to know the dimensions

drifting ore
#

nevermind solved

zealous wing
#

lol, was about to answer.

slate dagger
#

i was wondering, is there an event that triggers after character spawns?

slate dagger
#

well, that is what I thought, but when trying to add items to a character after the β€œNew Character” is selected upon a character recently dying nothing happens

#

it seems when i check the player it is non-existent

ruby urchin
#

so this may help OnCreatePlayer

slate dagger
#

ok, I will give it a try

#

so that one happens every time the character spawns, I am wondering if there is an event related to creating a new character after the death of the original but triggers once. i thought NewGame would work but it still has the dead player at the time

weary matrix
#

all right, downloading the 2500+ mods available on Steam Workshop!!! πŸ˜‚

#

"only" 2100+ left πŸ˜„

slate dagger
#

that is a lot of mods lol

weary matrix
#

that's not a lot, that's ALL of them πŸ˜‚

#

well all from steam, guess there's also plenty of mods out of steam

#

but.... I will be able to make a database of which mod is using which Lua Event and in which file of the mod, so guess what?

#

We can have real life example for each event in the wiki!!! πŸ˜„ πŸ˜„ πŸ˜„

#

or well maybe not the examples themselves directly in the wiki, but at least for each event we will be able to know which mod is using it

#

and since I have a list of all deprecated Lua Events, I can also tell which mod is using depracted Lua Events

slate dagger
#

oh, which ones are deprecated?

weary matrix
#

meaning which mod are broken

#

is that all you got from what I said??? πŸ˜‚

slate dagger
#

lol

weary matrix
slate dagger
#

ahh ok, interesting

#

i must not have had that version

#

or well, it wasn't there on my instance i was looking at

#

so you plan on reading all files with a text reader

weary matrix
slate dagger
#

gotcha

weary matrix
slate dagger
#

the smart way to handle it πŸ˜‰

weary matrix
#

πŸ˜‰

blazing radish
#

holy fuck co, the absolute madman

#

πŸ˜‚

slate dagger
#

quite

#

but i admire the spunk

blazing radish
#

me too

#

doign mods it's like building a castle: you can't do it on your own, you need more people

slate dagger
#

yeah

#

this one mod here is tricky, but luckily i know more than 1 way to skin a cat

weary matrix
#

@slate dagger what mod are you coding atm?

#

@blazing radish how cool is that man???? πŸ˜„

slate dagger
#

working on a mod that has traits that grants equipment

weary matrix
#

traits that grants equipment? πŸ€”

#

like the fireman has an axe?

slate dagger
#

yeah, something like that

weary matrix
#

or well not profession, traits, but I guess the idea is similar

slate dagger
#

yeah

#

for some reason it can't seem to find an item, CannedBroccoli

weary matrix
#

mmm have you found some in the game?

slate dagger
#

have actually made a can

weary matrix
#

@slate dagger wait, which trait gives you some canned broccoli? Like vegan? πŸ˜‚

slate dagger
#

lol

#

one of my traits grants some basics for survival πŸ™‚

weary matrix
#

basics for survival == canned broccoli? πŸ˜‚

slate dagger
#

lol, well, that is 1 item

#

in the list

weary matrix
#

nice

#

don't worry I'm just all excited and giggling at the same time, don't take me too seriously πŸ˜„

slate dagger
#

lol, no worries πŸ™‚

#

how many mods left?

blazing radish
weary matrix
#

I can't wait to be using it

blazing radish
#

yeah me too, that will help me a lot to understand the source code and how we can man ipulate it through lua

weary matrix
#

I should be good

#

@blazing radish when I'm done downloading I'll only keep the lua files, so it should be less than a GB hopefully

#

also I delete the mods if they don't have any lua files (usually maps)

#

so that's saving some space too

blazing radish
#

shit sounds like a lot of work anyways

weary matrix
#

don't worry I'm having my fun πŸ˜‰

blazing radish
#

no doubt! I wish I could help but welp, I can't even guess how to add tooltips without overriding yet πŸ˜…

weary matrix
#

@blazing radish you should check the CommunityAPI, mostly @thin hornet is working on it at the moment and I'm pretty sure he added support for tooltips

blazing radish
#

that's a mod?

#

or it's on github?

weary matrix
#

on github for now, but should be available pretty soon on steam, as a library for other mods

#

if not already on steam, I'm not sure

blazing radish
#

in any case I still have to learn this

#

but I'm motivated... yet

slate dagger
#

finally... figured it out

#

huzzah, it was tricky, but i did it

#

lol

weary matrix
#

1254 mods, getting first half done

#

I cleaned a bit some mods, like there was approx 10 mods with more than 1GB, so I deleted every file that is non lua from those

#

so now it only takes 11GB for 1254 mods

blazing radish
#

those were map mods?

weary matrix
#

of course

blazing radish
#

because afaik the meshes and textures are quite small for this game

weary matrix
#

I still found a Lua file for a map mod that is more than 5MB πŸ˜‚

blazing radish
#

D:

weary matrix
#

it's mostly the .lotpack, the .lotheader, and the .bin that takes a lot

#

but I don't need anything except lua files, so...

#

oh and the big images to show the rendered map too πŸ˜…

royal ridge
#

is there a lua event that triggers when the game is closed? like exiting to the main menu when you have finished a session?

weary matrix
#

mm I don't think there is

#

@royal ridge what do you need it for?

royal ridge
weary matrix
#

@ruby urchin what are you trying to do ?

blazing radish
#

@weary matrix it's allowed to send files in this channel to see if I'm doing something wrong?

#

or it's better to send chunks of code?

ruby urchin
royal ridge
#

I found OnSave and it seems to only run when the player quits, does anyone know if it runs at any other time?

bronze skiff
#

Is there any modder active adding features to the building/carpentry system? Like new buildings/tiles? Im interested in having more pre-fab blueprints available for MP, like a watchtower, wind/watermills, root cellar. I discussed the blueprint idea on reddit a while back. Id like a function to cooperate on a build. The initiating builder meets the lvl reqs, a vague outline of the chosen building appears where builder placed it, with a interactive item in the middle, the blueprint. The bp when used tells you the amount of resources needed and time left to put into the build total. This way multiple characters can put in time if they have some minimum carpentry skill (not necessarily equal to the blueprint reqs - to simulate the oversight of a experienced builder/the initiator). Even if not able to help build, other characters could add resources needed by reading the blueprint and leaving them at the site. Id love for something like this to be developed, both for the cooperative features and the possible way for different professions to "weigh" heavier.
Thats even another possible mod, how you/the character with high enough level in a skill might give/get bonuses to/from others.

weary matrix
#

@royal ridge when you sleep

slate dagger
#

am i mistaken or is there a "refreshBackpack" function that is related to an inventorycontainer?

royal ridge
weary matrix
#

@royal ridge guess I should add this info to the descriptions of the wiki

#

@bronze skiff so what are you waiting for?

bronze skiff
weary matrix
#

@bronze skiff that won't happen by just waiting πŸ˜‚

bronze skiff
#

True indeed! Well, Ive started looking into easier things, like adding items.. so I have about 37.5 xp right now.

slate dagger
#

the baby steps

#

i am running into timing issues right now

#

the fun of timing πŸ˜„

royal ridge
#

is there a function to check if the player is sleeping

#

found it I think

#

isAsleep()

slate dagger
#

yeah

#

that should do

#

finally... i have completed this feature to my mod

#

does anyone know a way to access the game start & current day before fully initializing the world?

#

i haven't seen a way to do it, but doesn't mean i am 100% accurate

blazing radish
#

there is a mod that's based on days passed, it may help you

slate dagger
#

i wrote that πŸ™‚

blazing radish
#

lmao

slate dagger
#

good mod, I recommend πŸ˜‰

blazing radish
#

ahahah

#

I've already subbed

#

a few days earlier

slate dagger
#

oh cool, thanks 😊

dry chasm
slate dagger
#

yeah, I couldn’t find a way

dry chasm
#

For example, character specific will likely not work

slate dagger
#

the problem is the linked mod doesn’t work if you just load a game where you died

#

i couldn’t find a way to access that data to calculate the free points you get normally

#

it only works if you create a character right after dying

#

because the game time/clock has been initialized by then

dry chasm
royal ridge
#

at the start of the game, you could save the date in global moddata

#

when the character dies save the date in global mod data

#

and compare the two to get days passed

dry chasm
#

^- question is if the global moddata is available for whenever he wishes to access it

royal ridge
#

It is loaded quite early, dunno if it is before time/clock tho

dry chasm
#

hence It's something that'd be worth a try

royal ridge
#

it would be worth trying I think

#

you can run global mod data in 'OnLoad'

#

or 'OnGameStart'

#

You could maybe even write the data to a text file

#

and read the text file on load?

dry chasm
#

would require too much tinkering to not fill up with long gone save files and all.

royal ridge
#

oh yeah, good point, it saves in lua folder

dry chasm
#

or the mod's folder

#

you have the choice in that regard, but not save folder IIRC

royal ridge
#

unless you create a folder during the process with the save game name

dry chasm
#

which you'd then still have to remove upon removal of the actual save game, so that is imo not a solution as said before πŸ˜›

royal ridge
#

oh yeah

dry chasm
#

or might be but not great without removing old stuff

royal ridge
#

@slate dagger could always add a note saying it sticks around

#

or even they use mod options (or something similar) maybe an option that clears the folder? I dunno if that is possible

dry chasm
willow estuary
#

People use every mod in a collection w/o having any idea what mods they are using as well πŸ€ͺ

royal ridge
#

I've noticed that, I have had a few of my mods added to collections saying "All work together" when my distro lists weren't even fixed

dry chasm
#

Collection of 500 mods for pz? Great, lemme download and activate them all
"Hmmm, that red box in the bottom shows 9239 and rising.... well who cares!"

willow estuary
#

Well, I mean, a collection could be called "All of these mods are tested and work together with the latest build"
But it could have been made 5 years ago. And there's nothing keeping, say, a toddler or an insane dog from making that collection?
People put far too much faith into collections.

dry chasm
royal ridge
#

or even calling it "Best and most updated collection, with everything working" and adding nothing but mods that don't work

worldly olive
#

People never use the "Last Updated" information that is a must to check for either collections and mods... reading is overrated

willow estuary
#

To be fair, people could also be children, or new to computer games, or speak another language than the information on the workshop page, or all 3? Or have reading comprehension issues.
The whole ball of wax is a messy issue.

slate dagger
#

yep exactly

willow estuary
#

The fact that it's common practice, I gather, for people to use 100+ rimworld or skyrim mods, doesn't help either. Especially with how PZ is not finished, and even the current beta build isn't stable.

weary matrix
#

the number on the left indicates how many mods use this event

#

I wasn't expecting this at all! πŸ˜‚

#

only a small part of events are actually used in mods (haven't checked for the lua from the game though)

hollow shadow
#

"OnFillWorldObjectContextMenu.Add" is that why my game freezes for 2 seconds wheni rightclick the ground?

weary matrix
#

@hollow shadow probably yeah, but could be something else too I guess

hollow shadow
#

Happened while playing splitscreen modded

golden totem
#
{
    imports
    {
        Base
    }
    item PizzaS
    {
        HungerChange    =    -23,
        Weight    =    0.4,
        Type    =    Food,
        IsCookable    =    TRUE,
        DangerousUncooked    =    TRUE,
        UnhappyChange    =    25,
        MinutesToBurn    =    15,
        DisplayName    =    PizzaS,
        Icon    =    TVDinner,
        MinutesToCook    =    10,
        UnhappyChange    =    20,
        Carbohydrates = 81,
        Proteins = 30,
        Lipids = 25,
        Calories = 670,
        Packaged = TRUE,
        GoodHot = true,
        BadCold = false,
        StaticModel = pizzam,
        EatType = plate,
        WorldStaticModel = pizzam,
    }
}```
#

i'm trying to get my model to load in but it's not happening, is something wrong wtih this?

hollow shadow
#

yeah

golden totem
#

i have the model located in media > models_x > worlditems foder

hollow shadow
#

you need a script that tells it to load the models too i think

#

1 sce

#

model ScrapWorkbench_Ground
{
mesh = WorldItems/ScrapWorkbenchGround,
texture = other/ScrapWorkbenchGround,
}

#

@golden totem you got the texture too?

golden totem
#

yeah i do

#

alright, let's see

#

i love you @hollow shadow

#

it works πŸ˜„

#

now to figure out why the texture is so dark

drifting ore
#

"SoundVolume" changes the ingame volume, right?

#

currently trying to make the gun sound not so loud without directly modifying the file

golden totem
hollow shadow
#

Is there a way to allow a recipe to use broken items?

#

i tried "Nobrokenitems : false,"

slate dagger
#

hmm.. i know you can fix broken items

#

but i don't know about using them in a recipe

ruby urchin
hollow shadow
#

uhhh

#

so i just remove the line i tried?

ruby urchin
#

yes, try it, I've never touched recipe, but that's what I see it doing in the source codes

willow estuary
#

One thing I do when trying to figure out recipe stuff is make multiple, different versions of the same recipe, with different names, to test parameters like that.

ruby urchin
#

gg πŸ˜…

hollow shadow
#

so we tried: nothing, NoBrokenItems:False

#

and nobrokenitems:true speaks for itself

#

im making a recipe where i can recycle broken weapons so people dont drop them on ground which causes lag on server or lategame

slate dagger
#

ahh, that is a cool idea

#

using it as a repair option

#

maybe you can do this

hollow shadow
#

wdym

slate dagger
#

give the player an option to right-click the item and make it a "Scrappable Item"

#

turning it into a different item all together

hollow shadow
slate dagger
#

that can be used to repair an Axe or whatever weapon

hollow shadow
#

which didnt work

hollow shadow
slate dagger
#

oh, i was just thinking maybe adding to the right-click context menu

#

of the item itself

hollow shadow
slate dagger
#

and do some code that basically removes the broken item and replaces it

hollow shadow
#

You can see i can use broken tool head just fine in recipe becouse its not a broken weapon

#

but i cant use the spear becouse it is a broken weapon

#

i was certain that there is a way to use broken items. But i think that feature got removed?

slate dagger
#

maybe

#

i joined late, so not sure. i starting playing like 2 months ago

hollow shadow
#

this sucks, i made 2 scripts that allow you to deconstruct all vanilla weapons xD

#

3 months ago it used to work

slate dagger
#

ahh

#

that does suck

hollow shadow
#

My workbench is useless now ;_;

slate dagger
#

😦

#

that is a nice looking workbench

#

i could maybe help out

#

collaborate so to speak, seems like such a waste 😦

#

@hollow shadow i will leave it up to you, i wouldn't mind helping

hollow shadow
slate dagger
#

i could see what recipes you have and make the item replacement

hollow shadow
slate dagger
#

yeah, basically where the broken item is replaced with a scrappable item

hollow shadow
#

you would have to do that with car parts, vanilla weapons, modded weapons, clothing items

#

its probably not worth it

#

maybe its easier to code a "brokenitems : true," by a coder or something

slate dagger
#

true

#

that is a lot of items

sour island
#

I faintly recall something about recipes checking for condition

#

Might be in the OnPerform

buoyant glade
#

I'm trying to start a modded map in multiplayer to play with a friend

#

gives me this every time

#

map works in singleplayer tho

#

any clue how to fix this?

hollow shadow
buoyant glade
hollow shadow
#

hmm, both of you should redownload the map then

weary matrix
#

@buoyant glade any clue why the server can't save the map_meta.bin? Could it be due to filesystem permissions? Also no errors in console.txt or server log?

north ledge
#

My game don't seem to want to make bags 3d

hollow shadow
north ledge
#

All of them

hollow shadow
north ledge
#

They just appear as their 2d sprites

hollow shadow
#

when you restart the game 5 times to notice that you forgot to write "item_" infront of the icon name😫

slate dagger
#

lol

#

yeah

#

i feel you

zealous wing
#

So am I retarded, or does Brita/Gunfighter have a different way of attaching attachments to guns other than a screwdriver?

#

I've got an M9 and a suppressor, but they won't go together.

#

NVM, It seems one of my mods is causing base guns to spawn. πŸ˜›

low crest
#

Hello guys, i am planning to start developing content for this game soon

zealous wing
low crest
#

i do modeling mainly

#

have done a couple of things for other videogames but i don't specifically know Lua

#

i'm hoping its not too hard to wrap my head around it since i have a little bit of coding experience

#

is terrain manipulation (Tunnel digging and so) something the game engine would allow? if so is anyone working on it?

blazing radish
#

hey! I have a question: there is a way to add a modified weapon/tool (a shovel, hammer, etc) to some kind of "weapon/tool gorup, so they can be used by other mods as regular countarparts?

blazing radish
#

for example, if I modify a hammer, can I add that hammer to a "hammer group" so other mods that use hammer can use my modified hammer too?

#

oh fucking nice

hollow shadow
#

require "recipecode"

function Recipe.GetItemTypes.Pliers(scriptItems)
scriptItems:addAll(getScriptManager():getItemsTag("Pliers"))
scriptItems:addAll(getScriptManager():getItemsTag("Plier"))
end

blazing radish
#

I was sleeping and I've had a fucking epiphany

#

I had to write it down, I finally have my idea compelte

#

for weapons at least πŸ˜…

hollow shadow
#

This will make it so any recipe that has "keep [Recipe.GetItemTypes.Plier]," in it or "keep [Recipe.GetItemTypes.Pliers]," in it to allow it to use any item/tool with the tag Plier / Pliers in its script

blazing radish
#

that includes "context actions"?

hollow shadow
#

not sure, i only tried on recipes

blazing radish
#

i'm not sure of the term b ut I'm talking about right click mainly

#

I want to do enhanced versions of all the melees but IDK if I should allow them to work as tools or I should convert them only in weapons

hollow shadow
#

oh didnt know. I thought you wanted to make a tool that works for other mods recipes

#

a weapon can also be a tool i think

blazing radish
#

I mean, weapons like hammers or shovesl can be used as weapons and tools

#

but idk how to give them the "vnailla" behavior

hollow shadow
#

not sure what you mean

blazing radish
#

an enhanced hammer could be used for any "vanilla" hammer instance: same context actions, recipes

hollow shadow
#

not sure about that

#

depends if they coded the building with the specific item or with the tag

blazing radish
#

I think I'll be better making them just weapons πŸ˜…

#

sounds too comlicated and prone to be broken as hell

hollow shadow
#

eh i would just try adding the hammer tag to a weapon script and see if it works lool

blazing radish
#

I'll try anyway, I've alraedy "stole" your code so I'll be testing

#

thank you mate, I appreciate your help

willow estuary
#

What you're asking is, generally, how the vanilla tools work, but not all of them.
Look up the scripts for items like hammers.

zealous wing
#

@late hound Do you mind if I make a patch for AuthenticZ to make it compatible with Brita's Weapons/Gunfighter?

late hound
blazing radish
#

I'll go to bed, I was sleeping and the idea came while I was in the bathroom πŸ˜…

willow estuary
dawn shuttle
#

Question regarding multiplayer, getModFileReader/Writer

Will this access the mod folder on the server or client? Unsure how Zomboid did server/client replication.

zealous wing
late hound
zealous wing
slate dagger
#

how do you utilize global mod data?

slate dagger
#

is it something like getGlobalModData()?

slate dagger
#

oh, thanks πŸ˜„

slate dagger
#

hmm.. just need to figure the Lua event that triggers when the character creation screen appears

#

on GameBoot is slightly before that it seems

slate dagger
#

well, unfortunately Global Mod Data disappears upon game closing

#

so, currently if you load a save that you haven't died on, die, go back to the main menu -> load -> you get the free points

#

but if you close the game out, then go back in, mod data is gone 😦

fair frost
slate dagger
#

that is pretty good!

fair frost
#

ty

austere scarab
#

for adding new "consumables" ingame

#

do i have to change these stats

#

for example:

#

item TunaTin
Weight = 0.3,
Type = Food,
DisplayName = Tuna,
Icon = Tuna,
Carbohydrates = 0,
Proteins = 15,
Lipids = 34,
Calories = 370,
Packaged = TRUE,

#

for the food item i want to add?

slate dagger
#

up to you, I think you can just do a straight hunger change

austere scarab
#

no i meant

#

how is the correct way

#

and what program should i use for PZ modding?

hollow shadow
austere scarab
#

I'll use notepad++ then

slate dagger
#

yeah I use notepad++

#

though I don’t know what language the scripts are

sour island
#

There not really in any language

#

It's just text that's parsed

weary matrix
#

@sour island I'd say it's one of the bastard child of JSON πŸ˜‚

sour island
#

Makes sense, I mean no point in reinventing the wheel

weary matrix
#

Oh yeah baby!

#

@sour island finally succeeded at making a tool to rename Java variables automatically based on the types πŸ˜„

royal ridge
weary matrix
#

indeed it shouldn't

slate dagger
#

weird

#

it does for me

#

because i load up the table where i stored the data and nothing is there

#

but while i keep the game running, it is there

weary matrix
#

@slate dagger show your code?

slate dagger
#

if start then
local modTable = ModData.get("characterProgressionTime")

    if modTable ~= nil then
        currentDay = modTable.CurrentDay
        print("Current Day " .. currentDay)
        currentMonth = modTable.CurrentMonth
        currentYear = modTable.CurrentYear
        
        startDay = modTable.StartDay
        startMonth = modTable.StartMonth
        startYear = modTable.StartYear
    else
        return
    end
else
weary matrix
#

@slate dagger what's ModData?

slate dagger
#

that is the global mod data

weary matrix
#

@sour island πŸ˜„

#

@slate dagger I was actually more interested in how you store the data

slate dagger
#

ahh, i put it in a table, as shown below:
local tableTimeData = {
StartDay = getGameTime():getStartDay() + 1,
StartMonth = getGameTime():getStartMonth() + 1,
StartYear = getGameTime():getStartYear(),
CurrentDay = getGameTime():getDay() + 1,
CurrentMonth = getGameTime():getMonth() + 1,
CurrentYear = getGameTime():getYear(),
}

ModData.add("characterProgressionTime", tableTimeData)
#

that is called OnSave

#

so, when quitting the game

#

or sleeping

#

well, quitting the save i mean

weary matrix
#

@slate dagger are you sure about the add?

slate dagger
#

yeah

#

that is the way you insert a table into the global mod data

weary matrix
#

does it actually create the key in ModData?

slate dagger
#

yeah, i can retrieve it later

#

so long as i don't close PZ

weary matrix
#

with same code you showed earlier?

slate dagger
#

yep

dry chasm
weary matrix
#

oh that's right

#

@slate dagger you have to register a handler for OnInitGlobalModData I guess

#

@dry chasm aren't you supposed to be in bed Mr I go eat and go to bed? πŸ˜‚

slate dagger
#

register a handler, what do you mean?

weary matrix
#

an event

slate dagger
#

but what would i store there?

dry chasm
slate dagger
#

get some rest πŸ˜„

weary matrix
#

@slate dagger nothing, but at least the GlobalModData would be initialized for sure

dry chasm
slate dagger
#

EST here

weary matrix
#

well my TZ is fucked up anyway so... πŸ˜‚

dry chasm
slate dagger
#

πŸ˜‰

weary matrix
#

oh noes 😦

slate dagger
#

will do

#

hmm, so i should just add a function to the OnInitGlobalModData?

weary matrix
#

@slate dagger well I don;t really know what you're trying to do, but if you need data from GlobalModData you have to fetch it only after this event has been triggered

slate dagger
#

yeah, problem is

#

i know the data is there while PZ is still running

#

but as soon as i close it, and go back in, data is gone

weary matrix
#

yeah

#

and when the game starts again it has to load global mod data from disk, which is only guaranteed to be done once the OnInitGlobalModData has been triggered

#

I guess you're trying to fetch the data before global mod data has been initialized

slate dagger
#

hmm...

#

could be

#

let me try something

weary matrix
#

it's easy enough to try, just register your function to OnInitGlobalModData event and copy paste inside your function the first code snippet you showed us

slate dagger
#

well... the problem is if that doesn't happen until after the save loaded... that is a tricky situation

#

and that appears to be the case

weary matrix
#

@slate dagger why is it a problem?

slate dagger
#

well, the mod adds free trait points for character creation

#

as a way to help replayability of saves where you have died

#

but you do the character creation before the save loads

weary matrix
#

mmm can't you add traits to an existing character?

slate dagger
#

not without Debug Mode or some mod that adds them after certain actions

weary matrix
#

Couldn't you add the traits from your mod in your handler for OnInitGlobalModData?

slate dagger
#

well, it is part of CC

#

i don't give a set of traits, i allow the player to choose

weary matrix
#

CC?

slate dagger
#

character creation

weary matrix
#

but when you load a saved game, the character creation step is already done?

slate dagger
#

well, if you died, the game has you create a new character

#

my mod gives free points after a certain time interval of surviving

#

but i can't get the time data until after the game is loaded unfortunately

#

using the global mod data was a theory, but it doesn't seem to work out either, because it doesn't initialize until the save is loaded

weary matrix
#

@slate dagger mmm why do you need to save the time? Can't you just call getGameTime() when you need it?

slate dagger
#

well

#

you can't call game time until the save is loaded

#

which doesn't let me do the calculations to give the free points

weary matrix
#

ah I see

#

and you need the value in main menu?

slate dagger
#

i need it before the save is fully loaded

#

unfortunately, it seems no way to do that 😦

weary matrix
#

@slate dagger what about not using GlobalModData but just the ModData of your mod?

slate dagger
#

where would i store it?

#

that is the next problem

willow estuary
#

Are you trying to access global mod data before a game is loaded? Because global mod data is part of a "world"/save itself as far as I know?

slate dagger
#

yeah, it appears to be the case

weary matrix
#

You could still store data in a file and load the file when you need it, but there's probably a better/cleaner solution

#

mmm from what I see not so many options:

zombie/globalObjects/GlobalObjectSystem.java:   public final KahluaTable getModData() {
zombie/globalObjects/GlobalObject.java:   public KahluaTable getModData() {
zombie/iso/weather/ClimateManager.java:   public KahluaTable getModData() {
zombie/iso/IsoObject.java:   public KahluaTable getModData() {
zombie/iso/objects/IsoThumpable.java:   public KahluaTable getModData() {
zombie/iso/IsoMetaGrid.java:      public KahluaTable getModData() {
zombie/iso/IsoGridSquare.java:   public KahluaTable getModData() {
zombie/network/PacketTypes.java:   public static final short getModData = 80;
zombie/inventory/InventoryItem.java:   public KahluaTable getModData() {
zombie/GameTime.java:   public KahluaTable getModData() {
zombie/vehicles/VehiclePart.java:   public KahluaTable getModData() {
slate dagger
#

yeah

#

i think the file solution is probably the only solution, but it is messy

weary matrix
#

yeah it is

#

also it will be global, just not for a specific save file (IIRC you can't write to the Save folder)

slate dagger
#

yeah

weary matrix
#

@slate dagger any clue about joysticks?

#

Are they setup in main menu?

#

never used one

slate dagger
#

yeah, i think they are in the options

weary matrix
#

in LuaManager there's a method "setPlayerJoypad", the code of the method receives an IsoPlayer object and calls player:getModData() on it

slate dagger
#

ahh, but i don't think you have a player anymore

#

if you have died in your save

#

or if you did it would apply to the dead player

#

until you create your new one

weary matrix
#

then I'm wondering how the setPlayerJoypad would get a player instance

slate dagger
#

yeah, that is a good question

weary matrix
#

@slate dagger what about GameTime.getInstance().getModData()

#

yeah it should work

slate dagger
#

hmm, would the be accessible though prior to the save/game loaded?

weary matrix
#

I think so because: java public static GameTime instance = new GameTime();

slate dagger
#

oh, i think i did

weary matrix
#

it's in the declaration of the class so it should always be initialized as soon as you run Zomboid

slate dagger
#

but it uses the standard days/times based on the default values

willow estuary
#

FYI there's corner case situations where the GameTime modData eats shit, and, AFAIK, global mod data was added because of that issue?

slate dagger
#

i think the real day/time isn't loaded until the save is fullly loaded

weary matrix
#

@slate dagger but you can call getModData on this object and store what you want in there

#

before quitting your game

slate dagger
#

yeah

#

that is true, i will try it

#

but will Mod Data load before Global Mod Data?

#

i guess is the question

weary matrix
#

not sure you'll have to try, but if it does not work, you could still try to call this method to make it happen:
public void load(DataInputStream var1) throws IOException { no idea if it would work though

#

and DataInputStream is exposed so you should be able to instanciate one: this.setExposed(DataInputStream.class)

slate dagger
#

what would be i be loading?

weary matrix
#

probably one of the file in the save dir, but no clue which one

#

I'm totally in unknown territory on this one πŸ˜‚

slate dagger
#

yeah, i am learning as i go πŸ˜„

#

trying out the game time instance now

#

@weary matrix it appears ModData and Global Mod Data load after a save is fully loaded

weary matrix
#

damn

slate dagger
#

yeah

weary matrix
#

@slate dagger try to call GameTime.getInstance().load() maybe

slate dagger
#

hmm

#

i can try

weary matrix
#

it seems to be creating the DataInputStream and to call load(DataInputStream) so that could work!

#

and it's also call when initialized the world

slate dagger
#

yeah, i will give it a shot, hopefully that works

weary matrix
#

but before it can work you'd have to do this during a game:
GameTime.getInstance():getModData().yourDataKey = yourTable

#

otherwise there would be no moddata to load

slate dagger
#

yeah

#

it wouldn't help for the first time you started

#

it doesn't appear load works

weary matrix
#

no but in that case you don't have free traits to add no?

slate dagger
#

it seems to crash the GUI

weary matrix
#

hum πŸ˜‚

slate dagger
#

well, my goal was to make it to where it didn't matter

#

you could use an existing game

#

file system is the only way it seems 😦

weary matrix
#

@slate dagger does this one also crash the GUI? SandboxOptions.instance.load()

slate dagger
#

i am not sure

weary matrix
#

it's done much sooner in the IsoWorld.init()

slate dagger
#

well, the problem is i need the time calculations

weary matrix
#

ah forget it

#

it has no getModData(), sorry

slate dagger
#

no worries, i appreciate the help πŸ™‚

weary matrix
#

guess you could try to parse map_sand.bin yourself

slate dagger
#

lol, yeah that doesn't sound too fun

weary matrix
#

or map_t.bin not sure

slate dagger
#

i will see what i can do, definitely seems to be a bit more complicated now queasy

weary matrix
#

@slate dagger Any clue what year the game start?

slate dagger
#

default is 1993

weary matrix
#

july right?

slate dagger
#

yeah

weary matrix
#

I think I found it πŸ˜‚

#

@slate dagger

#

see where the cursor is?

#

1993 in hex is 07c9

slate dagger
#

ahh, that is in map_t.bin

weary matrix
#

could be random

#

though

#

but I'm pretty sure it's there

slate dagger
#

seems to be

#

i also notice "GMTM"

#

is at the start of the file, GMTM = Game Time i imagine

weary matrix
#

yeah

#

wait, hold on

#

@slate dagger ```java
public void load(DataInputStream dataInputStream) throws IOException {
int int1 = IsoWorld.SavedWorldVersion;
if (int1 == -1) {
int1 = 184;
}

    dataInputStream.mark(0);
    byte byte1 = dataInputStream.readByte();
    byte byte2 = dataInputStream.readByte();
    byte byte3 = dataInputStream.readByte();
    byte byte4 = dataInputStream.readByte();
    if (byte1 == 71 && byte2 == 77 && byte3 == 84 && byte4 == 77) {
        int1 = dataInputStream.readInt();
    } else {
        dataInputStream.reset();
    }

    this.Multiplier = dataInputStream.readFloat();
    this.NightsSurvived = dataInputStream.readInt();
    this.TargetZombies = dataInputStream.readInt();
    this.LastTimeOfDay = dataInputStream.readFloat();
    this.TimeOfDay = dataInputStream.readFloat();
    this.Day = dataInputStream.readInt();
    this.Month = dataInputStream.readInt();
    this.Year = dataInputStream.readInt();
    dataInputStream.readFloat();
    dataInputStream.readFloat();
    int int2 = dataInputStream.readInt();
    if (dataInputStream.readByte() == 1) {
        if (this.table == null) {
            this.table = LuaManager.platform.newTable();
        }

        this.table.load(dataInputStream, int1);
#

That should be helpful!

#

so first it reads 4 bytes from the file, then one integer (4 bytes long), then a float (also 4 bytes), then 2 ints (so 8 bytes), then 2 floats (8 bytes), and then it's reading day, month, year

slate dagger
#

ahh, well, that is something anyway πŸ˜„

weary matrix
#

let me compare with the hex editor

#

and the bytes 71, 77, 84, 77 is indeed the "GMTM" part

#

so four initial bytes it's reading

#

@slate dagger is the start date is 16th of june?

#

or july?

#

might be off by one

slate dagger
#

hmm..

#

i think 8th of July

#

is the start day

#

sorry, 1st of July

weary matrix
#

I'll just start a game to see πŸ˜‚

slate dagger
#

indeed πŸ˜„

weary matrix
#

I'm looking at an old saved game, so no idea what time it could be

#

@slate dagger so this is it, start date is 9 of july, and here's the values I get:
00 00 00 08 00 00 00 06 00 00 07 C9

#

it's just off by one

#

08+1 = 9
06+1 = 7 (july)

#

cause first day must be 0, and first month too

slate dagger
#

that is what it appears to be

weary matrix
#

so you have to add one to get the human readable value

#

so shouldn't be too hard, just get a DataInputStream to that file, skip the first 28 bytes, and then you can read: Day (4 byte integer), Month (4 byte integer)

slate dagger
#

well, that is half the equation

#

what is the current day?

weary matrix
#

problem with this approach, is if someday they change the format of that file, then your mod will get bogus values when trying to read the date

#

@slate dagger this is what I showed you

#

just started a new game

#

this is where current date is stored

slate dagger
#

ahh

#

wonder where the start day is then

weary matrix
#

it's not the "Official date of the story"

slate dagger
#

i need both to determine the days total elapsed

weary matrix
#

mmm

#

not sure it is stored

slate dagger
#

yeah

#

i need that as well

weary matrix
#

it's not there I think

#

otherwise I would find twice the same pattern in the file

#

but you could store it yourself when the new game is started

slate dagger
#

yeah

weary matrix
#

so I guess you'll have to write data to disk anyway

slate dagger
#

yep

#

looks like it

weary matrix
#

so better do it directly like this

#

but, it means you'll have to save it for each different saved game

#

you could have a filename with the save ID for example

slate dagger
#

yeah

#

that was what i was thinking

weary matrix
#

if you want to enable your mod on an already started game, you could still use the default value, I guess most people don't really change it, or do they?

slate dagger
#

they might

#

not sure

#

especially if it is a sandbox

#

some people like to also play 6 months later

#

and various other things

weary matrix
#

true

#

@slate dagger worst case scenario is you give them extra trait points? Not too bad I guess, especially since in sandbox mode you can add as many free traits as you like

slate dagger
#

yeah, i will think about it

weary matrix
#

nothing related but I was thinking it would be nice to have a mod where you can cleanup a house automatically, like when you sleep, you'd just have to possess bleach or soap, a mop etc πŸ˜‚

#

the time would advance by 2 or 3h depending how many "bloody" square there is in the house and you would get tired πŸ˜‚

slate dagger
#

lol

#

that would be neat πŸ˜„

weary matrix
#

shouldn't be too hard to do

hollow shadow
#

@weary matrix Is there a way to have a recipe that uses broken items?

hollow shadow
dry chasm
dusty moat
#

Someone knows a mod like.. "make your own ammo"

#

Like with

#

Ammo parts

#

So you can made idk... 7.56 ammo shotgun ammo

#

And all of that

slate dagger
#

hmm.... is there something wrong with accessing the core variables?

#

local savedGame = getCore().steamServerVersion this returns nil everytime

#

but when i look at the core object itself, it shows all these properties that i can access

#

and function calls i can make, but i can't seem to get anything to return anything except nil, is it because the game is closing?

austere scarab
#

where can i find the devs unused consumables file?

#

as SoulFlicher did use some for his

slate dagger
#

not sure there are any unused consumables

weary matrix
hollow shadow
#

I have tons of recipes that used "NoBrokenItems = False," but i realized after that this didnt even work. Now i have like 30 recipes that dont realy work

#

the recipes allow you to recycle broken weapons or items so you get some scrap metal bacjk

weary matrix
hollow shadow
#

but they are many variations of outcomes. some give metal pipe and some give wood. some give a broken tool head which can be used in other recipes again

willow estuary
hollow shadow
weary matrix
#

@hollow shadow mmm I can find this in vanilla recipes:

    {
        BrokenFishingNet,

        Result:Wire;3,
        Time:100.0,
        Category:Fishing,
        NeedToBeLearn:true,
    }
hollow shadow
willow estuary
hollow shadow
#

ah yep

#

i dont want to create tons of seperate broken vanilla items either, as i want my mod to be compatible with other mods

weary matrix
#

@hollow shadow Like sometimes your fishing net breaks, then you can get it back in your inventory as a "BrokenFishingNet", which you can apply this recipe to

#

@hollow shadow it seems from the perspective of recipes, broken items are just like any other items

hollow shadow
#

anything that has a red cross on it can no longer be used on the recipes

weary matrix
#

@hollow shadow can you show your recipes?

hollow shadow
#

recipe Dissasemble Golfclub
{

    Golfclub,
    keep ScrapWorkbench,

    NoBrokenItems            : False,
    Result                   : GolfClubHead,
    Time                     : 100.0,
    Category                : Scrap,
    Category                 : Welding,
    Sound                     : BreakingMetalWeapon,
    OnGiveXP                 : Give10MWXP,
    OnCreate                : DeconstructMetalTool_OnCreate,
    AnimNode                 : Disassemble,
    Prop1                    : Screwdriver,
    Prop2                    : Source=1,
    CanBeDoneFromFloor      : TRUE,
    NeedToBeLearn: true,
}
weary matrix
#

ah yeah ok now I understand what @willow estuary means

hollow shadow
#

i need code that does something like NoBrokenItems : false but idk how to code ;-;

weary matrix
#

I guess when a golf club is broken it's just a regular golf club with condition=0 and broken=true, but it's not like a new item as in "BrokenGolfClub"

willow estuary
#

There has been some change to the recipe code in recent build where items with the broken status are automatically rejected from being used in recipes regardless of what NoBrokenItems is set to, probably so broken tools can't be used for 100s of recipes without adding a NoBrokenItems parameter to them.

That's why I suggest taking this problem upstairs to nasko.

weary matrix
#

@hollow shadow you'd have to do something like: item:setCondition(1) and item:setBroken(false), no clue if that would be enough though

hollow shadow
hollow shadow
weary matrix
#

that is to check if the item is broken, what I showed you is the code to make the item non broken

willow estuary
#

Guys, seriously, nasko gets paid to handle problems like this.
Talk to nasko about this, and he might be able to see if something can be done to solve this issue for you.

slate dagger
#

@weary matrix got the file madness done, it now works πŸ˜“

#

it still requires you to load the game first

#

so it can be added to file, but after that, it is golden

#

all because game time loads after the save starts sighs

weary matrix
#

@slate dagger awesome! Glad you could make it work

#

@slate dagger btw, I found out where is the start date configured

#

not just the current date in-game

#

it's in map_sand.bin

slate dagger
#

ahh

#

interesting

weary matrix
#

Check the two highlighted lines

slate dagger
#

nifty, i will have to see about implementing that

#

wonder if there is an easy way to read hex and convert to string in the lua code

weary matrix
#

I don't think so

#

you'll have to parse it I guess

blissful escarp
#

Anyone knows what "error 6" is?

weary matrix
#

using a DataInputStream and reading the proper bytes

slate dagger
#

yeah... that sounds tedious lol

#

about as tedious as the file thing 😦

weary matrix
#

@slate dagger not really, it shouldn't

slate dagger
#

@blissful escarp sounds like you need tech support

weary matrix
#

the only problem is depending on how you do it, it might not be portable across different game release, meaning your mod might break every time there's a new release that change the format of either map_sand.bin or map_t.bin

slate dagger
#

yeah

#

versus my current file thing is pretty flex

weary matrix
#

@slate dagger but I would suggest you start easy, just try to make it work the simplest way you can, then we'll see if we can make it work for different game release

slate dagger
#

yeah, sounds like a plan

blissful escarp
#

I think something is wrong with my distro

slate dagger
#

oh

weary matrix
#

@blissful escarp never heard of "error 6", what does it look like?

slate dagger
#

yeah, i have only seen error 6 when trying to connect to a server

weary matrix
#

using Linux?

blissful escarp
#

I don't know, happens with travelling and loading

#

Ignored it for long time but i think it's from mod and messed with game

slate dagger
#

is it your mod?

blissful escarp
#

Mine? Nope, but i think it's some sort of mod conflict

slate dagger
#

ahh, i mean the only thing i would do is try disabling the mod in question

#

see if it goes away, if it does then you are right

#

then contact the mod author and let them know

#

a lot of distribution mods are broken at the moment with all the changes to distribution functionality

blissful escarp
#

The problem is i have no idea what mods are conflicting or is it a one mod problem

slate dagger
#

yeah, basically just go one by one through with a fresh save

#

or new game

#

and see what happens

#

that is all you can do honestly

#

if it turns out the error 6 goes away after disabling a certain mod, you know the problem

weary matrix
#

Anyone using a Mac who could share with me the full path to where is pzexe.jar?

#

Same question for Windows actually

#

if you don't want to leak your system username just replace it with whatever name you like

#

@slate dagger using windows?

slate dagger
#

i am yeah

#

i don't see a Pzexe.jar

weary matrix
#

it should be in steam

#

like Program Files/Steam/... etc

slate dagger
#

hmm, yeah nothing

#

lots of .jar files, but nothing pzexe.jar

weary matrix
#

mmm

#

@slate dagger do you have a windows with bash enabled?

slate dagger
#

hmm, i do not, but enabling it now

weary matrix
#

@slate dagger thanks!

#

going to release my tool for reversing and beautifying zomboid source code πŸ˜„

#

that why I need the info so I can make it work on Window and Mac too

slate dagger
#

ahh

#

i see

#

let me restart

weary matrix
#

sure

slate dagger
#

alright, it appears to be enabled now

weary matrix
#

@slate dagger so I have no idea how the filesystem is structured under windows bash πŸ˜…

undone crag
weary matrix
#

do you have like the C: drives and stuff? Or is is a regular unix-like structure, like /home/FireDragoon/.steam/steam etc?

slate dagger
#

there are C:\ drives and such

weary matrix
#

can you show me the output of ls -l?

#

you can do it in DM if you prefer

slate dagger
#

H:\SteamLibrary\steamapps\common\ProjectZomboid

#

that is my current game structure to PZ

weary matrix
#

@slate dagger mmm so could you go that folder, like: cd H:\SteamLibrary\steamapps\common\ProjectZomboid and then show my the output of ls -l

golden totem
#

huh, my weapon is mute even though i put the swing sound to be M16Shoot

slate dagger
#

@weary matrix sure

weary matrix
#

@slate dagger also once you changed directory it would help to have the output of pwd

#

and just to be clear, you decided to install Steam in your H: drive right? But for most people it should be C:?

slate dagger
#

most people utilize C:\ i am sure

weary matrix
#

ok yeah

willow estuary
golden totem
#

i just figured it out πŸ˜„ my gun was jammed and i didn't put in the jam sound yet

willow estuary
#

Well, that's a new one. πŸ˜„

blissful escarp
#

Oh, do you have ways to detect mod conflicts through logs?

#

I mean it seems very useful and better than trial and error

slate dagger
#

the log file if it provides an error that is useful

#

it will tell you the source of the error, mainly the file

#

which could help you limit it down

blissful escarp
#

Great, any way to do this easily? I barely understand the logs

slate dagger
#

i look for Stacktrace usually

#

but i also often know the mod name

#

so i also just punch that in

#

the log files can be quite massive

willow estuary
#

Look for stack trace and not error.

There are commonplace, inconsequential error messages that are just meant to nag the developer that they didn't include a translation for a text string, or a loot distribution for a vehicle, but have zero negative effect on the game and do not generate the "red box numbers".

This causes a lot of "false positives" leading people down blind alleys when trying to evaluate mod issues.

slate dagger
#

^

blissful escarp
#

Cool, thanks for advice

#

function: ScrapGuns_Distributions+.lua -- file: ScrapGuns_Distributions+.lua line # 24

#

What does this mean?

#

STACK TRACE

function: ScrapGuns_Distributions+.lua -- file: ScrapGuns_Distributions+.lua line # 24

ERROR: General , 1637949503341> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: items of non-table: null at KahluaThread.tableget line:1689.
ERROR: General , 1637949503341> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: items of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:492)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1782)
at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:76)
at se.krka.kahlua.integration.LuaCaller.protectedCall(LuaCaller.java:117)
at zombie.Lua.LuaManager.RunLuaInternal(LuaManager.java:539)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:485)
at zombie.Lua.LuaManager.RunLua(LuaManager.java:471)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:319)
at zombie.Lua.LuaManager.LoadDirBase(LuaManager.java:246)
at zombie.gameStates.GameLoadingState.enter(GameLoadingState.java:91)
at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:145)
at zombie.GameWindow.logic(GameWindow.java:285)
at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
at zombie.GameWindow.frameStep(GameWindow.java:726)
at zombie.GameWindow.run_ez(GameWindow.java:642)
at zombie.GameWindow.mainThread(GameWindow.java:471)
at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1637949503341> -----------------------------------------
STACK TRACE

weary matrix
#

it means scrapguns is having problem during distribution

slate dagger
#

it seems that something with ScrapGuns is broken regarding how it accesses the distribution

blissful escarp
#

Any ideas how to fix/adress it?

#

Worked on "Blank version" With only scrap guns and eris minimap

slate dagger
#

sounds like you should reach out to the author, let them know when it does work and when it doesn't

blissful escarp
#

At least i think i know the culprit in the code

fair frost
#

US Marshals in PZ : )

willow estuary
weary matrix
#

@slate dagger could you tell me if your bash has the following commands available?

jq -h
find -help
java -h
sed -h```
slate dagger
#

everything but jq

#

sorry, jq

weary matrix
#

ok thanks!

blissful escarp
#

Something is just wrong with lua file

#

No idea how to fix

#

"" attempted index: items of non-table: null. "" What does it even mean

slate dagger
#

sounds like the lua ran into some issue while looping through the distribution

blissful escarp
#

Yeah, now i wonder why that happened

willow estuary
# blissful escarp Yeah, now i wonder why that happened

The current version of Scrap Guns, being used with the current version of b41 PZ loads without any problems for me. This tells me that possible culprits are:

  1. You are trying to use Scrap Guns, a build 41 mod, with the build 40 PZ client.
  2. You are using a version of Scrap Guns from one of those dang modpacks or some othe re-upload, and not the official/legitimate updated versions.
  3. Some other mod you are using is overwriting the distribution files, instead of properly modifying the distribution tables instead, and it's a broken/out of date version of the distribution files.

#3 is unfortunately quite likely, as, in general, the state of mod distribution stuff on the workshop is a dumpster fire, and it's a far too common practice by modders that don't know any better to upload a modified version of the distributions files with their mods instead of using lua code to properly modify the distribution tables, and this includes far too many "popular" mods.

ie, this isn't the fault of Scrap Guns' author in any way.

blissful escarp
#

Oh, right now to find the mod that breaks the game

slate dagger
#

good luck!

willow estuary
#

This is a good example of how sometimes the stack traces in the logs may point at one mod as being at fault, but in actuality it's some other mod that is breaking that mod instead.

slate dagger
#

yeah

blissful escarp
#

Yes, i hate that

slate dagger
#

i try to make my mods modify as little as possible, but i was wondering

#

is there anyway to change the WorldObjectContextMenu options?

#

by simply adding new options

#

?

dry chasm
slate dagger
#

yeah

#

that is the one

#

does it have parameters it passes?

dry chasm
#

Player, context, worldobjects ,test

slate dagger
#

gotcha, thanks so much πŸ˜„

blissful escarp
#

IT'S FREAKING BRITAS

#

Now i Know

dry chasm
#

and using context:addOption(...)

slate dagger
#

cool πŸ˜„

hollow shadow
willow estuary
#

Oh no, Brita's?
Poor dj must have gotten so many reports about this 😒

slate dagger
#

yeah

#

probably

#

have to break down Britas

#

see what is happening

#

wonder if they are adding/changing some of the loot tables

hollow shadow
#

its just recipe books too

blissful escarp
#

Gotta ask them now XD

slate dagger
#

indeed

hollow shadow
#

i dont know brita or talk to them so

hollow shadow
blissful escarp
#

Well, someone should

#

Zomboid if both mods were compatible

hollow shadow
blissful escarp
#

Really? What's the difference? I thought britas is more advanced/militaryt and scrap is improvised/survivor style

hollow shadow
#

you wouldnt need to use a melee weapon ever again

#

and ammo is infinite

worldly olive
#

Btw, if you really want to play with Brita, better download Left 4 Dead and go shoot zombies there, it is a better experience

willow estuary
#

A lot of people do want PZ to play like L4D, so the fact that Brita's provides a more shoot 'em up fps-like experience is a good thing as long as people are aware of how it changes gameplay IMO.

slate dagger
#

shooting guns, i always found that to be a horrible idea

willow estuary
#

Ah, I main guns in Vanilla PZ, and I do just fine, albeit I'm use them the same way I do in Tarkov and DayZ?
ie I'm cautious about drawing attention to myself πŸ˜‰

slate dagger
#

πŸ˜‰

willow estuary
#

But you gotta be willing to spend the trait points for Police Officer or Veteran for that to be viable IMO?

slate dagger
#

yeah, i agree

#

leveling firearms with no XP boost is a pain

willow estuary
#

I consider most skills to be novelties or luxuries with my nomad scavenger playstyle as well? So like all the base building and resource farming skills to me aren't a priority? I can play for weeks without ever using carpentry, cooking, mechanics etc?
But I also enjoy playing as the wandering scavenger and am used to that playstyle. Point being I don't feel any need to make builds that are "good" at those skills vs a lot of people.

slate dagger
#

i hear you, i like the building/outdoorsman playstyle

blissful escarp
#

I see, so Britas is really a different mod

#

But it could be cool if we could use both guns

#

So we'd see more diversity in playstyles

willow estuary
#

Well, sometimes there seems to be a lack of awareness of just how much using a mod may change how the game plays out?
Brita's makes PZ a more fps like game. Hydrocraft radically changes survival concerns, and, in that sense, makes the game "easier" but provides an experience with more opportunities for a crafting and tech tree building style of play, which a lot of people enjoy vs hardcore zombie survival?

I would say some mods change the game enough that they're almost "total conversion" territory?

#

Now, none of that is a bad thing, just that there's really multiple different "versions" of PZ that people are playing?

ruby urchin
willow estuary
#

This will become more relevant when MP drops, in that, for example, someone who wants a vanilla DayZ style hardcore survival experience should probably avoid servers using Hydrocraft; people who want to avoid shoot em up style PVP should avoid PVP servers using Brita's; etc.

weary matrix
#

Any Mac user willing to help me make my script for decompiling pz source code to work on a Mac?