#mod_development

1 messages · Page 252 of 1

grizzled fulcrum
#

literally the very right button, it means continue even though there was an error

analog breach
#

My bad 😭

grizzled fulcrum
#

it's just you cant see the icon because the game error'd so early into the loading (I think?)

analog breach
#

I had the 3 boxes

#

Just nothing in them

grizzled fulcrum
#

you can see in that ss the stack trace and the mod that's causing the error whicih is Skizot's riding mower

analog breach
#

Ok

#

That's a problem?

grizzled fulcrum
analog breach
#

Ok

grizzled fulcrum
analog breach
#

Yeah

#

Ok I'm loading into my test world rn

#

Ok finally loading in lmfao

#

God please just work 😭

#

Yeah

#

Back to only 32/32

grizzled fulcrum
#

you mean there is literally only 32 recipes

analog breach
#

Yes

#

There should be like 800

#

But I can't even rip sheets

#

It's messing it up so bad

#

And I only have this mod enabled, along with mod manager and a cheat menu, but when I disable the mod it works fine

grizzled fulcrum
#

hmm

#

try removing module base from your scripts

#

like not remove

#

but change it to your mod id

analog breach
#

What do you mean?

#

I'm new to this

grizzled fulcrum
#

So in your recipe and item scripts

#

there is module Base at the start

#

Base is the vanilla game, so you're defining (creating) your items in the vanilla game module instead of your own mod's module

analog breach
#

Ok

#

What should I change it to?

grizzled fulcrum
#

this shouldnt be that much of an issue in reality, but I've had some past issues with module base so just change it to see if anything else changes, if not you can change it back

grizzled fulcrum
analog breach
#

Ok

#

For both the item.txt and the recipe.txt?

grizzled fulcrum
#

yes

analog breach
#

There doesn't need to be a comma after that right?

grizzled fulcrum
#

no

analog breach
#

Ok Opening pz back up

grizzled fulcrum
#

oh btw you shouldn't need to restart pz every time you make a change since in debug mode, if you click "Reset Lua" down the bottom right of the screen in the main menu, it will reload all your mods!

analog breach
#

😭

#

Dude

#

That would have been nice to know

#

Tysm for telling me that lol

#

Well shit

#

It didn't work

#

Still 32/32

grizzled fulcrum
#

ok now it's time to share the console.txt in dms because I have no idea

analog breach
#

Ok

grizzled fulcrum
#

Like I've seen this happen due to syntax errors in the item script but yours has none that I can see

grizzled fulcrum
#

someone pls help this person I have no idea why it's causing vanilla recipes to vanish

#

it's literally a scooby doo mystery

analog breach
#

Im having an issue where when my mod is installed and you are playing with it you are locked at 25/32 crafting recipes.

#

you cant even rip sheets lmfao

#

the actual item you can craft

#

it works fine aswell

#

just the whole crafting got deleted

frank elbow
#

Referring to these screenshots

ancient grail
#

how tf did you even notice that

frank elbow
#

I made a deal with the devil to trade social skills for attention to detail

grizzled fulcrum
#

well I assumed they changed it after I mentioned it but yeah no difference

#

their mod is quite literally just the bare minimum and nothing else with an item script and a recipe script with each both containing only one entry

frank elbow
#

Have they isolated it to either file? i.e., tried with the content of the recipe file cleared out to confirm that's the cause

#

I remember someone else running into a similar issue months back but unfortunately idr what it ultimately was

grizzled fulcrum
#

I swear I suggested literally everything I could think of

#

syntax on the scripts are good, mod structure is good, not overriding any vanilla game files, only happens when their mod is enabled (no other mods except ModManager too), tried different saves, nothing in console.txt

#

maybe they just need to verify game files

topaz tangle
#

Guh! Still no luck

thick karma
thick karma
grizzled fulcrum
#

yes

thick karma
#

@analog breach

topaz tangle
#

Boy is this taking a while

topaz tangle
#

troubleshooting, file type was wrong for spawning

#

and didnt replace a "mod_name" bit

#

uh oh

tranquil kindle
#

Ummm, youre overriding vanila recipe txt file?

#

Its literally same name

bright fog
#

hmmmmmmmmmmmmmm

tranquil kindle
#

Change name of it to literally anything

#

Unless its already solved?

topaz tangle
analog breach
#

Sorry guys I just woke up

#

@tranquil kindle I was using the pipe bomb as a basis for the mod. So I could change the values of it

#

@thick karma yeah, you still on?

analog breach
#

I'll try changing the name on both.

analog breach
#

Getting on my PC rn

#

I just woke up

#

So @tranquil kindle said the problem was the .txt file name but I believe I've already tried that. (Excuse me for being slow on this I just started modding like 1-2 days ago)

tranquil kindle
#

So that makes vanila file non existent if you load this mod

analog breach
#

I changed it to itemrecipe.txt

tranquil kindle
#

No

#

Change it for something UNIQUE

#

that noone would name it

analog breach
#

Piddysmansion ?

tranquil kindle
#

k12recipes or something that you can guarantee noone will use

analog breach
#

Ok I changed it to "duckpipebombcrafting.txt"

tranquil kindle
#

Just so both mods don't cancel eachothers out

analog breach
#

Is that fine?

tranquil kindle
#

Anything that is not vanila is fine.

analog breach
#

Ok.

#

Alr I'll load up the game rq

topaz tangle
analog breach
#

Lmfao if this works I think I'm going to cry

tranquil kindle
#

Thats why some people put their nickname or mod id before name. For example bit braven does BB_Items or whatever,

analog breach
#

Ahh I see

tranquil kindle
#

I make The last of guns mod, so its TLOG, so when i have my recipes i do TLOG_Recipes

analog breach
#

Nik I have spent like 4-5 hours doing random stuff trying to fix this 😭 if this works I will be so mad

analog breach
tranquil kindle
#

Usually the most obvious things can be missed

#

It depends on what you want your mod to be.

#

But in this case you don't really wanna get rid of vanila recipes don't you

#

Unless hmmm

analog breach
#

No

#

Definitely not lol

#

@tranquil kindle

#

I have the recipes back

#

But now I don't see my item

#

Oh wait silly me

#

I didn't confirm the mod 😂

#

Ok

#

When I load in I now have more crafting recipes

#

But not all of them

#

Still missing so many

#

It maybe cheat menu interfering. I'll try disabling that really quick

#

It looks like I have modded recipes even though I have no mods except for mine?

tranquil kindle
#

Why you think thats the case

analog breach
#

I think maybe because one of the names of my files interferes with a mod file?

#

I don't have any enabled though

#

Yeah I'm still only at 25/32

#

i wonder if it because i have a texture folder?

#

i mean i really dont know

tranquil kindle
#

Why do you have both module Base and imports base?

analog breach
#

Look idfk

#

i was just told to add that lmao

tranquil kindle
#

by pek?

analog breach
#

No not pek

#

someone was helping me last night

#

Pek told me do module Base, but then i was told that it interferes with vanilla so i switched it.

tranquil kindle
#

I only do module Base drunk

analog breach
#

tbh i really dont even know what the imports base is

#

my recipe still showed up ingame without it

tranquil kindle
#

just remove imports base, but aside from that i doubt anything else is wrong

analog breach
#

and it was just as broken

tranquil kindle
#

Create new save maybe

analog breach
#

what about the item_duckbomb

tranquil kindle
#

both

analog breach
analog breach
#

real

#

ok i deleted that

#

ill go try it

#

It didn't work

tranquil kindle
#

Please tell me your name of txt file which rubberducky item is does not override any vanila files

analog breach
#

The .txt file where the item stats are?

tranquil kindle
#

yes

analog breach
#

It's K12_items.txt

topaz tangle
analog breach
#

is it possible for me to just send you a .zip or something?

tranquil kindle
# analog breach It's K12_items.txt

Did you intend to make custom tab just for your item? If not you should change recipe> Category:Category:Engineer, instead of Engineering. Also remove item_duckbumb from recipe above "recipe Ducttape pipebomb to rubberducky"

analog breach
#

ok

#

no i didnt intend that lol

#

ill go try it ingame

tranquil kindle
#

There is nothing else that can be wrong that i can thing of right now.

analog breach
#

You said this issue is caused by something in my mod overriding vanilla recipes?

tranquil kindle
#

It was overriding, because it shared name of vanila file

#

But thats not longer the case

analog breach
#

Only other thing I could think of is that right next to the media folder, I have textures.

#

But that's only a png of the item icon

#

Im not even sure if my codes saving right?

tranquil kindle
#

Im not sure why you would have textures outside of texture folder, but that shouldn't do anything

analog breach
#

I changed it to engineer

analog breach
#

I changed the category to engineer, but it's still showing engineerING?

tranquil kindle
#

I just want to make sure, you're not actually subscribed to your mod on steam too?

analog breach
#

Im not sure

#

let me check

#

lmfao i was 😭

tranquil kindle
analog breach
#

was i using

#

the old code from what i uploaded?

#

is that why nothing was changing?

tranquil kindle
#

That is most likely the case

thick karma
analog breach
#

Ok sounds good thank you burry.

#

Nik, do you think I should delete the steam workshop folder for when I subscribed to it?

#

For some reason I thought it would be easier with being subscribed to it 😭

tranquil kindle
#

Nah. Just have to remember that steam workshop subscribed mods have priority over local files

#

So when you work on your mod, you have to unsub from your on steam.

