#mod_development

1 messages ยท Page 310 of 1

bronze yoke
#

can we see your body location file?

whole yoke
#

group:getOrCreateLocation("QuiverLK")

.. this is erm,,.. all.. i .. have..

#

b_ch_sweat ...

bronze yoke
#

that's weird then, this is correct

#

body locations are equipment slots so the only thing i could blame here is either wrong body location (it isn't) or you somehow accidentally made them exclusive (you didn't)

storm trench
#

I have a question for anyone who wishes to give input.

For the ZuperCarts - Carts & Trolleys B42 port, when I fix the container issue where it's stuck at 37 capacity, should I start working on a reason to use one over the other and vice versa?

What I am thinking is a trolley will hold less capacity (example: 35) but have 100% encumbrance reduction.

While a Shopping Cart will have the full "50" capacity but only an 85% encumbrance reduction?

Plus maybe more functionality later, like maybe the trolley allows you to move at full speed with a full container, while the Shopping Cart makes you slightly slower as the encumbrance approaches max capacity?

whole yoke
bronze yoke
#

oh, yes, do that!!

#

i forgot

#

container clothing work slightly differently from normal clothing

#

i'm not sure if the bodylocation field even gets read, they use canbeequipped

#

vanilla examples have both and they always match

whole yoke
# bronze yoke oh, yes, do that!!

i tried it, and i can no longer equip it anymore. It just appears with equipping in primary or secondary.. nothing of equipping it however

#

Im gonna research into it

#

Maybe take a look into the fanny pack script

bronze yoke
#

absolutely do that

whole yoke
#

jarvis, show me the fanny pack script

storm trench
#

Also, this "weight" function... is that the correct function to use here?

#

Because when the capacity is at or above max value (50), then the container capacity is 37 (50-13=37).

silent zealot
#

Is this adding light & heat when a "radio" is turned on?

vast pier
#

56 total now.
2x2x2x7

umbral raptor
#

exactly what its meant to do

queen oasis
#

I thought I took those out. I was trying to avoid the nil issue and obviously that doesn't do it

silent zealot
#

Also, confirm you're adding the heat source correctly my manually making a heat source using the lua console... they might behave the same way as light sources.

#

Not helped by none of the vanilla lua using IsoHeatSource, because vanilla objects that generate heat do that in the java code.

storm trench
#

So I found code in another mod for an item like a trolley/cart, and it's in B42. Why does this work and mine doesn't?

    {
        WeightReduction             = 100,
        Weight                      = 20,
        Type                        = Container,
        /* Capacity                    = 180, */
        Capacity                    = 50, /* hard coded b42 50 bags, 1000 vehicle */
        DisplayName                 = Wooden Wheelbarrow,
        Icon                        = HCWoodenwheelbarrow,
        DisplayCategory                = Container,
        RequiresEquippedBothHands   = true,
        StaticModel             = carretilla_model,
        WorldStaticModel         = carretilla_world,
        
        ReplaceInPrimaryHand = models_x_wheelbarrow holdingbagboth_cart,
    }```
slender thistle
#

For some reason I can't get 3d models to appear in game. I have them in a models_x folder within the media folder. The StaticModel and WoldStaticModels match the filenames exactly, and they are fbx files. is there anything else I could be missing?

queen oasis
storm trench
queen oasis
storm trench
#

Ahhh, so just straight up ignoring the pushback. Yeahhh... that's dangerous to mess with lol.

#

Maybe I can try forcing it via lua... ehhh...

silent zealot
#

Can the change be done as a prefix/postfix instead?

bronze yoke
#

it's not as simple as just overriding the capacity or something, you are hard blocked off from doing that

#

mods that get around it have to patch every function that checks the capacity

queen oasis
#

as a brute, I would hook into transfer, save the item weight, set the weight to .1 or something and set it back to the original weight when moving it out. nothing is optimal though

#

or hook whatever happens before it checks if there's room in the container

silent zealot
#

For reference, here is my unreleased "bypass all capacity limits" mod and you can see how much stuff is replaced because a few lines in the middle need to be redone and there is no practical way to do it with pre/post patching.

queen oasis
#

580 lines left...

silent zealot
#

Java sets hard limits for capacity, but it's up to LUA to enforce them.

bronze yoke
#

discord doesn't like tab characters ๐Ÿ˜”

queen oasis
#

this mod is just overwriting capacity in ISInventoryTransferAction:isValid() and ISInventoryPane:canPutIn()

silent zealot
#

Download & open if you really want to see it all.

queen oasis
#

already did

bronze yoke
#

there are limited ways to inject code into the middle of a function that you may not have tried

silent zealot
#

I managed to learn c# harmony transpiling, if lua has anythig similar I would love to know

bronze yoke
#

for example, you can use literally any function call they make to trigger your own code

#

you can also trigger code off of the original code indexing a table

#

if you need locals from inside the function i added some utilities to starlit's reflection module that can get them - they're read only but most of the time you'd want to do that they're objects/tables anyway

silent zealot
#

So patch a function called near what you want changed in a wayy that does the needful?

bronze yoke
#

yeah, basically

#

it's never 100% but there are a lot more tricks than just prefix/postfix the original function

storm trench
silent zealot
#

What is the immediate goal? getting more than 50 capacity in the cart?

bronze yoke
#

if you're open to java edits then it's pretty trivial

silent zealot
#

Instead of replacing a compiled java file, can you add an extra one that modifies the code in existing classes?

bronze yoke
#

there's a framework for that kind of thing in development but for now not easily

storm trench
bronze yoke
#

i feel you... java ๐Ÿคข ๐Ÿคข

#

you could easily patch it just with java's reflection stuff but i don't know how you'd get the game to actually run any code in a new file

silent zealot
#

Java is just C++ in a funny hat with OCD about filenames and directory structures.

bronze yoke
#

well i much prefer it without the funny hat ๐Ÿ˜…

silent zealot
bronze yoke
#

yeah, basically

silent zealot
#

that can be plan B, and plan A is "heck no I ain't doing that!" ๐Ÿ˜‚

silent zealot
bronze yoke
#

i'd definitely wait for that framework to be released before doing anything like that, i hear it's coming along and it'd allow for a lot more interesting stuff than just reflection

silent zealot
#

What is the framework called?

oblique estuary
#

Bumped to a wall with a lua code, trying to make it so if your skill is at a certain level the recipe will give you different outcomes, but it keeps saying something is wrong with the 2nd "AddItem" line.. What am I doing wrong?

Here's the code

require "recipecode"

function Recipe.OnCreate.FNCC_Dissasemble_Woodenhandle(items, result, player, skill)
    if player:getPerkLevel(Perks.Woodwork) > 4 then
        player:getinventory():AddItem("Base.UnusableWood")
    elseif
        player:getPerkLevel(Perks.Woodwork) <= 4 then
        player:getinventory():AddItem("Base.Plank")
    end
end
#

๐Ÿคฆโ€โ™‚๏ธ I wrote getinventory instead of getInventory

vast pier
#

(None of these are duplicates)

oblique estuary
#

That is an awful lot of variety xD Gotta love that

vast pier
#

It's exponential, I have more planned

#

honestly the hardest part is setting up the display

#

I had to repeat this process 56 times in total

  1. equip item
  2. put code in console getPlayer():getPrimaryHandItem():setModelIndex()
  3. place item down
  4. adjust item placement using extended item placement
#

alternatively I can spawn in an absurd amount of them and just sift through for one of each

vast pier
oblique estuary
#

Yeah, 2 models and a whole looooot of textures, right?

#

or is it attachments?

vast pier
#

8 models, 7 textures

#

the way I'm designing it, these models will be reusable since I designed the textures to work as atlas'

#

one atlas supports 3 different stock variants, 4 barrel variants, 4 grip variants, and two receiver variants

#

technically each one also supports two wrap variants as well, idk if I'll add more colors or textures to that though

#

and then the pink is free space that can be used for extra bits

oblique estuary
#

Wait, so the atlas is kinda like a mask?

vast pier
#

the atlas is a texture

#

the model determines what part of the texture gets used

oblique estuary
#

How did you manage to get that done? That sounds awesome for variety

vast pier
#

which part

oblique estuary
#

Well, making use of the pink for extra bits, is that because of the atlas?

#

Sorry, I am a near complete newbie at this xD

vast pier
#

It's because if I add new parts to a gun, I can try to fit in texturing there since that space isn't used by the models

vast pier
#

it's currently 256x256 pixels

oblique estuary
#

aah, I still love seeing things like this, customization, variety and potential of that is amazing

vast pier
#

Yeah it's cuz build42 supports having multiple models for weapons that it picks at random

oblique estuary
#

Oh, I still haven't converted to 42, the unstable makes me hesitate a bit since I'm still not even sure how to do 41 yet

vast pier
#

the hardest part I've had to deal with so far was getting it so when you crafting the stock version of the gun, it keeps the same variants

#

otherwise it would just spit out a random choice

oblique estuary
#

Also I mainly do modding for me and my friends to enjoy, and since 42 don't support multiplayer yet... Well, there's the main reason I stay 41 for now

vast pier
#

having them be consistent is important for me

oblique estuary
#

Hmm.. Yeah, consistency and reliability goes hand in hand after all

vast pier
#

also as a little tidbit, I'm gonna be making it so the player blacksmithed pieces will never roll the rusty variants

#

cuz that just wouldn't make sense

oblique estuary
#

Heh, yeah making rusty stuff seems a bit odd if it's literally comming from the furnace

vast pier
#

and to ease my workload a bit, I wrote out this lua code that adds the models to the guns

#

otherwise it would look like this in the weapon script
WeaponSpritesByIndex = ImprovisedMagRifleNoStock;ImprovisedMagRifleNoStockGreen;ImprovisedMagRifleNoStockBlack;ImprovisedMagRifleNoStockPurple;ImprovisedMagRifleNoStockRed;ImprovisedMagRifleNoStockOrange;ImprovisedMagRifleNoStockPink,

#

which is unreadable and hard to make changes to

oblique estuary
#

Yeah.. I try to keep order in my codes as well, otherwise it's near impossible to change anything

vast pier
oblique estuary
#

So in lua I do a lot of -- to categorize, scripts it's /**/ and xml <!-- --> all over but because of that now I can finaly go back and find everything within 10 seconds

vast pier
#

do you use visual studio code?

oblique estuary
#

Aye

finite scroll
#

how can i replace a specific texture in a texturepack?

oblique estuary
vast pier
finite scroll
vast pier
oblique estuary
oblique estuary
vast pier
oblique estuary
#

Oh, the ctrl+F?

vast pier
oblique estuary
#

Goodness gracious ๐Ÿคฏ

vast pier
oblique estuary
#

I love you Oreos

#

I've wished for something like that for ages

#

That little trick is gonna be abused in my scripts and codes from now on ๐Ÿ˜

vast pier
#

@red tiger taught me that

#

at least I think it was them

vast pier
#

makes item files look like this

red tiger
red tiger
oblique estuary
#

I got an autist diagnose, so this is candy for my soul

vast pier
#

oh also in item files you need to do

*/```
instead of the ```--```
red tiger
oblique estuary
red tiger
vast pier
#

