#mod_development

1 messages · Page 536 of 1

willow estuary
#

I have a money mod on the workshop that adds US currency, as well as stacks and rolls of bills. Might be suitable for the cash side of things for you.

shadow bough
#

I think I found it. Browser8 on Steam, made Tape Recorder, Unbreakable Windows and more?

shadow bough
willow estuary
#

Thanks! , Ive been meaning to add some more functionality to it with calculating cash on hand and such.

shadow bough
willow estuary
#

Nah, I think it works out to 100 bills = 1 weight unit loose or in stacks/rolls or in an envelope?

#

You can stuff 100 bills in a sealed envelope and write on it though.

drifting stump
#

what im working on is a bit different

#

price editing interface

#

as for currency will be a sandbox option where you pick which item is considered the currency

gaunt belfry
#

Anybody familiar with this? I searched and have seen other run into it but don't see a resolution anywhere

#

It says "There are unrecognized files in your Contents/folder. Only folders are allowed in Contents/." but based on what I see above that folder is empty

willow estuary
#

You got a disallowed file type somewhere in your directory structure is all.

#

Probably in a subdirectory then, it's not very specific with that message unfortunately.

gaunt belfry
#

It helps to know that I can consider the subfolders as well as the Contents folder! Thanks!

willow estuary
#

👍

gaunt belfry
#

I just figured it out... its the .DS_Store hidden files

#

they keep auto regenerating, but if I delete them in Contents and Contents/Mods it fixes it. Must be a mac thing

willow estuary
#

Well, that's a new one for me, but every day can be a magical adventure alright 😄

quasi geode
#

its a mac thing

#

stores folder viewing information if i remember right

willow estuary
#

One more corner case issue for the corner case bucket!

icy swallow
#

idk where to post it since this is not even a mod but anyways, i made the "Dizzy" Moodle! what you all think?

sweet knot
#

quick mod idea

#

throw bags or gas cans over tall fences

#

i imagine it would make some noise, and the gas could spill a bit losing some

zenith smelt
#

I meant locality as in the player client that owns the zombie and where the zombie code runs in.

chilly beacon
#

I made a clothing mod that just adds a few branded tshirts and hoodies. i cn confirm it works in single player (it spawns in clothing shops fine). but when i add the mod to multiplayer it doesnt seem to be loaded at all, and cant even spawn it with /additem. do i have to do something else to make it work in MP?

drifting ore
#

Hey everybody, I have learnt some Lua and now I want to learn about the zomboid modding API, where should I learn the API from?

#

I tried making a mod, but found it hard to make as I was relying on Lua events but the events I needed were obsolete or didn't exist.

fast galleon
#

Most zombies look cleaner than my character, if I could I would add random stuff from surroundings like branches or cushions from couch to the zombies. Maybe even give them buff to not get detected by player.

Imagine seeing bookshelf with hands and head chasing you, something in that sort.

drifting ore
#

Could somebody please point me in the right direction on making vehicle and clothing mods? I have some ideas based around WW2 RP stuff to do with my friends but seem to come up empty handed when looking for tutorials.

winter bolt
# drifting ore Could somebody please point me in the right direction on making vehicle and clot...

This guide will provide all necessary to create a clothing mod for Project Zomboid.
Get now all clothing models in Clothing Assets !...

winter bolt
vernal island
#

Is there a better built-in way of logging rather than just print function?

gaunt belfry
#

I'm having a weird situation where I packaged my first mod and uploaded it to Steam, but now I cant run it locally? The mod is showing up and the lua is getting loaded but its not working and its not showing up in the debug menu

Anybody have any ideas where I can debug?

The screenshots below show

  1. It seems to be loading successfully according to the logs
  2. Its not available at actual game time and not showing up in the debug menu when i search for it
chrome egret
#

@gaunt belfry as soon as you add your mod to the Workshop dir, it'll be preferred from that location over anything you put in the mods dir

chrome egret
gaunt belfry
#

I was hoping to find an error since the .lua doesn't seem to be loading anymore and I'm not sure what I inadvertently changed

fickle relic
#

Anyone here running TED Beer's Skin Retexture for 41.68 MP?

fickle relic
vernal island
chrome egret
#

None that I know of, but I haven't been modding PZ very long

chrome egret
gaunt belfry
#
➜  logs```
#
[19-04-22 10:49:12.554] LOG  : General     , 1650383352553> I am testing a print at game boot.```
#

Well now its loading since I truncated it and just added debug code

#

So it must have been silently failing trying to parse it

chrome egret
#

that might not be the exact right exception name

#

Don't have a current one without breaking my code right now

chilly beacon
quasi geode
#

not exactly a builtin logger, but its pretty versatile and handles different levels

#
local Logger = require('Zmu/Logger')

-- create a ZLogger instance to log to a shared log file.
-- This can be created automaically if desired
local zlogger = ZLogger.new("MyLog", false)

-- now create 3 different Logger instances with different output levels and link
-- them all to the same log file. Normally these Logger instance would be in
-- different mods instead of one place.
local log1 = Logger:new("Mod1", Logger.INFO, zlogger)
local log2 = Logger:new("Mod2", Logger.ERROR, zlogger)
local log3 = Logger:new("Mod3", Logger.DEBUG, zlogger, fuction(text)
    -- have the player say the message for log3, instead of printing to console
    -- note this still goes to our custom log file.
    local player = getPlayer()
    if player then player:Say(text) end
end)

-- log some various messages to the different loggers
log1:info("log1 shows info messages, warnings and errors")
log1:warn("this is a warning message")
log2:warn("log2 doesnt print warnings") -- wont print or log to file
log2:error("log2 only prints error messages")
log3:debug("can even format %s like %s", "messages", "this")
log3:info("it uses string.format syntax like %.2f and %04d", 123.4567, 55)
zenith smelt
#

is there any way to get the field details that all the objects have if they don't ahve getters?

drifting stump
#

^

#

@zenith smelt

chilly beacon
#

like, everything seems to be linked up fine. and yet it just shows the icon and no model

chilly beacon
#

doesnt explain the wierdness in multiplayer though, still need help with that one

faint jewel
chilly beacon
#

yeah i was trying to be all good programmer by putting it all in my own module

devout flint
#

Does anyone know if there is an item you can equip but isn't shown on the character model?

faint jewel
#

i know right

#

now i just stick with "ok" programmer and cheese shit so it works.

chilly beacon
#

do you have any thoughts on how i can make the mod load properly in MP when it works fine in SP?

faint jewel
#

looks awesome right? IT'S NOT

faint jewel
#

it makes the DAMAGE USE THE HSV COLORING.

faint jewel
chilly beacon
#

just the workshop item, surely thats enough right?

#

mod is on the workshop, i subscribed to it, and added it as a mod in the hosting settings

faint jewel
#

nope

#

you have to have the mod ID and the mod number in the config for the server.

chilly beacon
#

i even renamed my local files mod.info sections so it doesnt see that local dev files as the ones to use

#

then... hang on

#

how come i can add other workshop mods fine without having to do that?

faint jewel
#

Workshop ID: 2781895054
Mod ID: SprinterAE86

floral nexus
#

How does the game know what walking animations to use? Like is someones leg is hurt. I'm trying to make a trait that forces the character to limp.

faint jewel
#

every time i add a mod.. i have to add both.

chilly beacon
#

surely thats like, the whole point of the workshop 😛

faint jewel
#

lol yeah

chilly beacon
#

with other mods from the workshop i havent had to do that, which is what makes that wierd for me..

#

unless the game kind of does that automatically, but fails when its your own mod?

faint jewel
#

possibly?

chilly beacon
#

I'll compare mod and workshop lists and see if thats the case

#

indeed. the mod and workshop lists are different

#

funky

gaunt pendant
glass zodiac
#

Somebody make a hotkey for smoking

#

P l s

white quest
#

Where is cargo space allocated for vehicles?

faint jewel
#

the script for each vehicle.

white quest
#

I can't find anything related to cargo/inventory

faint jewel
#

the one about the trunk?

white quest
#

Yeah