analog breach
#

Oh my fucking God

#

It worked

#

But one problem

tranquil kindle
#

Oh nyo

analog breach
#

Now I'm missing the texture for the duck bomb

#

Which is minor ig

#

But everything is in the game

#

So improvement

thick karma
#

Then you won't have conflicts between versions

analog breach
#

Dude I wish I would have known this 😭

#

oh my god nik

#

what is your steam

#

ur getting all my steam points lmfao

tranquil kindle
analog breach
#

ive been working on this for too long

bronze yoke
#

my preference is to use a separate cache directory for development

#

i disable the workshop too

analog breach
#

the texture isnt showing in game smh

bronze yoke
#

that way you won't get consistency errors when joining servers with an unreleased update, and you don't need to unsubscribe or anything while developing

tranquil kindle
analog breach
#

Yeah it's there but the texture isn't.

#

I accidentally deleted it

#

But I restored it

#

And now it's not working

#

The name of the texture is duckbomb.png

#

For the icon id for the actual item I had just duckbomb

#

I'm gonna try adding the .png lol

tranquil kindle
#

For icon texture you need to name it Item_Youriconname

#

and then in item.txt file put just Youriconname

analog breach
#

ok

thick karma
analog breach
#

For the icon texture it's named Item_duckbomb.png

#

For the .txt file I have duckbomb

#

Am I missing the Item_?

tranquil kindle
#

duckbomb.png as its name, or png as file type

#

remove .png

analog breach
#

Png is file type

tranquil kindle
#

But name isnt?

analog breach
#

No when I go to remove .png it's giving me the unstable error

tranquil kindle
#

You know what, zip it and send it to me and we will see

analog breach
#

uhh

#

lowkey

#

idk how to :p

#

never have done it

#

wait

tranquil kindle
#

The only issue is missing icon?

analog breach
#

i got it

analog breach
#

only problem

tranquil kindle
#

Do you have that icon in texture folder?

analog breach
#

yes

#

i sent u the zip

brisk remnant
#

Is it a size issue? Like is your png to many pixels

analog breach
#

my png is 32x32

tranquil kindle
#

you did not add i"tem" to Duckbomb.png

brisk remnant
#

Ok nvm

tranquil kindle
#

it should be Item_Duckbomb

analog breach
#

i thought i did

#

maybe im not cut out for modding man

#

It's not working still

#

why wont the little guy work

#

imma try adding item_duckbomb to the .txt

#

maybe that will work 🤷‍♂️

tranquil kindle
#

That wont

analog breach
#

Well

#

What the fuck

#

What is going on

#

Ok

#

So the crafting works

#

But now I can't even spawn the item in the game

#

And when I craft it

#

I get an error

tranquil kindle
#

What did you do

analog breach
#

I legit don't know

#

I didn't mess with any of the code except for display name

#

It's now not even an item ig

brisk remnant
#

Stressful times man. You’ll figure it out though you’ve got this far bro 💪

inner ruin
#

Hi there. I'm trying to create a mod that replaces the zombie growl noises, and to do so without just editing the soundpack. I have a script file that seems like it should set the sounds up correctly, but it doesn't.

I'm perfectly happy doing this with lua if necessary, but I'm not sure how to hook into the game to make it happen.

inner ruin
rancid panther
#

the blackouts crew is cooking fryingPan Spiggo

analog breach
#

I should have mentioned i have it all fixed. I just need to figure out how to update my preexisting workshop file.

rancid panther
#

you just do the same way as uploading as long as the mod.info uses the same workshop id

#

and it will ask if you want to update the mod

#

also updating the mod doesnt change the workshop.txt file, so if you made any changes to it, copy it from steam and paste it into the editor

#

i have lost workshop descriptions too many times

inner ruin
rancid panther
#

have you seen any other mods that do replace zombie sounds without requiring the user to replace the file?

#

the bgm and zombie sound mods are always the ones i see that require user action to install

inner ruin
#

Additionally, is there anything that describes in details how the script blocks work? I see that sound clip blocks can have event fields and file fields, but I get the feeling they don't interact but instead describe different sources, and I'd love to see something describe the various schema for these blocks

rancid panther
bronze yoke
#

event means it triggers an fmod event instead of directly playing a sound

#

basically just patching over the old sound scripts for the new sound engine

inner ruin
#

I DID IT

bronze yoke
#

unless you're replacing the soundbank entirely mods can't create events so they're not much use

inner ruin
#

I just had to name the sound as the same names used by the vanilla scripts

inner ruin
#

Thanks for your help everybody <3

rancid panther
#

congrats on figuring it out!

thick karma
#

@bronze yoke What if you just made a mod shut down without saving and required people to run routine saving and made everyone quit before you triggered the exit without saving?

#

Would that be possible using system agnostic Lua commands?

bronze yoke
#

probably?

thick karma
#

🤔 now I have an urge to fish around in the Javadoc about this

bronze yoke
#

earlier versions did just quit without saving, just the data loss was too annoying

thick karma
#

Can't you just delay the quit for X minutes after kicking everyone?

#

Or will it not routinely save after everyone is gone?

bronze yoke
#

i'm not sure because kicking everyone is pretty much the same as saving

thick karma
#

Right so why so much data loss? So confused

bronze yoke
#

everyone's chunks unload and therefore get saved, maybe things like gametime and global mod data get data loss though

thick karma
#

Hmmm

cobalt cove
#

I am trying to write code that lets me add a delayed broacast message to the in-game radio and I don't know what is wrong. Could someone have a look at my code?