Does manually spawning and placing 56 variations of the same two guns for a single photo count?

oblique estuary
red tiger
#

That's how TypeScript mods support for PZ happened.

#

A lot of gin and redbulls.

oblique estuary
vast pier
oblique estuary
vast pier
#

You need to set the file language to zedscript or lua for it to show up

oblique estuary
vast pier
#

if you don't wanna install zedscript, then just press
ctrl + k, and then m.
then you type lua in the bar that shows up

#

note I said and then m

#

you press ctrl k and then let go before hitting m

#

zedscript is better for item scripts tho since Jab is setting up descriptions for functions n' stuff

red tiger
#

There's an unfilled section of that extension that allows for more descriptions to be implemented.

#

But with build 42 there's changes I'll need to make when I get to it.

bronze yoke
#

batman's one works with build 42 scripts i think

red tiger
bronze yoke
#

i don't spend much time in scripts so i don't really use either one

red tiger
#

Also a cat just jumped on my head

bronze yoke
#

ah i was thinking of a different community, not batman LOL

#

or wait no maybe that is this one

red tiger
#

Their uhh syntax highlighter good?

#

It's a little short.

oblique estuary
red tiger
#

@bronze yoke Are they a user here?

#

I was looking for discord info

bronze yoke
#

i believe so, discord doesn't really have good ways to search for users though and i only sort of remember their name ๐Ÿ˜…

vast pier
bronze yoke
#

it's @ batman-fr

vast pier
#

it stays .txt

red tiger
#

He's French.

oblique estuary
#

Any way I can get a link to Zedscripts?

red tiger
#

@true plinth Hello. You there? I wrote the other vscode extension for ZedScript.

vast pier
oblique estuary
#

Didn't see time, already 03:33 here, better get to bed now
Nice meeting you both @red tiger @vast pier And thanks for the help!

#

Hmm.. one last thing, is there a way to keep tab being the 4x spacebar as it was before on Zedscript?

bronze yoke
#

hmm, that shouldn'tbe up to the extension

#

you can change it in the bottom right (or left? parts of my ui are backwards for personal preference)

#

this should open a menu that changes the indentation

oblique estuary
#

Thanks @bronze yoke ๐Ÿ˜„

vast pier
#

dear god help me, that means there will be 112 variants

#

cuz 2x2x2x2x7

vast pier
# vast pier cuz 2x2x2x2x7

2 guns
2 barrel textures
2 ejection port placements
2 reciever variants
7 color variants
2x2x2x2x7 = 112

silent zealot
#

You're crazy.

#

Does that mean 112 items have to be defined, or is this done with various attachments?

vast pier
#

112 model definitions

#

๐Ÿ‘

#

lmao

#

not 112 fbx files, 112 entries in a txt file

silent zealot
#

You can't abuse the attachment system used for scopes/mags/silenceers/etc?

#

make a stock attachment, a mag port attachment, a tape attachment...

vast pier
#

I could maybe but then I would need to write my own randomizer code to choose random attachments, no?

silent zealot
#

Easier than writing code to auto-generate 112 model definitions

vast pier
#

I mean the heavy hitter for the definitions is actually just the colors

silent zealot
#

but, since you've got that working, not worth redoing now

vast pier
#

everything else is copy paste

#

I have the variants in separate files so I can mass edit them

#

not 112 files

#

the way I said that made it sound like 112 txt files

#

It's 8 txt files right now, with 7 model definitions each

vast pier
#

I haven't done the other 56 yet since I just made the angled mag variant and still need to make all the model variants associate with it

vast pier
#

Is there a way to fire off some lua when the player starts a reload?

#

And when finishing said reload?

tacit pebble
#

ISInsertMagazine.lua
ISEjectMagazine.lua