faint jewel
#
        part TruckBed
        {
            itemType = Base.SmallTrunk,

            container
            {
                capacity = 45,
            }
        }```
i mean the one that handles the trunk
white quest
#

Let me add that and test

faint jewel
#

is this a NEW car?

white quest
#

mod

#

Adding the format you sent fixed it, thank you 👍

thorn cipher
#

Anyone know why my 3d clothing item when placing looks like this?

#

and then placed like this -

faint jewel
#

bad texture path

thorn cipher
#

ah ok! are you able to send an example a good texture path? I thought i had it right (but clearly not lol)

#

thanks!

faint jewel
#

show me what you have?

#

for the world model

thorn cipher
#

need to actually put a path in right lol

#

like with the mesh?

chilly beacon
#

right

#

and without the file extension

thorn cipher
#

me writing the script

thorn cipher
chilly beacon
#

so texture= Clothes/Pipboytexture1

#

the whole file path would be "media/textures/Clothes/Pipboytexture1.png"

thorn cipher
#

but no file extension right?

chilly beacon
#

but you omit the "media/textures" as it already knows to look there

#

correct

thorn cipher
#

ah cool! thanks!

#

its works! Thanks @chilly beacon & @faint jewel

chilly beacon
#

no problem my dude

thorn cipher
#

will tweak the model but it's gonna get ther

chilly beacon
#

yeah, all that is now is an image edit

devout flint
#

Is there a way to make a new Bodylocation equip spot

chrome egret
#

doubtful

willow estuary
# devout flint Is there a way to make a new Bodylocation equip spot

In the media/lua/shared directory

require "NPCs/BodyLocations"
-- Locations must be declared in render-order.
-- Location IDs must match BodyLocation= and CanBeEquipped= values in items.txt.
local group = BodyLocations.getGroup("Human")
group:getOrCreateLocation("YOUR_NEW_BODY_LOCATION_ID")
willow estuary
#

👍

chrome egret
#

oh shoot, nice!

lavish bridge
#

Anyone that has used True Music here that could help me out pls?

floral nexus
#

I'm trying to make a trait that forces you to limp at all times. I'm not able to find where the game calls for the walking animation. Help?

chilly beacon
#

A kludgy way could be to keep adding/renewing a leg injury every tick or day

devout flint
#

Test out that mod, see if it acts the way you want and then check the code to reverse engineer

floral nexus
#

I have that mod. I want the limp to be permanent. Broke heals.

floral nexus
#

THank you though!

#

Literally the first time I've ever been responded to here.

floral nexus
zealous ember
#

Does anyone know where to install project humanoid

devout flint
floral nexus
zenith smelt
#

Hello, is there an event that triggers when all mods are done loading?

#

I found the OnGameBoot, but when mods are getting reloaded during a game

#

Does that mena this event triggers between mods?

#

getting loaded is a onging action

weary crypt
#

How does the math work on determining if a firearm jams? Not sure if this is exactly the correct channel but it seems coding adjacent.

zenith smelt
#

every gun has a jam chance defined

#
        - every condition loss increase the chance of jamming the gun
        baseJamChance = baseJamChance + ((weapon:getConditionMax() - weapon:getCondition()) / 4)
#

The lower the condition, the higher the chance

#
        if baseJamChance > 7 then
            baseJamChance = 7;
        end
        if ZombRand(100) < baseJamChance then
            weapon:setJammed(true);
        end
#

This last bit means that highest jam chance is 7.
Every time the gun is fired the chance to jam is:
** gun specific jam chance **
PLUS
** weapon condition loss based jam chance **
RESULT will never be higher than 7,

Then roll a 100 sided dice and if it's less than your current jam chance (max at 7), your gun jams

crisp crypt
#

are there any mods for hallucinations akin to Barotrauma's psychosis?
i want to throw together a server where many people have it, for gits and shiggles

floral nexus
#

How? I can't figure out how to change what animation the player uses when they walk.

faint jewel
#

it would be based on what they are holding.

#

rather than the walk anim.

#

where can i find the list of these? ```ProceduralDistributions["list"]["GarageMetalwork"]

craggy furnace
weary crypt
#

I have a follow up question actually about jamming then, can the base chance be a decimal or does it have to be an integer?

floral nexus
sweet tide
#

does anyone have any recommendations for mods to make, for someone starting out with modding?

sinful vessel
#

depends on scope, start with clothing or weapons those are documented more

craggy furnace
#

id recommend weapons or a simple item mod for a beginner

#

it will allow you to fully get to grasps with how the game operates

sweet tide
craggy furnace
sweet tide
#

I see

#

also im pretty sure my mod isnt being detected, im in debug mode, have my mod in C:\Users\compl\Zomboid\mods\snipedtest\media\lua\client\snipedtest.lua, and theres no errors or anything its just not in the mods menu

willow estuary
sweet tide
#

does it have to be in the workshop folder?

#

thought it worked in zomboid

willow estuary
#

I dunnno, but in general the directory structure and formatting stuff with modding is absolutely ruthless in how you have to implement them "properly".

#

There's 2194793014743 mod directories in a PZ install? I just use that one for making mods.

chrome egret
#

You should be able to put your code directly in the mods folder, that's how I most-often test.

willow estuary
#

You gotta be absolutely scrupulous with formatting + directory structure stuff however, regardless.

sweet tide
chrome egret
#

Did you check console.txt to see if it claims to load your mod?

sweet tide
#

theres no mention of it

#

it just doesnt detect it

#

ill try the other method

willow estuary
#

Ah, mebbe you borked up your mod.info file if it ain't loading.

sweet tide
#

file

willow estuary
#

Absolutely.

sweet tide
#

that would be it lmao

#

thought that was just a descriptive thing

willow estuary
#

My argument for using the workshop directory as I do is that, vs the mod directory, is that the mod needs to be in the workshop directory anyways when/if you want to upload it to the steam workshop?
So better off learning how to use that directory now than have to fuckaround learning how to use it later?

sweet tide
#

true

#

I just want to test mine out first to see it works and all

#

perfect

faint jewel
#

aight i need one of you code monkies for a bit.

#

MRBOUNTY @drifting ore ! you sir are who i needs.

fallen solar
#

hey guys, looking for mods, does anyone have any to recommend

polar gyro
#

anyone know how to add event on stomping? like additional hp lost

chrome egret
#

what do you need Skiz?

faint jewel
#

more coding skill than i have

fallen solar
#

hey guys, how do I add all the mods to the server I am hosting, all at once?

kind fossil
#

Map=TreadsMilitaryVehicleZoneDefs;Muldraugh, KY

willow estuary
#

#mod_support is the channel for inquiring about these sorts of mod-user issues? This channel is intended for mod making. No big deal though, but you'll find it more helpful there 🙂

kind fossil
#

OH my bad!!

#

you're right

willow estuary
#

No worries 👍

shadow flower
#

what is the all distributions table for? is it for procedural or suburb?

kind fossil
#

Do you know guys a mod that drops the map of a player when he dies?

#

Like you have a map with markers written on it and someone kills you and loots your map so he can see the markers you had written

shadow flower
#

I have table.insert(SuburbsDistributions.all.crate.items, "ITEM"); table.insert(SuburbsDistributions.all.crate.items, 0.8); which works for me and everyone else subscribed. But one person gets the error

attempted index: crate of non-table: null

#

Are you sure it breaks it?

willow estuary
faint jewel
#

uhhhhhhhh

shadow flower
#

Yeah huh

willow estuary
#

One of the rare tables in Distributions.lua that you can add items directly to.