#
        radioScript:AddBroadcast(bc, true);
        channel:AddRadioScript(radioScript);```
cobalt cove
cobalt cove
#

I also set the radioscript name and ID to not always be the same as if they are the same you cannot properly set the active script.

thick karma
#

#mod_support message @bronze yoke When you said this, were you suggesting that /quit (the "admin command") is a perfectly safe and effective way of saving and shutting down server?

bronze yoke
#

as far as i know

thick karma
#

So is there something wrong with SendCommandToServer("/quit")?

#

I mean it just claimed to work when I called it, but I am new to this being an issue.

#

It said server shutdown safely, map and player data saved.

bronze yoke
#

you'd need an admin to send it

hollow lodge
topaz tangle
#

finally...
almost done

sour island
#

Is it floating?

topaz tangle
#

it was in that screenshot, its been fixed

thick karma
# bronze yoke you'd need an admin to send it

So all you would need is to set one client admin for a frame and then send that right? Is that not a fairly viable solution for some reason that is not obvious to my peanut brain?

#

Because if UUD is not working as expected and that admin command IS safe, I might take a crack at an updated version

#

It doesn't seem that bad

bronze yoke
#

it seems like a bad idea

thick karma
#

To give someone admin for a frame you mean?

bronze yoke
#

yeah

thick karma
#

I see.

topaz tangle
thick karma
#

Would they have to become god?

#

And thus lose damage and such?

#

Or could they be made a non-god admin without healing them

#

Or are you just concerned about what someone might pull off in the frame they have available?

bronze yoke
#

not sure, that's the vanilla behaviour but it might be part of the command rather than part of becoming admin

thick karma
#

Hmm

bronze yoke
#

it's a vulnerability that i think most servers that would use a mod like this wouldn't want

#

i'm not sure you can really do it 'for a frame' either

thick karma
#

Perhaps autoadmin could be an optional feature?

#

And the default behavior could require an admin to be online?

bronze yoke
#

you'd have to admin them, then have them send the command, and have them still be admin when the command arrives

thick karma
bronze yoke
#

the server will absolutely check permissions on its end before running any command

#

otherwise all hacked clients have to do is say 'ban everyone' and the server just trusts it? 😅

thick karma
#

I'm aware the server would want to check the player's admin state, but when and how is my question

#

I was thinking as soon as you call setAdmin a command might go out to the server that will inevitably make you admin

#

And if I immediately call a command requiring admin after that

#

Would server not be aware that I am admin in time?

bronze yoke
#

that's relying on them arriving in order which isn't guaranteed

thick karma
#

Fair

bronze yoke
#

and a command that can make you an admin might be an even bigger vulnerability

thick karma
#

Well I mean that already exists, I would just be calling it, to be clear.

bronze yoke
#

i'm unsure if there's actually any way to guaranteed unadmin them and have the command go through when doing this

#

since you can't really catch the command arriving to my knowledge, and lua will probably stop running once the command goes through

thick karma
#

Why would you need to unadmin them..?

#

That happens automatically when server closes?

#

People don't stay admin between sessions right?

bronze yoke
#

aren't admins saved to a database?

#

there's a field for it in the player database, i assume admining midgame will update that

thick karma
#

Not to my knowledge. When I admin mid-game and then quit and rejoin, I am no longer admin

#

In fact I am unaware of how exactly to make a normal player permanent admin

#

Only way I know of to be admin immediately at login is to login to server as admin

#

Afaik...

bronze yoke
#

hmm, well sounds like you have more experience with it than i do

thick karma
#

I'll test again now for giggles

#

Just made myself admin...

#

Closing, reopening...

#

Jeopardy noises...

#

No longer admin

#

Yeah Idk if this is just like clientside global mod data though

#

Works for you and not for me lol

#

But afaik this is how it's worked as long as I've played

#

And it's kind of been annoying in the past but could be convenient in theory here

bronze yoke
#

i actually don't see this permissions field anymore so i guess i misremembered it

#

is admining actually that annoying...? that seems like a massive pain for big dedis

thick karma
#

I think some probably have workarounds in place but yeah vanilla as far as I know this is it

#

Maybe some auto-admin mods or somethin that keep a database of their admins' names.

hollow lodge
#

For some reason my mod doesn't appear on the recent page in the workshop, like a shadowban. Which is pretty rare since I haven't heard of that on steam ever, I also checked the community guideline for the workshop.
The file is on public, it has the mod id and eveything uploaded correctly, any guess?
I also tried uploading it again

version=1
id=3296852138
title=More Jackets
description=Adds 6 new pieces of clothing and original icons, including:
description=-Canvas Jacket
description=-Denim Vest
description=-Punk Jacket
description=-Racer Jacket
description=-Tactical Jacket
description=-Pocket Hoodie
description=
description=Expect to find them in their contextful places, like bars, army bedrooms, gym lockers, wardrobes, and on full clothed zomboids! Enjoy.
description=
description=Credits to Spongie for the opened jackets models, and BongoRaccoon32 for teaching and helping me with the original models.
tags=Build 41;Clothing/Armor;Items;Realistic;Textures
visibility=public

topaz tangle
#

hey! does anyone know how to change a modded vehicles vehicle type?

analog breach
topaz tangle
#

it will be "franklin cabover"

analog breach
#

ight bet.

#

Is anyone on that could help me?

#

everything works with my mod, ii could even upload it to steam but just the mod doesnt show up in game

#

i messed it up while tinkering with it to be able to upload it to steam.

tacit carbon
#

hey does anyone know if there is a code in Lua for resetting progress of a perk? I dont see anything on the perks profile

#

also can perks go past level 10?

topaz tangle
#

What even is this dawg😭

#

another issue.....

#

still floating... and the big hole

topaz tangle
#

i should maybe take a break until tommorrow.....

analog breach
#

Hey guys just a general question, is learning lua for modding worth it?

analog breach
grizzled fulcrum
safe silo
#

Has anyone developed a sprinter zone mod? Or a mod where you can create zones and customize the zeds in there?

topaz tangle
analog breach
#

and where do i even start with learning lua?

#

Youtube?

frank remnant
#

Is it possible to get player information? Like for example:
player:getHealth() or
player:getStats():getHunger()
player:getStats():getThirst()

grizzled fulcrum
#

This is official manual for Lua. It is lots of words and not a lot of images, but it teaches you Lua pretty good. You can also use YouTube as well although I can't guarantee the quality of information as it depends on each video. You could probably use a combo of both to get the best amount of knowledge.

bronze yoke
#

a lot of people try to just learn from looking at other mods and that does help but if you don't read up on how the language works you'll miss a lot of basic understanding

grizzled fulcrum
#

oh wait yeah thats how I learned it

#

well I read both but I thought pil was the manual initially

mystic vessel
#

I made a update for the CRM mod, and added the rick grimes backpack from the series

worthy pawn
#

Hello!

I am the author of of Handlebar's Cured Meat. (my personal venture to learning coding through making simple, but vanilla friendly mods)
https://steamcommunity.com/sharedfiles/filedetails/?id=3266738501

I've recently had some help to add in additional conditions that maintain the diversity of fish filets via function.

Works perfect in Solo, however in a Multiplayer server food immediately vanishes once I place it in my inventory after being cured. It is not a mod conflict as I have run it as the only mod and it is reproduceable every time.

Any ideas or suggestions?

The function is located within lua\server.

bronze yoke
#

could you post the code?

worthy pawn
#

Yes. I'll post the function, the recipe and items are unremarkable

#

And a sample of items.txt

    item HNDLBR_PrepFish
        {
            DisplayName         = Prepped Fish,
            DisplayCategory  = Food,
            Type             = Food,
            Weight           = 0.35,
            Icon             = HNDLBRPrepFish,
            FoodType = Fish,
            IsCookable = TRUE,
            DangerousUncooked = TRUE,
            OnCooked = MamaCookbook_HNDLBR_CookMeat,
            MinutesToCook = 300,
            MinutesToBurn = 360,
            DaysFresh = 1,
            DaysTotallyRotten = 3,
            HungerChange = -15,
            ThirstChange = 5,
            Carbohydrates = 0,
            Proteins = 18,
            Lipids = 1,
            Calories = 205,
            WorldStaticModel = HNDLBRPrepFish_Ground,
            Tags = FishMeat,
        }
    
    item HNDLBR_CuredFish
        {
            DisplayName         = Cured Fish,
            DisplayCategory  = Food,
            Type             = Food,
            Weight           = 0.28,
            Icon             = HNDLBRCuredFish,
            FoodType = Fish,
            DaysFresh = 14,
            DaysTotallyRotten = 60,
            HungerChange = -15,
            ThirstChange = 5,
            Carbohydrates = 0,
            Proteins = 18,
            Lipids = 1,
            Calories = 180,
            WorldStaticModel = HNDLBRCuredFish_Ground,
            Tags = FishMeat,
            EvolvedRecipe = Pizza:20;Stew:20;Stir fry Griddle Pan:20;Stir fry:20;Sandwich:10;Sandwich Baguette:10;Salad:10;Roasted Vegetables:20;PastaPot:20;PastaPan:20;RicePot:20;RicePan:20;Taco:20;Burrito:20;Omelette:10;Soup:20,
        }```
#

and a recipe snippet

    {
        keep [Recipe.GetItemTypes.SharpKnife]/[Recipe.GetItemTypes.Saw]/Axe/HandAxe/AxeStone/WoodAxe/MeatCleaver,
        FishFillet,
        Salt/HNDLBR_ContainerSalt;2,
        Result                    :HNDLBR_PrepFish,
        OnCreate                :MamaCookbook_HNDLBR_CureMeat,
        Time                    :250,
        Category                :Cooking,
        OnGiveXP                :Recipe.OnGiveXP.Cooking3,
        AnimNode                :Craft,
    }```
#

I don't think items or recipe are it, as it worked fine before the function.

bronze yoke
#

is it after cooking that the issue occurs?

worthy pawn
#

So the process goes.

Prep food - ok
Place in Oven - ok
Meat is cooked and can sit in oven - ok (i can leave it indefinitely no issues.)
Move meat to inventory - it vanishes instantly or within .5 second.

bronze yoke
#

hmm, my concern is that OnCooked might get called on the client, which means the items it creates aren't 'real'

#

there's a function to work around that but if it's getting called on the client it might create an opposite issue where an item gets created by every client in range?

#

i'm loading into a debug server to check if that is actually the case

worthy pawn
#

Ok. I appreciate your help!

bronze yoke
#

yeah, it runs on the client...

#

you can do```lua
-- when adding the new
local container = theMeat:getContainer()
local cookedMeat = container:AddItem(cookedMeatType)
container:addItemOnServer(cookedMeat)

-- when removing the old
container:Remove(theMeat)
container:removeItemOnServer(theMeat)

#

if it runs on the client, then the function is probably going to run on each client in range, and you'll end up with that many copies of the item...

worthy pawn
#

Ok. Hmmm. Perhaps I'm going about it the wrong way using a function.

Do you know of another way ti preserve an items data(calories, weight, nutrition levels etc) other than using a function.

I'm not sure how the game currently handles making filets from different size fish, then maintaining that through the cooking process.

I suppose I need to dig some more.

bronze yoke
#

i think the fillets are made similarly to how you do it, but if i remember right i don't think cooked fillets are a different item, so they don't hit this pitfall

worthy pawn
#
    if instanceof(sourceItem, "Food") then
        return sourceItem:getActualWeight() > 1.0
    end
    return true
end

function Recipe.OnCreate.CutFillet(items, result, player)
    local fillet = nil
    for i=0,items:size() - 1 do
        if items:get(i):getType() == "FishFillet" then
            fillet = items:get(i)
            break
        end
    end
    if fillet then
        local hunger = math.max(fillet:getBaseHunger(), fillet:getHungChange())
        fillet:setBaseHunger(hunger * 0.5)
        fillet:setHungChange(fillet:getBaseHunger())
        fillet:setActualWeight(fillet:getActualWeight() * 0.5)

        result:setBaseHunger(fillet:getBaseHunger())
        result:setHungChange(fillet:getBaseHunger())
        result:setActualWeight(fillet:getActualWeight())
        result:setWeight(result:getActualWeight())
        result:setCustomWeight(true)
        result:setCarbohydrates(fillet:getCarbohydrates());
        result:setLipids(fillet:getLipids());
        result:setProteins(fillet:getProteins());
        result:setCalories(fillet:getCalories());
    end