If you want earlier or later than the actual timedAction,
ISReloadWeaponAction.lua (Or something similar. I can't remember)

umbral raptor
#

i have a question. so my old structure involved having all the files in both common and 42. i didn't know much back then

#

can i throw everything in 42?

#

my mod is only for B42

#

also i wanted to know if that file structure change might affect the saves of people using the mod in any way

bronze yoke
#

everything can be in 42, but the common folder must at least exist

#

it shouldn't affect the mod in any way to move them to just that folder

umbral raptor
muted garnet
#

is there an easy way to add a vanilla trait for a certain profession as a profession trait that can't be removed, and for other professions make it a trait that can be added/removed?

bronze yoke
#

the only way is to make a new profession trait with the same display name and description, make it mutually exclusive with the 'real' one, and swap it with the real one when the player spawns

#

this is also how the vanilla ones work

muted garnet
#

no, i want to add the NightVision trait to the profession, but so that this profession can't remove it. is there such a possibility, except for adding a duplicate trait ongameboot and adding the original trait ongamestart?

bronze yoke
#

that's just how profession traits are done

muted garnet
#

thanks

vast pier
#

Is there a guide for making weapon attachments?

muted garnet
bronze yoke
#

player:getTraits():add("InternalNameOfTrait")

muted garnet
#

thanks

red tiger
bright fog
true plinth
red tiger
#

I'm bogged down with other work atm

true plinth
#

ok if you want some help, i can contribute ๐Ÿ˜‰

umbral raptor
#

is it possible to make this script cool instead of heat?

local function AddHeatSource(x,y,z,heatData)
local heatSource = IsoHeatSource.new(x, y, z, heatData.range, heatData.temp)
getCell():addHeatSource(heatSource)
return heatSource
end

ancient grail
#

reverse the var maybe?

#

or * -1

fallen merlin
#

Helloo, I am having the following problem and hope someone can help me. I have this quiet simple script:

function CurePlayer()
    local player = getPlayer()

    if player then
        player:getBodyDamage():setInfected(false)
        player:getBodyDamage():setInfectionMortalityDuration(-1)
        player:getBodyDamage():setInfectionTime(-1)

        for i=0, BodyPartType.ToIndex(BodyPartType.MAX) - 1 do
            local bodyPart = bodyDamage:getBodyPart(BodyPartType.FromIndex(i))
            bodyPart:setBleeding(false)
            bodyPart:setDeepWounded(false)
            bodyPart:setBurnTime(0)
            bodyPart:setScratched(false, false)
            bodyPart:SetBitten(false)
            bodyPart:setFractureTime(0)
            bodyPart:setCut(false, false)
        end
    end
end

local function AddCureButton()
    local cureButton = ISButton:new(100, 100, 150, 30, "Heal", nil, CurePlayer)
    cureButton:initialise()
    cureButton:addToUIManager()
end

Events.OnGameStart.Add(AddCureButton)

And it seems to work. So it creates a little "Heal" button and the wounds I had were cured as well as the queasy moodle. But after some time, the queasy moodle reappears. Also I noticed my Stress value going slightly up even when just sitting in a base without bad moodles or traits that could cause Stress to increase. This lets me believe that I didnt cure the zombification infection and so I thought maybe someone of the more experienced modders here knows, if I did miss a method, which actually cures the knox infection.

Thank you in advance ๐Ÿ™‚

fleet bridge
fallen merlin
# fleet bridge Are you setting infection level to zero as well?

I thought setInfected(false) would eliminate the infection and the level would therefore be irrelevant.

I added the like so it looks like this now:

        player:getBodyDamage():setInfected(false)
        player:getBodyDamage():setInfectionMortalityDuration(-1)
        player:getBodyDamage():setInfectionTime(-1)
        player:getBodyDamage():setInfectionLevel(0)

Will try it out quickly

umbral raptor
heady glen
#

hi anyone here can tell if it would be possible by modding to get data of closest tiles. or at least all visible tiles or all currently loaded tiles to memory or something like this?

ancient grail
heady glen
umbral raptor
#

@ancient grail

fallen merlin
# fleet bridge Are you setting infection level to zero as well?

I am getting an Exception (java.lang.RuntimeException: attempted index: getBodyPart of non-table: null) at this line:
local bodyPart = bodyDamage:getBodyPart(BodyPartType.FromIndex(i))

I think I maybe use the BodyDamage wrong. I am new to Lua, but I saw that BodyDamage has a List BodyParts and I thought this would be the way to reference it in my script

ancient grail
# umbral raptor this is code for a heater

you want to add heat to radio? interesting. i think i need the code for adding heat too... maybe
another idea is to spawn an object that produces heat and just modify the sprite maybe

torn igloo
#

What event immediately comes after OnInitGlobalModData?

ancient grail
fleet bridge
#

It's body damage

bright fog
fleet bridge
fallen merlin
fleet bridge
#

java arrays start from 0

fallen merlin
#

No I know that haha

#

I just answered to ping you haha. I can actually program in Java, Python (have a cs degree), but yes the modding stuff is new for me

sour island
fallen merlin
# sour island The wiki has been getting a lot of updates (big shout-out to <@29381589280502579...

Yeah it is just pretty big and some things have to be found out by yourself (our I just missed some smt). For example:

        local bodyParts = player:getBodyDamage():getBodyParts()
        for i = 0, bodyParts:size() - 1 do
            local part = bodyParts:get(i)
            part:setBleeding(false)
            part:setDeepWounded(false)
            part:setBurnTime(0)
            part:setScratched(false, false)
            part:SetBitten(false)
            part:setFractureTime(0)
            part:setCut(false, false)
        end

This makes total sense to me, but I didnt expect the BodyParts to be in BodyDamage. And what's was rly frustrating was the SetBitten method. For some reason all methods seem to be set..., only SetBitten starts with an capitalized S. Maybe this is part of Lua's language, but yes took me a while

Btw I dont rly know if this loop now works

#

It doesnt throw an error at least, but the Stress level is still rising

sour island
# fallen merlin Yeah it is just pretty big and some things have to be found out by yourself (our...

Some of the codebase is 10+ years old, I imagine a lot of it is in systems related to player health and stats. Some of the naming conventions are not easy to follow.

If you use an IDE I suggest looking into the Umbrella tool which auto-generates functions as you type. Also, having a copy of the decompiled code so you can jump around and look at inner workings. Sometimes you'll figure out the best route to take by reading through java.

bright fog
#

I suggest checking this out

silent zealot
silent zealot
umbral raptor
#

if item:hasID("SupportCorps.X) then

How do i correctly ask for an item ID?

#

idk if this is correct

ancient grail
#

you mean getFullType()
?

#

like Base.Apple

#

@umbral raptor

umbral raptor
#

yeah, i want my code to detect a certain item

#

when its used

heady glen
#

i wrote my first script for mod and i want to see if it works

#

how do imake something appear in ingame console

#

like you know print( or something)

drifting ore
heady glen
#

ahh okay

#

then my script dont work xD

drifting ore
#

Any errors? You can share the script here if you'd like

heady glen
#

well this is my code

#
    local player = getPlayer()
    if not player then return end
    
    local px, py, pz = player:getX(), player:getY(), player:getZ()
    local range = 3
    
    print("tilez mod")
    
    for x = px - range, px + range do
        for y = py - range, py + range do
            local square = getCell():getGridSquare(x, y, pz)
            if square then
                print(string.format("Tile (%d, %d, %d):", x, y, pz))
                
                print(" - Is solid:", square:isSolid())
                

            end
        end
    end
end

Events.OnPlayerUpdate.Add(logNearbyTiles)
#

i did activated the mod in menu

#

i look for anything in this console

#

but cant even see "tilez mod"

#

technically it should spam whole console with "tilez mod" and bunch of other stuf each tick

#

a lol i think its because this uncommented text i pasted with local player xd

drifting ore
#

I think lua requires more than just print("string")

#

Unless it was
print(stringVariable)

heady glen
#

aa its actually the code xd sceond line

#

seems like my mod isnt even running

#
local function logNearbyTiles()
    local player = getPlayer()
    local xdd = 0;
    print("tilez mod")
    print(player)
    print(xdd)
    if not player then return end
    
    local px, py, pz = player:getX(), player:getY(), player:getZ()
    local range = 3
    
    
    for x = px - range, px + range do
        for y = py - range, py + range do
            local square = getCell():getGridSquare(x, y, pz)
            if square then
                print(string.format("Tile (%d, %d, %d):", x, y, pz))
                
                print(" - Is solid:", square:isSolid())
                

            end
        end
    end
end

Events.OnPlayerUpdate.Add(logNearbyTiles)
#

i did this and cant see any of these even if the prints are on top

undone elbow
heady glen
#

do i have to restart zomboid anything i change code?

#

so i made an file with print("i'm alive") only

#

and still cant see anything

undone elbow
#

Lua code will definitely be updated if you exit to the main menu.

heady glen
#

i tested print("test") in console and it worked so i know how it works

#

LOG: General

undone elbow
heady glen
#

nothing

undone elbow
#

i.e. 1) edit 2) exit to main menu 3) see console.txt

heady glen
#

i searched by alive word and in whole file no such word

#

althrough i see

#

LOG : Mod , 1741273894184> loading scan_tiles_mod

undone elbow
#

So your lua file is not loading. What is your file structure? Where is the file?

umbral raptor
#

is heatsource hard coded to never go below room tempreture?

#

and is it possible to override this?

umbral raptor
heady glen
#

official

#

i just downloaded from steam

#

no beta

undone elbow
# heady glen

must be tengo/Zomboid/mods/ScanTilesMod/media/lua/client/scan.lua

#

for B41

heady glen
#

so in 42 its good?

#

like it is?

#

is this 42?

undone elbow
#

this is 42

heady glen
#

so media/lua?

undone elbow
#

yes

#

media/lua/client/

heady glen
#

ok imma give it a try

naive fox
#

Guys, I'm stepping into PZ modding, but one thing that isn't clear to me.

What's the best way to debug code and test it in game? It sucks to have to restart the game to test code

undone elbow
#

Going to main menu resets lua. Also press F11 in debug mode and see what you have there. ||You can reload a lua file in active game||

umbral raptor
#

not model scripts tho

naive fox
#

I'll mostly be doing lua scripts, which I'll have to reload pretty often to test things out.

Can I reliably do that with the F11 screen?

undone elbow
#

Yes

naive fox
#

Thank you~ lastly, what's the best way to catch and identify errors?

Does F11 show them?

undone elbow
#

console.txt

#

in C:\Users\user\Zomboid

naive fox
#

Aahhh, I see. It updates in realtime?

#

As in, I don't need to quit the game?

undone elbow
#

You can track it while in game

naive fox
#

Awesome. Thank you. You've been great help (:

umbral raptor
#

how do i reload lua through F11?

#

if the file isn't there

#

like no errors occured

undone elbow
#

