#mod_development

1 messages Ā· Page 346 of 1

silent zealot
#

And an image that has to match when a dated newpaper is read.

bright fog
#

Override the image

silent zealot
#

And pretty sure thing like "1993" are not translated, just a number

cinder storm
#

nada?

snow hatch
#

I dont have modding experience

nocturne kiln
silent zealot
snow hatch
#

Wouldint know where to start

silent zealot
#

Pinned messages, that one is full of resources.

#

There is also the good old "find a mod that does something you want to do and look at how they did it" way of learning.

regal umbra
# snow hatch Wouldint know where to start

Like DrStarlker was saying, download a mod, look at how it was coded, then do something similar.

Don't copy and paste it over that's forking and will get you bad rep, you can even get hit with a takedown request.

Just look at how a coder did something and give it a twist and do it yourself

#

In other words, inspire yourself from more experienced coders

shy mantle
#

Does anyone know what the vehicle equivlant to player:getForwardDirection():getDirection() is? I've tried some variations, but I can't seem to get it on my own.

queen oasis
#

or getForwardMovementIsoDirection() if that works better for you

shy mantle
#

Are those new?

#

I hope they work because this is like the final piece of puzzle lol

queen oasis
#
  1. Idk about 41, I never messed with vehicles in 41
zealous fern
#

Im working on a mod for jumping over desks and counters etc i've been looking at some code that others have done outthewindow guy and trying to get context menu to show up but even when i take his code directly and change the var names nothing appears but when i don't edit his it works local JumpOver = require('JumpOver/JumpOver')

function JumpOver.OnFillWorldObjectContextMenu(playerId, context, worldobjects, test)

local player = getSpecificPlayer(playerId)

for _, object in ipairs(worldobjects) do

    local objects = object:getSquare():getObjects()
    for i = 0, objects:size() - 1 do
        local jumpType, jObj = JumpOver.getJumpType(player, objects:get(i))
        if jumpType then
            context:addOption(getText('ContextMenu_JumpOver' .. jumpType), worldobjects, JumpOver.onJumpOver, player, jObj)
            return
        end
    end
end

end

Events.OnFillWorldObjectContextMenu.Add(JumpOver.OnFillWorldObjectContextMenu)
-------- local JumpOver = {}

JumpOver.jumpTypeDesk = 'TheDesk'
JumpOver.jumpTypeCounter = 'TheCounter'

function JumpOver.getJumpType(player, object)

return JumpOver.jumpTypeDesk, object

end

function JumpOver.onJumpOver(worldobjects, player, object)
print("[JumpOver] Jumping")
end

return JumpOver

#

new to the modding scene but experinced programmer

queen oasis
#

it always says S

bright fog
#

So it's never going to trigger

#

Wait

shy mantle
#

I know it exists SOMEWHERE because when you exit a vehicle it sets your character's angle to the vehicle's

bright fog
zealous fern
bright fog
#

Bcs it's unclear what is your code, if everything's in the same etc

bright fog
#

You're making it hell

zealous fern
#

sorry will do

bright fog
#

Also your snipet is unclear if it's your code or the one you copied

zealous fern
shy mantle
bright fog
zealous fern
#

media/lua/client/JumpOver

#

and shared/Translate/En for the text

#

within the lua folder

bright fog
#

Is your mod loaded ?

zealous fern
#

wdym

#

i have it loaded into pz

bright fog
#

did you activate it

zealous fern
#

but nothing appears in the context menu

#

yeah

bright fog
#

Add a print to the function being triggered, and see if it prints

zealous fern
#

it doesn't i tried that

#

i really don't know why its working

bright fog
#

which version

zealous fern
zealous fern
bright fog
#

You've put a print right under JumpOver.OnFillWorldObjectContextMenu ?

#

At the start of the function

zealous fern
#

i had one in my old code yes

#

ill add one now and see if that helps

#

also i get this

bright fog
#

Are you using Umbrella

zealous fern
#

no

bright fog
#

Use that, don't add the game files to your Lua environment

#

I mean I think you can add it to your workspace but not sure

zealous fern
#

ohh okay are there anyother addons i should get ?

bright fog
#

Also Umbrella isn't downloaded as an extension

#

In case that's what you did

#

It's a Lua extension from the Lua extension (yes confusing)

zealous fern
#

yeah nearly did that haha

bright fog
#

Yea some people make the mistake šŸ˜…

bronze yoke
bright fog
zealous fern
#

do you know whats the best practice to get sprite names from objects ?

bronze yoke
#

there actually is an 'umbrella' in the extensions, it's something to do with dota, but we had the name first šŸ˜…

bright fog
#

However, there might be a tile tag to distinguish counters

#

That you could use

bright fog
zealous fern
#

do you enable umbrella in media folder ?

bright fog
#

No, you enable it in your workspace

#

Read the wiki page, it goes over that

bronze yoke
#

we might actually become an extension in the future so that might make it easier for people

zealous fern
#

installed it now

#

anything else i need to do

bright fog
zealous fern
#

Thank you

bronze yoke
# bright fog Nice ! Why that ?

- emmylua (which is seeming like the better lua language server) doesn't have an addon manager, and manual installation will be hard to explain
- the zedscript language server could be included in it
- forking emmylua to allow communication between the zedscript and lua language servers would be really cool
- forking the language server would also let us change some pz-specific things to work better
most of those are 'it would be really cool's though šŸ˜…

zealous fern
bright fog
zealous fern
#

ahh okay no worries thank you for the help

queen oasis
lofty frigate
#

Can you give me a general idea of how to make a container accept only certain items? I don’t know of any mod that does it either. I remember trying it once and couldn’t get it to work. For clothing containers, the base game handles it and it’s simple, but for world containers I remember I couldn’t get it done. If not, no worries—I might try again one of these days and maybe I’ll figure it out.

queen oasis
#

time to declutter the inventory options. wish me luck

shy mantle
#

Is it because I'm using getNearVehicle instead of getVehicle?

bronze yoke
#

there isn't a way to do it for tile containers

queen oasis
#

makes sense to me

#

why is that so big

#

there we go

queen oasis
shy mantle
#

So for some reason the debug menu uses the proper full 180 and -180, but getting the value returns it as something else

queen oasis
#

hmm

#

not sure why that would be aligned to the grid

shy mantle
#

I'm just gonna quickly force place the player in a seat regardless, take the player value, and immediately take them back out of the car

#

if all else fails of course

queen oasis
#

hopefully someone with more knowledge can help out

#

I'm just winging it

shy mantle
#

That's fine, I've tried a bunch of different variations at this point

#

It's time to jank it

queen oasis
#

me: bangs on keyboard until it does what you want

shy mantle
#

I hope this is a bug and not a limitation, or maybe we're just missing it

queen oasis
#

maybe you can get the vehicle poly and shoot out a ray along the y to get the angle. now, that's janky

shy mantle
#

vehicle:enter(0, player) vehicle:transmitCharacterPosition(0, "inside") vehicle:playPassengerAnim(0, "idle") vehicle:exit(player)

the solution all along

#

I really just had to turn the player to face the vehicle by quickly entering/exiting the vehicle lol

#

That's actually not that janky tbf

#

I say as my game crashes

queen oasis
#

I hate context menus

#

resisting. the. urggggeee

#

"jim, it would break other peoples stuff, just don't"
"but if you check recipeList:size() > 0 it works soooo welll unnnggg"

main pasture
#

Can't check it right now, but I can post the solution I used later

cinder storm
#

Is food considered a consumable, like lighters and matches now?

#

Lets say butter; it has 3200 calories and 24 hunger. Are the calories the uses left? Or is it the hunger?

bronze yoke
#

the hunger is

shy mantle
#

I now have an actual working climb on vehicles thingy I think

half valley
#

Can someone help me with my custom professions mod?

prisma hamlet
#

hello all

#

first time here

#

if i would like to commission a mod, is this the right channel to make a request?

#

xD

snow hatch
#

Ill pay 10 usd to whoever makes a mod where you can dissolve zomboids in acid in barrels

bright fog
#

For commissions

prisma hamlet
bright fog
#

That's not where you put commissions

prisma hamlet
#

ah ok commissions

prisma hamlet
#

is the Unofficial Modding Discord this discord group?

#

nvm found it

bright fog
prisma hamlet
#

there was no discord channel link, but i already googled and found it

bronze yoke
#

is it even called the Unofficial Modding Discord?

bright fog
#

I guess I can add an about template to not confuse it with the official Discord

sour island
bright fog
#

Pretty sure I wouldn't have named it that way without asking either back then too

#

So we can change it back if you want

#

Then I'd do the same with the mapping one

sour island
#

I think the mapping one is actually has Unofficial in its name

#

For the modding one you could name the article "PZ Modding Community Discord (Unofficial)"

#

When Konijima and I were deciding on a name we both agreed unofficial sounded strange in this context

#

I just checked and the mapping discord has discord in its name

#

Reminds me of that API joke someone made in here

queen oasis
#

I like how "nil" is centered so well

gusty saffron
#

Hey guys, I'm working on an Avrix plugin for a zombie kill counter. I've been digging through the ProjectZomboid-core-41.78.16.jar decompiled code but I'm stuck—I can't find where the game actually increments the kill stat. Any pointers? (Sorry for my English)

queen oasis
#

because some trees are not really trees? there's a couple trees so far that don't cast to IsoTree

#