end```
#

I found this.

outer crypt
#

is there a way to adjust the volume on a gridsquare playSound command? example: getSquare():playSound("LightSwitch") I would imagine this sound is added to the ambient sound?

topaz tangle
marble folio
#

Good night folks!
Has anyone found a way to modify the Intro Background?
I know you can change the text on it through the UI_EN, and you can change the image on the Main Menu, but I haven't been able to find a way to change the Intro Background itself, would really appreciate some help with that if someone knows.

abstract raptor
#

what's the best way to get the overall lighting color of the square the player is standing on?

woeful flint
#

Excuse me, I would like to develop a mod for a game that requires writing some Lua scripts. Where can I find the development documentation and APIs

#

thanks every one

limber urchin
limber urchin
# woeful flint Excuse me, I would like to develop a mod for a game that requires writing some L...

Also my general copy paste advice for Lua stuff that will save your brain:
Get Microsoft's Visual Studio Code which is an epic text editor for scripting languages like Lua: https://code.visualstudio.com/
In VSCode, get the extensions:
Lua LSP (https://marketplace.visualstudio.com/items?itemName=sumneko.lua)
Umbrella (read install guide here: https://github.com/asledgehammer/Umbrella?tab=readme-ov-file#addon-manager-vscode-only)
The rest of extensions are personal preferences like themes are.
Read pinned messages in ⁠mod_development
Have fun (boom)

Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.  Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows.

GitHub

A collection of LuaCAT typings for Project Zomboid's API - asledgehammer/Umbrella

woeful flint
#

thanks very much

grizzled fulcrum
#

I mean still read the manual but I'd only recommend reading it like well after you've understood Lua's concepts.

woeful flint
#

Thanks

grizzled fulcrum
#

I am curious if people in the modding space are even slightly open to the idea of multiple developers on projects. Considering most of the mod developers I have seen don't use github or any version management software, I assume it doesn't cross people's minds.

coarse sinew
grizzled fulcrum
#

I am actually already in it, I didn't know people posted stuff like asking for collaborators though

grizzled fulcrum
# bright fog Check the project channel

I see, so there are people that post this stuff. I was just curious and sadly don't have time to contribute to much of anything including my own mods which is a bit annoying honestly

bright fog
#

I myself don't have much time for group work

grizzled fulcrum
#

wat is TLOU

#

oh wait, The Last Of Us?

sour island
#

I've been trying to will the Community Projects idea off the ground, but I really should start putting in work lol.

sour island
#

The concept for this is to pool together small fixes/tweaks that don't really warrant their own mod. Also more drastic changes to the vanilla Lua in places where it's written poorly for mod compatibility.

#

That aside, the community projects has a Steam account associated with it to handle uploads - and with Steam's recent change to collaborators being able to upload - you can actually let the account handle uploads from github for a project you maybe don't have time for.

#

PZNS (Project Zomboid NPC Spawning Framework) did this

#

The main idea is ape together strong

#

As something like full fledge NPCs would take years of fulltime work lol

#

but also I see with every new wave of modders people reinvent the same utility functions and tricks

grizzled fulcrum
#

I was wondering how people go about that since you need the 2FA seed to use account and upload to workshop, but I guess you could have a separate account without 2FA as a contributor (I think that's only way considering you can't get 2FA seed from steam mobile authenticator anymore)

sour island
#

I have the account name and password hashed on github

#

2fa is a one time check

#

So I just turned it off/on 😅

#

Only issue was when the ToS got updated

#

To clarify you need 2fa to post new workshop items

#

You don't need it to update

#

But yeah, aside from the fact you can't share secrets on github - it's a pretty smooth process

#

could even be worked off a fork - as I'm sure people wouldn't routinely change ownership over

topaz tangle
#

ayeeeee

worthy pawn
#

Is it possible to change an items fresh time after it's cooked?

Like say a burger raw would be rotten in a day, but cooked burger would last 5 days? (Just a generic example)

bronze yoke
#

i do have a couple thoughts about that

#

a) if it's allowed, you could use an oncooked function to set the food's age to a negative number - if it's allowed because it might be that it'll refuse to save a negative number and reset or going negative might disable aging entirely
b) if not, make the food's fresh time the cooked one, set its age up when it spawns, and set it to zero when it's cooked

#

actually, don't jars need to be cooked to work? have you looked at how they do it?

#

oh, you can just set the maximum age directly apparently!

worthy pawn
#

I have not. Still trying to figure out the issue maintaining fish weight. So I'm going to use the same item, rather than creating a new one, but I want it's fresh time to increase once it is cooked

bronze yoke
#

use an OnCooked function that calls:

local age = food:getAge() / food:getOffAgeMax()
food:setOffAgeMax(newDaysToRot)
food:setOffAge(newDaysFresh)
food:setAge(newDaysToRot * age)
#

i didn't suggest that before because items don't usually save properties like that, but that's how the jars of vegetables do it

worthy pawn
#

Ah. So I can just add that. This may be the silver bullet I needed!

brave ruin
#

Hey.. How can I make a sound repetable?

lilac flower
#

I have a sandbox option which is a string

    page = DZ_Speech_Page1,
    type = string, default = The sun is up!,
    translation = DZ_Speech_Daylight_Interval0, valueTranslation = DZ_Speech_Daylight_Interval0,
}```

Is there a way for me to make the default string look at the language translation for its value instead? I have tried to prefix it with `Sandbox_` but that did not work
grizzled fulcrum
worthy pawn
# bronze yoke i didn't suggest that before because items don't usually save properties like th...

Any idea what I'm doing wrong, not seeming to be called when item is Cooked

Function

    local aged = curedMeat:getAge() / curedMeat:getOffAgeMax();
    curedMeat:setOffAgeMax(60);
    curedMeat:setOffAge(30);
    curedMeat:setAge(1);