Double click the filename (I guess, not sure)

undone elbow
#

@umbral raptor btw how do you get the builder tag here? Your questions sound like you just started creating your first mod.

umbral raptor
#

idk how i got the builder tag

#

@undone elbow do u know LUA? could i ask u some things?

undone elbow
#

I know LUA. It's the simplest programming language and it takes 15 minutes to learn it completely. But most of the questions are not about lua, but about the game API.

umbral raptor
#

true

#

but i do lots of LUA syntax issues haha

#

thats the problem

undone elbow
#

Learn it ๐Ÿ™‚

umbral raptor
#

trying, nobody starts a master man

#

im learning it from looking at other mods

undone elbow
#

Google "lua in 15 minutes". Let's say it will take 1-2 hours max.

umbral raptor
#

ight man

true plinth
torn igloo
#

What does negative value in distribution does? Doesn't spawn or still spawn?

umbral raptor
#

can someone help me fix this?

#

im trying to override zomboid's base-game heat source capping

quiet glacier
#

Does anyone know where the vanilla Nailgun files are located?

bronze yoke
umbral raptor
#

but for some reason it sets the entire world to being cold lmao

#

i suck at programming

twin lintel
#

any suggestions on how to start learning how to create mods?stressed

naive fox
sly ivy
#

uh, sorry but anyone know how to fix this?

bright fog
#

What did you do ?

#

That's your model which is broken I bet ?

bright fog
#

We can't help you if you literally give ZERO detail

#

Explain your situation or we literally can't do shit for you

sly ivy
#

thats not entirely true,

#

i was asking if anyone has any ideas on how to fix that,
not if people know the exact fix,

#

or what the cause may be

bright fog
#

It is, you're getting a bug which I've never seen in my entire life

  • are you developping a mod ? Updating one ?
  • what's the mod
#

You can literally give so much detail

#

That's not a common problem what you just shared

sly ivy
#

how was i supposed to know?

#

and i'd appreciate if you were a little less rude

bright fog
#

I asked two questions, clearly pointing to you needing to give more detail. When you share a problem you have, giving as much detail as you can on the situation is necessary if you expect anyone to be able to help you

#

Sometimes, an image doesn't give enough informations, like in your case

#

I can only guess your problem involves an item in hands, and that's it shrugs

sly ivy
bright fog
#
  • how did you get in this situation
  • what mod are you developping
  • is the item a weapon ?
bright fog
sly ivy
#

and tbh dude you kinda put me off asking for help from you

sly ivy
bright fog
sly ivy
#

eh, you came off condescending

#

so im just gonna end this n say goodbye

naive fox
#

Has anyone worked with the getWindows() function in IsoRoom?

#

It's supposed to be a vector of windows in a given room. I'm trying to do something with it, but it's always empty

queen oasis
sly ivy
#

is size supposed to just be a run command?

naive fox
naive fox
queen oasis
sly ivy
#

ahhh, and, thanks for teaching me something new, hope it goes well

bright fog
#

That's notably the case for methods that involve retrieving the list of buildings in the player cell drunk

#

I don't know if that's the case here however

naive fox
bronze yoke
#

there's also something really weird with vectors

bright fog
#

Also you said it gives out a vector ?

#

Bcs I checked getWindows and it gives an ArrayList

#
    public ArrayList<IsoWindow> getWindows() {
        return this.Windows;
    }
#

Doesn't look like that's mentioned a lot

naive fox
#

Ahh, yeah. You're right. I confused it with "Windows" field in IsoBuilding

bright fog
#

Hmm nvm

#

It should have windows

#

I think

naive fox
#

but anyhow, IsoRoom:getWindows() still says it's 0 when I enter a room

bronze yoke
#

this array is unused

#

nothing ever adds to it

naive fox
#

Jesus

bright fog
queen oasis
#

yea I was trying to figure out why I had this code for windows if it was easy

bronze yoke
#

these are the only usages

#

the getter is never called

bright fog
#

Ah yeah you need to get the vector from the building I feel like

naive fox
#

I tried, but it's a field without a getter. I checked out the link you sent and gave it a try but couldn't figure out how to get the field

bronze yoke
#

if you don't mind adding a dependency starlit library makes it pretty straightforward

bright fog
#

Yeah

bright fog
naive fox
#

I'll give that a go. Is it possible to check if the Windows vector is actually used in IsoBuilding?

umbral raptor
#

could someone decompile a java file for me?

queen oasis
#

I ended up grabbing the room squares, looping through and checking the square for an IsoWindow. You have to check south and east also because those windows are technically outside. Don't know if that's the right way to do it though

bright fog
bronze yoke
#

there are code usages

umbral raptor
bronze yoke
#

can't promise that means it actually runs but it's not a 'definitely not' situation

bright fog
naive fox
#

Alright, thanks guys. I'll give your suggestions a go.

umbral raptor
bright fog
bright fog
#

There's a single click decompiler made by Albion in there

umbral raptor
#

awesome

bright fog
#

You just click it and boom files are decompiled

umbral raptor
#

thats amazing

#

thanks

queen oasis
#

that reminds me, I need to decompile 42.4...

bright fog
#

Me too lol

#

But I'm not modding rn

queen oasis
#

if you ain't modding, you ain't living right

bright fog
#

But I'm busy these days, I focused making documentation for the wiki

umbral raptor
#

its so weird that the game uses so many different codes and languages lmao

#

and they all work together somehow

queen oasis
#

the wiki is looking phenomenal

umbral raptor
#

like it uses lua, it uses whatever the fuck scripting is, it uses java.

bright fog
#

I already have a mod which is pratically finished, just not getting motived by continuying work on it because I need tiles and I'm absolutely not an artist Depressed

bright fog
#

For some reasons lol

bronze yoke
#

and also does not qualify for the definition of the term 'scripting' ๐Ÿ˜ญ

bright fog
#

Yeaaah, you're basically defining tables of objects in a way

umbral raptor
#

yeah it allowed modding. if i had to mod items in lua or smthin i wouldnt have touched modding haha.

bright fog
#

The same could have literally been done in Lua I feel like, by literally just having tables that are your objects ?

#

It would have made it easier for people to learn Lua a tiny bit to get used to some basic formatting for it

#

Would also allow soooo much to be done on script entries

umbral raptor
#

not sure how it'd be done, i dont know much about lua, but everytime i touch the lua file while modding i always end up producing garbage code lol

bronze yoke
#

zedscript predates the game having lua scripting

bright fog
#

Yeah

bronze yoke
#

it also was actually a scripting language originally

bright fog
#

That was my guess

#

If all was made in Lua you could directly modify any existing scripts, expand them and shit

#

Without the need for the shitty methods to modify existing scripts that we currently have and that do the bare minimum

#

Would allow for easier compatibility basically

bronze yoke
#

i don't really like things like that being defined in code but i wish they had gone with a different name than 'scripts' and ideally a more standard format like json or something

bright fog
#

Yeah

umbral raptor
#

but u could do both scripting and lua lol

bright fog
#

What do you mean ?

umbral raptor
#

i mean that you can set up your item fully in scripts and add the additional functions in lua

#

like the oncreate, oneat, etc etc

#

thats the simple stuff

bright fog
#

Or just directly have everything in Lua so you can literally do anything on items

#

I see how defining things in the script files in Lua files could cause some issues, but it would bring actually soooooo much to the game

#

Would make everyone's lifer easier in so many ways

#

And tbf that's basically what distribution is rn, it's purely Lua based

umbral raptor
#

what could it allow u to make if that were to happen?

#

that isn't possible right now

bright fog
#

Overwriting will cause incompatibilities

umbral raptor
bright fog
#

Yea

umbral raptor
#

maybe having the ability to add in our own commands would be cool

#

if it isn't already there

bright fog
#

You need to go through a few Java objects which involve getting the script object, and you are limited by the methods defined for that object

If you define custom entries in the scripts of your items, you are fucked because the game by default adds custom entries to the mod data of every single items

#

So you end up having to use lookup tables for your items, instead of directly accessing the item script data which could hold your custom entries directly

#

You could automate the creation of items based on conditions because it would use tables that you could repeat

#

You could create items based on sandbox options directly

#

Dynamically create items

#

There's a looooooooot of shit you can do with defining items in the Lua

#

You want to change values based on if another mod is activated ? You need to go through the script java object while you could directly set values based on conditions from the Lua

#

And let's not mention any new scripting added by the devs, like the craftRecipe which sometimes lack java methods to modify those

#

You're basically entirely depend on the devs actually adding the methods

#

While if scripts were just tables in the lua, you could directly access anything and modify anything

naive fox
bronze yoke
#