isValid only checks if square:HasTree() btw

cinder storm
#

Evolved recipes are still a thing in 42, right?

#

I got a script load error just earlier;

ERROR: General      f:0, t:1757204354967> ExceptionLogger.logException> Exception thrown
    java.security.InvalidParameterException: Could not find evolved recipe or template: 'HotDrinkRed' in item: CKRations.CKRSugarCube at Item.OnScriptsLoaded(Item.java:4167).
    Stack trace:
        zombie.scripting.objects.Item.OnScriptsLoaded(Item.java:4167)
        zombie.scripting.ScriptBucketCollection.OnScriptsLoaded(ScriptBucketCollection.java:166)
        zombie.scripting.ScriptManager.loadScripts(ScriptManager.java:1925)
        zombie.scripting.ScriptManager.Load(ScriptManager.java:1831)
        zombie.GameWindow.initShared(GameWindow.java:160)
        zombie.GameWindow.init(GameWindow.java:1377)
        zombie.GameWindow.mainThreadInit(GameWindow.java:756)
        zombie.GameWindow.mainThreadStart(GameWindow.java:598)
        zombie.MainThread.mainLoop(MainThread.java:64)
        java.base/java.lang.Thread.run(Unknown Source)
cinder storm
#

though if you're specifically talking about incrementation, its probably a lua script sitting somewhere

queen oasis
# shy mantle Maybe it's a bush

I thought that too but it was causing an error with IsChopTreeCursor, no mods. Needed to make sure my shenanigans weren't borking it.

bright fog
#

I think they still are a thing, tho I'm unsure if they still use the same params ?

bronze yoke
#

if you just add your item to HotDrink it should be added to the variants automatically

cinder storm
#

i ended up just removing it to fix the problem for the moment

#

but ive come across another problem; i'm gonna have to make a new liquid called "broth" since this recipe is now outdated

#
    {
        timedAction = Making,
        Time = 80,
        Tags = InHandCraft;CanBeDoneInDark,
        category = Cooking,
        inputs
        {
            item 3 [CKRations.BouillonPowderSachet],
         item 1 tags[CoffeeMaker],
        }
        outputs
        {
            item 1 CKRations.CKRMugOfBroth,
        }
    }```
#

i intend to have it work similarly to the coffee

#

as i also had to rework that

#
    {
        timedAction = Making,
        Time = 80,
        Tags = InHandCraft;CanBeDoneInDark,
        category = Cooking,
        inputs
        {
         item 1 [CKRations.TinOfCoffee],
         item 1 [*],
         -fluid 0.2 [Water;TaintedWater],
         item 1 tags[CoffeeMaker],
         +fluid 0.2 Coffee,
        }
        outputs
        {
        }
    }```
#

should i implement it in the existing mod module, or add it into Base?