end```

Item
```    item HNDLBR_PrepFish
    {
        DisplayName = Cureddd Fish,
        DisplayCategory = Food,
        Type = Food,
        Weight = 0.35,
        Icon = HNDLBRPrepFish,
        FoodType = Fish,
        IsCookable = TRUE,
        DangerousUncooked = TRUE,
        /*** ReplaceOnCooked = HNDLBR_CuredFish, ***/
        MinutesToCook = 300,
        MinutesToBurn = 360,
        OnCooked = Recipe.OnCooked.CuredMeat,
        DaysFresh = 1,
        DaysTotallyRotten = 3,
        HungerChange = -15,
        ThirstChange = 5,
        Carbohydrates = 0,
        Proteins = 18,
        Lipids = 1,
        Calories = 205, 
        WorldStaticModel = HNDLBRPrepFish_Ground,
        Tags = FishMeat,
    }
    ```
bronze yoke
#

OnCooked functions can't be in tables, it doesn't look for them properly

#

try something like Recipe_OnCooked_CuredMeat instead

worthy pawn
#

Sorry I had pasted wrong thing

#

Got ya.

outer crypt
#

is there a way to force the overlay to update on a container?

#

I tried this but it just errored out... updateOverlaySprite(IsoObject obj)

worthy pawn
brave ruin
grizzled fulcrum
topaz tangle
#

there are alot of unused textures

#

6 unused vehicle textures!

#

7 actually

#

8!!

#

9!!!!!!!!!!!

topaz tangle
#

current list of errors with my mod

inters and exits from the car via the framerails
weird red stuff
weird pink stuff
weird blue stuff

lighting is odd
headlight texture doesnt work
and the glass doesnt change

shadow willow
#

Does anyone know how i can i use ISInventoryTransferAction to transfert item from a cell's floor to the player inv ?

shadow willow
#

Where ?

dawn portal
#

I noticed a built-in lua script in "media\lua\shared\keyBinding.lua" that only has a table with keybinds names and values. is that where the game stores and keeps track of binds? modifying the keybinds in the pause menu then printing the object doesn't seem to change it, is this how we can access and modify keybinds at run-time?

this is the code I'm using to print the "Forward" bind:

local KEY_2 = 3
local function OnKeyPressed(key)
  if key == KEY_2 then
    for k,v in pairs(keyBinding) do
      if keyBinding[k].value == "Forward" then
        print("Forward Key: ", keyBinding[k].key)
      end
    end
  end
end
true plinth
#

Hello all,
after several months of mod development (public and private), I've come to wonder about creating a tooltip framework.

Too often I see an ISTooltip:render “hook”, which leads to hooks of hooks of hooks, and so on.
Whereas if render() were coded to support a “customTooltip” modData for each item, there'd be no need to hook this render function every time : everything would be done in an item's modData.

What do you think about that idea ?

fair frost
#

i got a question

#

if i make clothing piece

#

with multiple possible textures it can spawn with

#

and i select said clothing piece whilst creating a character for a new game

#

and while scrolling for the texture i want on it

#

is it possible to make so that each texture in the character creator will show up as the name i intended for it instead of just being type 1,2,3,4,5 etc etc

#

but instead for example: Private, PFC, Specialist, CPL, SGT, Staff SGT etc

silk hollow
#

Anyway, it's a good idea and I think it would be great to have a sort of "unofficial community patch" a la Skyrim has in which multiple people contribute to fix/improve things that are usually considered "essential mods"

#

However, I don't know how much it will clash with the classic "modders' ego". I for one would love if more people would contribute to my mod. The main reason I stopped working on it actively (beside waiting for b42) is because I just don't have proper knowledge of PZ apis and inner working as other modders have and don't have motivation to go indiana jhones and dig them out of discord seach or chase people around the discord

sour island
#

There's a few tools that open up the API somewhat

#

I haven't run into an ego issue yet, at least when it comes to the community repo, it's mostly people just not having the time/motivation to work on an ambiguous project of QoL fixes.

#

I've considered reaching out to consolidate / reimplements fixes around the workshop, but I'm kind of wary of that.

silk hollow
#

Oh yeah, I was talking more in the general sense. Modding is usually a passion project for people and with that comes a sense of belonging usually. It's not unheard that people who makes mod take... decisions based on ego rather than the good of the community using a mod. Until now I have not encountered ego-driven modders as well for PZ

grizzled fulcrum
# dawn portal I noticed a built-in lua script in "media\lua\shared\keyBinding.lua" that only h...

All this does is hardcode define some keybinds for quick testing in development of Lua scripts, this is not a substitute to access keybinds in the game. As you can see from the Lua below, it sets a static keycode for each bind, it does not get the binds from the game that the user has set.

bind = {};
bind.value = "Forward";
bind.key = 17;
table.insert(keyBinding, bind);
bind = {};
bind.value = "Backward";
bind.key = 31;
table.insert(keyBinding, bind);
#

You should be able to do this to get certain keybinds live in-game

local forward_bind = getCore():getKey("Forward") -- Gets 17 by default
local is_forward = isKeyDown(forward_bind) -- True on Key Down, False on Key Up
local foward_pressed = isKeyPressed(forward_bind) -- False on Key Down, True on Key Up (but only after Key Down)
lavish kayak
#

Hey all, I'm new to this server and new to modding. I'm hoping to get some help on beginner stuff. If I want to make a mod that will change what zeds do how would I go about doing that, with out changing the base zombies. In Java I believe that would be overloading.

silk hollow
lavish kayak
#

So I want to keep basic zombies the same, but I also want to add a mod that will allow some of them to behave differently, i.e. slow the player down when in a certain radius to that specific zombie.

dawn portal
lavish kayak
sour island
silk hollow
lavish kayak
lavish kayak
lean jay
#

Does anyone of a mod that degrades tools when being used as tools?
like scissors have a chance of losing durability when you rip leather or jeans?
or hammers when you build something
or saws when you saw logs
etc
Cause I feel after you find your 1st hammer, saw, screwdriver, scissor you don't need a 2nd one
Unless you use them for combat

fair jolt
#

hey is mod.info require="XXXX" patchable? example: i want to patch mod to remove library dependency

grizzled fulcrum
#

I'm sure you have a slight chance of doing it using some file trickery but honestly I don't think it's worth it considering the unexpected results that removing a dependency gives.

fair jolt
#

well, only way i come up with was to add empty mod with same mod id as that removed dependency. but its more like moving problem somewhere else rather than solution.

bright fog
#

Usually is never a good idea doing that

fair jolt
#

yea. so uploading modified version without dependency makes more sense than patch

dawn portal
#

can someone please fact check me on this, I'm still new to modding zomboid and this is what I concluded based on my research:

-IsoGridSquare represents one tile in the game
-IsoChunk represents a chunk which is 10x10 tiles (not often used as far as I can tell)
-IsoCell represents one big square of 300x300 tiles (30x30 chunks)

but then what about the player cell? the one in white when looking at the zombie population window which is about 2 thirds of the size of a cell and causes zombies outside to become simulated, what class is it and how can I access it (size, start/end position etc...)?

bright fog
#

the player is cell is just Cell

#

I believe

sour island
bright fog
#

player:getCell()

#

It's not the same than 300x300 IsoCell

dawn portal
bright fog
#

Hmm

#

Give me a sec

#

IsoCell is the player cell

#

Not sure if you can access the 300x300 cell

#

But I'm pretty sure they aren't IsoCell

#

(was the other way around)

dawn portal
#

hmm.. that's confusing. for example IsoGridSquare which represents one tile as far as I can tell has a function getCell() that returns a IsoCell object, is it different than the player?

bright fog
#

hmmmm

#

Good question

#

That's the same cell then I guess

dawn portal
#

I appreciate your help this is really confusing lol

bright fog
#

I didn't knew getCell was a thing for other stuff too

#

So I guess they are IsoCell either way

#

But IsoCell of player is centered on the player

#

So it's a mobile cell

#

@sour island is that right ?

dawn portal
#

yeah that's my theory so far but I have no way to confirm it on my own, I'm guessing IsoCell of the player is unique in that its size is different and it doesn't snap to the grid

bright fog
#

player IsoCell is player centered but tile cells are not tile centered ? Or are they tile centered too ?

bright fog
#

And see if it's the same

fair jolt
# sour island I assume this dependency is for some reason not needed(?)

im trying to split fancyhandwork from brutalhandwork, because fancy breaking animations and i still want offhand attack for only cure, only for situations when somebody without proestetic can attack, so i dont rly care for bad sync of that attack. but fancy conflicts with stuff like playing music from lifestyle

sour island
dawn portal
#

ooh that's a lead

bright fog
#

Or is the 300x300 cell not an IsoCell

sour island
#

IsoCell I think is the loaded one

bright fog
#

So tiles have IsoCells

sour island
#

er

bright fog
dawn portal
#

yeah it seems tiles and chunks both return an IsoCell object

bright fog
#

You can getCell on tiles

bright fog
sour island
#

getCell returns the cell you're currently in yes

#

but squares in that cell might not be loaded

bright fog
dawn portal
bright fog
sour island
#

Cell in this case is the x300 area - but it gets weird

#

I would honestly need to refresh my memory before giving advice

bright fog
#

So the 300x300 cells (tile:getCell()) and the player:getCell() are both IsoCell ?

sour island
#

cells afaik are always out of x300

#

but players can load upto 4 cells

bright fog
#

yea

sour island
#

but they always have a home cell

bright fog
#

In MP can be less

dawn portal
#

though the player cell is smaller, not sure how much but visually it appears about 2 thirds of a regular world cell

bright fog
#

Player IsoCell in MP is smaller

sour island
#

75x75 iirc

bright fog
#

50x50 in MP

#

I believe

sour island
#

it's probably 50x50 then

bright fog
#

In solo it's bigger

sour island
#

I remember doing tests with ehe and the maximum a square could be found was 75 tiles away

bright fog
#

Yea that's solo

#

Probably

dawn portal
#

the white rectangle is basically what I'm trying to access

#

I'll continue to throw things at the wall until I figure something out, if you guys have any ideas please let me know

bright fog
#

Around player ? Or the grid ?

dawn portal
#

the one around the player, the smaller one not the grid

bright fog
#

You do player:getCell() for that one

dawn portal
#

okay I'll try that

sour island
#

getCell returns the home cell iirc

bright fog
#

wdym the home cell ?

sour island
#

isoChunk is the radius around the player

bright fog
#

No

#

What ?

#

No

#

Definitely not

dawn portal
#

iso chunk is 10x10 in size, I tested that by printing its size in lua

bright fog
#

I use getCell to access zombie objects around a player

sour island
#

Yeah, wait your right

#

they use cell and another term for the loaded area

bright fog
#

Yeah it's stupid

fast galleon
bright fog
#

Same terms makes it confusing asf

#

It's also why it's confusing to have getCell() for tiles

sour island
#

well tiles are in a cell

bright fog
#

Yeah but it's not the same type of cell ?

dawn portal
sour island
#

the cell I'm talking about as home cell is the xyz cell

bright fog
#

Or is getCell() the cell around player

sour island
#

I'm reptty sure IsoCell isn't the loaded area

#

it's the cell of the map you're in

bright fog
#

player:getCell() outputs IsoCell

#

It's the loaded area of the player

#

And I can ASSURE you it's in fact the player loaded cell

#

That's where all the confusion comes from

sour island
#

I'll defer to you as I haven't messed with it in months

dawn portal
#

everytime I try to learn something new about zomboid modding I end up spending days researching and diving into rabbit holes XD I wish there were official documentations for everything

fast galleon
dawn portal
#

by printing the width and height of both the player cell player:getCell() and the cell returned by a tile IsoGridSquare:getCell() I seem to get the same results

print("Player cell (IsoCell):")
local player_cell = getPlayer():getCell() -- IsoCell
print("Width:" .. tostring(player_cell:getWidthInTiles()))
print("Height:" .. tostring(player_cell:getHeightInTiles()))

local square = getPlayer():getCurrentSquare() -- IsoGridSquare
print("Player tile cell (IsoCell):")
local tile_cell = square:getCell() -- IsoCell
print("Width:" .. tostring(tile_cell:getWidthInTiles()))
print("Height:" .. tostring(tile_cell:getHeightInTiles()))

result:

Player cell (IsoCell):
Width:170
Height:170

Player tile cell (IsoCell):
Width:170
Height:170

I didn't even know there is a cell with size 170x170 😵‍💫

topaz tangle
#

Does anyone know how to fix this issue?

fleet bridge
#

Lua only fetches what's visible to the player, which is dependent on their screen resolution iirc

dawn portal
#

okay so the exposed API doesn't allow access to the big 300x300 cells if I understand you?

fast galleon
#

@dawn portal
IsoChunkMap CalcChunkWidth, that calculates the area loaded for player afaik.

dawn portal
fleet bridge
dawn portal
#

yeah I'm saying do we not have access to those map cells? and instead IsoCell only represents the player area, because in that case I'm confused about how many classes including tiles have a getCell function

fast galleon
#

Map cells are mainly used when a new chunk is loaded for first time.

solar bramble
#

Ive got a good mod idea but i have no clue what im doing.

#

anybody wanna hear?

drifting ore
topaz tangle
livid badger
#

Could you please explain what the if isClient() then return end placeholder is used for in server files?

bronze yoke
#

it stops the file running on the client

#

misleadingly files in the server folder will run on the client

brisk remnant
bronze yoke
# dawn portal can someone please fact check me on this, I'm still new to modding zomboid and t...

IsoCell is a singleton, it contains the entire currently loaded area around the player (or up to four splitscreen players, or on the server it will contain the area around every single player), there is only ever one and all functions that return a cell return the same one - getCell() functions existing on different kinds of objects is just a legacy thing from when there actually was more than one cell and objects belonged to different ones, now they all do exactly the same thing

IsoChunks are 10x10 square areas, the game saves and loads in chunks so a chunk will never be half loaded

IsoGridSquares are single tile areas (though they can and almost always do contain multiple tile objects so it's not exactly accurate to call them tiles)

the 300x300 'map cells' don't really exist in any major way at runtime, they're used for some meta simulation stuff (e.g. zombies migrating in unloaded areas) but you can't really get at them with lua and you wouldn't really be able to do much interesting with them anyway

sorry to dump paragraphs on you but i see persistent misinformation about these 😓

topaz tangle
#

Ooooo you could be right I didn’t think of that

#

I haven’t don’t the damage overlays yet…

brisk remnant
#

Yeh seems to be pulling a default texture from one of those it looks like

topaz tangle
#

Gonna test that now…

#

yup, rust and damage textures missing causes it

#

thanks so many!!!!!!

unreal pewter
#

how do i make a recipe give skill xp, and how do i lock a recipe behind a skill level?

fast galleon
#

OnGiveXP needs a function name that gives the xp to player, you can use an existing one or create a custom one.

dawn portal
livid badger
#

Is it possible that the command square:AddTileObject(tree) creates a tree in single-player mode but stops working on the server? However, the attempt to remove objects with square:removeAllButFloor(square) works on both the client and server sides.

server/Farming

local square = self:getSquare()
if IsoTree and IsoTree.new then
    removeAllButFloor(square)
    -- FIXME: by default "e_americanholly_1_3" get current tree sprite getSprite(sprite)
    local tree = IsoTree.new(square, "e_americanholly_1_3")
    square:AddTileObject(tree)
end
livid badger
#

I just double-checked, and it turns out the tree only appears after restarting the server. That is, the LuaObject removal and square clearing happen immediately, but the tree is added only after a server restart. Does anyone know if there's a way to trigger the IsoTree object recalculation method without negatively impacting performance

bronze yoke
livid badger
bronze yoke
#

no, you can't write to fields (and reading from them is pretty complicated), i'm not sure there's any way to change that value

grizzled fulcrum
#

I wonder why there's no getters and setters for stuff like that

livid badger
#

by the way, maybe :transmitCompleteItemToClients() would work here?? I'll give it a try, and if it works, I'll let you know.

drifting ore
#

furry zombie config tool is coming along nicely

#

frickin sparkledogs, man

#

picked a random eyewatering color for the meme - 10 minutes later, lo and behold

livid badger
#

XD))

livid badger
unreal pewter
#

so, question
if i have a large standalone map, is it possible to make multiple lootable maps that uncover different parts of the map?

#

i dont think you can do that because the lootable map just references the worldmap.xml

drifting ore
#

it should be. It's how it's done in vanilla.

unreal pewter
#

oh shit youre right im dumb

#

ill just look at how vanilla does it

livid badger
#

The most ingenious solution is the simplest solution

unreal pewter
#

also speaking of scrolling through game files

#

i scrubbed through Distributions.lua, and i cant manage to find the name of the loot pool for bags, like satchels and backpacks and such. does anyone know what theyre called?

bronze yoke
#

it should just be the bag's type

unreal pewter
#

type?

#

like if im trying to add loot to satchels for example, what do you mean?

grizzled fulcrum
#

I assume the type is like Base.Bag_Satchel or something

#

or Base.Satchel

unreal pewter
#

???

#

why could i not find this

livid badger
#

I made a mod about zombie loot and there are all the backpacks there, zombies already in the form of a finished object if necessary

unreal pewter
bold lynx
#

Can anyone explain how to make a lua script make the player character play an existing animation? Can't find it by googling around.

livid badger
#

look for a zombiid dance mod))

thick karma
#

What kind of animation?

bright fog
bold lynx
#

I'm not sure yet which default one will fit, gonna have to look around. But a short uninteruptable one-time animation.

#

Any easy way to trigger an animation like that for testing?

livid badger
#

there is a command that launches the selected animation on the selected character, look at the dance mod, if I remember correctly, there is also such an approach through the radial menu, also look at the meditation mod, the same logic is there.

#

u can check Fitness & Workout Overhaul too and more more other mods with chr animation))))

bold lynx
#

I'll go digging then, thanks for the tip!

livid badger
#

good luck

bright fog
#

Tell us wtf your animation is

#

And in which conditions it triggers

#

It doesn't trigger the same based on what and when you want it to trigger

#

Either crafting, emote, attacking etc

#

Everything is different

grizzled fulcrum
unreal pewter
#

i just cant find it there, unless control F is broken

grizzled fulcrum
#

if you have it set to match the specific word, it wont show because it isn't just the word "Satchel"

bold lynx
#

It starts raining, the player character stand still and gets visibly irritated. the way a sim would

grizzled fulcrum
#

aA is the match case, the [_] is the match word

bright fog
# bold lynx It starts raining, the player character stand still and gets visibly irritated. ...

Alright so what you need to do is:

  • Check AnimSets, it controls the speed of your animation and triggers the animation based on conditions. Such a condition to trigger animations is usually variables
  • the variable that defines your animation can be given to the player at any time with a simple command player:setVariable("yourVariable",true) which activates your animation (if other conditions if any are respected) and disabled with player:setVariable("yourVariable",false)

So what you want to do is:

  • give this variable to the player when he's under the rain
  • remove it when he's not
bronze yoke
#

a simpler way to just play an animation can be to put them into a timed action (like eating, crafting, etc)

#

but that will interrupt things like combat and other timed actions

bold lynx
#

Ah, animations aren't triggered manually, but automatically by something outside of your own script. Do I understand correctly?

#

Unless you create a timed action for them?

bright fog
#

No ?

#

I'm not familiar with how timed actions trigger animations ngl

bright fog
#

You can trigger animations by setting a variable in your AnimSets to true

bold lynx
#

I understand now, thanks!

bronze yoke
bright fog
#

let me check an example

#

setActionAnim

#
    public void setActionAnim(String string) {
        this.setAnimVariable("PerformingAction", string);
        this.chr.setVariable("IsPerformingAnAction", true);
        if (Core.bDebug) {
            this.chr.advancedAnimator.printDebugCharacterActions(string);
        }
    }
#

Yeah so that's setVariable

#

Basically

bronze yoke
#

i'd expect everything to be setvariable, that's how the animation system works

grizzled fulcrum
#

Hey, this is kinda unrelated to the whole animation debacle that is happening above but if there is anyone who prefers IDEA over say VSCode for Lua mods, is there a main reason apart from personal preference? I'd assume maybe it is more 'powerful' than vscode because it's an IDE and not just a text editor, but I am unsure where the pros and cons lie as I do not use it myself. I am thinking about giving it a whirl but the only downside that I dislike is IntelliJ's font renderer breaks a lot of fonts 😦

bronze yoke
#

so intellij was a completely ridiculous choice for a pretty long time considering it hasn't supported lua for about two years

grizzled fulcrum
#

* I do not use it for Lua I mean

bronze yoke
#

but as of last month it does support lua again, and while it's a liiittle worse than vscode's, it's fine

#

i personally like jetbrains ides a lot, i think that's a big part of what brings a lot of people to it

grizzled fulcrum
#

I do prefer them too, especially like for C++ like I mean sure VS has gotten a lot better but it's still slow as bricks and not cross platform

bronze yoke
#

i'm personally a little split on whether to switch over to idea myself now, i used it way back when it did sort of support lua (much worse than what we have now though) and while the new lua plugin is a bit rough to use (no in-ide configuration is the most obvious complaint from me) it is fully featured

#

i think being able to look at the java in a java-specific ide is a noteworthy benefit

#

in general i find its code searching functions faster/more reliable than vscode's

grizzled fulcrum
#

my vscode workspace can take up to 30 seconds for searches

#

to be fair all my mods are in the workspace including the vanilla game luas but stiill

grizzled fulcrum
#

rip idk how its not finding it

bronze yoke
#

i think the big downside here is that you'll be using a less popular option that will be less supported by the community, but if you find it more comfortable i think it's a pretty valid option these days

#

(and there's a bunch of older modders who still use it because they haven't updated it in over two years when it still worked for lua so you won't be totally alone)

grizzled fulcrum
#

ill give it a test drive for a couple days of modding time and see if I can find any benefits

#

Although one thing I will say I noticed from just opening my mods workspace is it analysed it way quicker and the intellisense feels immediate

#

not sure if thats placebo or just the higher amount of resources IDEA uses that vscode does not

bronze yoke
#

oh yes definitely!! i don't have all my mods in one workspace like you do and even then vscode can take quite a bit just to process umbrella, idea feels snappier with that

#

let me know how you find it, i'm using jetbrains for literally everything else i work on so i'm sort of itching for an excuse to switch back

grizzled fulcrum
#

ok 🐙

tawdry solar
#

its been a while since i made mods i totally forgot how to make models samller in the code i need help lol 😭

grizzled fulcrum
#

I think you can change model scale in it's model script definition, but it is set once

tawdry solar
#

i figured it out, i had to mess with export settings in which is weird as i never had to do that before

bronze yoke
#

you can set scale in the model script

#

you can do it in your modelling software too though

grizzled fulcrum
#

I think intellij is just not the one for lua LOL

#

god I hate discord's image collage stuff its so ugly

#

The suggestions thing is so bad, I am unsure if it's linked with the language server or if it's IDEA itself but holy problems. No suggestions, duplicate suggestions, and even completely wrong suggestions lol

#

But on Java, I've never ever had this issue so I will assume it's the lsp

#

On top of this, it flags random variables as null (lua doesn't even have null), says some variables are unused while using it literally the next line, highlighting sometimes not working but definitely never works in autocomplete/hover.

#

As much as I like it's robustness, it just can't perform well enough to be close to good even on smaller projects. But, this becomes worse the more projects you have and the more libraries/dependencies you include as then it really has no idea.

#

vscode does it really well despite being "only a text editor" as some other people like to criticise it for.

bronze yoke
#

eugh, what a shame

grizzled fulcrum
#

I think it's partly the extension being buggy and partly the fact that the ide didn't have the design of lua in mind at all when developing

bronze yoke
#

the lua addon is built for a generic language server api that jetbrains don't support, so the intellij version goes through some kind of emulator instead, i imagine a lot of these issues are coming up from that

#

the glimmer of hope here is that jetbrains are actually developing an ide that natively supports that api

#

but i suppose it'll be another while 😔

grizzled fulcrum
#

Ya

safe silo
#

Trying to remove all shotguns/handguns etc. from spawning on zeds on their backs or in the holster:

    -- Weapon(s) Attached to Zeds
    AttachedWeaponDefinitions.handgunHolster.chance = 0
    AttachedWeaponDefinitions.shotgunPolice.chance = 0
    AttachedWeaponDefinitions.assaultRifleOnBack.chance = 0
    AttachedWeaponDefinitions.huntingRifleOnBack.chance = 0
    AttachedWeaponDefinitions.attachedWeaponCustomOutfit.PrivateMilitia.chance = 0
    AttachedWeaponDefinitions.attachedWeaponCustomOutfit.Police.chance = 0
    AttachedWeaponDefinitions.attachedWeaponCustomOutfit.PoliceState.chance = 0
    AttachedWeaponDefinitions.attachedWeaponCustomOutfit.PoliceRiot.chance = 0

Called on Events.OnPostDistributionMerge, but it's not working. Any ideas?

empty flame
#

You think its possibile to code a anticlear-lag for safehouse zones?

drifting ore
#

if you're concerned about lag spikes when a lot of stuff is happening on the same frame simply because there were a lot of stuff, you can code a routine that feeds in stuff one item per frame. The normal code consumes all items in a loop, and it takes as long as it takes. You just add a break statement at the end of the loop body, so each frame it processes one item at a time, which is a pretty light load. But it takes a few seconds to complete, as opposed to completing instantly (in game time).

empty flame
empty flame
#

So
Clear a zone
Doesnt clear the same zone if there is a safehouse

hollow forge
#

I created a clothing mod for my server but when users are patching holes in the clothes they disappear, how can i fix this?

red tiger
#

I really hope that TIS chooses to distance themselves from Kahlua2 over time. If they could get their serialization data code out of Kahlua2 and abstract it into a utility or library and interface the rest of the calls to the Events manager for Lua they could eventually go with something like LuaJ which would greatly help with performance slowdown with interops.

#

It would have to be a multi-staged process. I'm not sure this would be an item of interest / opportunity this late in development though. =/

#

You'd need to write an abstraction between Kahlua and code execution and then swap out Kahlua when that time comes.

#

KahluaTable is really most of the library's integration into the codebase. It'd be cool to see what would be done though if this were ever considered by the dev team.

#

Kahlua is ultimately the strongest option for both familiarity and security as the sandbox is very strong to keep Lua modders out of trouble. LuaJ or other options would need to also have that option or the ability to apply itself through little work to be a possible solution. This is just conjecture / thoughts I thought I'd throw here after a few hundred hours working in the Java bytecode for the past couple months.

#

Besides Map-related solutions, Kahlua is IMO one of the top 3 main factors behind UPS limits and slowdowns in the game.

drifting ore
# red tiger Kahlua is ultimately the strongest option for both familiarity and security as t...

kahlua is just a bad implementation of Lua, it works the same as regular lua, but some of its functionality is buggy and/or slow so you avoid it. So "familiarity" is not an argument in its favor in context of modders. Lua itself allows you to simply set relevant system functions to nil and they will not be accessible from scripts, for the means of providing sandboxing, so that's not an argument in its favor either.

#

the one and only reason to use kahlua is because they chose it to begin with, and the code already exists. For any other implementation of Lua, they'd need to rewrite the entire interfacing code.

#

or write a 1:1 interfacing library, which is probably even more work due to debugging load

#

from managerial sandpoint this issue is very low priority. Occasional lag spikes in heavily modded with low quality code games does not detract from their sales.

#

the strongest argument against "wasting time" replacing kahlua with any other implementation which will by default be a huge upgrade, is that a small handful of players and a couple thousand zombies at a time is not the amount of CPU processing that causes performance issues unless you write exceptionally inefficient code, and at that point having that same code run 5x faster will hardly help - simply installing another mod like that will undo all gains. The core issue there is that the particular modder(s) didn't care or knew how to optimize anything, which is why a trivial task of updating a few hundred entities per frame can even cause frame drops at all. Which is to say, it's nothing to do with kahlua being slow. Complaining about it would be like complaining that chopping trees is too hard and it would be way easier if you had a chainsaw, when you're using the flat side of the axe to hit the trees and you intend to use the flat side of the chainsaw to do it too. It's the gamedev version of buying a more powerful PC to solve performance issues of poorly written code.

#

or at least that's my perspective on the matter as someone who's been making their own games as a hobby since 2005, and at one point have been doing it professionally

drifting ore
#

More specifically. Kahlua is about 10x slower than C Lua, and 100x slower than LuaJIT, which runs at speeds close to C++. I figure LuaJ splits the difference. If you use kahlua, it's more or less equivalent of using C but on a 40 MHz CPU. That's more or less 5 millions lines of code per second. If you run into performance issues, it's because you execute more than half a million operations per frame. Clearly the source of the problem is not that it takes too long to execute each individual instruction.

grizzled fulcrum
red tiger
grizzled fulcrum
red tiger
#

Its not the modders' fault.

red tiger
#

Going between Java and JNI is also time taken.

drifting ore
# red tiger Its not the modders' fault.

kahlua is slow, that is a fact. LuaJ would've been leaps and bounds better, that is also a fact.

This is not the kind of game that requires such massive amounts of computation that this becomes an issue. It becomes an issue when someone loads the game with massive amounts of computation, which didn't actually need to run. Making the entire thing run faster does not remedy the problem (running code that doesn't needs to run), it just masks it for a bit longer.

grizzled fulcrum
#

Java modding would slightly potentially fix these issues, so long as it is supported by steam workshop

#

Like I am not sure how you would implement that, but how difficult would it be to load a .java file into your game externally?

#

Surely it'd be similar to loading your own game's java files

hollow forge
#

Boidin in style

drifting ore
#

If you squint hard enough, executing .jar files is like executing .lua files.

grizzled fulcrum
#

But it's possible, im just not sure as to how much work it would be that's why I'm not definitive on it

drifting ore
#

well the python thing already exists and it's basically an alt version of java modding system

#

i think someone said there were java modloaders for pz too

#

if all else fails you can just build against the original jars and use mixins to hook into original code, but that approach has all sorts of issues. I'm not an expert but I'm pretty sure 99% of labor in supporting modloader is rewriting mixin definitions each time a new build is released.

#

so it's kind of a chiken and egg problem. In order for modloaders to exist, there needs to be demand for modloaders. And there's no demand for modloaders which don't exist.

#

PZ devs might have poisoned the well by opting for Lua modding instead of Java modding

#

this is no minecraft but there's still hundreds of thoudsands of players

grizzled fulcrum
#

Yes, especially now when if they were to adopt java modding over Lua, all the mods would stop working which would make heavily modded servers out of action for a long while.

#

I guess you could use both but at that point it's too complex, even more so than just using one or other

thick karma
drifting ore
#

actually curious. Last I remember Unity was spearheading development of one by making their own weird version which you had to jump through hoops to even use, but that was a good while ago.

#

well nevermind apparently that guy's blocked me. Somehow I can still reply to his posts.

topaz tangle
#

Hey I’m wondering if anyone is able to help me figure out why the damage texture doesn’t work on my vehicle mod? I’m just a bit confused

red tiger
#

So I'm the sole Java Modder who has spent the last decade modding PZ to improve the moddability of PZ

#

I'm giving my thoughts on the subject after spending a few thousand hours in the codebase over that time.

#

Java modding optimizations is honestly worth it IMO. Adding tools as well.

#

The python support is something I plan to release in BETA tomorrow.

#

The project is called Pythoid.

grizzled fulcrum
#

is Pythoid going to be the same as Pipewrench or is it an interface for Java modding via Python?

#

I doubt it'd be the latter since I don't even think that's possible but I'd ask anyway

bronze yoke
#

it's java modding via python

grizzled fulcrum
#

dam hoow

#

I think I am crazy that I'd prefer java

bronze yoke
#

jython basically compiles python to the jvm

agile vigil
#

Is there a server for finding artists to commission for Zomboid art?

agile vigil
dawn portal
#

does anyone know what does instantiate() do in UI elements? it seems common to see something like

element:initialise()
element:instantiate()
...

are both of them needed? some mods only use initialise while other use both, is instantiate a legacy thing? or is it only used with some elements like buttons?

#

I tried making ui elements both with and without instantiate() and they work in both cases, is it safe to just not use instantiate ever?

fast galleon
dawn portal
#

I see.. looking in the lia files it seems many function including addToUIManager and addChild call instantiate anyway so I guess I don't really have to call it myself...

drifting ore
#

instantiate hooks up the java object

dawn portal
#

It's weird that we have 2 functions for initialization though

drifting ore
#

initialize i think calls createchildren and that kind of stuff

dawn portal
#

Thanks for the clarification

drifting ore
#

in general don't worry about it. You need to call initialize when you're creating loose GUI objects but if you add them as children then that's not needed

dawn portal
#

Yeah i was confused by how some modsonly call one function while otherscall both

stray summit
#

I’m looking to hire mod developers. Must speak English, have a portfolio, and be dedicated.

Dm me please!

bronze yoke
#

they exploded violently a long time ago

hollow lodge
#

no way.

#

they made really cool mods

grizzled fulcrum
#

Exploded?!?

bright fog
#

Basically

sour island
grizzled fulcrum
#

o

tacit carbon
#

Can anyone explain to me how modData works and how I can save variable's values even after opening and closing the game? Make the variables persistent over login in and out

drifting ore
#

not sure about saving but generally speaking ModData is just a lua table. You can put whatever you want in it. Internally it's a kahlua table class instance so there's no penalty for using it, it's exactly just a regular lua table

#

i think i recall from source code that it saves automatically

tacit carbon
drifting ore
#

i've never used it but you should be able to simply treat it like persistent Lua table. Unless you use it on zombies, in which case it should be actively avoided since zombie instances reuse it without resetting and it's never saved or loaded.

bronze yoke
#

it's just a table that saves

#

what are you trying to do?

tacit carbon
#

what I want to do is sorta of a each player has a "favorite weapon", so I need every player to have one specific weapon to their name, which I need to always be saved up, so even if I log out and log in, I should know which weapon that player has favorited

#

kinda of

drifting ore
#

player:getModData().myMod_favoriteWeapon = thegun

tacit carbon
drifting ore
#

also does PZ prevents mod ID collisions?

bronze yoke
#

no

drifting ore
#

well then prefixing your variables with mod ID is not a sure way to avoid data collisions either

bronze yoke
#

well it is because everything explodes if you have the same modid anyway

#

because it selects which mods to load by their ids, it's a problem if two mods have the same id

drifting ore
#

huh i suppose, i do rememer having severe issues if i simultaneously had a local mod and a workshop mod

bronze yoke
#

it will mostly only load one specific folder's mod but it's not 100% accurate with it

drifting ore
#

(pz didn't show that i had a local install so that was a dog and a half to figure out)

bronze yoke
#

and it's a problem when the server says 'load mod ModId' and you have two and it decides to pick the other one

#

that's why everyone gets so mad about modpacks, it completely fucks over the users as soon as they get out of date

drifting ore
#

wdym

bronze yoke
#

modpacks pack a bunch of mods into one workshop item, players subscribe to the modpack, original mod gets updated, modpack doesn't, players try to join a server using the original mod, checksum fails because it loads the modpack version

drifting ore
#

oh i see. It didn't occur to me think people were doing it this way.

#

i mean besides the implications of uploading someone else's mods on the same platform, it also seems backwards since collections exist

bronze yoke
#

the main reason is public servers like doing it so they don't have to restart when mods update to let people join

drifting ore
#

riiight. Steam's idea of version control is to not have one.

bronze yoke
#

but a lot of modpacks are made by Some Guy for their listen server with 3 friends and that i can't really decipher

oak cipher
#

any modders / mappers open for commission? 🙂

I'm the one who commissioned and funded

  • True Actions Act 1 and 2
  • Zuper Karts
  • Autotsar Tuning Atelier Bus
  • Autotsar Tuning Atelier Jaap Wrungel

If you are please DM me

topaz tangle
#

If anyone could help me fix the last few issues with my mod it would be greatly appreciated!!!!!!!!

inters and exits from the car via the frame rails,

headlight texture doesnt work,
the glass doesnt change,
Damage texture doesn’t work

grizzled fulcrum
#

o wait ur talking about mods having same mod id nvm

slow flax
#

Hello
I wanna make a mod that changes the level up sound to the mission complete sound from Far Cry 5

But I have no clue how to make mods

drifting ore
#

you can modify the mod that changes level up sound to Respect+ from GTA SA

slow flax
#

Ok,but uh...
How do I do that?

I never modded a game before

I do have some small coding knowlage from a little game I am making in gamemaker,but no clue when it comes to modding

bright fog
#

You'll realize it's very easy to do

slow flax
#

Ok but uh...
How do I check said files?

#

-# sorry for asking a lot of questions, I just dont know what I am doin stressed

grizzled fulcrum
slow flax
topaz tangle
grizzled fulcrum
#

Asking questions is how you get answers!

mystic vessel
#

Good evening, I have a question and I haven't been able to find the answer until now.

How do I do this function in lua, or what line of code do I put so that when the player performs crafting, he receives a little fatigue.
so that if he does it several times he gets tired?

#

Currently this function means that crafting gives XP to the player, but I also wanted this fatigue to come along with the XP. How do I do this?

tacit carbon
#

When im using context:addOption() my action is being applied to when I right click an item instead of when I left click the option I made, how do I fix this?

topaz tangle
tacit carbon
#

atm im using it like this:
context:addOption(getText("UI_translate"), playerObj , actionFunction(), item)
with Events.OnFillInventoryObjectContextMenu.Add()

bronze yoke
#

when you write actionFunction() that calls the function and passes the return value (probably nil), you want to pass the function itself

tacit carbon
thick karma
#

functionName is a reference to the function itself.

#

You need to pass functionName

tacit carbon
#

so I have to take the parentheses off to not make it the return value of the function

#

thanks

thick karma
#

Correct

grizzled fulcrum
mystic vessel
grizzled fulcrum
#

nice

torn steeple
#

I'm not a modder, but I need help modifying an NPC mod.
I want to modify the walktype of a Bandit NPC that I add in a mod called 'Bandits', and the mod's lua file that I can find has modifiers for the local walkType = "".
I've noticed that there are modifiers like “Run” “Walk” “SneakWalk” “Limp” and so on, and the NPCs that are set to “Run” are sprinting instead of running, so I want to reset their speed to something reasonable, and I'd like to know all the modifiers for these walktypes, is there a Doc for this?

torn steeple
#

I double-checked and the “Run” modifier seems to be working fine, but if you have a modifier wiki, please point me to it.

prisma harbor
#

Is there a mod that prohibits attaching the machete to the spear so that players stop exploiting the infinite machete bug?

drifting ore
#

wrong channel; the correct solution is to fix the recipe such that it doesn't duplicates machetes, not ban it

#

or do you mean infinite durability?

echo lark
#

If i assign moddata to a world object like a gnome does that need to me transmitted after? i assign the moddata just fine but if i leave the area and come back it no longer has the moddata.

#

so im assuming i need to transmit that or do it server side?

drifting ore
#

i think for online mode you need to do transmit data either way since (i think) it only transmits the whole object automatically when it enters the client cell

#

e.g. i've had issues with turning corpses to skeletons being registered as skeletons on the server, but the client would only see the change if the chunk was unloaded and reloaded

echo lark
drifting ore
#

i wouldn't know, i've never used moddata

echo lark
#

ah kk. ive used a bit of global moddata but never used moddata by assigning it to a world object

#

i just honsetly need to figure out how the hell to make tiles XD. making a teleport mod and everythings done except for i have no method to only show the teleporter to the player when they are in the right zone. so was gonna apply moddata to a gnome and use that as a teleporter XD. but the simpler way would be to make my own tile object that players cant get ahold of

drifting ore
#

you could simply run that code on the client, it will only be visible to that client

echo lark
drifting ore
prisma harbor
drifting ore
prisma harbor
#

(sorry, google translate)

drifting ore
#

original game only resets repair counter, durability is not reset

#

so i don't understand what do you mean by "infinite durability"

#

if you mean that you can attach 10x repaired machete to a spear and then reclaim it with "never repaired" then I made a mod that fixes it

prisma harbor
drifting ore
#

I see. Not sure how that would be fixed.

prisma harbor
drifting ore
#

Well this new mod will fix this issue, since it will remember each time you repaired it. So this specific exploit will not exist.

#

There is a concession though that reclaimed spear shaft itself will be reset to "never repaired".

prisma harbor
#

Thanks! Will you share this mod with the public?

drifting ore
#

Yes. Give me a few minutes. Throwing together the code was trivial but I need to make images and description and everything.

drifting ore
#

Hang on a sec. There's a bit of a bug.

prisma harbor
drifting ore
#

Nevermind, there is no bug. It was just the game effects kicking in after repairing a machete 20 times

red tiger
#

I think that my Python mapping of PZ's API is about good enough to release as a BETA today.

#

Here's all the classes mapped in zombie.characters package (Not sub-packages):

prisma harbor
drifting ore
#

it's "open beta" for now. It's public but unlisted so you need a link to install it. Report back if it works properly or has issues. If all goes well I'll set it to public.

dull moss
#

whats the folder name for german translation files

#

DE or GER

drifting ore
#

DE

#

see Steam\steamapps\common\ProjectZomboid\media\lua\shared\Translate

sour island