there'd be performance implications if they were kept in lua

bright fog
bronze yoke
#

in b41 they had to rewrite the loot system in java since accessing the loot tables just had so much overhead

bright fog
#

I agree at the minimum using json could improve things a bit

bronze yoke
#

if scripts were lua that exact problem would come back but worse (they have to check like a hundred script properties to instance an item)

bright fog
#

Yeah

#

They would still need to bring the things java side

#

But at this point isn't the problem just Kahlua ? drunk

umbral raptor
#

the decompiler wont work ๐Ÿ˜ฆ

#

cant run it neither by clicking or by command line

bright fog
#

Wait

#

Yeah I think that's the reason ?

bronze yoke
#

apparently that's what unable to access jarfile means

umbral raptor
bright fog
#

Welp, Albion should be able to help you better than me here

umbral raptor
#

i have it open

bright fog
bronze yoke
umbral raptor
#

if anyone can help i just need the decompiled isoheatsource

queen oasis
# umbral raptor

the path after should be your path to the ProjectZomboid folder?

bright fog
#

That will make your life way easier

queen oasis
#

I just did this and I can't remember for sure but I think so

bright fog
umbral raptor
bright fog
#

Then you're in the wrong folder

bronze yoke
#

this project was only written in java since it needed to interface with stuff that was already in java, i don't have much experience with actually using java

bright fog
#

You need to do

cd "folder/with/the/jar/file"
queen oasis
#

whereever the ZomboidDecompiler.jar is, you need to nav to that folder with cmd, and then run that command with your zomboid folder

bronze yoke
#

you can also just open the folder in file explorer, put cmd into the address bar and press enter

#

that'll open cmd to that folder

bronze yoke
#

try it ๐Ÿคทโ€โ™€๏ธ

bright fog
#

I just did

#

That doesn't do that

bronze yoke
#

what os are you on?

bright fog
bright fog
queen oasis
#

works for me

bronze yoke
#

which version

bright fog
#

10

bronze yoke
bright fog
#

ups

#

Lol

#

Yeah that works hahalol

#

Such a silly mistake

bronze yoke
#

i was a little afraid for a second that one of the many weird things i installed to edit file explorer added it ๐Ÿ˜…

umbral raptor
bronze yoke
#

it can only guess your game directory if it's in very specific places (i can probably ask the registry for steam's location but i haven't looked into that yet), you'll have to pass the path to the ProjectZomboid folder

#

e.g. for me java -jar ZomboidDecompiler.jar "D:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid"

bright fog
umbral raptor
#

got it to work

umbral raptor
#

while trying to get it to work

bright fog
#

๐Ÿ’€

umbral raptor
#

does it say when its done?

frank elbow
#