faint jewel
#
table.insert(SuburbsDistributions["all"]["cashregister"].items, 100);```
shadow flower
#

they also get an error on

table.insert(SuburbsDistributions.Bag_SurvivorBag.items, "ITEMM");
#

So I guess someone on one of the mods he has installed screwed up their distribution table

willow estuary
shadow flower
#

yeah

#

why can't people join here and get gud

willow estuary
#

Well, people love using mods for build negative twelve that were last updated in 5,000 BC as well?

shadow flower
#

right

#

wouldn't it nuke all the tables and not just mine specifically though?

willow estuary
#

Ah, when people use mods, especially old ones or poorly made ones, all sorts of magical things can happen?

shadow flower
#

good point lol

#

i don't think my tables have anything wrong

#

maybe theres a mis-matched mod id?

willow estuary
#

Yeah, offhand they look solid to me?
And most of the time when it's a situation like which works for me and everyone else subscribed. But one person gets the error, that one person is using a mod or mods that fuck up shit, or maybe they're using an old build of PZ, or maybe something else on their end is just cooked?

shadow flower
#

true

#

should i change my mod id, to by absolutely sure lol

willow estuary
#

Why would you want to change your mod ID?

shadow flower
#

because mine could easily be used elsewhere i suppose

willow estuary
#

Yeah, your call. It's very very very no bueno to have a modID that's the same as other mods' modID.
Just be aware that it could cause issues for subscribers' savegames or servers, you dig?

shadow flower
#

ahh right

#

I'll send him the file to test it separately

#

thanks

willow estuary
#

NP, good luck! 👍

subtle sapphire
#

Hello! 🧑‍💻 Is there a way to check whether is day or night?

fair frost
#

"....1998....I'll never forget it...It was the year when those grisly murders occured in the Arklay Mountains..."

faint jewel
#

meh.

#

lol i'm kidding, they look great 😉

fair frost
fair frost
devout flint
#

Can someone point me in the right direction I am trying to make an item that you can equip but has no world model. I just want it to be equipped to the player in their inventory

#

Are there any similar mods I can look into the source code to figure out?

faint jewel
#

what?

#

what are you trying to make? a nexklace or?

devout flint
#

Something like that. Lets say like a trinket that gives you a buff

#

I tried using silver ring as the base for the item and tried removing certain properties

#

But I am getting some errors that I dont quite understand

#

I created my own body location where the item can be equipped to

vapid arrow
#

Im happy with this

echo apex
# thorn cipher

Which model of pip boy are you making? Is it the pimp boy 😂

thorn cipher
#

gonna add the other ones too

echo apex
#

Nice, looking good and can't wait for it all 👍👍

tranquil reef
#

Anyone know if survivor respawning is enabled in the superb survivors mod

#

I keep driving through town and causing all the ape brained NPCs to run outside and get eaten, and I'm hoping I won't run out of survivors before I can rescue any lol, I have zombie respawning off so if I kill all the zombies, and then more survivors respawn for me to rescue it'll be nice

flint beacon
#

Hello, where can i change the text of
"This is how you died"
I would like to change it to say something else.

hot void
vapid arrow
tranquil reef
tranquil reef
#

it'll be a bit different for you, since I have my steam games on a different hard drive, but everything after "steamapps" should be the same

flint beacon
#

yeah i found it ty!

trail lotus
#

im looking to commission a full drug mod. from producing the drugs to packaging them, to crafting into usable items. i used jiggas and i love it but the problem is im looking for more then weed. and i'd like to have namely all the most popular drugs including (heroine, meth, weed, cocaine, pills, lean, shrooms, etc.) this would be a large mod that adds alot of items, crafting, farmable plants. and id pay a solid price to have it all done. the mod would have to work beside a police mod as well on my server i have another developer working on. pm me about it if you'd like to help or if some one could get me in touch with jiggas and he'd like to be paid for actually making a larger mod let me know ! thank you 🙂

devout flint
pastel dune
#

stole this post from reddit because its asking a question I've long wanted an answer for :

"Is there a mod that lets players create their own power grid in a fully-player-made base/home?
I'm essentially looking for a way to be able to build my own house from scratch, and be able to make my own ceiling lights, light switches on the walls, and have a working power grid so I can throw a fridge or two down in various places.

Any help/suggestions you can provide would be much appreciated!"

latent orchid
#

what is the correct way to get the localized text for a recipe name via lua?

#

ie recipe:getName() will return the english name in the script

#

but what about other languages?

willow estuary
#

So switch client language to desired language and run a getText on it?

#

Then switch back.

latent orchid
#

In my case, I am looping through recipes, so TEXT_HERE is not a value I am able to locate via the recipe itself

willow estuary
#

getText(recipe:getName())

latent orchid
#

ERROR: Missing translation "Build A Workbench"

trail lotus
# hot void idk if the devs............ nvm

Oh my bad I figured they probably didn’t care, because of how popular jiggas is. Plus it’s just a workshop item it’s not like I want it added to the game haha! My bad though.

willow estuary
#

Nah, drugs are fine.

latent orchid
willow estuary
#

Yeah, that was just guesswork on my part anyways?

latent orchid
#

Nvmd, what you suggested works. Seems lua refresh didnt work first time round

latent orchid
#

no blair, you cant turn back time

willow estuary
#

Huh, well anyways that sounds like that might have some neat utility for say procedural text generation?

latent orchid
#

turns out that little refresh issue on my end was the issue altogether. the localized text is returned on getName()

willow estuary
#

Cool! Could have neat utility for generating messages in different languages and such.

pastel dune
#

does anybody know if its possible to make "extension cords" to extend the range of a power generator or power source?

polar gyro
#

Maybe anyone know how to add event on stomping? like additional hp lost
Also.. which function affects bleeding damage?

thorn cipher
lyric pewter
#

Hello. This question has probably been asked before but what is the best way to learn about modding PZ? I am a Computer science student and am very interested in learning since I really enjoy this game. Any input/information would be greatly appreciated.

polar gyro
fresh geyser
#

does anyone know the resolution of trait icons?

#

I know it's 1x1 but like

#

pixels and stuff

#

18 pixels

#

by 18

faint jewel
#

8x8 or 16x16

#

all video textures have to be powers of two.

#

2 4 8 16 32 64 128 256 512 etc

fresh geyser
#

Thank you

#

If I'm trying to do a HUD overlay over the entire screen, should I just go with the screen size of most monitors?

#

Err

#

Hold on I can't word for crap

scenic mulch
#

Aye Fellas anyone know why is my custom vehicle distribution not working? I just copied the vanilla one that uses specific distributions for my Gigamart Van.. The first Distribution uses food items and the second one uses Toys and stuff. Here is how I set it up.

noble holly
#

Where can I find the mod tools?

smoky meadow
#

guy do you have any guide on how to set up gun attachments?

peak bridge
#

hey am trying to set up a melee weapon to be able to attach it onto multiple points. An attachment on the back and the belt.
Would "AttachmentType = BigBlade/Knife," work or am I missing something?

gaunt pendant
gaunt pendant
#

ergo for that to work you'd need to define a new attachment type and make it so it's accepted on BeltLeft/Right and Back (look at media\lua\client\Hotbar\ISHotbarAttachDefinition.lua for the vanilla stuff)

faint jewel
#

i need some code assistance, anyone free?

round depot
#

Does anyone know if there's a mod that lets you chain up zombies to act like guards and/or alarms?

shadow flower
#

We found the mod that is the culprit its one known as "AZN_Crossbows"

#

Save everyones sanity, and don't do this!

shadow flower
#
table.insert(SuburbsDistributions["all"]["cashregister"].items, "Base.item");
table.insert(SuburbsDistributions["all"]["cashregister"].items, 100);
#

Switch suburbs out for the vehicle distribution table

faint jewel
#

lol i recognize that.

shadow flower
#

it makes me want to slam my head against my desk when people copy the vanilla code and think it will work, yes it'll work for your mod, but any mod loaded after won't have any distributions loaded xD

gaunt pendant
#
local function mergeDistributions()
    SuburbsDistributions = Distributions[1] -- the games distribition table should always be the first in table.

    -- if there are modded distribution tables merge them into the main suburbsdistributions
    if #Distributions>1 then
        print("### Merging distribution tables ###")
        for key,dist in pairs(Distributions) do
            if key > 1 then
                print("Merging distribution addon #",key-1)
                MergeDistributionRecursive(SuburbsDistributions, dist)
            end
        end
        print("###################################")
    end
    
    -- ...
  
end```
shadow flower
#

still why copy all that and make it look like a mess when all you need is two lines

gaunt pendant
#

well the indenting is a mess apart from that I'd do it like that too

#

doesn't really matter now, that most stuff is in the procedural distributions anyway

hazy raft
#

was reading the modding guide on github, these 2 are empty

latent orchid
#

Lua question: How do you get the items from an item of 'Container' type? I'm presently stumped and probably missing something obvious 😩

#

nvmd, figured it out. Just needed to do a 'getInventory()' on the item itself

queen leaf
#

I’d love it if someone could make a mod that introduces welding goggles to the game. They can be rare or common, so long as they’re lighter than the mask and don’t override the entire face. I wanna wear my novelty Todd Howard mod mask while I disassemble doors!

latent orchid
#

On the topic of welding eye protection, aren't welding mask almost impossible to see out of normally? They should affect player sight radius imo

faint jewel
#

truuuue

#

would stop people from wearing them forever.

rose notch
#

They are tinted as well

junior raven
#

How do you prevent PZ from removing your "stale" zombies

#

I think I figured it out. You can set its authOwner. Let me test it.

zenith smelt
#

How do you set the authowner

junior raven
#

Yeah... never mind

steel jackal
#

anyone know if there is a hand warmer mod anywhere? playing cryogenic winter and i feel like thatd be a great mod to go along with ot or is there some game code tht makes that too hard to do?

junior raven
#

How do you prevent your zombies from being removed due to be "stale"?

spice finch
#

Where does the game track as to which clothing item covers what?

#

like you can get a long sleeve t-shirt and it covers the torso, upper arms, and forearms; on the same slot the bandeau covers the torso, and upper arms.

dreamy canyon
#

I'm trying to use this Json util, but I don't seem to be getting an output. I'm simply registering a function on boot to dump a table to a json output, but nothing is happening. Code snippet below, any ideas?

local Json = require("Json")

local function dumpProps()
    local fileWriter = getFileWriter("farming_vegetableconf_props.json", true, false);
    local json = Json.Encode(farming_vegetableconf.props)
    fileWriter:write(json);
    fileWriter:close(json);
end

Events.OnResetLua.Add(dumpProps)
Events.OnGameBoot.Add(dumpProps)
dreamy canyon
pastel dune
#

where can i find the code for the generator?

#

i want to muck around with power stuff

gilded hawk
gilded hawk
vocal saddle
#

idk if i should ask here but can i give my friend the cheat menu if i have the mod installed (he has it installed too)

fair frost
chrome egret
vocal saddle
chrome egret
#

Could you send a screenshot? @vocal saddle

sweet tide
#

I have an idea for a mod but could I run it through here, it sounds a little stupid

chrome egret
#

go for it

#

There are literally mods that add defecation to this game, so I think the field of relevant ideas is pretty broad!

polar gyro
#

anyone can tell me how take value from other mod?

chrome egret
#

Can you be more specific?

polar gyro
#

i have two mods

#

i want to grab value A from mod 1 to mod 2

#

to use this A in mod 2

sweet tide
#

where you get benefits for being younger/older (younger gets shit like bonuses to fitness), older gets bonuses like wisdom? also a chance to die of old age and related stuff like heart disease

chrome egret
polar gyro
#

@chrome egretfor example one mod set weight 10 and i want to use this value -2 in my second mod

sweet tide
#

is there a way to edit the info character screen

#

and add an extra section?

sharp crystal
#

Hello. I want to remap the key-bind from 0 /zero/ to Numlock 0 /zero/

#

elseif key == Keyboard.KEY_0 then
ui:refresh()

#

Is there anyone who knows how to change "Keyboard.KEY_0 " to NumLock 0 pls?

chrome egret
sharp crystal
#

Tank you. Should I change it to:

#

elseif key == Keyboard.KEY_82 then
ui:refresh()
end

chrome egret
#

you can simply compare key to the value, key == 82