#
    {
        Color           = 0.556 : 0.713 : 0.462, , -- The color value here must be an RGB01 value ( Decimal ranges from 0 to 1. Alpha (transparency) input is not supported.
        ColorReference  = Brown, -- You can also use a plaintext color reference. 
        DisplayName     = Broth,
        Categories
        {
            Beverage,
        }
        Properties
        {
            fatigueChange           = -10,
            hungerChange            = -10,
            stressChange            = 0,
            thirstChange            = -5,
            unhappyChange           = -10,
            boredomChange           = -10,
            calories                = 20,
            carbohydrates           = 2,
            lipids                  = 1,
            proteins                = 1,
            alcohol                 = 0,
            fluReduction            = 0,
            painReduction           = 0,
            enduranceChange         = 0,
            foodSicknessReduction   = 0,
        }
    }```
#
    {
        timedAction = Making,
        Time = 80,
        Tags = InHandCraft;CanBeDoneInDark,
        category = Cooking,
        inputs
        {
            item 1 [CKRations.BouillonPowderSachet],
         item 1 [*],
         -fluid 0.2 [Water;TaintedWater],
         item 1 tags[CoffeeMaker],
         +fluid 0.2 Broth,
        }
        outputs
        {
        }
    }```
#

should work?

#

and then theres foraging

vast pier
#

What metalworking items were removed ?
This recipe file was working a few months ago, and I'm assuming it has to do with changes to smithing items

cinder storm
#
require "Foraging/forageSystem"

Events.onAddForageDefs.Add(function()
    forageCategories["Rations"] =
    {
        name                  = "Rations",
        typeCategory          = "Food",
        identifyCategoryPerk  = "PlantScavenging",
        identifyCategoryLevel = 5,
        categoryHidden        = false,
        validFloors           = { "ANY" },
        zoneChance            = {
            TrailerPark = 10,
            TownZone    = 10,
            Nav         = 10,
            DeepForest  = 0,
            Forest      = 0,
            Vegitation  = 0,
            FarmLand    = 0,
            Farm        = 0,
        },
    }

    forageSystem.addCatDef(forageCategories["Rations"]);

    local MUnit = {
        type = "CKRations.CannedCRationMUnit",
        xp = 2,
        skill = 5,
        categories = { "Rations" },
        zones = { Nav = 5, TownZone = 5, TrailerPark = 5, },
        spawnFuncs = { doGenericItemSpawn }
    };

    local BUnit = {
        type = "CKRations.CannedCRationBUnit",
        xp = 2,
        skill = 5,
        categories = { "Rations" },
        zones = { Nav = 5, TownZone = 5, TrailerPark = 5, },
        spawnFuncs = { doGenericItemSpawn }
    };

    local KRation = {
        type = "CKRations.KRation",
        xp = 2,
        skill = 5,
        categories = { "Rations" },
        zones = { Nav = 5, TownZone = 5, TrailerPark = 5, },
        spawnFuncs = { doGenericItemSpawn }
    };

    forageSystem.addItemDef(MUnit);
    forageSystem.addItemDef(BUnit);
    forageSystem.addItemDef(KRation);
end);
#

also, this foraging lua doesnt seem to work anymore; its from build41. what changed in the foraging system where it has to be revamped?

#

i looked at the console, it only pointed to the script at line #22

#

Ah, must've been why alot of mods broke on that update

#

Guessing Events.onAddForageDefs is duds then.

#

Something like this?

require "Foraging/forageSystem"

Events.preAddCatDefs.Add(function()
    forageCategories["Rations"] =
    {
        name                  = "Rations",
        typeCategory          = "Food",
        identifyCategoryPerk  = "PlantScavenging",
        identifyCategoryLevel = 5,
        categoryHidden        = false,
        validFloors           = { "ANY" },
        zoneChance            = {
            TrailerPark = 10,
            TownZone    = 10,
            Nav         = 10,
            DeepForest  = 0,
            BirchForest = 0,
            Organic Forest = 0,
            Managed Forest = 0,
            Primary Forest = 0,
            Forest      = 0,
            Vegitation  = 0,
            FarmLand    = 0,
            Farm        = 0,
        },
    }
    forageSystem.addCatDef(forageCategories["Rations"]);
end);
Events.preAddItemDefs.Add(function()
    local MUnit = {
        type = "CKRations.CannedCRationMUnit",
        xp = 2,
        skill = 5,
        categories = { "Rations" },
        zones = { Nav = 5, TownZone = 5, TrailerPark = 5, },
        spawnFuncs = { doGenericItemSpawn }
    };

    local BUnit = {
        type = "CKRations.CannedCRationBUnit",
        xp = 2,
        skill = 5,
        categories = { "Rations" },
        zones = { Nav = 5, TownZone = 5, TrailerPark = 5, },
        spawnFuncs = { doGenericItemSpawn }
    };

    local KRation = {
        type = "CKRations.KRation",
        xp = 2,
        skill = 5,
        categories = { "Rations" },
        zones = { Nav = 5, TownZone = 5, TrailerPark = 5, },
        spawnFuncs = { doGenericItemSpawn }
    };

    forageSystem.addItemDef(MUnit);
    forageSystem.addItemDef(BUnit);
    forageSystem.addItemDef(KRation);
end);```
#

Worked!

#

Kind of. At least i loaded ingame this time.

#

Max foraging, not here.

#

Im gonna have to guess the game couldnt interpret the category

#

Thanks, ill work on it.

#

Referenced yours, i dont think i need to move the item defs anywhere but yours did not mention any; is it stored in a separate file?

cinder storm
#

Found this as an example in the faq also; local appleDef = { type = "Base.Apple", zones = { Forest = 1, }, categories = { "ForestGoods" }, months = { 7, }, xp = 10, };

cinder storm
#

Or is it towards the foraging skill?

#

Alrighty. For the record, i'm updating one of Arendas mods to b42 (with their consent of course).

#

Ill see how to implement this

#

Ill first try it in the same file, for now.

cinder storm
#

I feel like i'm missing something. Category still not appearing.

#

Set the foraging skill to 5, nada

#

It did give me this earlier: ```SEVERE: Error found in LUA file: C:/Users/nikol/Zomboid/Workshop/[B42] C&K Rations/Contents/mods/[B42] C&K Rations/42/media/lua/shared/Foraging/CKRations_ForageDefinitions.lua
ERROR: General f:0, t:1757213207765> ExceptionLogger.logException> Exception thrown
se.krka.kahlua.vm.KahluaException: CKRations_ForageDefinitions.lua:18: '}' expected (to close '{' at line 12) near Forest at LexState.lexerror(LexState.java:278).

#

Ill keep an eye out for commas, added that

#

No result.

#

I see, i added those commas after you told me there might be some missing commas.

#

Noted

#

Playtesting now

#

Nada

cinder storm
#

Thats when the zonechances are mentioned

cinder storm
cinder storm
#

I have been

#

I'm updating the mod TO b42

#

Uh oh

queen oasis
#
require "Foraging/forageDefinitions"
require "Foraging/forageSystem"

local function generateFirewoodDefs()
    local firewood = {
        SmallLog = {
            type = "JB_Big_Wood.SmallLog",
            skill = 0,
            xp = 5,
            categories = { "Firewood" },
            zones = {
                DeepForest    = 3,
                OrganicForest = 5,
                BirchForest   = 4,
                PRForest      = 3,
                PHForest      = 3,
                Forest        = 2,
                Vegitation    = 1,
            },
            bonusMonths = { 9, 10, 11 },
            itemSizeModifier = 5,
            isItemOverrideSize = true,
        },        
    }
    for itemName, itemDef in pairs(firewood) do
        forageSystem.addForageDef(itemName, itemDef)
    end
end

generateFirewoodDefs()```
not sure if that helps ya but this setup works great for me on 42
#

will forever hurt my spelling bee heart that vegetation is spelled wrong

cinder storm
#

yup

#

alright ill see what i can do

cinder storm
#

let me go dig in the game files for a proper list...

#

might be in the faq too

#

it was

queen oasis
#

wish I had thought of that before digging through the translation files last week

cinder storm
#

so i dont need Events.preAddCatDefs/Events.preAddItemDefs?

queen oasis
#

the function call at the end adds it to the forage defs when the mod is loaded. I'm not messing with much so I didn't. you may want to depending on what you're doing

cinder storm
#

Now its time to see if it appears or not

#

actually

#

code works; too scared to mess with it.

#

I'll go to making sure all the craftRecipes and such work,

#

Appreciate the help!

queen oasis
#

if you have a look at lua\shared\Foraging\forageSystem.lua it lays out what to use and why

cinder storm
#

think this will work for coffee from a coffee machine in b42?

#
module Base {
    craftRecipe MakeCoffeeMug2
    {
        timedAction = MakeCoffee,
        Time = 40,
        OnCreate = Recipe.OnCreate.MakeCoffee,
        category = Cooking,
        Tags = CoffeeMachine,
        inputs
        {
            item 5 [CKRations.TinOfCoffee],
            item 1 tags[CoffeeMaker] mode:destroy flags[InheritColor;InheritModelVariation] mappers[mugShot],
            -fluid 0.2 categories[Water] mode:mixture,
        }
        outputs
        {
            item 1 mapper:mugShot,
        }
        itemMapper mugShot
        {
            Base.HotDrink = Base.Mugl,
            Base.HotDrinkWhite = Base.MugWhite,
            Base.HotDrinkSpiffo = Base.MugSpiffo,
            Base.HotDrinkClay = Base.ClayMug,
            Base.HotDrinkCopper = Base.CopperCup,
            Base.HotDrinkGold = Base.GoldCup,
            Base.HotDrinkMetal = Base.MetalCup,
            Base.HotDrinkSilver = Base.SilverCup,
            Base.HotDrinkTumbler = Base.GlassTumbler,

            Default = Base.HotDrinkWhite,
        }
    }
}```
#

alright so it just made the coffee machine menu impossible to open

trail aspen
#

I wish there was a mod that added more animations like the character fanning himself in the heat, shivering from cold or fear, tiredness animation, clumsy walking when drunk, holding his nose near bodies

#

or a mod that automatically allows the character to adjust their clothes according to the weather, lift their sleeves, open their jacket, stay in just a shirt, tank top or go shirtless or wrap up and automatically put it in their backpack or take it out of their backpack and get dressed

cinder storm
#

in b42 ofc

cinder storm
#

category thing worked but items did not, ill have to work on that

#

tomorrow though

zealous fern
#

Whats the best way to check the sprite name of a world object using lua

#

for example check if the item clicked on is a desk

bright fog
#

You can also check if the tile has a desk property of some sort

#

But I doubt it, best it could have is a table surface tag of some sort which is used for recipes

zealous fern
#

want the object name not the floor tile is worldObject not the right one to check

bright fog
#

Wait what are you trying to do ?

#

Why do you get the objects in the worldobject entry

#

Just use the worldobject you right clicked ?

#

You're iterating over the worldobjects, so you get the right clicked objects already

#

Why do you bother going over the objects on the same tiles as every objects

#

getJumpType if this returns something every time, then jumpType is true everytime and you end up returning directly, so you skip every possible objects

zealous fern
#

ahhh okay thank you

high hamlet
#

hello all , just putting this idea out there i have no idea how to make mods but i have an idea for a mod in MP servers if there is a permadeath enabled. having a way to resurrect your friends in game, how that's done is up to you guys could be ritual at some church with specific candles found around the map, really whatever also can have some negative traits applied for some time after resurrections. it would give purpose to some of the map also some items , like the crucifixes neckless found sometimes.

karmic cobalt
#

You guys know if it's possible to make zombies to not have stunlock when they get shot or hit? zombie

bright fog
karmic cobalt
karmic cobalt
#

Thank you! ā¤ļø I'm kind of a newb when it comes to coding. Hopefully I'll figutre out how to copy and paste some of that code.

trail aspen
queen oasis
#

why are my new mods textures missing? ohhh, how'd that happen?

magic minnow
#

if i wanted to make a voice pack for personal use only, would it be as easy as taking one from the workshop and swapping out the sound files?

cinder storm
#

probably, yeah

cinder storm
#

are these distributions fine?

bright fog
# cinder storm

You expect us to go over all of these entries one by one ?

#

I highly advise you at the very least setup an easier to manage table for the loot distribution which will make both your life and our lives easier ...

cinder storm
#

ill look over it

true nova
queen oasis
queen oasis
#

and it's only getting worse

bright fog
queen oasis
bright fog
#

Fair, you could also just make it a UI panel with a transparent background

queen oasis
#

too busy making cursed tables that gives the linter a heart attack

#

unnng, donnnt

#

already thinking about re-doing the log textures to match vanilla better since I had forgotten about the camp logs and log containers, etc

#

and uhh, tree stumps when you kill a tree that you have to dig up with a shovel or pickaxe

#

and if I knew how or if I could rotate a tree sprite, I would have falling trees too

#

literally anything to never finish this mod

willow tulip
#

best I can tell the period he renders causes it to appear under the characters.

#

but oddly enough not always. I dunno exactly what the depth is based on because when I tried similar in B42 it seemed I had 0 depth

#

(always rendered above)

bronze yoke
#

well b42 is kind of The Depth Update

#

so i would not be shocked if there are behaviour differences there

willow tulip
#

ahh ok, makes sense

true nova
queen oasis
#

that and I'd like to learn how to spell

true nova
#

can only offset

#

i can make you some falling tree animations, i think it would look cool

#

a lot of different trees though šŸ˜…

queen oasis
#

yesss, that's why I was hoping to just rotate the x,y and make it fall

true nova
#

could do a few frames then do offsets

queen oasis
#

I don't know how hard any of that is. I looked at blender animations and blanked. I'm pretty sure y'all are geniuses knowing how to make animations

true nova
#

Id just take the sprite and do it frame by frame into a spritesheet then in ontick have the tree change its sprite to each frame until it gets to the end

queen oasis
#

that sounds like a lot of work, and there's probably 40-50 different trees

#

I would not be adverse to it if you did one so I can see how you did it?

true nova
limber gorge
queen oasis
queen oasis
queen oasis
#

is losing square in ISBuildingObject a normal thing? I lose the square reference every other frame and it's driving me insane

#

frame/tick/render - idk

#

forget all that, y'all know I'm an idiot somost of the time.

trail aspen
#

Is it possible to make a mod that gives characters "memory" by connecting zombies who had relationships with the character when everything was normal?
I don't know, for example, when the character enters the house of someone they know, they have memories of the moments they shared, like: "Oh... [name] and I used to play video games in this room when we came home from school..." (triggering sadness).
That kind of detail would be interesting, having a character who remembered the friendliness of the grocery store employee, you know...
Like a character's lore with others communicating with you via radio, reminders left behind, and things like that.

bronze yoke
#

yeah that could be done

trail aspen
#

we'll have to wait until build 43 to see that. :/

shy mantle
#

Why do both, player:setForwardDirection and player:setDirectionAngle, come with excess twist? Shouldn't it be instant? Why is there a turning animation for setting player direction?

#

If there is anyway to skip that whole twist thing, I'd like to know

stiff zinc
#

hello, im trying to make a mod that logs exp granted from admin powers, any idea what the trigger word might be?

cause Events.AddXP.Add(onAddXP) only logs exp from doing regular grinding stuff, ie, dismantling furnitures

#

this is for b41 mp btw

bright fog
#

You could also possibly hook to the java function being called since it's being called lua side

trail aspen
#

Because i cant pay someone to do it and so i dont now how to program

#

XD

main pasture
livid nexus
#

Hi all !

I mod on b42, but my mod don't want to appear in the in game manager...

All the files are the same in different folder

bright fog
main pasture
marble sierra
shy mantle
main pasture
#

It uses the same vector2 as the player:setForwardDirection

shy mantle
#

Where'd you find out about that long named setTargetAndCurrentDirection ?

main pasture
#

I searched the IsoGameCharacter.java from the decompiled files for something that looked right. It is also in the java docs, but then you don't really know what the functions are supposed to do

queen oasis
#

a bad nights sleep has pushed the stupid mostly to the back of my head... for a bit. I still can't type like a normal human, though.
Digging a tree stump. It's not perfect but it's close enough.

bright fog
#

Did you make that for your mod ?

queen oasis
#

Debug Options / PathFind / PathFind.Render.Path

bright fog
#

Pretty cool !

#

I didn't knew about it

queen oasis
#

it's nice to figure out what the zombies are up to

#

or the chickens

past radish
#

Think I just posted this in the support channel but I fear this is actually the right channel so apologies;
I'm currently creating my own mod (my first one) which is tailored off a mod I saw an old friend make but I want to remake it for my own server. "Loot_StashGraves" which makes graves lootable containers capable of stashing items. Currently I have the mod "finished" but my server isn't recognising the mod - I think I have it in the right spot in FTP via gportal.. so now I'm wondering if I wrote the mod structure wrong and am wondering if any knowledgeable people would be willing to take a look at it?

Currently looking to make friends in modding that can help me navigate this space as I have a lot of great ideas i'd love to bring to the game. In return, when I'm informed in a space, I'm an exceptional friend to have around for theory-crafting/testing and would have no issue assisting on a friends mods as well ā¤ļø
Feel free to DM me (sorry about novel)

burnt quartz
#

It would be great if, when a pipe bomb explodes, the windows of vehicles and houses also break, and fences and similar objects get destroyed too (textures from the More Destroyable Objects mod could be used)

burnt quartz
#

I tried but ı couldnt

bright fog
#

Simply ask questions on how to do things

#

People will be willing to guide you

burnt quartz
#

I’ve got no clue at all

livid nexus
bright fog
#

Il te manque beaucoup de dossier lĆ 

#

Relis la page wiki, tu vas trĆØs vite capter ce qui manque en une lecture

#

Il te manque Contents/mods

#

Va vƩrifier Ƨa

bright fog
#

Pareil, je t'invite Ơ lire la page wiki sur le sujet, j'ai Ʃcris en dƩtail pourquoi il est fortement conseillƩ de ne PAS utiliser le dossier mods

livid nexus
#

Tu test localement comment ducoup ?

bright fog
#

Le dossier Workshop est load dans le jeu

#

Les mods dans le dossier Workshop sont reconnus par le jeu

#

Vraiment, lis la page wiki, je déconne pas, c'est LA page qui a eu le plus de travail sur wiki modding et les détails de pourquoi et comment sont très bien expliqué normalement

livid nexus
#

Je lirais en dƩtail tout Ƨa demain, merci, j'ai dƩjƠ ƩtƩ dessus avant de trouver ce discord.
Mais nativement dans les dossiers du jeu faut donc crƩer le folder content et mods ?

bright fog
#

Comment Ƨa dans les dossiers du jeu ?

#

C'est dans les dossiers de ton mod

#

Tu verras Ƨa sur la page wiki

livid nexus
#

Merci en tout cas !
Je vous redis Ƨa demain šŸ˜‰

bright fog
#

šŸ‘Œ

shy mantle
#

mfw my image is exactly 2.00MB by coincidence but steam won't let me upload the image because is too big

#

let me just shave off a row of pixels rq

shy mantle
#

I'm hoping people consider their weight when jumping off a vehicle before splatting face first on the ground lol

#

Good thing for most vehicles I have the "height" set to just before it plays that recovery animation, so damage should be minimal.

vast pier
#

Me omw with a full set of scrap metal armour to jump off the back of a bus

bronze yoke
shy mantle
low bramble
#

"your mod killed me!"

vast pier
#

As someone who regularly carries like 60lb duffle bags of groceries,,,,, Falling over with that weight can kill you

low bramble
vast pier
#

Can't imagine it would be any better as a suit of metal around ya

shy mantle
#

The range from wearing nothing to everything being the difference from no damage to instant death is crazy

#

You should never be able to die from 1 floor up, flat out simple as that. I don't care if you're carrying a damn piano on your back

shy mantle
#

The next update is going to be a vehicle reworking and all this work will become meaningless lol

empty gate
#

Hello!
Do anybody knows if it's possible to extract the array of existing in game npcs names?
It seems there's nothing in the Output decompiled folder

marble sierra
main pasture
shy mantle
#

Having it done automatically sounds more difficult than just plopping in numbers lol

main pasture
#

I tried calculating the positions from the physics box, but then it depends on how accurate the modder made it. Doing it properly would require some kind of raycasting or analyzing the mesh manually

empty gate
shy mantle
#

Oh yeah... manually getting through every modded vehicle is gonna be a pain, but it's not like I have any other plans for my mod, so this is the equivlant to placing farm tiles on a modded map when you just finished building the city lol

bright fog
marble sierra
unreal pewter
#

Hey, quick question
I’d like to create a mod which allows me to place zombie spawn locationd at specific areas in my map mod so I can have guaranteed zombie spawns in specific locations. Does anyone have any reference mod or any direction they could point me in so I could even begin figuring out how this would work?

ancient grail
ancient grail
opal flame
#

Fixing Fix 1T1Ak47
{
Require : 1T1Ak47,

    Fixer : BlowTorch=5; SheetMetal=3; MetalYay=4; MetalPipe=2; Aiming=6; MetalWelding=4,
}

I want to add repair to this weapon. But I must be doing something wrong and I can't seem to add repair.

build 41

tall lotus
#

Hey all! I installed all the extensions that the wiki is suggesting, but I still get stuff like: Undefined global ModData.Lua Diagnostics.(undefined-global)
Is there a way to make VScode understand stuff coming from the Java part of the game? Not sure if I missed something...

livid nexus
# bright fog C'est dans les dossiers de ton mod

Salut, j'ai fait comme Ʃcris sur le wiki...

J'ai cette erreur

[09-09-25 16:13:21.740] WARN : Mod f:0, t:1757427201740> ChooseGameInfo.readModInfoAux > can't find "C:\Users\Utilisateur\Zomboid\Workshop\StaticMerchant\Contents\mods\StaticMerchant\common\mod.info".
[09-09-25 16:13:21.741] ERROR: General f:0, t:1757427201741> ExceptionLogger.logException> Exception thrown
java.lang.NullPointerException: Cannot invoke "zombie.gameStates.ChooseGameInfo$Mod.getId()" because "<local4>" is null at ChooseGameInfo.getModDetails(ChooseGameInfo.java:205).
Stack trace:
zombie.gameStates.ChooseGameInfo.getModDetails(ChooseGameInfo.java:205)
zombie.gameStates.ChooseGameInfo.getAvailableModDetails(ChooseGameInfo.java:222)
zombie.modding.ActiveMods.checkMissingMods(ActiveMods.java:219)
zombie.ZomboidFileSystem.loadMods(ZomboidFileSystem.java:924)
zombie.GameWindow.init(GameWindow.java:1347)
zombie.GameWindow.mainThreadInit(GameWindow.java:756)
zombie.GameWindow.mainThreadStart(GameWindow.java:598)
zombie.MainThread.mainLoop(MainThread.java:64)
java.base/java.lang.Thread.run(Unknown Source)
.

livid nexus
#

Ducoups ce n'Ʃtais que Ƨa, je vais essayer de lancer le bouzin pour tester le code

bright fog
#

Aussi pour la suite je t'invite Ơ demander de l'aide en anglais, comme Ƨa n'importe qui peut t'aider

#

Et perso je ne suis pas l'assistant perso des gens et je préfère que n'importe qui puisse venir aider à n'importe quel moment

livid nexus
#

42
Je comprend, mais comme tu m'aidais hier, je me suis dit que ce serait plus simple.
Plus de soucis, j'ai corrigƩ, maintenant je planche sur le LUA

bright fog
#

šŸ‘Œ

livid nexus
#

Hello everyone!

I wanted to know how useful AI (Gemini, chatgpt) can be in mod creation on PZ.
Mainly for the LUA coding part (I'm much more familiar with UE5 and XML in general).

Can they help from A to Z?
Can they be used to modify an existing mod (without stealing the author's work, of course)?

bright fog
#

No they can't help from A to Z

#

The Lua environment of PZ is different from generic Lua

#

So it's going to spit out wrong stuff and things that don't actually exist or are not available in the PZ environment

alpine hazel
bright fog
#

Because it still was trained on other data

#

Giving it examples, won't actually train it on proper data to learn how the Lua works

#

Consider the amount of data you have to feed AI to even teach it something, I doubt you're not teaching shit by just giving an example šŸ˜…
It'll copy the stuff in the example at best but it won't handle every case scenario

alpine hazel
#

Yeah I see what you mean only way to get a proper AI to help is literally to train just for PZ environment which I dont think will happen at least not soon lol

bright fog
#

A guy seemed to be interested in training an AI on PZ code tho

#

He claimed to have vectorized the game code

#

So eh, who knows

queen oasis
#

why aren't my textures available in the game? idk idk...
I hate myself sometimes

unreal pewter
#

do recipe oncreate functions need to be in the client folder?

#

it should be like:
OnCreate:Recipe.OnCreate.InjectSyringe,
and then in another script:

--logic using player
end``` 
correct?
#

this is a build41 mod by the way

#

all the documentation i could find is updated to b42 which seems very different

#

apparently if the recipe function doesnt have player ingredient and result arguments it just doesnt work

#

also uh. how do i add a trait to a player through scripts because ive been referencing other mods and stuff and i just have no idea how to do it
every time i reference player i get "tried to call nil"

clear perch
#

Is there a minigun mod in the game?

strange smelt
#

Sorry if this is a dumb question. Is anyone working on or interested in working on an AFK trading/vending machine type mod for 42 mp?

true nova
unreal pewter
#

thank you
i ended up figuring that much out and then had to figure out what arguments i needed, and now im trying to figure out how to set the infection level through script

#

player:getBodyDamage():SetInfectionLevel(int)
doesnt work for some reason

#

and i cant figure out how to set infection to false because the game has six different bools called some variation of "isInfected" all in the same script

unreal pewter
#

oh well

#

inputting a number doesnt change it

true nova
#

its probably a percentage

#

1.0 being 100%

unreal pewter
#

i mean

#

getInfectionLevel returns a float 0-100

#

and either way i tried setting it to 0 and nothing happened

true nova
#

are you trying to do zombie infection or regular infection?

unreal pewter
#

zombie infection

#

basically im trying to make an item that kinda halfway cures the player

#

i have a script that applies a bunch of extra symptoms based on the infection level

#

which it gets via player:getBodyDamage():getInfectionLevel()

#

but then i want to make it so it caps out the infection level so the player can't actually get to high levels of infection and therefore die to it

#

so for testing purposes i tried

                player:getBodyDamage():setInfectionLevel(0)
            end```
#

oh hold on a new development

#
            print("Player infection level: " .. player:getBodyDamage():getInfectionLevel())
        end

    if player:HasTrait("Cured1") then
            print("Player Cured")
            if player:getBodyDamage():getInfectionLevel() >= 50 then
                player:getBodyDamage():setInfectionLevel(0)
                print("Player infection level: " .. player:getBodyDamage():getInfectionLevel())
            end
    end```
#

it seems that setInfectionLevel DOES do something in that it changes the infection level for like one tick then it goes back to whatever it was before

true nova
#

might need to change infection time also?

unreal pewter
#

what does infection time do?

#

i tried setting it to 0 and it didnt change anything

#

i also tried setInfected(false) and this did nothing

#

i wonder if i need to set the infection level from client instead of on server

#

putting the script into client changed nothing

true nova
#

the folders have more to do with load order

#

only when working on a server and having it run functions i think it can only read from the server folder but the client can read from all of the folders

unreal pewter
#

oh interesting

true nova
#

it looks like infection time should effect the infection level

unreal pewter
#

ill make it print infection time too hold up

#

infection time seems to be properly being set to 0?

#

but it seems to affect the speed at which infection level builds? im not too sure

#

wait when im not infected, infection time is -1??

true nova
#

i think you are right it has to do with the speed

unreal pewter
#

ok so i prayed to the ancient gods at the indie stone and for some reason it works now

#
    if player:HasTrait("Cured1") then
            print("Player Cured")
            if player:getBodyDamage():getInfectionLevel() >= 50 then
                player:getBodyDamage():setInfectionLevel(0)
                player:getBodyDamage():setInfectionTime(-1)
                player:getBodyDamage():setInfected(false)
                print("Player infection level: " .. player:getBodyDamage():getInfectionLevel())
            end
    end

i have no idea what part of this makes it work

#

but it works

true nova
#

i didnt understand you'd want it cured. that is how you'd do that. i thought you wanted it to go up and down. i was going to suggest stopping it and then infecting again

unreal pewter
#

oh yeah i do want it to go up and down

#

i want it to fluctuate between 0 and 50 infection level

#

the "cured" thing is an internal name for it thats not exactly accurate

#

hey so while i have you here do you have any idea how to make this do something?

        local infectionGrowthRate = player:getBodyDamage():getInfectionGrowthRate();
        player:getBodyDamage():setInfectionGrowthRate(infectionGrowthRate * .125)
#

i want it so when the player is in this "cured" state, the infection increases really slowly compared to normal

#

most ways i could do this feel really clunky except for the potential "growth rate" but once again, the growth rate is not actually being changed, it seems

true nova
#

this is all handled in java. the issue may be that it is tracking the numbers and updating them separate from lua so even changes you send will be changed back in the next update. I haven't done anything with infections so idk for sure , might have to do some janky stuff to make it work

unreal pewter
#

i think youre right about that, it feels like my changes are being overridden immediately

#

not sure why all these functions and variables would exist then, though

#

ok so changing infectiongrowthrate DID work. unfortunately changing it does not affect the rate at which the infection grows

#

jank solution it is, then

#

now, what to do when the jank solution doesnt work

#

Oh my god I think I figured it out.

#

i swear to god. i think "setinfectionlevel" actually CHANGES the infection level by the inputted amount

#

nevermind, this isnt working at all
the game has completely stopped recognizing that my script exists at all, and im not even getting any errors

unreal pewter
drifting ore
#

hey guys, is there a procedure for commissioning mods?

true nova
#

which i can't share 🫠

bright fog
#

Pinned messages

median hound
#

Has there been a mod to bring back carpentry xp when dissasembling?

low bramble
#

not a mod, use sandbox options

bright fog
median hound
bright fog
#

I think I remember a sandbox option too yea, maybe check it out

#

You would have probably already seen a mod for it if that wasn't a thing I would guess ?

median hound
unreal pewter
#

anyone know where the source code is for how like bandages and disinfectant work, specifically what allows them to be applied to specific body parts? was unable to find it in lua so it might be java

true nova
unreal pewter
#

well i’m just looking g for a reference for how an item is able to be applied to a body part

#

like how splints, bandages, and disinfectant can all be applied to injured body parts

#

i’m looking for a reference on how to make a similar item

true nova
unreal pewter
#

i see. thing is i’m still working on that syringe thing from the other night and i’m trying to make it so its injected into the player via the health panel, so a bandage thing would be a little too jank i think, but i have an idea of how to make it not janky if its my only option

true nova
unreal pewter
#

hmm, thatll work

#

thank you

unreal pewter
#

is there a surefire way to just get a specific isogridsquare from coordinates that doesnt require the square to be loaded?

ancient grail
bronze yoke
#

if it's not loaded it doesn't exist

unreal pewter
#

i'm trying to spawn zombies in a specific place in a specific building even if the player spawns in that building and nothing i have tried has come anywhere close to working

#

right now im resorting to this:

function spawnExtraZombies(player, square)

    player:getCell():getGridSquare(60, 150, 0):getRoom():onSee()
    player:getCell():getGridSquare(60, 150, 0):getRoom():spawnZombies()

end

Events.OnNewGame.Add(spawnExtraZombies)
#

those coordinates in the getgrisquare are cell coordinates right? and is 0 the correct z level for ground level? can zombies just not spawn at all in buildings that the player spawned in? because my first try was

createHordeFromTo(660, 3450, 661, 3451, 40)
#

this doesnt work in the building the player spawned in even if i set it to run every 10 minutes, it just refuses to spawn them indoors

#

it works outdoors but not indoors

#

atp im about to resort to spawning zombies outside nearby and playing sounds inside the building to draw them into that room

bronze yoke
#

zombies don't usually spawn indoors so that might just be it

#

they can spawn inside a building the first time it is loaded but apart from that they're never allowed to respawn there

#

i don't think migration is allowed to put them inside either

unreal pewter
#

well then im not sure what IsoRoom.spawnZombies() does

#

and the game spawns them indoors SOMEHOW when the building is firstloaded, i just need to figure out how they do that

#

ok so what im trying to do is make it so that the player spawns on floor 3 and zombies spawn on floor 1. could i possibly just make floor 1 a separate building so that zombies spawn in it, and stack floors 2 and 3 ontop?

vast pier
vast pier
#

Based on the lewis gun mag

tranquil kindle
# vast pier

If i might give my 2 cents, you might wanna try out Auto Shade smooth instead of Shade smoothing everything, I belive some sharp edges especially in grip and magazine area would make this gun look even better

#

Play around with diffrent degrees, i'd try with 50 for starters, just to make sure most of it is smooth, but not all, so like 80 degree faces will get the Sharp edge

vast pier
vast pier
#

It's a left handed mechanically drum fed semi auto pipe pistol that utilizes a chambering system similar to a luger lock

bright fog
#

When do you spawn them ?

quiet fulcrum
#

why did they change setInvincible mechanics in b42? Before in BodyDamage.Update it looked like this:

} else if (this.getParentChar().isGodMod()) {
...
} else if (this.getParentChar().isInvincible()) {
...```
and now it looks like this with an unreachable else if:
```java
if (this.getParentChar().isGodMod()) {
...
} else if (this.getParentChar().isGodMod()) {
...```

Guessing this is a bug, is there somewhere else I could report this?
main pasture
bronze yoke
#

they tried to remove redundant cheats with b42, looks like a mistake here

#

does it actually cause an issue with the cheats?

main pasture
#

It removes the functionality of "invincible", but it seems they also removed the option from the cheats menu

bronze yoke
#

yeah they got rid of the weird redundant ones

#

if god mode still works as intended without it it's not really a bug, just dead code

quiet fulcrum
#

but I needed it in my mod to not die but still retain wounds. God mode restores full health

#

so there was a definite use case for modders for invulnerability

livid nexus
#

For b42

main pasture
#

They still kept the setter/getter functions for it, so not sure if it was intentional

livid nexus
#

Debug mod

quiet fulcrum
#

that's its name? where do I find it?

quiet fulcrum
#

thanks I'll check it out

nova socket
#

So is mod structure backwards compatible from 42 to 41.
Im talking about common and version folders aka 41 and 42?

unreal pewter
unreal pewter
#

eh its fine i gave up on spawning them indoors, nothing is working

unreal pewter
#

i’m not sure, it’s weird and inconsistent. maybe it was the function i was using, but it was ā€œcreatehordefromtoā€ that only seemed to be working outdoors

#

i also tried to get the room and do spawnZombies on the room but idk how that works

#

im gonna five it one last try and just go through the list of functions one by one and try all of them related to spawning zombies

nova socket
#

B42 just refuses to be friendly kek

bright fog
main pasture
unreal pewter
#

huh really

#

ill try that one

main pasture
#

Yeah. Tested it in B42 with this local zombieList = addZombiesInOutfit(player:getX(), player:getY(), player:getZ(), 1, "", 1, false, false, false, false, false, false, 1) binded to a key

nova socket
#

Right, its just pointless kek

#

It's like making a bridge that ends with 200 meters drop right before the destination.

bright fog
#

Wait what are you talking about here

#

Yea 41 folder isn't a thing

#

Bcs making a change now for common folder would require a lot of work on B41 side

#

And I agree with this method

#

You're in the middle of B42 dev or even more, you're not going to go back to the previous version. The change was for the future

unreal pewter
#

do i reference virtual zombie manager as you did there? with VirtualZombieManager.instance:function

#

oh wait
addIndoorZombiesToChunk(IsoChunk chunk, IsoRoom room)

red tiger
#

Wondering if TIS uses Umbrella for writing vanilla Lua code. šŸ¤”

bright fog
bronze yoke
#

definitely not, you'd expect to see at least a single type annotation in their code

bright fog
#

True lol

red tiger
#

I might get back to writing a transpiler using luaparse to lift code to Typescript.

unreal pewter
#

alright, thank you

fleet bridge
#

you need to get the roomdef, and it will spawn it in that room specifically

#

if you want to spawn it in the entire bldg you need to loop the rooms in the bldg

red tiger
#

Oh no.. It begins. I've been writing enough Python to start muxing my Lua code and question why it's syntactically wrong.

#

aaaaaaaaaaaaaaaaaaa

#

I did the if .. : and not if .. then

unreal pewter
bronze yoke
#

if all you need is the roomdef you can get that from the metagrid

fleet bridge
#

if the sq is not loaded then you cant

#

the zombies wont spawn

unreal pewter
#

uhhhhhh im gonna try something, how do i reference IsoMetaGrid functions? (im very new to java and lua so im still really figuring this all out)

bronze yoke
#

getWorld():getMetaGrid():getRoomAt(...)

fleet bridge
#

local roomDef = getWorld():getMetaGrid():getRoomAt(square:getX(), square:getY(), square:getZ())

unreal pewter
#

tysm

bronze yoke
nova socket
bronze yoke
#

they messed it up a bunch for b42, if it was existing mods getting broken by an update to b41 people would've been pissed

unreal pewter
#

uhhh so how about this writeup



local function spawnExtraZombies()
    fillRoomAt(658, 3489, 0)
end

local function fillRoomAt(z, y, z)
    local roomDef = getWorld():getMetaGrid():getRoomAt(x, y, z)
    local chunkDef = getWorld():getMetaGrid():getChunkDataFromTile(x, y)
    VirtualZombieManager.instance:addIndoorZombiesToChunk(chunkDef, roomDef)
    print("Added zombies at " .. x .. ", " .. y)
end

Events.EveryTenMinutes.Add(spawnExtraZombies)
#

got the ol "object tried to call nil" somewhere in there but i dont know where

unreal pewter
#

OH M GOD WAIT IT ACTUALLY WORKED

#

thank you for the help you two

#

oh nevermind every time i spawn into the building it despawns every enemy in the bottom floor uhhhh okay ill just change it to be like whenever anyone spawns in that building itll spawn them in

quiet fulcrum
#

I have an animnode that worked fine in b41, now in b42 it doesnt play (everything else of the mod works fine), did with animsets something change?

bronze yoke
#

yes, copy paste every anim node into the location it would be in if it was build 41

#

there's a longstanding bug with b42 that it still scans the original location for animnode files

#

but it does actually load them from the new location

#

it just won't see files that don't have a duplicate there

#

so you need both MyMod/42/media/AnimSets/player/state/foo.xml and MyMod/media/AnimSets/player/state/foo.xml

quiet fulcrum
bronze yoke
#

the other couple issues that can come up are that the state folder matters a bit more now, and you may need to set conditionpriority as well

quiet fulcrum
#

ah wait.. that's it, I did a minor rename to the folder actually

#

thanks

bronze yoke
#

if that doesn't work try adding <m_ConditionPriority>10</m_ConditionPriority> to the node

woven wren
#

So I have this true music mod I want to update to b42 but it has a dependency requirement for the b41 version of true music and I don't want to disable the mod for b41

#

so how do I update the mod to work with b42 without making it unusable for b41 users?

bright fog
#

It works in B41 if you have the B41 mod structure and it works for B42 mod structure, and you can have both exist together

#

And there's no "it depends on B41 veesion while on B42", that's just not a thing

#

This pahe goes in the details of mod structure and shows examples of combined B41 and B42

next marlin
#

How do I make my mod have multiple sub mods like this?

#

The file tree seems to be the same

#

huh, in the workshop upload only the one is present

#

I forgot to change the fucking mod ID again how do I make the same mistake every time and never learn kyou

solar rover
#

So I got to playing around with weapon mods again and got frustrated with the HitChance, AimingPerkHitChanceModifier and AimingPerkModifier and made this script to punch in some numbers to find what feels right for whatever weapon I'm working on.

Thought it might help if anyone wanted to know what to enter for these values.

#

Oops forgot you can type B to go back let me edit that

solar rover
next marlin
#

lmfao
s

#

so, I was panicking because suddenly my mod was bricking pz to the point you couldn't even open it

and I had already uploaded it to the workshop because all it does is change some vanilla values, what's the worst that could happen

so I'm freaking out, trying to figure out what's wrong

#

Go through everything on the debug log, eventually find something about assaultrifle2 crit multiplier not having a valid value

#

I go check it out and...

#

I randomly hit the W key while I was tying in stuff and didn't notice

that was it

that was the entire error

solar rover
#

Yuuup that kinda thing is my alarm for its almost 6am, go to bed

next marlin
#

2:43 am KanakoHaha

solar rover
#

Good luck! Night all, hope the script helps someone. I hate random values!

muted garnet
#

How can I call my function when the grenade has landed and exploded?

true nova
tight elm
muted garnet
thin swan
#

Not sure if it's known, but there's a way to add new entries to B42 recipe outputmappers.
I was pleasantly surprised that it worked, so figured I would share in case someone else needs to do it:

Events.OnGameStart.Add(function()
    local recipe = ScriptManager.instance:getCraftRecipe("SliceHead")
    if recipe then
        local outputs = recipe:getOutputs()
        for i=0, outputs:size()-1 do
            local out = outputs:get(i)
            local mapper = out:getOutputMapper()
            if mapper then
                local list = ArrayList.new()
                list:add("HorseMod.Horse_Head")
                mapper:addOutputEntree("HorseMod.Horse_Skull", list)
                mapper:OnPostWorldDictionaryInit(recipe:getName())
            end
        end
    end
end)
bright fog
thin swan
queen oasis
#

I just call my functions when the script loads. all the recipes are loaded by then

bright fog
thin swan
#

I can test it real quick

bright fog
#

Since this section will be mostly full of known scripts that work to modify recipes

#

It's not anything too clean and just random info sent there

queen oasis
#

I like Alex's way better than mine, which just swaps inputs and outputs with other recipes

bright fog
#

Which wasn't possible in your case was it ?

queen oasis
#

I never had a reason to try with an itemMapper

#

I need to look at the java again. Something is picking at the back of my brain about items and mappers

bright fog
queen oasis
#

yep

bright fog
#

So either you need to modify inputs/outputs, or itemMappers, those aren't the same thing at all

thin swan
# bright fog I'll keep the script snipet as is until confirmed to work without the event

Seems the event is needed actually, I tried just doing:

local function addHorseHead()
    local recipe = ScriptManager.instance:getCraftRecipe("SliceHead")
    if recipe then
        local outputs = recipe:getOutputs()
        for i=0, outputs:size()-1 do
            local out = outputs:get(i)
            local mapper = out:getOutputMapper()
            if mapper then
                local list = ArrayList.new()
                list:add("HorseMod.Horse_Head")
                mapper:addOutputEntree("HorseMod.Horse_Skull", list)
                mapper:OnPostWorldDictionaryInit(recipe:getName())
            end
        end
    end
end

addHorseHead()

In both lua/client and lua/server, but neither worked

muted garnet
#

As far as I understand, a zombie’s moddata disappears after the player goes to the menu and comes back, because the zombie isn’t saved and is recreated. How, then, can moddata for a zombie be preserved?

willow tulip
muted garnet
#

@bright fog @willow tulip Following this, there’s no way to save a zombie, right?

willow tulip
bright fog
#

But is not suggested for large amounts of zombies

#

It is to set the zombie as a dead survivor, meaning it will have an inventory and should be saved properly when reloading and be the same zombie

willow tulip
#

Neat.

bright fog
#

I've personally never played with it

willow tulip
#

Boss zombies

muted garnet
#

I implemented a kind of grenade that applies an effect to zombies. The problem is that this effect resets after re-joining. So yes, I have to work with a large number of zombies.

queen oasis
#

well I can't find it so it must have been a fever dream. I thought there was an outputMapper reload triggered at some point. oh well

#

glad I didn't shake that 'dumbass' out of me

upbeat turtle
#

🐺

muted garnet
#

How can I make a custom crafting station, like the forge in vanilla? I mean, the player clicks on it and a recipe window shows up. As far as I understand, recipes need to have a tag, but how do I actually create this station?

bronze yoke
#

you need an entity script

#

not much (or any?) documentation of them currently, take a look in media/scripts/entities

muted garnet
#

Found it, thanks.

bright fog
#

So yea to my knowledge, no docs about it

vast pier
bright fog
upbeat turtle
# bright fog You trying to make a dog mod ?

Tamable wolves mod šŸ˜‰

Been working on it for a few days now. finished a good bit so far!
my biggest step next will be coding a framework for the custom taming system — plus some other AI logic stuff lol

bright fog
upbeat turtle
#

correct! right now, i’m doing some polishing work on em in blender before importing everything in game. got anims for every state (including hopping over fences lol)

#

i’ve been chatting with Alex & Paddlefruit on the side. they’ve been super insightful with the animation stuff especially

bright fog
#

Like in-game ?

upbeat turtle
#

not quite yet, lol šŸ˜‚

Everything works fine in blender so far.
I was a bit overkill with my prep work overall (got 13 anims in total lol) xD
but yeah, i’ve been doing my research on custom animals. if I run into any issues with getting things in-game— I have a few points of reference to bug fix from

#

i’ll be working on actually porting stuff in the next couple of hoursish

#

once that lines up, y’all can expect to see some more teasers and a #1162438206516645948 šŸ˜„

marble osprey
#

question for yall, if you wanted to make a map, is there any tools to like tile it somehow? using the vanilla sprites?

upbeat turtle
#

they have a whole bunch of guides over there. You can also search for ā€œDaddy Dirkieā€ on youtube. he has a tutorial playlist for mapping 101

marble osprey
upbeat turtle
#

happy to help! I wish them good luck with their project. it’s awesome to see folks interested in mapping! šŸ˜„

willow tulip
drifting ore
#

thats it im calling the police

willow tulip
#

@tame mulch any chance your around? ^

#

(recommend you delete last hour when you ban @dense lagoon due to him spamming it 15 places on server)

upbeat turtle
#

a few of the anims are a tad bit janky (lol), but planning on fixing them later in the dev process

dusk saddle
#

New wild animals will be awesome!

mossy crypt
#

any suggestion on debugging a recipe script file for B41? all of the recipes for one of my files aren't loading. I've already made a test file with a single recipe that works fine

#

like are there any logs that might display some sort of error? or is it just quiet?

mossy crypt
#

not sure how, but an empty break unicode character appeared at the start of the file. the other files i had did not have this character so unsure of how it appeared there

vast pier
#

Vague screenshot with a lot going on in it

open drum
#

Fellow modders

#

I have this code made (reading chracter skills, and its level saved up in a .ini file)

#

then applying to the chracter again after revive

#

but Perks.perk works well with Vanilla skills

#

but if chracter has custom one, it will throw an error

#

wht will be the best solution for this?

bronze yoke
#

<@&671452400221159444>

sour island
#

Oh there's two of them wild

#

<@&671452400221159444>

ancient grail
#

<@&671452400221159444>

ancient grail
ancient grail
#

did not work?

open drum
#

just tried and worked

#

ty

#

thought it wasn't working

#

but forgot to put FromString

#

that was simple fix. ty for ur help

hexed lintel
#

This might be a dumb question but how would I get in contact with K15 I want a commissioned vehicle and am willing to pay well, does anyone know?

open drum
#

ummm maybe send him friend request?

tranquil kindle
vivid vessel
#

Idea; sauce thst puts your survivor in agony

small yarrow
#

One of the hair mods I have installed has a 3 length tied hairstyle revert to the wrong untied hairstyle which also happens to be a 2 length. Is there a way I can edit the mod myself to just specify which hairstyle untying that ponytail should change it to?

#

oh right b41 to be clear

tranquil kindle
small yarrow
#

Spongie's hair. Specifically, the kotone ponytail hairstyle changes to long (curly) despite there being an untied variant of the kotone hairstyle. If possible I'd like to just tweak it myself but I couldn't find anything related to untying on the wiki, at least in terms of the hair modding section.

tranquil kindle
#

By default it unties to vanila hairstyle from what i remember

#

So it's strange that it would cut your hair

#

Without modifying hairstyle.xml i don't think you can do anything and at this point i think is simply better to let original author know

small yarrow
#

actually now I'm unsure if long (curly) is 2 length I might've misread the xml file

tranquil kindle
#

@winter bolt In worst case scenario i'll take the blame drunk

small yarrow
#

but regardless I couldn't find a way to change my hair to that kotone untied style in game

#

oh yeah I did misread I was looking at the texture name not model. Idk what length long (curly) is.

tranquil kindle
#

If i remember correctly you keep your hairs lenght if you tie hairstyle into something, once its "cut" then yeah... you cut to that

#

So i make my hairstyles "tie" so you can always revert it

#

Even if they do look shorter

small yarrow
#

in that case let me double check the tie menu

#

yeah no it's not there either

small yarrow
#

oh honestly nvm I did a little more digging and apparently spongie has a separate mod that lets me change it to the right hairstyle

winter bolt
lament oak
#

Can someone help me? Please. Lol. I simply want to make a personal use mod to create some posters with my family pictures to place in my base and I have no idea where to start. Google makes it seem to be straight forward, but I think I need a bit more help than AI can deliver

true nova
lament oak
fleet bridge
#

can the tile object be picked up already?

#

if so you can add them to inventory as a movable

lament oak
#

I'm not sure. I created the mod using AI instructions, but it says at the end how to enable the debug menu to spawn the item and I don't want to do that, I want it to spawn in the world like other items. So I'm not sure if the mod even took tbh.

#

This is literally my first ever attempt creating a mod

true nova
ancient grail
#

anyone knows if Safehouse
getId() returns persistent value?

vale garden
#

How possible is it to ask ChatGPT to help create a mod if I have zero modding experience?

bronze yoke
#

not very

upbeat turtle
#

the issue with chatgpt, claude, gemini, etc… all of those ais are trained on much different data than PZ.
Zomboid is a very unique coding environment which those AIs simply aren’t equipped to handle

#

as a result, the AI will make up stuff & hallucinate and give barely-usable output

#

in theory it is possible to train your own AI… but that in of itself is a whole can of worms

upbeat turtle
vale garden
#

Or maybe I can start from somewhere and do a trial and error

willow tulip
#

you will be 100x better off

warm moon
shell widget
#

might be interesting

true nova
#

it sure is trying. it looks like pz code but is it really doing anything?

worn olive
#

i finished my first mod! i added energy drinks with custom mesh/Textures!

warm moon
rich void
#

Anyone know if there is way to increase range of sound from BaseCharacterSoundEmitter?

zed:getEmitter():playSound("examplesound")
#

think i answered my own question for anyone who ctrl fs a problem I hadn't defined the sounds in scripts so its all just wacky defaults šŸ™šŸ»

drifting ore
#

Please disregard --

#

I tried with setCanPerform and setLuaTest, won't work
Edit: Ended up overriding the actual recipe txt so I would be able to add OnCanPerform

ancient grail
#

might also cause syntax error cuz the item isnt drainable

vale garden
#

So, the easiest way would be using Lantern mod, replace the light part with temperature part?

upbeat turtle
#

interesting. My guess is since enough people have tried feeding gpt data (including what it’s learned from prompts) - it actually does have some training data.

with this in mind though, it’s giving disjointed code probably because there simply isn’t enough training for reference. it’s likely working with tiny snippets of examples, but not the bigger picture.
For one, I’m skeptical GPT has the game files vectorized in its database

rich void
#

Can be a great learning tool though I started out using chatgpt loads to write functions from scratch and overtime it becomes more effecient to check documentation and great forums like this when you run into road blocks

bronze yoke
#

people kind of overestimate what ai does and how it works, yes it has a general awareness of PZ, but it still won't use it properly and will happily make things up as soon as you ask it something tricky

#

these days it can make something that looks convincing but unless it's very very simple, it won't actually work and without learning the skills yourself you won't be able to debug it (and at that point, why even use ai)

muted garnet
#

Can I add a custom clothing patch with custom parameters?

#

Or is there a way to increase protection for a specific body part on a specific piece of clothing as much as I want, like patches do?

true nova
muted garnet
true nova
muted garnet
muted garnet
true nova
muted garnet
true nova
#

rename your Model_X folder to models_X

left osprey
#

nuh uh

#

is it really that

#

damn

true nova
#

yes, also i suggest making the names lowercase, it is not case sensitive in windows but can cause issues for linux users

left osprey
#

It's still the 32x32 textures sadly changed to lowercase m

true nova
#

did you restart the game? i dont think new folders load while in game

#

which it would be new to the game when renamed

left osprey
#

Yeah I restarted and it's still the 32x32 textures

#

wait wait wait

#

"models_X" not "model_X" facepalm

true nova
#

lmao

left osprey
#

Yeah.. still 32

#

made it models_X and still 32

true nova
#

so MagicJellyBandage_Ground would be Base.MagicJellyBandage_Ground

#

in your item scripts

left osprey
#

so would this be the correct setup? It was still 32

left osprey
true nova
left osprey
true nova
left osprey
#

alright I'm trying lowercase

#

YES

#

omg thank you

#

they're huge but I'll just scale them down

true nova
#

scripts are case sensitive in majority of cases

#

i havent touched scripts in a while and never did a lot of models so i was slowly remembering things

left osprey
#

Welll I greatly appreciate it lol

muted garnet
tranquil kindle
ancient grail
winter harness
#

I want to make a mod that messes with the day and night temps but I've never touched PZ code, where can I get started with this?

bronze yoke
#

<@&671452400221159444>

delicate solar
small yarrow
#

What's the function to set a player's weight? I can't seem to find it in the stats class and the "setWeight()" function I found elsewhere doesn't seem to do it.

ancient grail
small yarrow
#

ty

unreal pewter
#

also for the record i cant actually open the "show recipes used in" dropdown

unreal pewter
#
    craftRecipe boilCupNoodles
    {
        inputs
        {
            item 1 [ProjectGurashi.CupNoodles],
            item 1 [*],
            -fluid 1 [Water;TaintedWater],
        }
        outputs 
        {
            item 1 ProjectGurashi.CupNoodles,
        }
        category = Cooking,
        Tags = CanAlwaysBeResearched;RightClickOnly;AnySurfaceCraft,
        Time = 200,
    }
red tiger
#

This game is really hurting for the implementation of render layer / render pass controls for Lua.

#

I'd mod this game to support it if adopted but that's unlikely.

#

UI would have such an insane boost of quality if one could add quest-like UI to the map where rendering comfortably with map tiles.

#

UI being locked to post-world renderpass is such a hard limiting factor.

#

It wouldn't be too hard to implement since the game uses a CPU-Thread render call instruction cache. It simply needs Lua events added to make possible so like a few lines of code and maybe some FBOTexture stores for shaders.

unreal pewter
tranquil reef
#

are there plugins to support Jetbrains Rider

bronze yoke
#

you can use intellij which is jetbrains' java ide, it has a decent lua plugin, but it's still overall inferior to vscode

true nova
#

all my homies hate intellij

tranquil reef
#

I'm just using both at the same time now lol. Reorganizing files with Rider but using the plugin from Vscode

#

Also am I able to add commands for the lua command line thing in the command console

vast pier
vast pier
#

Is there a way to check what specific item/bullet is loaded in a gun mag ?

getAmmoType()``` checks the gun's AmmoType param.
And will return that value regardless of what ammo is loaded in the magazine
bronze yoke
#

getAmmoType() on the magazine, not the gun

vast pier
bronze yoke
#

probably not

#

to be straight up you might be really overestimating how guns work in this game

#

there isn't support for things like multiple ammo types, mods that do that use entirely original systems to do it

vast pier
#

Yeah ik, I might have to fiddle with some stuff

#

Trying to think up a way to get different casing types functional.
Like steel/brass/aluminum/copper

vast pier
bronze yoke
#

definitely

#

there aren't 'bullets' in a gun/magazine, there's just an ammo count

#

the ammo type tells it which item to remove/add to fill/empty it, which is all that's needed when you only support one ammo type anyway

willow tulip
#

(its used for evolved recipes)

#

And I think weapon mods?

vast pier
#

extra items property ?

willow tulip
#

I believe you store stuff like 'base.itemtype' in there

vast pier
#

what's it do

willow tulip
#

Im 80% sure that it will automatically add the little icon of the extra item to the tooltip when you mouseover your mag

#

Like how gun mods can be seen on a weapon, and how ingredients can be see in an evolved recipe

#

Not that it changes how reloading or guns work, but it could give an indication whats loaded (assuming it works)

vast pier
#

Which means I might be able to use getExtraItems to determine the current bullet type, which the casing ejection code should be able to check and update to the next casing :D

willow tulip
#

Im not sure if it will let you store duplicates of the same item.. Actually, I guess it does since the same evolved recipe can have multiple of the same ingredient.

vast pier
#

it does, I'm currently checking to see if it saves the order they were added to the item or not

willow tulip
#

just note they arnt actual items: just strings

vast pier
#

yeah ik

#

The value would be injected during the loading of the magazine itself, which would then be snatched and applied onto the gun itself

willow tulip
#

(And the game may do something horrible if you try to store anything except valid item typenames there lol)

#

So if you need extra data use moddata to store a table

#

And you might still wanna only hold '1' bullet type in the mag for anything over 6 rounds or so to prevent the UI from looking like a mess trying to render 30 bullet icons

#

Like, cool idea for tube mags for shotguns or rifles, bad idea for assult rifle mags.

vast pier
willow tulip
#

You use getModData() on the item, and then you get this wonderful table that you can just edit and it saves it to the item

#

(Note: there is some update command you may have to use for MP compatability depending on if its server or client code doing the updating and I forget what it is since I don't mod for MP yet)

#

But basically you can just

#

local foo = magazineitem:getModData();

#

foo.MyImportantData = 10

willow tulip
#

foo.MyBigData = {23,25,36,"hello world"}

#

Uh thanks bot šŸ˜›

willow tulip
#

foo.MyFancyData={x = 23, y = 42, moredata = {53, 53},} etc.

#

Just remember to init things (they will be null) before trying to read them. This idiom is commonly used:
foo.MyImportantData = foo.MyImportantData or 0;

#

foo.MyBigData = foo.MyBigData or {} -- Sets up a table for you if it doesn't exist yet.

#

Basically, this says "Assign it the value of itself!... or if it has no value, assign it this other value"

vast pier
#

Is this data modified by each individual item? like will the moddata of one item share data with the same item type ?

willow tulip
#

Nope! its unique per-item instance

#

every player, car, inventory item (But not zombies so much) has persistent moddata that will save/load for you!

#

Just name your data something unique enough not to accidently trample someone elses šŸ™‚ or TIS'es.

#

ie moddata.ammo = bad idea,
moddata.mycoolmod.ammo = awesome. moddata.mycoolmod_ammo = also awesome.

#

moddata.MCM_ammo = also awesome.

#

There is also 'global' mod data for data you don't want attached to anything in particular.

#

(Do note: you can only store POD data, ie tables, arrays, strings, numbers. You can't store functions in moddata, or fancy classes like inventory items)

vast pier
#

how do I apply mod data to items šŸ˜“

bronze yoke
#

just call item:getModData() to get its mod data

#

it's just a table, nothing weird, do normal lua stuff to it

willow tulip
willow tulip
vale garden
#

Wonder that is there any channel for mod request?

torn rapids
#

Hello! Working on a sports card collecting mod, and have prepared a subset of card items with tags. I wish to call this specific set of tagged items during a recipe OnCreate function, but I can't seem to find a way to create the list in LUA by pulling items with the tag.

Is the only way to list out all the items for the table?
Or is there a way for the scriptItems:addAll(getScriptManager():getItemsTag("Tag")) to populate a table with item names?

ancient grail
silver delta
#

Hello! I would like to join the modding community as a brand new modder working on her first mod. Is there a place/Discord for PZ modders?

bright fog
red tiger
#

I neeeedddd aassyyyyynnnccc

#

aaaaaaaAAAAAAAAAAA

jagged wren
#

i’m looking into creating my own challenge, how would i go about that? by challenge i mean like cd/da or last stand where it’s a custom scenario, would i use the project zomboid modding tool app or something else?

bright fog
haughty bridge
#

Been working on a luau transpiler for project zomboid. I am dying writing all the declared types crybaby

(For those that don’t know luau is the equivalent of typescript is to JavaScript, luau’s syntax is the same but supports type annotation)

red tiger
#

My guy I was literally looking this way

haughty bridge
#

Converting the code itself is easy 😭

It’s solving for all the updates require paths and weird syntax that is hRd

red tiger
#

I wrote a few transpiled modding environments for PZ.

haughty bridge
#

The main issue is having to translate a .luarc file into updated require paths

#

Luau uses luarc files to point to aliases

#

So instead of having to find every path you can say all games assets are contained within require(ā€œ@game/fileā€)

red tiger
#

When I wrote a Typescript environment I had to post-render adjust the require paths and wrap re-imports in a custom PZ event to avoid broken requires.

haughty bridge
#

My idea is I’ll likely regret all patterns so anything that starts with @ will instead be converted into its true file path

red tiger
#

Ambient modules will probably cause headaches.

haughty bridge
#

Probably, the hardest part will probably be defining all the classes project zomboid uses

#

As there is no documentation on .d.luau files

#

I had to learn via trial and error

#

I’d use dalbit but I really hate how it works

#

I’m likely gonna transpile it using lune

red tiger
#

Check out Umbrella and Candle. It's all about what you're trying to do.

#

Candle more-specifically.

haughty bridge
#

The issue is luau is very very very niche language

#

It was invented by Roblox and only has recently blown up for outside Roblox use

#

I’d argue it’s better then regular lua just because of its type annotation system

bronze yoke
#

as long as you know the format you're trying to write to, candle provides all the type data you need