wt opens the newer terminal but idt the explorer trick works without modification (some setting had to be changed somewhere iirc, but I don't remember where)

#

Which sucks

bright fog
#

newer terminal ?

frank elbow
#

Newer only in the comparative sense (which is the only sense but you know what I mean); this has been around for a few years now

bronze yoke
#

i had no idea it was open source

frank elbow
#

Some of those issues are a fun read

#

There was drama a whiiiiile back when someone called out inefficient code, it led to some unnecessarily heated exchange & ultimately they demonstrated a better way to do it by rolling a basic terminal

queen oasis
#

Deciphered what I had from before and rolled it in to one function to find all windows in a room. Returns window objects in a table.

function JB_ASSUtils.GetWindowsInRoom(playerObj)
    local windows = {}
    local roomSquares = playerObj:getSquare():getRoom():getSquares()
    for i = 1, roomSquares:size() -1 do
        local square = roomSquares:get(i)
        local south = square:getS()
        local east = square:getE()
        if square:getWindow() then
            table.insert(windows, square:getWindow())
        elseif square:isWindowTo(south) then
            table.insert(windows, south:getWindow())
        elseif square:isWindowTo(east) then
            table.insert(windows, east:getWindow())
        end
    end
    -- print("I found " .. tostring(#windows) .. " windows in this room.")
    return windows
end
frank elbow
#

Nice. Open to feedback?

queen oasis
#

absolutely, but I know it's a mess

frank elbow
#

One way to improve it would be to reduce repetition; you're calling roomSquares:get(i) quite a lot, which means unnecessarily repeating the process of getting that element. You could assign the result to a variable and then operate on that instead (local square = roomSquares:get(i), then use square in its place after that point)

umbral raptor
#

found this

#

works far better than any of those decompilers

#

lol

frank elbow
#

What works better?

#

Pretty sure albion's is built on a fork of fernflower & certainly improves some of its output, as someone who has used both

queen oasis
#

and I'm out

bright fog
umbral raptor
#

yeah probably lol

naive fox
bright fog
#

They make the decompiled code better to read

#

What problem do you have with the decompiling rn ?

bright fog
bright fog
naive fox
umbral raptor
#

it gives u the code as text in the website

bright fog
bright fog
frank elbow
bright fog
#

Ik

frank elbow
#

...you are the "he"

#

Of course you know lol

bright fog
#

Oh sorry lol

naive fox
#

@umbral raptor

Put the jar file in an empty folder.

If you have PZ installed on a different drive, use the instructions for "other" and feed it the directory of your PZ installation.

bright fog
#

It's seriously just a singular double click

#

But you need java installed, it should be explained in the wiki page

naive fox
#

Nope, double click hadn't worked for me either. If the game is not on your C drive, it doesn't find it

bright fog
#

Yes

#

Ofc

queen oasis
#

mines on E: and it works fine my reading skills need work

bright fog
#

np lol

queen oasis
#

I think the directions for ZomboidDecompiler are pretty straight forward though

bronze yoke
#

i think i can probably ask the registry or something where the steam library is but i haven't looked into that, not much of a priority

#

currently investigating analysing the output to fix up some common decompiler annoyances in post

naive fox
#

I mean, I got it to work long ago. I just had to do it through the console rather than double clicking (which didnt work)

silent zealot
#

Has anyone tried running both B42 and B41 by making copies of the game instalation? Any gotchas with them both sharing the same c:\users\me\Zomboid profile directory?

bronze yoke
#

it will absolutely destroy everything if you let them share a cache directory

#

launch one of them with -cachedir="C:/SomewhereElse/

#

otherwise there's no issues with having multiple installations

ancient grail
silent zealot
#

Thanks, doesn't sound worth it just to backport a mod to B41.

#

Also, 42.4 broke one of my mods... somehow my simple recipe breaks the code for using a game controller on the crafting interface.

storm trench
silent zealot
#

Definitely that, but I'm struggling to work out why.

vast pier
#

that's what I did

#

since b41 isn't getting any updates, you should be safe to just leave it there

drifting ore
#

I've searched every file of reference mods and searched up every term I could think of and I still can't figure out how to set the coverage of my bracers so that the armor value applies to the character's forearms

vast pier
#

unsure tho

#

why not just try to figure out what the vanilla vambraces do?

#
    {
        DisplayName = Forearm Leather Armor - Right,
        DisplayCategory = ProtectiveGear,
        Type = Clothing,
        Icon = Arm_Armor_Leather,
        BloodLocation = ForeArm_R,
        BodyLocation = ForeArm_Right,
        ClothingItem = Vambrace_Leather_Right,
        BiteDefense = 100,
        ScratchDefense = 100,
        CanHaveHoles = TRUE,
        ClothingExtraSubmenu = RightForearm,
        ClothingItem = Vambrace_Leather_Right,
        ClothingItemExtra = Vambrace_Leather_Left,
        ClothingItemExtraOption = LeftForearm,
        WorldStaticModel = Vambrace_Leather_Right,
        Insulation = 0.35,
        WindResistance = 0.3,
        CombatSpeedModifier = 0.98,
        DamagedSound = ArmourBreakLeather,
        Weight =  0.5,
        DiscomfortModifier = 0.05,
        Tags = IgnoreZombieDensity,
    }```
#

It's probably bloodlocation

#

cuz that's also the value that handles clothing holes

drifting ore
#

Weird

#

Thank you, I was just ignoring it

silent zealot
silent zealot
vast pier
silent zealot
#

Important: if you list an invalid bloodlocation you can cause the game to load and delete lots of items from yoru savegame.

vast pier
#

Why is this happening

#
{
    model ImprovisedWoodStockTest
    {
        mesh = weapons/firearm/parts/attachments/WoodStockTest,
        texture = WorldItems/HandleWooden_Small,
    }
}```
#
        ModelWeaponPart = DefaultwWoodenStock ImprovisedWoodStockTest saltystock saltystock,```
#

@silent zealot You ๐Ÿซต
Help me figure this out, you're the reason I'm setting up gun attachments

silent zealot
#

hahahaha

#

I just spent two hours working out why my recipe broke game controller code.

#

Answer: because 42.4 parses the recipe input list differently; in 42.3 you didn't need a comma at the end of every line, now you do.

vast pier
#

yeah and I'm gonna be spending hours figuring out how I can get the tape to still have color variants despite the fact that the attachments aren't capable of having randomized sprites

tacit pebble
#

is there any possibility of syntax error? because

MeshAssetManager.loadCallback> Failed to load asset: AssetPath{ "media/models/Vehicles_WheelFRTrans.txt" }

this is what i've usually seen (the path is inside of {})
(Or something has been changed in B42...)

silent zealot
#

Otherwise the @$#%@#^%@#ing game controller code thows a fit

#

Becuase __len is not defined for something.

silent zealot
vast pier
#

no

silent zealot
#

vanilla is all:```
model x4Scope
{
mesh = Weapons/parts/Rifle_4XScope,
texture = Weapons/parts/Rifle_12XScope,
}

vast pier
#

The guide I'm following does this tho

silent zealot
#

You shouldn't need to, but I have trust issues with the Zomboid parser/loader

vast pier
#

maybe

#

they did change a lot about the guns, it could be a new bug

silent zealot
vast pier
#

I'll look at a mod that adds attachments first

vast pier
silent zealot
#

in the weapon:
ModelWeaponPart = x4Scope x4Scope scope scope,

vast pier
#

yeah I know
ModelWeaponPart = ItemName ModelName location location,

silent zealot
#

Where you write the attachment name twice then the attachmnet point in the weapon item twice, for some reason

#

hmmm

#

correct file extension on weapons/firearm/parts/attachments/WoodStockTest ?

#

not WoodStockTest.fbx.bx or something silly?

#

model file not being held open by blender?

#

Did you burn sage and anoint your CPU with the correct sacred oils?

vast pier
#

Huh that's weird, I was gonna ping rainmaker_13 but they aren't in the server? or any mutual servers?

#

strange

#

their last message was 2/12/25 at 12:47pm

#

was gonna ask them if they knew what's wrong since they've modded in attachments for b42

silent zealot
#

Not sure I'd classify a four-color bic as a "memento"

prime adder
#

Why does no1 develop a mod that removes any basically nude female characters whether from sex events or strip club I can't look at them in islam

vast pier
vast pier
vast pier
#

Read my mesh script, I have it as firearm/parts/attachments when it's just firearm/attachments

tacit pebble
bronze yoke
#

i've updated ZomboidDecompiler with a more robust system for detecting game installations since that's come up more often than i thought it would: if anyone has a steam library in a weird place, i'd appreciate it if you gave it a try and let me know if it works
as before, the detection only works for steam copies of the game on windows
https://github.com/demiurgeQuantified/ZomboidDecompiler/releases/tag/v0.1.5

silent zealot
#

I can't recall if I had to set that explicitly when I used the previous version of ZomboidDecompiler

bronze yoke
#

the older version could literally only find the default steam location on either the c or d drive

#

but it turns out way more people than expected don't have their steam library in the default location ๐Ÿ˜…

silent zealot
#

This new one found the game, no issues.

bronze yoke
#

thank you for testing!

silent zealot
#

Thank you for the tool and motivation to update my decompiled game to the latest version!

queen oasis
bronze yoke
#

thank you!

prime adder
#

I am not kidding 1 bit

queen oasis
#

when you think things might be simple...

public Square[][] getSquaresForLevel(int _int) {
  ChunkLevel chunkLevel = this.getLevelData(_int);
  return chunkLevel == null ? null : chunkLevel.squares;
}
vast pier
silent zealot
#

That is why I use git and checkin every time a bit of progress is made

#

So I can see what I did to break everything

vast pier
#
    {
        mesh = weapons/firearm/attachments/imp_mag_angled,
        texture = weapons/firearm/GunAtlas1white,
    }``````
    model WoodStock
    {
        mesh = weapons/firearm/attachments/imp_wood_stock,
        texture = weapons/firearm/GunAtlas1white,
    }``````
    model WoodGrip
    {
        mesh = weapons/firearm/attachments/imp_wood_grip,
        texture = weapons/firearm/GunAtlas1white,
    }```
    ModelWeaponPart = ImprovisedStock WoodStock stock stock,
    ModelWeaponPart = ImprovisedMagFeed MagFeed magfeed magfeed,
    ModelWeaponPart = ImprovisedGrip WoodGrip grip grip,```
silent zealot
vast pier
#

this is driving me insane

#

It doesn't make sense to me, because the game is properly registering the models

silent zealot
#

Take a break and resume later

#

Texture path ok?

vast pier
#

yes I know they're both fine for certain

#

I know for certain because they show up in the attachment editor properly modeled and textured

#

the models are parsed correctly, or they wouldn't show up in the attachment editor

silent zealot
#

hmmm.

#

And no other errors exceptions in console.log?

#

Exception: too many variations I can't handle this much choice

vast pier
#

Nope, just the asset path

#

which makes zero sense considering the game literally loads it perfectly fine in the attachment editor

keen venture
#

Hello-I've never made a mod before but im trying to just make a variation for the Varsity jacket, Nothing fancy just a texture swap ontop of the alreayd existing bob and kate Jackett_Varsity models. I followed a tutorial but every time i try to load the mod it crashes so I honestly have no idea what is even wrong

#

could someone perhaps look at my files or maybe knows a more in depth tutorial/troubleshooting page i could look at to figure out how to do this? I am a complete newb at modding

tacit pebble
#

will it matter
models_x
and models_X?

bronze yoke
#

no

tacit pebble
#

hmm

bronze yoke
#

the game converts all filepaths to full lower case before doing anything with them

tacit pebble
#

I'm still wondering why there's a model name instead of actual path between { and }
pure curiosity

silent zealot
#

And are you making a new item, adding a texture to the existingjacket, or repalcing a texture of teh existing jacket?

keen venture
#

just trying to give it a new png. It times out anytime i try to load the game back up with it in the mod folder.

silent zealot
#

Interesting - Java is running out of memory. It only does this when you mod is activated?

keen venture
#

yep if i delete it from the folder it opens back up just fine. no idea how i messed it up so bad

silent zealot
#

How much RAM do you have?
Memory total available to JVM: 252.0 MB

keen venture
#

16 gb there is plenty of space too

silent zealot
#

actually that's just from the java settings resricting memory

#

not actual system ram free

#

Which reminds me, I need to adjust my memory settings as they got reverted when I refreshed files

#

How big is your texure file?

tacit pebble
#

i remember JVM was always around 256mb for me when I didn't set memory

keen venture
#

how would i find my free ram? Im not sure i understand how that is different apologies I am trying to learn

silent zealot
#

Right click tash bar -> windows task manager -> performance for system ram

#

BUT it's important to know Java has it's own memory system

#

Assuming you are on a 64bit Windows, backup ProjectZomboid64.json in the games directory and then open it in a text editor.

#

you should see something like this:

        "-Djava.awt.headless=true",
        "-Xmx3072m",
        "-Dzomboid.steam=1",
        "-Dzomboid.znetlog=1",
#

that Xmx means "java can only use 3 GB of ram"

#

And I think the default on B41 is even lower.
I set mine to:

    "vmArgs": [
        "-Djava.awt.headless=true",
        "-Xmx4096m",
        "-Xms1024m",
        "-Dzomboid.steam=1",
        "-Dzomboid.znetlog=1",
        "-Djava.library.path=win64/;.",
        "-XX:-CreateCoredumpOnCrash",
        "-XX:-OmitStackTraceInFastThrow"
    ],
#

That means it has a max of 4GB, and XmS means start with 1GB instead of starting with 200 MB and grabbing more because we both know that isn't enough"

#

This is on the assumption you've just hit the point where your mod collection is using to much ram for everything.

keen venture
#

interesting i do have a lot of mods. I'll give this a shot and report back

silent zealot
#

Could be something else happeing, but this is an easy first step.

#

It's also worth trying with only your mod enabled, and no other mods.

#

delete or edit C:\Users\milk\Zomboid\mods\default.txt to disable mods if you can't get the game to start.

tacit pebble
silent zealot
#

You're thining a loop/recursion eating all teh memory?

keen venture
tacit pebble
silent zealot
#

it's also crashing very early, I think before it actually get to running lua.

#

A 200 line console.txt is so tiny!

tacit pebble
#

yeah and I just realized it was happening when loading script (I guess)

silent zealot
#

same, comparing to my console,txt it shoudl be loading scripts right after the texture packs

#

Recursive item script? No idea how that would be possible. Script that breaks the parser? I know dozens of ways, even if they usually break in a different way to this.

tacit pebble
#

:3

keen venture
#

Ok I updated the json as you suggested. It seems to still crash out while loading scripts

#

looking at the console it looks like it ran out of memory again

grizzled fulcrum
silent zealot
#

Both ways work, but I can edit one file instead of two shortcuts. Not that it would be a lot of effort to edit two shortcuts lol

grizzled fulcrum
#

true, i just use the batch files when modding, but most peopel dont so that launch arg is useful

silent zealot
#

I don't think the devs have any idea what a cow is.

grizzled fulcrum
#

and remember steam can delete your edited json when it validates checksums unless you tell the bootstrapper otherwise so keep that in mind

silent zealot
#
  1. when they get upset they don't run away, they systematically destroy your stuff. Even if that means running back home after running away just to break some more fence.
#
  1. I killed three tonnes of cow because I was sick of this and got less than 2 kg of meat from them
#
  1. brown cows produce normal milk instead of chocloate milk.
#

...ok so manybe not that one.

tacit pebble
#

btw there's a possibility of this
since console says arrayList is the reason, some missing comma or syntax could cause that? Something.... when something wasn't closed, then everything will try to be read as previous parameter's value.

#

like an arrayList which contains 9999 things

keen venture
#

idk if this will help but here is a recording that shows basically the whole file structure and code

tacit pebble
#

need one more }

        /*codes*/
        ... Jacket_Ground, 
    }
}
#