sharp crystal
#

thank you..it has worked 😄

tame mulch
sweet tide
#

do you know where IGUI_char_Age is from?

chrome egret
#

Probably IG_UI_EN.txt

#

and others for the various translations

sweet tide
#

ohh so its a translation thing i see

chrome egret
#

yepper

sweet tide
#

good to know, I defo feel a bit out of depth rn

chrome egret
#

It can be a bit overwhelming getting started!

sweet tide
#

Yeah especially looking at a 700 line lua script half of which is how the char is being drawn haha

willow estuary
#

There used to be an Age display in the character info screen.
But it was just a placeholder that didn't change; you could survive 10 years in-game and it would be the same as when you started the game.

It was removed because it just confused/misled people.

sweet tide
#

which is pretty neat

willow estuary
#

Oh yeah, they never really remove anything 😄

chrome egret
#

It would be cool if you could age up the character's face, hair, and such

sweet tide
#

well thats kinda what im trying to create

#

but im not sure if id be able to edit the characters face?

chrome egret
#

I'm afraid since I don't mess with that kind of thing I don't have a clear grasp of what is or isn't possible

placid hinge
#

If you can change someones hair color via lua, should be able to just tie it to the characters current age in days survived

sweet tide
#

ah shit 38 errors

#

nice got it working

#

its pretty funny cuz you need to put the variable as a string

#

not an int cuz the function doesnt like it like that

chrome egret
#

Yeah, I don't think labels, buttons, etc., understand anything but strings

willow estuary
#

I think a cool and fun feature that someone could incorporate with age-related modding would be giving characters a birthday?

sweet tide
quasi geode
#

make their birthday 1 week after they spawn. just in time for the heli to come wish them happy bday.

sweet tide
#

I was thinking maybe add like an xp boost on their birthday

willow estuary
#

I'm not really that much of a joke mod guy myself, but there could be some good fun with having some party-outfit zombies spawn in for a players birthday 🤪

sweet tide
#

or someting balanced

willow estuary
near wing
#

🐔🐔🐔

storm scarab
#

Hey guys, I've been toying with hallucinations in project zomboid and I wanted to know if there is a way to directly make something client side. Say for example you spawn a zombie everyone on the server will see it. I'm looking for a way to make a client side zombie if its even possible

#

I dont know if anyone has toyed with this idea before, or if they can give examples of a mod thats done it before

#

any help is apricated

fresh geyser
#

Does anyone have the code / lua for the generator fumes?

junior raven
#

Is it possible to keep your zombies from being removed due to being "stale"?

trail lotus
#

Any good mod creators (3d modelers mostly) looking for a big job/project would mostly be quality of life items, also some other cool rp items. It would be similar to hydro craft but a custom mod for my server. Looking to pay quite a few dollars for some one willing to take on the task 🙂

faint jewel
#

quality of life as in?

#

you can dm if you need.

trail lotus
undone crag
storm scarab
#

I wonder if I can abuse that for a possible client side zombie

#

i double wonder if there is a lua thing for it

worldly spade
#

Anyone know why Hydrocraft items are invis when equipped in mp?

undone crag
storm scarab
#

Though i've not checked, You can spawn a non aggressive zombie. The idea is to have a client side non aggressive zombie go to your position, to make it look like its going for you, but when you look in its direction or see it I plan for it to disappear

#

So i'm not 100% sure it would work, its something I would have to look into

umbral hemlock
#

I keep having an issue were I get an error eating in game and when the animation stops the food is still there and hunger doesnt decrease. Any idea what mod might be causing it ?

analog brook
#

is there a mod or function in the game that allows you to quick equip and quick-drop primary and secondary hands items? For instance: Quick equipping a toolbox from the ground or shelve, then quick dropping the toolbox in front of a car

vapid arrow
#

i have an issue with a weapon model
apparently the model is shown lying on the ground

#

but when i equip it, doesnt show

#

the code of the weapon model is like this

module Base
{
    model Crucible
    {
        mesh = Weapons/2Handed/Crucible,
    }
}
#

and this is the path of the model

past tinsel
#

Edited to reflect progress, see later comment please.
~~I'm in the middle of writing my first mod (so excited!) (been programming for years for work and school, but new to Lua, seems relatively easy to pick up so far) and am making good progress. I want to find any firearms the player has in their inventory so I can take advantage of the methods that they have as a HandWeapon. So far I can tell if the inventory item is a weapon by:
player:getInventory():getitems(), for-loop through each of those items: IsWeapon(). (alternatively, getCat().)
But I can't seem to find out how to access the methods of the HandWeapon subclass, or to determine what subcategory of weapon the item is. Any advice on how to do this? ~~Thanks a ton in advance!

pastel dune
#

Can powered items be told to detect the presence of power in multiple tiles?
Like could I code a lamp to be powered if the either the tile behind it(directionally north) or the tile in front of it (directionally south) has power.

I'm only using the lamp as an example because I want to create a power cord/line mod that would allow you to place down power cables that can extend the range of a connected "power zone".

#

If anyone is interested in helping me make extension power cords that you can use to... y'know... extend power, from a generator or an already powered house I would really appreciate the help cause I have no idea what I'm doing

late hound
vapid arrow
past tinsel
# past tinsel Edited to reflect progress, see later comment please. ~~I'm in the middle of wri...

I'm making progress! The Lua function "instanceof" is what I needed in order to determine if it's a HandWeapon or not!
New question: How do I get it to tell the difference between firearms (like the VarmintRifle/MSR700 Rifle, for example) and say, a kitchen knife? (In the items_weapons.txt, there looks like what I assume is a comment header over the section saying ITEM_FIREARM, but that isn't a class or anything so far as https://projectzomboid.com/modding/allclasses-noframe.html tells me... so how do I tell them apart?)

subtle halo
#

Hey folks! I'm new here and fairly new to PZ but fell in love with the game after it was gifted to me. I've been inspired to create mods that I hope people would enjoy, but know absolutely little about programming a mod for PZ. Any idea what skills I need for doing it and how I can learn to mod for PZ?

#

Thanks ahead of time!

vapid arrow
fast galleon
#

Game Devs have said they will do some changes to generators and fuel, so it might be easier to mod in the future.

#

A cheat you can use is place a generator 5 squares away from generator you want to extend, so you can cover more squares.

pastel dune
#

so if i wanted to make a lamp output power like a generator when on but need to be powered by a generator what would i need to add or adjust in the lamps code?

fast galleon
#

I am new to this, but I would probably make a global objects, like campfire / plants.

#

And check if square has electricity and if a generator exists closeby.

#

Something like this is done by immersive solar arrays.

#

Check if generator exists and if it's on. Obviously you'd need to exclude the lamp, if you make it a generator.

#

There's also steam powered generators.

pastel dune
#

what happens when i want to start to daisy chain them though

#

im using the lamp as a placeholder for the power cable

fast galleon
#

Same but with something like water pipes mod. Irrigation farming on Steam ?

pastel dune
#

thats EXACTLY like what i want to do just with power

flint beacon
#

Is it possible to make it a select a random car when the function "Car_Random_OnCreate" is called? Instead of the code i have below.

function Car_Random_OnCreate(items, result, player)
   local ranValue = ZombRandBetween(1, 5)
   for i = ranValue,1,-1
   do
    player:getInventory():AddItem("Base.Car1");
    player:getInventory():AddItem("Base.Car2");
    player:getInventory():AddItem("Base.Car3");
    player:getInventory():AddItem("Base.Car4");
    player:getInventory():AddItem("Base.Car5");
  end
end

Im very new to coding so any help would be appreciated!

fast galleon
modern sundial
#

how do i mod a new trait?

craggy furnace
#

@zealous wing

#

back to the lab again

latent orchid
craggy furnace
#

😂

kind fossil
#

Hi ! We have found this road map of the Knox County and would like to add it in our server
Do you know if there's a mod that does this already ? And if it's not too complicated to do it ourselves ?

https://i.imgur.com/oRhAcDG.jpeg

peak bridge
#

Heyo can someone help me out with something regarding starting traits/clothing and the coding for it?

Essentially I am going about modifying the starting outfits and items for professions which I've done already, but now I want to know if it is possible that if one were select a specific trait for their character then they would be exempt from the occupation loadout or outfits that my mod provides.

To be more specific, I have an "Injured" trait and want to make it so if somebody were to select said trait for their character, they would be forced to spawn without the items that my occupation mod provides and to spawn only with a hospital gown or if not possible to also add the hospital gown to the outfit selection screen when the injured trait has been selected.

#

So far this is what I have for the trait section:
EDIT: Figured I'd try "player:getInventory():RemoveAllItems;" and it seemed to have worked so far with what am aiming for.

----Trait Items
    if player:HasTrait("Alcoholic") then
        player:getInventory():AddItem(getRandomStringFromTable(Alcohol));
    end
    if player:HasTrait("Smoker") then
        player:getInventory():AddItem("Base.Cigarettes");
        player:getInventory():AddItem(getRandomStringFromTable(Lighter));
    end
    if player:HasTrait("Injured") then
        player:getInventory():RemoveAllItems;
    end```
latent orchid
obsidian arrow
#

Hey folks, I'm trying to remember what the name of the mod is where the character talks to itself about how it feels, but I'm blanking out. Would anyone have an idea?

obsidian arrow
#

you bloody legend, thank you

craggy furnace
#

how could i forget when it was made by my friend chuckelberry finnm

latent orchid
#

Curious what else one would use a mechanical table saw for beyond cutting wood logs and planks? Ideas or things I might not be seeing?

gray goblet
#

How is inventory stored in this game? Ive noticed that when you overload your character by loads, the game laggs immensely. Been running in debug and seeing like how much loot is in each area. When reaching high amounts of loots the game slows down ALOT.

drifting ore
#

I was wondering if it was possible to make the sun hurt the zombies so a "I am legend" like mod would be possible

worldly spade
#

Anyone that could help me sort load order for my MP game with friends? The weapon mods are never working like arsenal guns missing icons and being invis same with b rita weapons but in SP they work fine

latent orchid
chrome egret
chrome egret
drifting ore
willow estuary
#

Looks like I've got another one of my mods to fix! 🤪

chrome egret
#

If you so decree 😄

#

I'm on about translation support currently

#

I wish there were something built-in that would help me get a plural form of an item name, or get the appropriate article for a word, in the current language.

drifting ore
chrome egret
#

The answer to your initial question is "yes, it's possible".

fast galleon
#

I wanted to make zombie parts weapons at some point.

chrome egret
drifting ore
chrome egret
#

np

peak bridge
#

Ay can anyone help me with a set of lines real quick?
I am trying to remove all items at the start of a game and then equip a hospital gown onto the player character if a certain trait has been selected but I don't think I am doing this quite right.. 😛

if player:HasTrait("Injured") then
     player:getInventory():RemoveAllItems();
     player:getInventory():AddItem("Base.HospitalGown");
     player:getInventory():EquipItem("Base.HospitalGown");        
end```
chrome egret
#

Do you get an error? Does some of it work, but not all of it?

peak bridge
#

nah no errors just not the desired outcome. only thing that works is player:getInventory():RemoveAllItems();

chrome egret
#

I honestly think what you have looks right, but have you tried removing "Base." and seeing if that affects the outcome?

#

Also if you'd like you're welcome to send me your console.txt to see if I can spot anything

peak bridge
#

My apologies guess there was an error in the console

#

says line 298 which is where the first "additem" section is for the hospital gown which is weird.

#

Also the remove all items command seems to only remove any actual items that arent equipped but none of the clothing.

chrome egret
#

Yeah, I don't think worn/equipped clothing is considered "in" the inventory at that point.

peak bridge
#

ERROR: General     , 1650720588341> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in Add at KahluaUtil.fail line:82.
ERROR: General     , 1650720588341> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: Object tried to call nil in Add
    at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:973)
    at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
    at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
    at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
    at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
    at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
    at zombie.Lua.Event.trigger(Event.java:64)
    at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:130)
    at zombie.iso.IsoWorld.init(IsoWorld.java:2691)
    at zombie.gameStates.GameLoadingState$1.runInner(GameLoadingState.java:262)
    at zombie.gameStates.GameLoadingState$1.run(GameLoadingState.java:219)
    at java.base/java.lang.Thread.run(Unknown Source)