and... you need to define your script is for which item like this

module Jacket_VarsityKoK
{
    item myNewItem                     /* This tell to Java that this script for myNewItem */
    {                                  /* This "{" tell to Java that script for myNewItem starts from here (opening) */
      DisplayCategory = Clothing
      ...
    }                                  /* to here (closing) */
}
keen venture
tacit pebble
tacit pebble
keen venture
tacit pebble
#

I don't earn any money from modding. (at least for now). pure enjoyment is the only fuel for making me keep modding. so you're welcome drunk

simple helm
#

does anyone know a script or how to write an LUA for loading cars on a trailer ?

silent zealot
#

Have you checked the existing car trailer mod?

simple helm
#

it goes farther then looking at that, also that script it written wonkie

#

wherever the code written it in the tsar common

tacit pebble
# keen venture I very much appreciate it like i said i am a complete noob to coding. if you hav...
module Jacket_VarsityKoK {
  imports { Base }
  item Jacket_VarsityKok
  {
        DisplayCategory = Clothing,    
        Type = Clothing,
        DisplayName = KoK Jacket,
        ClothingItem = Jacket_VarsityKoK,
        BodyLocation = Jacket,
        Icon =Item_JacketVarsityKoK,
        BloodLocation = Jacket,
        RunSpeedModifier = 0.92,
        CombatSpeedModifier = 0.95,
        BiteDefense = 50,
        ScratchDefense = 60,
        NeckProtectionModifier = 0.5,
        Insulation = 0.70,
        WindResistance = 0.50,
        WaterResistance = 0.60,
        Weight = 3,
        WorldStaticModel = Jacket_Ground,        
    }
}

You will be able to understand which is the difference when you check the wiki I sent.
{ means opening // while } means closing (opening for which you just wrote)
So logically, it should be like this

item Jacket_VarsityKok
  {
    parameters (Icon, BiteDefence, Weight, etc..)
  }

this means parameters is for item Jacket_VarsityKok

#

=====================

  imports {
     item Jacket_VarsityKok
  }    

what you wrote means
item Jacket_VarsityKok is for imports and doesn't much make sense

#

I hope I explained well.. I'm not really good at explaining :/

keen venture
#

no no you are very helpful im just reading through the wiki. so because the item im adding uses a model in the game does that mean i don't need the import section?

"Most vanilla items use the module Base. If you utilize the Base item block, you do not need to import it. Be careful with the naming when utilizing Base module, so it does not match name of a vanilla game item (as it will overwrite the vanilla item)."

it now shows up in game text as an item i can wear but does not actually load the model so i consider this great progress

tacit pebble
#

to be honest, I don't know what imports does since I don't make any item mods (script-related mod).
as far as i know, you will need model script too for your new item if your item uses own model? hmm (nvm this line. this is weird one)

#

also Icon should be Icon = JacketVarsityKoK unless your .png name is Item_Item_JacketVarsityKoK.png

silent zealot
bronze yoke
#

all imports do is add that module to the list of modules that will be checked when you reference another object without specifying the module

silent zealot
#

But a script to put a vehicle on a trailer isn't the sort of thing people are likely to have laying around, it's going to be a finnicky process.

bronze yoke
#

but you shouldn't really do that anyway and most scripts don't even do that (people just add imports because other mods do)

silent zealot
#

If you want to write one from scratch, The two tricky parts are 1) make the trailer look different when it is carrying a vehicle and 2) make a vehicle vanish from the game and then restore it reliably.

#

1 probably isn't hard, 2 is... I can't think of a great way to do it, just some crazy ideas that probably won't work.

silent zealot
simple helm
#

I used ChatGPT and not even sure that helped. I need to try and find where to get the code. Or learn LUA and try to write a script myself but would like to try and find the one already made and go off It

silent zealot
#

ChatGPT is a trap when it comes to code.

tacit pebble
silent zealot
#

It might help, but it will also give you made up code and you need to understand it well enough to fix it.

tacit pebble
simple helm
#

Anywhere you know where to begin ? I have the vehicle in game just need a script

silent zealot
#

Like a random person on the internet that learned to code by reading code forums but has never done it themselves, and also they can't admit they are wrong or don't know something.

#

Have you done much scripting and/or programming before?

tacit pebble
#

I use GPT as calculator only. like "does this code make sense logically?" after done my work and it helps me enough

silent zealot
#

Chat GPT is great if you want "give me 300 silly business names for my silly business cards mod"

simple helm
#

Scripting not really. I could learn Lua might start tomorrow. Also I learn best off of visual

silent zealot
#

Any other programming?

#

I have no idea where is a good place to start learning, except to say don't do what I did which is "learn BASIC because that's how everyone gets started in the 1980s"

simple helm
#

Java sorta, but not from scratch

#

I also have a vehicle dev helping me out

silent zealot
#

That's good - if you know the basics of flow control (if/then/else, loops. functions, passing variables around) and understand a bit about how objects work that will help a lot.

tacit pebble
#

@simple helm
btw this is the file for loading animals into animal trailer.
lua\shared\TimedActions\Animals\ISAddAnimalInTrailer.lua

simple helm
silent zealot
#

making the car vanish and then recreating it is not straightforward... probably needs some clever hack like hiding the vehicle in a distant part of the map, or some trickery with the vehicle DB.

simple helm
#

Ima try to do something like autosar trailer as clearly deleting the entity and recreating seems the best route

tacit pebble
#

btw is baseVehicle also IsoMovingObject?

#

otherwise... seems you really have to do kind of heck

silent zealot
simple helm
#

Anything possible

tacit pebble
#

logic is there and I thought keypoint is public void addAnimalInTrailer(IsoAnimal var1)

silent zealot
simple helm
#

Tbh not sure yet I am tired and going to sleep. Tomorrow a new day. Gn

silent zealot
#

first line of the function puts the animal object in the animal storing array, but we don;t have an equivilent vehicle storing array.

#

Would be easy if we could mod java...

#

I'm going to have a shower and do some shopping, I'll have a look at teh Autostar hauler later because I'm curious how they approached this.

tacit pebble
#

oh did autostar already do this? :0 I'm gonna sub autostar

silent zealot
#

Autostars solution: 1) on the tailer create a whole bunch of VehcleParts that match the normal part names, but prefixed with "wrecker_"