LOG  : General     , 1650720588343> -----------------------------------------
STACK TRACE```
chrome egret
#

The inventory is considered a series of "backpacks" each of which has its own contents-- minimally the player-held inventory and keyring, but also any true backpack they're wearing.

chrome egret
#

To make this easier to suss out, and for best practice anyway, try storing the result of getInventory() in a local variable. That can make the error/issue more apparent in the break debugger as well as more specific when you're trying to look into it. It also avoids the overhead of calling getInventory multiple times and simply re-using the value from the local variable-- miniscule in one instance, but every little bit helps.

#
if player:HasTrait("Injured") then
     local inventory = player:getInventory();
     inventory:RemoveAllItems();
     inventory:AddItem("Base.HospitalGown");
     inventory:EquipItem("Base.HospitalGown");        
end
peak bridge
#

hmm yea I tried this and it seemed to disregard everything all together, got the same error as above but instead it is line 299.

Which is right after the "local inventory" line

chrome egret
#

so when I look at the ItemContainer class, I don't see RemoveAllItems

#

I see removeAllItems

peak bridge
#

alrighty ill give that a shot

chrome egret
#

I would definitely commend you to check out the Java source, either through your IDE or using the online Javadocs

#

The other option is trying to scrape the vanilla Lua for clues

peak bridge
#

okie dokie

#

and that version of the line worked, it removed all the items in the inventory in its entirety but the character still has the set of clothing that was selected in the creation screen lmao

chrome egret
#

Yeah, I bet you'll have to combine another method to get everything out

#

Perhaps the player object has an unequip all that you can call before removeAllItems

peak bridge
#

Maybe i'll give it a tinker and see what happens

#

anyways tho thanks for assisting I am gonna pick this up later am dead tired, I will check out that Java source you mentioned later today. 😄

chrome egret
#

Sure thing! Take it easy.

chrome egret
echo apex
#

Can someone remind me what the mod is for having zombies be mainly fast shamblers but now and then throw in a sprinter?

chrome egret
#

So does adding translation (i.e. porting code to use strings from getText lookups) necessarily break the mod for any language which doesn't have a defined translation? Or is a default (EN?) used when the chosen language has no translation?

sweet tide
willow estuary
sweet tide
#

can someone explain the difference between CharacterCreationHeader.lua and CharacterCreationMain.lua? In SteamLibrary\steamapps\common\ProjectZomboid\media\lua\client\OptionScreens

#

im trying to add an extra dropdown box below surname

#

in the character creation menu

gilded flame
#

where can I find some of brita's armors?

chrome egret
sweet tide
#

I tried ripping the male female dropdown box from header and seeing if it would put another below but it just errored

chrome egret
#

Errored how? It does look like *Header has the responsibility of creating a lot of the input entries

#

If not all

sweet tide
#

ill try rerun it again give me a second

#

so i found

#

but im not sure where ISComboBox is located so I can check the function to see what it takes

deft falcon
#

anybody know how to set and/or check for states? Stuff like idle, bump states when you trip by fence/sprint into a tree, yk. I've tried looking for it in modding library website but couldn't find anything for it.

sweet tide
#

or ISTextEntryBox

#

nvm found it

drifting ore
#

im planning to make a mod (first time), and i was wondering. can i somehow replace the music in the game with my own without making a mod?

There is music that plays during combat or just random ambience, and i was wondering if whenever the combat or ambience theme triggers, it could play my own mp3?
People say: "Use youtube" But i cant alt tab out the game while fighting a horde, play my song and tab back in

sweet tide
#
self.ageCombo = ISComboBox:new(entryX, self.genderCombo:getBottom() + 6 + (entryHgt - 18) / 2, 80, comboHgt, self);
    self.ageCombo:initialise();
    self.ageCombo:addOption(getText("18"))
    self.ageCombo:addOption(getText("19"))
    self.ageCombo:addOption(getText("20"))
    self.ageCombo.borderColor = {r=0.4, g=0.4, b=0.4, a=1};
    self:addChild(self.ageCombo)

I have a combo box here, to select the characters age, but I cant seem to figure out how to get the selected value from the combo box and save it as a variable, everything I try it just errors and the combo box disappears

sweet tide
chrome egret
#

np, big credit to MrBounty for creating the original guide

#

saved me when I went to create the UI for Item Searcher

sweet tide
#

yeah wasnt sure if there even any documentation

#

cuz its such a small thing

chrome egret
#

Yeah, I'm not sure I have the energy or the correct vision

#

But I do wish there were better supplementary documentation

sweet tide
#

yeah i kept trying to do it the way the gender was grabbed

#

but it didnt like it

chrome egret
#

I think the code I'm seeing around that is using the index of the option that's selected

sweet tide
#

yeah I was trying to get the index

#

which starts at 1 cuz lua is weird

chrome egret
#

hah, yeah

#

so what happened when you tried to read self.ageCombo.selected?

sweet tide
#

well i tried to do this

#
function onAgeSelected(combo)
    if combo.selected == 1 then
        charAge = "18"
    else 
        print("Sjot")
end    
#

which doesnt work lol

undone crag
#

You could look at ISComboBox.lua to see how to tell which option exactly is clicked?

sweet tide
#

Nah I'm gonna use the get selectedtext

chrome egret
#

It looks like that function implementation has an error

#

you're missing an "end"

#

both the conditional and the function need an "end"

sweet tide
#

Oh yeah lol that explains it

chrome egret
#

Yeah, small syntax errors will kill ya 😄

sweet tide
#

I'm still very new to lua

#

So not used to end at the end of everything

chrome egret
#

I hear ya

#

Aside from just running the code in PZ, I highly recommend using repl.it to test bits of Lua syntax

sweet tide
#

Yeah it's annoying at times have to load up the game each time I wana test something small

chrome egret
#

For sure

sweet tide
#

Do alot of mods use preexisting lua

#

From in the game files

#

And just modify it

chrome egret
#

I'm sure many do

undone crag
#

If you want your mod to be compatible with other mods that modify character creation, then instead of overwriting the original functions to make changes, you could let them run and then make changes, like in someone's render example.

vapid arrow
#

how to check that error?

#

every time i press Q to yell, or i want to open the map, doesnt work at all

#

my mod have an error but i cant find it

deft falcon
undone crag
strange sequoia
#

Hey, i was wondering if it was possible to make the menu in the character creation bigger via a mod ? There's a great mod on the workshop "Improved hair menu" that creates new character windows for haircuts but i was wondering if it was possible to make those windows bigger. Especially the one where you see your character fully 🤔

small kernel
#

just got here

#

does anyone know what map this could be from

#

best image i have since its from a clip

#

I cant remember the name of it for the life of me

small kernel
#

imma check rq

thorn cipher
#

You're here

small kernel
#

you sure?

#

the house had a lake close to it

thorn cipher
#

Yes i'm certain

#

so that house is here

#

scribbled circle lol

azure rivet
#

Hello, can there be a problem if I put twice the number of pixels in the texture of the clothes?

small kernel
thorn cipher
#

Knoxville refuse station or something, has a gas pump too

azure rivet
thorn cipher
#

Well I feel like it is going to work then, have you tried uploading it to the workshop?

#

Can always make it unlisted

#

or just delete it if it's glitchy

#

if it's still wip

azure rivet
#

I haven't uploaded it yet, I'm correcting errors, but I'll keep it in mind, thanks.

thorn cipher
#

No worries, not sure if I've helped much lol

#

@winter bolt might be able to help more 🙂

winter bolt
#

most of the textures in brita's clothing mod are pretty high res and i dont think it causes any issues

azure rivet
#

Then perfect.

fresh geyser
flint beacon
azure rivet
#

Hi, what do I use so that my clothes do not have holes in the mesh?

sharp crystal
#

Hello. I want to adjust the amount of gas in a Gas Can. Does anybody pls know what should I adjust pls?

flint beacon
#

All i can think is that you can maybe change the
UseDelta = 0.125,? @sharp crystal

    item PetrolCan
    {
        DisplayCategory = VehicleMaintenance,
        Weight    =    5,
        Type    =    Drainable,
        UseWhileEquipped    =    FALSE,
        UseDelta    =    0.125,
        DisplayName    =    Gas Can,
        Icon    =    Petrol,
        ReplaceOnDeplete    =    EmptyPetrolCan,
        StaticModel = GasCan,
        ReplaceInSecondHand = Bag_GasCan_LHand holdingbagleft,
        ReplaceInPrimaryHand = Bag_GasCan_RHand holdingbagright,
        WorldStaticModel = GasCan_Ground,
    }
#

im new to all this aswell so i wouldnt know forsure

azure rivet
flint beacon
#

yeah the lower the delta the more times you can use it.

sharp crystal
#

item PetrolCan
{
DisplayCategory = VehicleMaintenance,
Weight = 5,
Type = Drainable,
UseWhileEquipped = FALSE,
UseDelta = 0.125,
DisplayName = Gas Can,
Icon = Petrol,
ReplaceOnDeplete = EmptyPetrolCan,
StaticModel = GasCan,
ReplaceInSecondHand = Bag_GasCan_LHand holdingbagleft,
ReplaceInPrimaryHand = Bag_GasCan_RHand holdingbagright,
WorldStaticModel = GasCan_Ground,

flint beacon
#

maybe try 0.01

#

just experiment with it

sharp crystal
#

OK..thanks ...gonna try it

flint beacon
#

forsure hopefully it helps

#

Does anyone know if anything is wrong with my code here? i keep getting an error when trying to craft the item.

function Random_Item_OnCreate(items, result, player)
   AddRandomItemToInventory({"CreditCard", "LightBulb"}, 0, 1)
   AddRandomItemToInventory({"Screwdriver", "Battery"}, 0, 1)
   player:getInventory():AddItem("Screws", 20)
end
zealous wing
azure rivet
winter bolt
#

not sure if thats the exact variable name though

#

if you can check the vanilla item scripts for underwear i think some of them have it

#

itll make the item completely unbreakable though im pretty sure

azure rivet
latent orchid
#

How does the game check if a magazine has been read/finished? I'm trying to to trigger an event once this state is successfully met

fresh geyser
#

Is it possible to modify zombie hearing/detection to next to none if the player is behind them?

sweet tide
#

I use VSCode. but where can i get intellisense for all available lua functions for pz? I saw there was one for jetbrains but I cant find one for vscode? It would be nice for autocompletion

small kernel
#

ive been hoping someone would make gas masks useful

#

spores are the best use

chrome egret
smoky meadow
#

is there a guide on how to make custom animation in project zomboid?

craggy furnace
zealous wing
#

With Eris NVGs?

craggy furnace
zealous wing
#

A couple of people reported that to me, but I couldn't reproduce it. 😛

craggy furnace
#

it was up and running fine last time, i wonder if adding a tooltip via the item script broke it?

zealous wing
#

That's why I tend to shy away from tooltips, they seem to break things more than being helpful.

craggy furnace
#

i am on my third coffee

#

ill look at whats doing it in a bit

#

its a shame because i wanted a short instructional since too many are confused

zealous wing
#

Eris's is easier to use than the other one too.

craggy furnace
#

i find the other one to be bloated

#

cool API but honestly it seeks to do too much

zealous wing
#

Are you me? Bloated and tries to do to much was my thought. 😄

willow estuary
drowsy needle
#

How can I adjust the chance of a weapon appearing impaled in a zombie? I made this one mod for one knife, added it to all the zombie distribution parts, and now it's showing up everywhere. I've got like 12 of them now.

junior raven
#

Recommended 3D modeler application?

zealous wing
#

For PZ? Blender.

#

Free, and literally anything else is a waste of money or overkill.

#

The tools I use for modding this game are Notepad++, GIMP and Blender, if you're curious. All free.

junior raven
#

Thanks

zealous wing
junior raven
#

No

zealous wing
#

Have you used any modeling program in the past?

junior raven
#

No

junior raven
#

Actually I used sketchup

zealous wing
#

Can that export to FBX?

#

If it can, I'd say use what's familiar to you.

junior raven
#

Maybe, but I'd rather use a modeler designed for this

zealous wing
#

I think the devs use Maya, but don't quote me on that.

#

Like 90% of the peeps on this thread use Blender, myself included.

junior raven
#

Will get better support using the popular tool

#

It's about time I learn

zealous wing
#

Well if you use Blender, download it from Steam and use the 2.93.8 version.

#

I say that, because you're going to need the Export to FBX plugin, and that don't work in 3.0+.

junior raven
#

Ok

zealous wing
junior raven
#

What does that do?

faint jewel
#

ewww

zealous wing
#

Lets you export to .X and FBX. Game uses both.

junior raven
#

Then the first one isn't needed

zealous wing
#

Ehh, you might be right.
Grab em both just in case, 3rd party things can break randomly.

junior raven
#

Good idea

junior raven
#

It's not showing anything when I import FBX files

#

Ok, some it shows, some it doesnt

junior raven
#

It doesn't export right either. The game isn't loading it.

#

Does it support multiple meshes?

zealous wing
#

What are you trying to do exactly?

junior raven
#

Modify an FBX file

#

Take an FBX model, add a mesh to it, and export it

zealous wing
#

You need to have it all one mesh.

#

Weird things happen when you have multiple separate meshes/objects.

#

In-game, either one mesh or the other will be there, and more likely neither because the origin's in a weird place.

junior raven
#

Okay, thanks

zealous wing
#

Yeah, join them together as a single object.

#

I guess that's one of Blender's idiosyncrasies. 😛

willow estuary
#

1 mesh + also one material/texture.

junior raven
#

Still not working

#

Only one mesh, only one material

#

Running Blender 2.93

#

Wait, there are two FBX export options

#

Yeah, that's not working either

#

I tried exporting with both of these:

#

Using the first FBX tool you posted

flint beacon
#

Does anyone know if anything is wrong with my code here? i keep getting an error when trying to craft the item.

function Random_Item_OnCreate(items, result, player)
   AddRandomItemToInventory({"CreditCard", "LightBulb"}, 0, 1)
   AddRandomItemToInventory({"Screwdriver", "Battery"}, 0, 1)
   player:getInventory():AddItem("Screws", 20)
end
crimson spindle
#

what does the error say?

#

I'm finally nearing the finish line for my mod... please enjoy this trailer I made for it: https://www.youtube.com/watch?v=gmJnkQWM_XY

Will you be able to find a cure for the Knox Virus? More importantly, will finding a cure be enough to get you published in a respectable journal? Embark on a journey to earn the respect of your peers... and save the world too I guess.

Based on my hardcore version of the Antiserum mod by b1n0m. This latest version features fully 3D items which ...

▶ Play video
flint beacon
#

@crimson spindle function does not exist

frosty falcon
#

is this in seconds or? trying to understand how it measures time since last seen, or just float time values in general

sweet tide
#

is there a function that checks what day/ and what month it is?

fair frost
#

Raccoon City Part 3

glacial flicker
#

I know this might be a very complicated thing, but is anyone working on a "working cameras" mod? like you know how outside the prison there are all sorts of machines in a place that are supposed to be security cameras/screens. How hard would it be to make them functionable and installable? I'd love to have one of those and a couple cameras around the perimeter of my base, for example. But it's not a thing yet, and I'm not sure if it'd be possible or how to go about if I wanted to modded it in.

drifting ore
#

I imagine you'd have to do some funky stuff

#

Like teleporting the player to the camera location

#

And making them invisible

broken fulcrum
#

Hello, I'm really new to this, I looked in mods which tweak loot spawn on zombies but didn't find the specific thing that I wanted.

How can I select only bald/short haired zombies to spawn with my mod's clothes?

queen leaf
#

I've heard that AutoTsar Motor club doesn't yet have a means of towing motorcycles, which I find to be a huge shame, because I love the motorcycles. If towing requires a special trailer/rig, how hard would it be to make it so that you can turn the Motorcycle into an item with, like, 75 weight or so that could be loaded into the trunks of large cars/vans/trailers? Too heavy to lift, but maybe there could be a command to transfer it directly into the trailer/trunk? Would that be an acceptable work around?

undone heron
#

I have the issue with traits as well. everything works singleplayer, but some times the server will send an error for multiplayer and yet still function.

vapid arrow
#

does anyone know how to fix the offset of the weapon when attached to the back?

crimson spindle
#

I have a custom definition for a zone defined and I have waaaay too many items spawning even though the loot rarity should be set to rare... how do I turn this down?

I want to be able to spawn maybe 4-5 items with chances of duplicates. Instead I'm getting 3x that much. What am I doing wrong?

#

ugh im trying to include an example but the character limit is too muhc

#

heres an example:

willow estuary
#

Yeah, 5 rolls is a lot of rolls + a lot of items in the list + a lot of those items have high spawn values?
= a lotta stuff spawning alright.

fast galleon
crimson spindle
#

so how do rolls work exactly.. would should this get tuned down? Do I actually need an item listed multiple times to get dupes to spawn?

zealous wing
#

Rolls = the amount of times the game will roll to add an item to the container.

crimson spindle
#

can more than one item be added per roll?

zealous wing
#

Basically when the container is generated for the 1st time, the game does some funky maff to determine what goes in there.

willow estuary
# crimson spindle so how do rolls work exactly.. would should this get tuned down? Do I actually n...

When items spawning is checked every item is checked vs a random number one time per roll.
More rolls, more checks.
The math behind the spawn chances is..... ...ugh, I'll let you look at the code yourself vs feebly attempting to explain it https://pastebin.com/ArNSSM2m

willow estuary
zealous wing
#

Honestly, trying to understand the math regarding item spawning is headache inducing. I've been at it for a few years now and even I barely understand it.

willow estuary
#

But the simplest solution would be to reduce your rolls to something lower, test, and see how you like those results.

zealous wing
#

👆

crimson spindle
#

alright ill give it a shot

zealous wing
#

Fiddle with the numbers, test, Fiddle with the numbers, test, etc.

willow estuary
crimson spindle
#

alright gotcha thanks

zealous wing
#

I've legit tried to math it out, and gave up when the math wasn't matching the game. 😄

willow estuary
zealous wing
#

lol

#

indeed.

willow estuary
zealous wing
#

@crimson spindle, be sure to test your mod under typical gameplay situations too. Like Blair said, zombies can mess with spawn chances too.

crimson spindle
#

jesus lol

#

thanks you both it was very helpful

zealous wing
#

Using the game's debug mode can help with not getting nibbled to death in the testing environment too.

#

Do you have a dedicated save for testing?

crimson spindle
#

i usually end up making a new save file and yeah ive been using debug mode to fly around invisible

zealous wing
#

Good, good.

#

A tip I can give you to sort the loot tables quicker is to delete the cell the container(s) are in between exiting to menu and loading the save. You'll have to work out the coordinates of the specific cell, then dive into the save game file in the File Explorer, then find the file with those coords and delete it.

#

For instance, I can tell you, from memory, that the Cortman Clinic in Muldraugh covers 4 cells: 1087_1002, 1087_1003, 1088_1002 and 1088_1003.

#

@crimson spindle So 1, load into the save. 2, judge the contents of the container. 3, exit. 4, fiddle with the values in your text editor and save. 5, delete the cell in the save, 6, repeat from step 1.
That's my process in this shindig. If there's a quicker/better way though that someone else uses, I'd love to know.

willow estuary
#

You can delete the map/world data in the savegame interface FYI.

zealous wing
#

I'll use that too, yeah. Often times though I've had to be more surgical.

willow estuary
#

Yeah, it's only good for clean sweeps? Great for testing vehicle spawning as well.

broken fulcrum
willow estuary
#

So you'd need a file in the shared lu directory like so

require "Definitions/HairOutfitDefinitions"

-- your new outfit hair definitions using the same formatting as in the vanilla file like so

local cat = {};
cat.outfit = "MY_NEW_MODDED_ZOMBIE_OUTFIT_NAME_HERE";
cat.haircut = "LibertySpikes:5;MohawkFan:5;MohawkShort:5;MohawkSpike:5"; -- total should not exced 100! anything "left over" will be a random haircut
cat.haircutColor = "0.98,0.87,0:10;0.82,0.15,0.07:10;0.21,0.6,0.3:10;0.26,0.6,0.81:10"; -- forcing a haircut color, total should not exced 100 anything "left over" will be a random color from our default color
table.insert(HairOutfitDefinitions.haircutOutfitDefinition, cat);

local cat = {};
cat.outfit = "ANOTHER_NEW_MODDED_ZOMBIE_OUTFIT_NAME_HERE";
cat.beard = "Long:30;Goatee:10;Full:10;LongScruffy:20";
cat.haircut = "MohawkShort:5";
table.insert(HairOutfitDefinitions.haircutOutfitDefinition, cat);
#

using the vanilla Bandit and Private Militia outfit entries as an examples here.

broken fulcrum
willow estuary
#

The probability, as a percentage, of the haircut spawning for that outfit type.

broken fulcrum
willow estuary
broken fulcrum
#

I was imagining a zombie with literally any outfit with bald or bald spot hair to have a chance of spawning with wigs, because when you have a big hair it glitches through

willow estuary
#

Yeah, that would require some custom lua coding to do. Not something that I can just cut and paste an example from a file for or anything like that to demonstrate?

broken fulcrum
#

Thanks anyway, I would not know about the outfits if it was not for you, I'll maybe just make the items craftable to not be jenky and poke through random zombies if I just add it to their inventory

#

Is there a way to limit the colours the item will spawn? like in the code you sent, I don't want to craft hair and it comes in a different colour every time

#

well, maybe I do, but it would be better if I could make different recipes if possible

drifting stump
#

z is chance of spawning
x is the chance per roll
y is number of rolls

#

used the wrong expression before

zealous wing
#

Missing about half a dozen variables, but in its most basic expression? Yeah, that.

#

Nearby zombies, Lucky/Unlucky, and world settings also play a role.

latent orchid
#

Do custom skills work with book bonuses? Just checking as I have created a new skill along with relevant skill books, yet they never gain any bonus modifier (little arrows next to the skill) when I read or finish the book.

zealous wing
#

Pretty sure you need to do some UI tweaking to get those - they're UI elements and not all of the skills have them.

undone heron
#

make sure you add the skill book multiplier under the right section

latent orchid
undone heron
#

check server -> XPsystem folder

latent orchid
latent orchid
#

Next question: Can you set/change a sprite's properties (tile definitions) via code? E.g. change the IsMovable flag for an object on a square

zealous wing
#

Turns out there's a fair few items in PZ that could realistically double as water bottles. 😄

zealous wing
latent orchid
#

Maybe start with a different question, is it possible to either get IsoSprite or IsoSpriteGrid without a square or object (i.e. the global reference of these)?

zealous wing
#

Hell if I know.

#

If you know what those words mean, you're better suited to finding out than I am. 😄

latent orchid
#

Lol...yeah sorry, I come from the mapping side, so those terms are quite bread and butter for me. They represent the tile properties we can edit in the Tilezed map editor. I want to force change the properties ingame for some sprites without having to override the actual vanilla 'tiledefs' via the editor.

zealous wing
#

Well IDK how much if at all lua can effect tiles. I know that it's possible to check to see if the character is standing next to a powered stove/fridge with lua, my cooking mod does that.

#

Are you wanting to know if a script can replace a tile with another tile?

#

because if that was possible the possibilities would be endless.

latent orchid
#

To map out the logic IsoSpriteGrid (tilesheet) > IsoSprite (tile) > Properties (all the various flags on how the tile acts ingame)

#

Im trying to edit any of those properties.

willow estuary
#

Ah, yeah, I don't know if it's possible, but being able to modify tile properties via lua the way script items can be is a personal holy grail and would allow for a lot of cool stuff.

latent orchid
willow estuary
#

Well, that is interesting and seems to imply that there are code allowances for that? I don't know offhand if that's for specific instances of the object or all instances however?

latent orchid
#

Yeah, I would be looking for all instances (globally change an oven's flag for example)

latent orchid
somber heath
#

ooo thank you

fast galleon
drifting ore
#

Ive got a question yall, if i add a mod midgame into multiplayer, will the server explode? talking about adding repair options to madax pack weapons

latent orchid
fast galleon
storm scarab
#

I thought I would ask, do you guys know any function that would work to make something client side only? I'm looking on making a zombie client side

fast galleon
#

or
not isServer()
so that it works for singleplayer

storm scarab
#

Ooh, so using this I could hypothetically make a client only zombie on a server?

thick narwhal
#

The driving skill and scavenger skill mod both have respective books

#

Oh nvm. Answered

latent orchid
fast galleon
#

I can unset, but not set, second string needs to be some value

#

works for things that have IsoFlag though

storm scarab
storm scarab
#

So I assume it's as easy as setting is server to false and is client to true?

fast galleon
#

I don't know much about adding zombies.

isServer() returns true only on server, so you can use that to check if it's server

storm scarab
#

Yes, but I'm attempting to make something client side only

#

So a zombie to only be seen by one person

chrome egret
#

Gratz on being featured by IS @late hound

storm scarab
#

Ie yourself

drifting ore
faint jewel
#

lol you is like 3 days late my dude.

strong nebula
#

I made a mod already but now want to update it and add some more features but I have no clue how to setup the Code Editor, I tried to set up IntelliJ Idea from Jetbrains with the wiki but an important step seems to be missing... 😅

help is greatly appreciated 🙂

chrome egret
strong nebula
#

I'll take a look at it, thanks 👍

tropic dirge
#

Anyone of you mind checking my message in the mod support channel?

somber heath
#

anyone has instructions on how to decompile java source of the game?
The link from this guide isn't working anymore
https://theindiestone.com/forums/index.php?/topic/61-robomats-modding-tutorials-updated-12112013/

sweet tide
#
local player = getPlayer()

local test = getClothingItem_Legs()

local test2 = test:getActualWeight() 


function player_say()
    player:Say("Hello World"..test2)
end

Events.EveryTenMinutes.Add(player_say)```
Im just messing around with  functions trying to get familiar with syntax, but im not exactly sure what im doing wrong here it keeps erroring on line 3 (getClothingItem_Legs) returns InventoryItem
#

probably a very simple issue but im still new to modding

somber heath
autumn flax
#

are there mods that add spawn spots into those small towns/villages that arent the main 4?

#

only thingy i have been able to find is louisville

past tinsel
sweet tide
#

worked cheers mate

past tinsel
#

I am working on a mod to create sandbox options to give more control over the sound radius of guns (the standard ones that come with the game). I know how to add a .txt file to overwrite the base game's items with new properties, and I know how to create the new sandbox options... But then I start having trouble. I can use Lua files to reference my sandbox options variables, but I don't know how to use Lua to change the base item properties (instead of, say, a specific item in a player's inventory, for example) that would be found in that .txt file. Can the .txt file reference my sandbox options variables (or other Lua file variables for that matter)? Or is there a better way to do what I'm trying to accomplish?

frosty falcon
past tinsel
#

Thanks for the suggestion. I thought about doing that, but don't those just add new weapons to the game (so they'd handle it all in that .txt file)? Hmm, do they also add sandbox options for how loud they are, sound radius, etc.? If so then you're right I should def look at how they do it 🤔

drifting stump
#

@latent orchid properties set through code are not persisted

#

And from all the testing i did never saw them being applied globally

drifting stump
past tinsel
#

That sounds like what I'm looking for! 😁

drifting stump
#