#
  1. one by one take every VehiclePart off the car and place it on the trailer (so the car's DoorFrontLeft gets attached to the trailer's wrecker_DoorFrontLeft
#
  1. record some values to modData somewhere on the trailer like the vehicle type, the vehicle skin, is hotwored, etc.
#
  1. if key is in ignition put the carkey in the player's pocket
#
  1. destroy the vehicle permanately.
#

Then to launch you replay that in reverse: read the trailer's modData, create a new vehicle of the same type, setthe skin, set if it's hotwired, etc etc. Then one by one remove each VehiclePart on the new car, and move the stored part from the trailer to the vehicle.

#

Looks like there's a whitelist of vehicles it can load, presumably to avoid problems loading modded vehicles with extraparts that don't have a corresponding wrecker_partname on the trailer.

#

Also that would let them use this for things like the boat trailers than can only hold boats.

#

So if you want a vehicle than can transport one vehicle you could make use of Tsarlibs to do it... looks fiddly to set up the vehicle file but not too nasty.

#

So RV with motorbike on the back, easy(ish)

#

But a car carrier that holds multiple vehicles - you'd need to rewrite a lot of code because it's all built on the assumption that only one vehicle will be transported.

#

...also I was supposed to shower THEN look at the code. Oops.

#

@simple helm have a read through that in the morning, see if that helps you understand the tsarlib code.

grizzled fulcrum
grizzled fulcrum
silent zealot
#

Does Carwanna just record details of the vehicle in modData and then recreate it? From screenshots looks like you need parts repaired/no items inside/etc

keen venture
#

hmmm so I got it to the point that it shows in the game list and you can wear it, tear it up and what not but the actual model is not showing up. I looked at the wiki and compared my files side by side with another mod that reskins the varsity jacket and im just kind of stumped as to why its not working.

bright fog
#

Some folks in #modeling might know more about typical issues with clothings

keen venture
#

Hm ok I'll ask them. This is my first mod. I thought a simple texture swap would be easy but I'm just completely lost

tacit pebble
silent zealot
keen venture
#

no model specified by item i think.....I also realized i messed up the clothingitem.xml but adding the extension in the name so it was reading it as clothingitem.xml.xml i can get something to show up after fixing that

#

i consider this progress

silent zealot
#

Sometime progress is weird. Like the time I celebrated because after hours of work I was able to make the game crash if the character put on underpants.

keen venture
#

haha i am doing my best im sure these are really dumb mistakes but its literally my first time. I'm determined now 100% sunk cost fallacy.

silent zealot
#

People who have been doing this for years make dumb mistakes.

#

Nothing to be ashamed of.

umbral raptor
#

could someone tell me how i can override isoheatsource's hardcoded cap of never going below room tempreture. this mod did it.

#

it uses isoheatsource, but my attempts ended up making the entire world cold instead haha

#

im trying to add it onto this code

#

local function AddHeatSource(x,y,z,heatData)
local heatSource = IsoHeatSource.new(x, y, z, heatData.range, heatData.temp)
getCell():addHeatSource(heatSource)
return heatSource
end

silent zealot
#

Is that file you posted the only lua for the mod?

umbral raptor
umbral raptor
silent zealot
#

link to workshop?

#

Timed actiosn often do stuff when they complete

umbral raptor
#

this is for B41 tho

#

i can send u all the lua files if u want

#

other things have to do with server commands, definitions of ACs and etc

#

timed actions seems to be about the player's actions and movements and such for turning on/off the AC

#

the file i sent seems to be the only one actually working with the temp

silent zealot
#

I can just subscribe on steam to get the files

umbral raptor
#

if not isMultiplayer then
if player:isInARoom() then

                                        local gt = cm:getTemperature()
                                        -- print ("---gt---")
                                        -- print (gt)

                                        local ht = cell:getHeatSourceHighestTemperature(0, player:getX(), player:getY(), player:getZ())
                                        -- print ("---ht---")
                                        -- print (ht)

                                        if ht > 1 then
                                            local playerTemp = cm:getAirTemperatureForCharacter(player)
                                            -- print (string.format("PLAYER TEMP: %f, TARGET TEMP: %f", playerTemp, targetTemp))
                                            
                                            local newOverride = cf:getOverride()
                                            if playerTemp > targetTemp then
                                                newOverride = newOverride - 0.5
                                            else
                                                newOverride = newOverride + 0.5
                                            end
                                            cf:setEnableOverride(true)
                                            cf:setOverride(newOverride, 1)
#

it emsses up with the air temp or the player temp not sure

#

it also uses isoheatsource which is weird

silent zealot
#

wow.. the climate stuff is pure confusion

#

WTF is class called "ClimateFloat" for?

#

It's not a float, it's an entire class.

umbral raptor
#

not sure, didnt seem to cause errors

#

it seems that it pretty much modifies the entire climate

#

or smthin haha

silent zealot
#

there's something called "override"

#

But.. not clear what it's overrriding.

umbral raptor
#

yeah was confused about that too

#

but problem in base zomboid is that isoheatsource never goes below the current temp so it can never cool

#

so i think that def needs to be overriden

silent zealot
#

and a ClimateBool class

#

and ClimateColor

silent zealot
umbral raptor
#

the air temp/climate change?

#

or maybe its changing the player temp?

#

it includes all of these so im not sure lmao

silent zealot
#

so ht is the temp of teh best heater affecting a square

#

if it is >1 (whcih probably means "it exists" ) it gets the air temp for character, getOverrise

#

then make the overide warmer or cooler to match the target

#

So an IsoHEatSource set to 18 won't so anything wthen it's a 30 degree day

#

but this override will

#

provided you're in a room and affected by an isoheatsource

umbral raptor
#

so i need to add this override?

sly ivy
#

Hey sorry to interrupt but what is the mesh in a model script for weapons?

umbral raptor
#

u direct the script to where it is

sly ivy
#

thank you, been struggling with that

silent zealot
#

It's a huge mess of badly names classes with no clear purpose, BUT we know know that getting enabling override and setting overide probably forces teh character temp

#

so open up the lua console,

#

cf=getWorld()getClimateManager():getClimateFloat(4)

sly ivy
silent zealot
#

then cf:setEnableOverride(true) and cf:setOverride(someNewNumber, 1)

#

just shove different numbers into setOverride adn see what happens

#

Traditionally it would be done by having a completely seperate item for each gun

#

You can probably hack it with lua and setName()

#

Is this for B41 or B42?

umbral raptor
#

but

#

u have to put ur module name before it

#

for some reason

sly ivy
#

whats the module?
sorry

umbral raptor
#

so if my module name is supportcorps and my model name is bigaxe then

WorldObjectSprite = SupportCorps.BigAxe

#

the thing at the top

umbral raptor
sly ivy
#

oh i have that setup

#

just a final thing
think this'd work?

#

module Base {
model Yuka {
mesh =YukaMesh,
texture =Yuka,
}
}

silent zealot
#

I'm talking items, not models here... but for example Brita would have an item for KrissVector9mm, then one for KrissVectorStockExtended. Then KrissVector22lr and KrissVector22lrstockextended

#

and the extend/collapse stock action replaces the gun and copies over attachments/condition/etc

silent zealot
#

Not calibres, but that's a simple recipe. AK74+short barrel = AK74u+long barrel

umbral raptor
#

model Cast
{
mesh = WorldItems/Cast,
texture = WorldItems/Cast,
scale = 0.065,
}

silent zealot
#

AK74+hacksaw = AK74u

umbral raptor
#

@sly ivy

#

change the scale ofc

umbral raptor
#

my scale is too small haha

sly ivy
#

cheers ngl i stole the base code from a random weapon mod i found XD

umbral raptor
#

yeah sometimes code will be changed from base game haha when modding

#

u gotta look at other mods

#

thats better for u

sly ivy
#

thanks again, i appreciate the help dude, hope you have a nice day!

silent zealot
#

"Should we have a setFog(int) method?"
"heck no! Fog shall be ClimateFloat(5)!"
"Could we... use a normal float instea... OK I can see I am making you angry I shall leave now"

prime adder
silent zealot
#

I'm skeptical that "skibiddi toilet" means "my request is a sincere one" ๐Ÿ˜‚

drifting ore
#

There are no sex events or strip clubs in my game

#

Idk about you guys

silent zealot
#

As for removing specific zombies - shouldn't be hard to do, AFAIK the zombie outfits are just huge lua tables so you just need a mod to remove the outfits you don't want.

#

If you want that, then congrats - you're a modder now.

silent zealot
#

Complete with big fake garage doors so it loosk like a mechanic's shop

torn igloo
#

Does ISModalDialog support new line \n?

drifting ore
#

Is there a quicker debug way to bloody/dirty a clothing item than killing zombies and letting them maul me?

#

I can get items on the right side bloody no problem but the left I have been trying for 20 minutes

#

Except for one of them for some reason

winter bolt
drifting ore
#

๐Ÿคฆโ€โ™‚๏ธ Thank you

#

Wait, do you mean something other than this?

bright fog
#

You can probably change the item name

winter bolt
drifting ore
#

I need something that can change bloodLevel of a clothing item

#

Think I'll just try to write a script unless something exists I am not seeing

umbral raptor
#

does someone know a B42 mod that has recipes with randomized outputs? I saw a mod here that had briefcases that u could unlock

bright fog
winter bolt
turbid ruin
#

If i want to start making for example food items, is there a tutorial i should read on?

drifting ore