Not on pc right now but something like getScriptManager():getItem("itemName")

past tinsel
#

Ok thanks, that gives me a starting point to work from

drifting stump
#

getScriptManager():getItem("Money"):setActualWeight(0)

#

Found this from my messages

#

Keep in mind existing items arent changed

sick yew
#

I am at my wit's end.

#

I am completely unable to make a script that gives you the building key of the place in.

#

When I do, it only works 50% of the time.

#

Anyone here willing to help?

chrome egret
#

sup, mind elaborating?

#

What do you mean by building key, and what's the problem the other 50% of the time?

sick yew
#

Alright so, I have two mods.

#

One spawns you in the Riverside Pharmacy, the other at Cortman medical.

#

That part is fine, and I have some code that is meant to scan the building you are in

#

and give you the key of that building

#

And this works 50% of the time, I get a key and all is good.

#

The other 50% of the t ime I get no key.

chrome egret
#

Oh, the literal actual key for the building

#

not like a string key

sick yew
#

Yeah, the actual key of the building you spawn in

sick yew
#

so I took the code from a mod that I know works

#

But the same problem comes up

#

I'm at my wits end here.

chrome egret
#

Can you post a snippet of the code?

sick yew
#

I'll post the entire thing here brb

chrome egret
#

Or link to the source.

sick yew
#

This is the code I used, unmodified.

#

If I try to modify it it causes errors

chrome egret
#

Can you also show the GiveBuildingKey code?

#

Does the character get the key ring when they fail to get the building key?

sick yew
#

Download the entire code

#

as it's in there

sick yew
#

not sure if it's the default thing that happens when you spawn or if it's the mod

chrome egret
#

In vanilla you will start with a key ring, so it may not be necessary unless something else is doing work to remove everything

sick yew
#

Not sure man, I just need a piece of code that scans the building you're in on spawn

#

and gives you the key of that building

chrome egret
#

Yeah, well looking at this I would just add some print lines to GiveBuildingKey

#

to ensure you have all the needed values in keyRing, buildingDef, keyIdNumber, and key

#

if they're nil for some reason then it's liable not to work

sick yew
#

How does one do that? I'm a total noob with lua coding.

chilly beacon
#

I have a mod that adds a few tshirts and hoodies, but get an error when trying to wear head protection if the hood is up. the tooltip sys "replaces: hoodie" and instead of unequipping the hoodie when you put a hat on, the hoodie just vanishes with a stack trace. when looking into it with debug mode, i get this trace: I've coped the item definitions and xml files from vanilla hoodies so something else must by at play here.

chrome egret
#

simple stuff like after local buildingDef is declared, add a new line print("buildingDef value: " .. tostring(buildingDef))

chilly beacon
#

its referencing some base game code that I havent touched, that works with normal hoodies

sick yew
#

Like this?

chrome egret
#

yep

#

then you play around and figure out where the issue is

#

Reminder that errors and other print output should be going to your console.txt file

sick yew
#

alright, thanks

chrome egret
#

Sure thing. Don't hesitate to reach out if you need more assistance.

chilly beacon
#

does anyone know what might be causing a stack trace when simply trying to wear a hat? it feels like theres some function missing to unequip the hoodie but i cant see anything in the vanilla files that would control that

sick yew
chrome egret
#

I'm at work but try to check every now and then

chrome egret
#

mine is under my user directory on Windows

sick yew
#

Ah, excellent

#

Alright I'm back

chrome egret
sick yew
#

Isn't printing to console.txt

#

Any where I can learn how code lua for

#

project zomboid?

chrome egret
#

Can you confirm it loads your mod? Here you can see a line noting my mod is loaded, then some printing from the mod itself:

sick yew
#

Moment

chrome egret
sick yew
chrome egret
#

Do you have any previous programming experience? I didn't find it very difficult.

chilly beacon
sick yew
chilly beacon
#

which... I never touched, and I copied the initial clothing from working vanilla game files...

also the tshirts i added dont have this problem of wearing them and trying to wear something else that takes the same slot, it does as expected and just removes the tshirt

mighty ridge
#

I have a quick question/suggestion

#

but if it sounds way to far fetched then im sorry

#

but do you think it'll be possible to add pets into the game or companions?

chrome egret
storm scarab
#

Hey guys, I thought id ask if anyone basically knows the project zomboid equivalent to while true do

chrome egret
#

There are while do loops, can you not use a constant true value with a break?

#

Or simply store the value in a dummy variable

storm scarab
#

Well, i've tried it but each time I tried the game froze up

chrome egret
#

That means you didn't hit a condition that would break your loop

#

I did the same thing to myself

storm scarab
#

Well, what I mean is

#

For example lets say I have a while true that counts to 100 then ends

#

For those counting to 100, the game would freeze

#

as soon as its finished, the game returns back to normal

chrome egret
#

There's really nothing you can do about that other than minimizing the code you're running during the loop, or decomposing it into chunks that can occur over time. Your loop code is the only Lua code that is being run by the game at that time-- it must wait until your work is done (unless it trips one of the conditions to be killed, which is ofc not ideal)

storm scarab
#

minimizing the code?

#

uhh

#

nvm

#

got it

marble jay
#

If I want to just up the forage rate of one item (cockroaches) do I have to edit a table or is there some function or event I can override

#

This is for a server

trail lotus
#

Any vehicle devs looking to get involved on a pretty big project? You’d most likely be creating early 90’s-00’s American cars and trucks. and it would be large.

#

Pm for more details about it and we can talk about it.

dry quail
#

On the initial release of a workshop mod, is it normal that the workshop page seems empty? It's been a while since I've uploaded something and was wondering if that's normal. Also is it because it is awaiting for approval?

#

Nevermind I had files that didn't belong to the mod structure (error 2). All good now!

hollow pecan
#

Hi all, I have started a non-dedicated server with two friends and we would like to claim the fire station in Rosewood as our safehouse. However it is a spawn point. How can I claim the fire station ? I have admin powers.

sour lion
#

i think just changing the setting 'safehouseallownonresidential' might fix that

#

ive also painted areas as safehouse as admin if that isn't an option for you

hollow pecan
#

It did not fix that, because the fire station is a spawn location. I have even subscribed to a mod which "should" allow for claiming safehouses no matter what, to no avail

#

I have seen the tool to set a safe zone but since it is, again, a spawn location I can't validate that either

#

It's a shame because that fire station is really cool

#

I have tried setting a fixed spawn point for all players, in hope that would remove the other spawn locations, but no