#mod_development

1 messages · Page 152 of 1

quartz badge
#

everything is correct

nimble spoke
#

That is usually said before you find something you hadn't noticed before..... trust me, I know

quartz badge
#

im gonna test making it non-transparent

#

it worked

nimble spoke
#

if you saved it as 8-bit transparency is not the issue. What are the height and width values?

quartz badge
#

32x32

nimble spoke
#

uhhhhh ok haha

quartz badge
#

i export it as 8 bit rgba

#

and the game just doesnt like that

#

for some reason

nimble spoke
#

As I said I have no experience with GIMP, so I have no idea how it can mess up an 8-bit png file

echo fiber
#

ill make it for you

quartz badge
#

theres the one that worked

echo fiber
#

send me the transparent one

#

i can get it to work

quartz badge
dusty wigeon
#

id say just save as a png nothing special

echo fiber
# quartz badge

save this icon and try again, i did what i do for all my icons on it so it should work without an issue

quartz badge
#

ill see

#

it works now

#

thanks

echo fiber
#

no problem

#

i do alot of art i just use Krita for everything amazing program can save as any file type and lets you re format the image to anything you need

quartz badge
#

now i have to rig the model i made

#

this is going to be fucking horrible

#

do i need to make seperate models for when it is worn over a vest and worn just over a shirt?

echo fiber
#

quick question how do i get the char:say("") function to work

echo fiber
nimble spoke
quartz badge
#

i see

nimble spoke
echo fiber
#

thank you

#

that worked thank you ❤️

nimble spoke
# quartz badge i see

What you can do is to give your item optional ways of wearing it, and each option uses a different model, but players would have to pick the right option manually

#

Like wearing a jacket with or without the hoodie

quartz badge
#

ill just use one model for now

echo fiber
#

hey soul is there a way to randomize the say function?

nimble spoke
#

It uses a string as parameter so you can randomize a string for a variable and then Say(yourVariable)

echo fiber
nimble spoke
#

by using ZombRand(6) it is randomizing 6 possible values starting from zero, so when it returns zero you have no string to be used. To fix that you can simply use ZombRand(1, 6)

echo fiber
#

but the code still tells me ZombRand is incorrect, is that an actual thing in the game?

quartz badge
#

ok what is the proper way to export a rigged model

nimble spoke
#

Yes

echo fiber
#

still getting an error

nimble spoke
#

remove +1 if you're changing it to ZombRand(1, 6)

echo fiber
nimble spoke
#

which line is generating the error?

echo fiber
#

its whatever one it lands on im assuming

nimble spoke
#

Say, not say

echo fiber
#

god damn it lol

#

i hate caps

nimble spoke
#

You better get used to them haha

echo fiber
#

xD will let you know if that worked

#

it works! thank you soul!

#

❤️

abstract garden
#

can someone help me if how to remove item in backpack code in in zomboid if we have
getPlayer():getInventory():Remove("Item")

whats the syntax for Backpack inventory

fast galleon
#

This should check also other containers in the players inventory

abstract garden
#

thank you Dane

sour island
# echo fiber

ZombRand excludes the last number -- you want ZombRand(6)+1 to make it 1-6

#

ZombRand(1,6)+1 would be 2-6

#

ZombRand(1,6) would be 1-5

torpid jackal
#

Hello

#

I want to modify my game to make it more realistic by removing the expiration of the jars
How should I modify the following item for example?
thanks in advance

#

item CannedBroccoli
{
DisplayCategory = Food,
Type = Food,
DisplayName = Jar of Broccoli,
Icon = JarGreen,
Weight = 0.5,
DaysFresh = 60,
DaysTotallyRotten = 90,
OnCooked = CannedFood_OnCooked,
IsCookable = TRUE,
MinutesToBurn = 120,
MinutesToCook = 60,
StaticModel = CanClosed,
WorldStaticModel = JarFoodBroccoli_Ground,
}

#

i don't know if it is the good place for this question

blazing pond
#

hey can i ask anyone here how to add animations into the game?
tried following a guide made by dislaik and it didn't work even when just using the provided animation mod

echo fiber
echo fiber
torpid jackal
#

@echo fiber Yes and if i delete those two line the item become non perishable ?

#

like this ?

#

item CannedBroccoli
{
DisplayCategory = Food,
Type = Food,
DisplayName = Jar of Broccoli,
Icon = JarGreen,
Weight = 0.5,
OnCooked = CannedFood_OnCooked,
IsCookable = TRUE,
MinutesToBurn = 120,
MinutesToCook = 60,
StaticModel = CanClosed,
WorldStaticModel = JarFoodBroccoli_Ground,
}

torpid jackal
#

@echo fiber Perfect Thank you

echo fiber
torpid jackal
#

@echo fiber Thank you
For the moment I'll keep it simple

red tiger
#

Markdown makes things pretty.

bronze sinew
#

Is there a way that a trait can make you see only black and white? Like the blind mod but without the perception radius thing just a black and white filter?

red tiger
#

I don't think that you can take away the hue though.

#

(Saturation)

#

MB

bronze sinew
#

Alright, I wanna make it where when you choose the bull trait for my mod, it makes the game turn black and white like the mask does lol

#

I’ll probably try and find a way or something. I could try to contact the person who made the blind mod and ask them

bronze sinew
#

Also is there any chance that you know a guide or something on how to make a custom occupation? Once I get Richard working in game I’m gonna tackle that next lol

red tiger
timber river
bronze sinew
#

Yeah I was thinking of doing that. I probably won’t start it until Friday or so because the texture is gonna take forever

red tiger
#

Never a better time to try ideas you have on how to solve your problem.

#

The only way to learn something is to get to know what it is and not what someone says it is for them.

bronze sinew
#

True

#

I plan on finishing this mask, then doing the occupation and traits, and then just spend a week or so making every mask I wanna add and do the textures afterwards

red tiger
#

Planning out each step is a good aid in completing your project.

#

Sometimes I use UML to help plan my frameworks and APIs.

#

Even if you don't find the solution you're working for, it'll often times give you ideas for new projects that'll be pretty cool.

#

=)

dusty wigeon
#

i need a little bit of help as i dont understand why i would have this issue with my mod that i created and i do want to fix it. I hads a comment from someone that used my mod which i will put a pic of and so i tested it and you can rip the sheets but you dont get the ripped sheets back. I am unsure how my mod could have affected this. also unsure hwat he is talking about in the second part.

#

-Ripping Clothes now with this mod not working and the big pods with food etc not working also. ¿Possible compatibility issues?

#

this is the entire recipe code i wrote so i could get items back for my mod. ```fix
Recipe.OnCreate = {}

-- for returning baking tray
function Recipe.OnCreate.PackageMeth(items, result, player)
player:getInventory():AddItem("Base.BakingTray");
end

-- for returning cooking Pot
function Recipe.OnCreate.BakingTray(items, result, player)
player:getInventory():AddItem("Base.Pot");
end

function Recipe.OnCreate.Pot(items, result, player)
player:getInventory():AddItem("Base.Pot");
end

-- for returning Baggy
function Recipe.OnCreate.Baggy(items, result, player)
player:getInventory():AddItem("KIDrugMod.Baggy");
end

-- for returning Box
function Recipe.OnCreate.Box(items, result, player)
player:getInventory():AddItem("KIDrugMod.Box");
end

fast galleon
dusty wigeon
#

ok how would i mmake it so that tthese are added to the recipe list without affecting it

fast galleon
#

skip that line
use

require "recipecode"
dusty wigeon
#

ok

fast galleon
#

technically you don't need the require, unless a mod overwrites that file.
Also you can use any global functions, so it doesn't need to be in recipe.

dusty wigeon
#

ill go test that. any idea what he meant by the big pods with food? I thought maybe coking pots with food but it works fine for me

fast galleon
#

It could be related to removing those function? no idea

dusty wigeon
#

hopefully

reef karma
#

hey guys! Is there an event that can be used to detect when sandbox options are changed? I am trying to update the values without having to restart the server everytime

red tiger
#

The best you can do from what I know is periodically check them.

reef karma
#

yea that is what i thought.. worth asking tho lol. thank you

#

how impactful would it performance wise to check every min? (just curious)

primal vapor
#

Hello, I need to create and change a variable on another player, I suppose I need to use GlobalModData for this?

red tiger
#

What if I made ComputerCraft, but instead for PZ?

#

I don't see that anyone's done this.

quartz badge
#

anyone know what this error means?

frank elbow
#

I'm working on a mod for playable games & realized I could theoretically use a lot of the code I wrote for computers, but decided not to bother since it wouldn't be a complete implementation. Programmable ones would be neat

red tiger
#

(Screams in 1993)

frank elbow
#

I was thinking BASIC, lol

red tiger
#

Could simulate both.

#

Sandbox the hell out of it.

#

I don't think programming on those computers would be planned.

#

(Writes full-blown OS for PZ computers)

frank elbow
nimble spoke
sour island
#

I remember that preview

#

Cool stuff

hollow lodge
#

does anybody now how can I add distributions on Large Metal Shelves? I want my gloves to spawn there

#

what would it be the container name?

#

--GarageTools
table.insert(ProceduralDistributions.list.GarageTools.items, "MoreGloves.NitrileGloves");
table.insert(ProceduralDistributions.list.GarageTools.items, 0.15);

#

I got the garage tools, but idk if it's the same

red tiger
fast galleon
hollow lodge
#

nvm, I'll just borrow some distributions from another mod that spawns where I want

fast galleon
timber river
#

I'm trying to troubleshoot a patch for the insurgent mod, anyone care to take a gander at it? I feel like fresh eyes might be able to see something I don't.

Basically what it should be doing is overwriting the InsurgentBeginGame function found in InsurgentMod.lua so that the function first spawns a few items into the player inventory (parachute, knife, etc) and then looks for a backpack. If it finds the backpack it adds items to the backpack, otherwise it adds those same items to the player inventory. I'm not getting any errors, I know the file is loading after the file it is meant to overwrite, but it isn't doing what it is supposed to.

I've already successfully used a varient of this bag checking inventory spawning code to add loaded magazines from the various loadout traits to the backpack if found so I know it works in theory. Any help would be appreciated

bronze sinew
timber river
bronze sinew
#

Same here man, I literally learned how to kinda add a object last Saturday and I was following a out of date tutorial lmao

#

And last night I just learned how to texture a model, you’ll get better though!

frank elbow
red tiger
#

I wonder if it was scrapped.

frank elbow
#

I'd assume backlog if anything

#

It (that video) was in a blog post a few years back and devices used to be mentioned every once in a while I believe, but haven't heard anything abt them in some time

bronze sinew
#

Im making a mod that adds all the masks from Hotline Miami, a 50 blessings occupation with a custom trait that when you kill zombies it lowers your characters sadness and anxiety, and the masks have a perk when you get the trait. Basically the trait for Richard is no skill bonus or anything, and Aubrey spawns you with a shotgun and +2 aiming

ancient grail
#

There are characters? So this is for sp?

#

Or just male female?

#

Sounds very doable . Where are you on the code?

red tiger
frank elbow
#

Just making it extra clear

ancient grail
minor wharf
#

I've been looking at other mods recently trying to figure out how they work. I noticed in one mod that the creator creates a custom .tiles file that overwrote the games default tile file for a locker in the game. This allowed them to add an inventory to an item in the game which previously did not have one. Im trying to figure out how to do this type of modification in zomboid, but I haven't been able to find any documentation related to this. Does anybody know how I might go about this?

frank elbow
#

This sounds like something you'd do with TileZed, but I'm uncertain because I haven't used it myself

frank elbow
minor wharf
reef karma
#

I am trying to play a sound with this
getSoundManager():PlaySound("Testfile" .. ZombRand(1, 5), false, 0.1)

#

My sound files are Testfile1 .. Testfile4, that is why the ZombRand()
I am getting playsound of non-table. am i using PlaySound wrong?

frank elbow
#

Can you show the exact error?

reef karma
#
ERROR: General     , 1681940351697> 56,240,412> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: PlaySound of non-table: null
        at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1689)
        at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:641)
        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:65)
        at zombie.GameTime.update(GameTime.java:680)
        at zombie.gameStates.IngameState.UpdateStuff(IngameState.java:566)
        at zombie.gameStates.IngameState.updateInternal(IngameState.java:1623)
        at zombie.gameStates.IngameState.update(IngameState.java:1333)
        at zombie.network.GameServer.main(GameServer.java:903)
LOG  : General     , 1681940351697> 56,240,413> -----------------------------------------
STACK TRACE
-----------------------------------------
function: CyclePhases -- file: CBTSMain.lua line # 111 |```
frank elbow
#

And you're calling it exactly like that? That implies getSoundManager is returning nil

reef karma
#

yep I copied that line and pasted it here

frank elbow
#

Which I guess would mean it's not ready yet? I'd have to check to see whether that's possible, but that's my assumption

#

If that's the case then if you try it within an event listener such as OnGameStart, presumably it'd work

red tiger
frank elbow
#

Lua has .. for string concatenation

red tiger
#

Okay PHP.. Calm down..

frank elbow
#

It should be able to concatenate without tostring, too

red tiger
#

I remember having to encase my string concatenations to nil protect the result.

frank elbow
#

Ah, yeah idt it can concat nil but it definitely can concat numbers

red tiger
#

Fun fact: TSTL compiles Typescript to do just that as well.

#

Actually if the metatable doesn't support this operation on anything, it'll throw a fit.

#

You know.. like a child without good parents.. just like Lua.

frank elbow
#

The (default) string metatable certainly does

red tiger
#

You could do some freaky stuff with primitives in Lua.

frank elbow
#

Yup, debug.setmetatable is a terrible beast

red tiger
#

People are caught up in JS magic but Lua is a lot stranger.

reef karma
#

so what am supposed to do again to try and fix it ? i feel like it should just work but clearly does not lmao

red tiger
#

It's like Wild-West cowboy logic.. but in Siberia.

frank elbow
#

Try it from an OnGameStart event listener

#

Or just check for nil

#

i.e.,

local soundManager = getSoundManager()
if soundManager then
  -- play the sound
end
red tiger
#

pcall is a fun way.. Lua's try/catch.. or something like it..

#

SoundManager should NEVER be nil.

#

That means something's really screwed up in the game's core.

frank elbow
#

The above error says otherwise

red tiger
#

It's a static method IIRC.

frank elbow
#

It's possible that it's not initialized when scripts load, but I don't know without looking

#

Likely returns a private static variable (which may not be set up yet)

reef karma
#

so i am calling it straight from the lua command line to see and it works fine

red tiger
#

You're calling it correctly.

#

You're using an instance.

reef karma
#

i was just checking
i called in on my dedicated server. i wanted to make sure eveything was loaded right lol. first time so i have doubts

red tiger
#
public Audio PlaySound(String var1, boolean var2, float var3)
frank elbow
#

I just checked & the sound manager is initialized when the main thread is initialized, which should be before scripts run

#

So yeah idk why that'd be the case

red tiger
#

This method is not null-safe.

#

I think that you'll need to double-check your sound-file name and location.

#

I'm assuming it's your code that's breaking first.

#

The stack won't help you much here.

frank elbow
#

The error is saying that the value PlaySound is being called on is nil

#

So it shouldn't even be reaching the call

red tiger
#

Since there're no sanity checks / asserts on the APII call, it'll be harder for you to diagnose.

#

I also only know one call.

reef karma
#

this also works in SP .. but not in MP

frank elbow
#

Are you calling it from a Lua file in server/? (I think it should still work, just wondering if that could be a factor)

reef karma
#

only got one file lol but yes media/lua/server/Main.lua

#

and sound is under media/sound/Testfile1.ogg

red tiger
frank elbow
#

Oh, huh. The server loads Lua files first

red tiger
#

Burden of proof thing.

#

Also the server shouldn't be trying to play sounds.

#

Send this info through a onServerCommand call.

#

Let the client play it.

reef karma
frank elbow
#

Nah this actually seems like a strange load order thing

#

Did you run this from within an event, or just in the main scope/in a function that's called in the main scope?

red tiger
#

I thought this was being executed on the client before that statement.

#

It's a generally known thing that server Lua code is really bad right now.

frank elbow
#

I assumed so as well but figured that could be a factor

red tiger
#

It's not something I'd simply apply to any of my mods.

#

I follow the rule that if anything can be executed on the client without an issue then I push that as a server command.

frank elbow
#

The implementation of PlaySound is a no-op on the server anyhow, so even if it worked it wouldn't work @reef karma

reef karma
#

i see, so it no worky if in server/

red tiger
frank elbow
#

Yeah. The reason it works in SP is because the server files still run, but in a non-server and non-client context (so the check for it being a server is not true)

red tiger
#

You're probably thinking of how you can write Forge, Paper, or Spigot plugins on Minecraft and how they can do that... because they actually made a solid API.

#

This is a different thing.

#

If you were Java-patching the server, you can totally send a sound packet by building it manually.. The Lua however...

reef karma
#

I am very very new to all of this so now i gotta figure out how to play it in a different way and i got no clue

red tiger
#

Whatever you do, do not base your ideas of how modding works off of PZ.

#

</warning>

frank elbow
#

You'll want to play sounds from a Lua file in client/

rancid panther
#

the complaints and questions on my mod suddenly coming in fast

reef karma
rancid panther
#

i should probably make the description more clear but im way too lazy for that since i havent done anything with pz for a few weeks

white hatch
#

I was testing the mod folder structure of the game but now the game not open, and can't find out why

#

only happens when my mod is enable

calm depot
#

java.lang.OutOfMemoryError

white hatch
#

This could be cause by a syntax error, right?

calm depot
#

either you're adding so much crap that there simply isn't enough heap space or you have some sort of error, yes

#

whether it be invalid syntax or valid syntax that creates some sort of infinite loop

white hatch
#

Ok, let me check

#

i find it

#

thanks!

red tiger
#

A lot of this same mistake lately..

#

Also:

Hello, World!
#

This helps whoever might be helping you out.

#

I am a broken record about this because images are hard to work with unless you're only reading it.

#

So isn't me slamming on newbies. (Just a disclaimer)

minor pumice
#

Hello all! I'm trying to make a mod, is a simple level up sound replacer but can't make it work

sour island
minor pumice
timber river
#

so I've got this that works:
inv:AddItems("Base.AlcoholBandage", 3)

could I do the inverse as well?
inv:RemoveItems("Base.AlcoholBandage", 3)

or would it be something different?

ancient grail
minor pumice
sour island
#

Are you enabling the mod from the main menu and loading a save?

minor pumice
#

enable from the mods menu after loading the save

sour island
#

Under [ More ] ?

nimble spoke
minor pumice
sour island
#

Under load game, if you're using an old game you need to add the mod there

#

Otherwise start a new game and it will use the mod menu's mod list - or you can edit it there too

timber river
reef karma
#
for PlayerIndex = 0, getNumActivePlayers() - 1, 1 do
        local Player = getSpecificPlayer(PlayerIndex)
        print(Player)```
hey guys, is there any reason for Player to be nil ?
GetNumActivePlayers() returns 1 (i am the only one on) so that works
minor pumice
ancient grail
#
getSoundManager():PlayWorldSound('GainExperienceLevel', getPlayer():getSquare(), 0, 5, 5, false);  

#

run the game in debug

#

then try this

#

if you hear your audio then it works

#

if it doesnt then maybe try again

#

or may try wav file

ancient grail
minor pumice
#

awwwwww

unborn radish
#

Daily bump for this unsolved issue

frank elbow
#

I'm sleeping soon so I likely won't be the one to answer anyhow—just saying more detail is preferable to just a bump

unborn radish
fading horizon
#

idk if this is better here or in modeling

#

but what do y'all typically do when making icons for items that are dark

#

like i'm making this an icon for example

#

but it wont stand out against the inventory background

#

what do y'all usually do to make it stand out?

#

a white outline?

bronze yoke
#

what does vanilla do?

#

i'm sort of expecting 'nothing'

fading horizon
#

idk i haven't played vanilla in like two months ive just been modding

hot patrol
# fading horizon

I'm not much of an icon guy but have you tried maybe a subtle white outline around the icon?

#

Vanilla doesn't do anything with darker items

#

That's why when you are wearing a black duffel bag it is nearly invisible on the backpack bar

fading horizon
#

hmm okay okay

#

ill try that right now

#

i also lightened up the middle to hopefully make it stand out a bit more

#

finally got the backpack working in game if anyone remembers me struggling lol

#

huge thanks to sapph and glytch3r for helping me get it to work

bronze yoke
#

ooh nice!

fading horizon
#

idk it looks a little strange with a white background

#

i guess this looks decent enough?

#

what do y'all think

undone tapir
fading horizon
#

or i could just scrap the wings entirely

#

have it just be the coffin icon

#

would be more identifiable i feel like

ancient grail
#

But can you fly?

ancient grail
fading horizon
#

i like this much better

fading horizon
#

lmao

gusty vortex
#

Os there any way yo optimize the zeds?

hot patrol
# fading horizon

That looks good. It's visible which is the most important. I hate how dark items are so hard to see in the game.

#

And the model looks great

fading horizon
#

that's why i went with the border in the end

#

i looked at the socks item i was wearing and it was totally invisible bc it was black and i was like

#

nah i can't have that

#

especially when it's a container that people need to click

#

and thank you! I'm happy with the model

#

i'm making it better and better

#

now it has some texture

ancient grail
#

helicopter mod?

gaunt meteor
#

where do the trait loadouts get saved on the client?

#

(the sets of trait builds we can save in the dropdown menu)

#

nvm found it, its in zomboid/lua

minor pumice
#

hey guys I just published my first mod! 😄 thanks for your help of course!
is there a channel to share the link to it?

torn igloo
#

my ISScrollingListBox is not showing a scrollbar, any potential reason?

neon bronze
#

Not enough items in it?

torn igloo
#

plenty of items

unborn valley
#

Hey guys, I have never modded a game before. But I am interested in doing some things for Project Zomboid.

GOAL: I want to know where to place a RightClickFix.lua file? I plan on making this available on the Steam Workshop.

WHAT DOES IT DO? When you are using melee on zombies and release the right-mouse the context menu annoyingly pops up in the middle of combat. I want to make it so if you hold the right-mouse longer than 0.1 seconds the context menu will not open.

Where do I put this? What file location or how to I set it up for players to download on the steam workshop? Even a good google search phrase will help! (Thanks!)

torn igloo
torn igloo
timber river
unborn valley
# torn igloo Look at your C:\Users\\<user>\Zomboid\Workshop

I did that... and I've been looking online.

I am a very amateur/beginner programmer. I used ChatGPT to help with this... lol.

Do I need to reference the ISContextMenu.lua or any PZ core lua file?

And is this the proper way and folder to place it in?

(sorry & thanks)

timber river
unborn valley
# timber river Does your mod actually work or have you not been able to test it yet
-- Define the time threshold in seconds
local TIME_THRESHOLD = 0.1

-- Define a variable to store the time when the right mouse button was pressed
local rightMouseDownTime = nil

-- Intercept the mouse press event
function onMousePress(event)
  if event:getButton() == Mouse.RIGHT then
    rightMouseDownTime = event:getTimestamp()
  end
end

-- Intercept the mouse release event
function onMouseRelease(event)
  if event:getButton() == Mouse.RIGHT then
    -- Check if the right mouse button was released within the time threshold
    local rightMouseUpTime = event:getTimestamp()
    if rightMouseDownTime ~= nil and rightMouseUpTime - rightMouseDownTime < TIME_THRESHOLD then
      -- Show the context menu
      ContextMenu.showContextMenu()
    end
    rightMouseDownTime = nil
  end
end

-- Register the event handlers
Events.onMousePress.Add(onMousePress)
Events.onMouseRelease.Add(onMouseRelease)

I have not been able to test it yet. I dont see it show up in the Mods in PZ

timber river
#

Got it, give me a sec, I will get you the guides

unborn valley
#

thank you

#

I've been to the following sites so far:

• https://pzwiki.net/wiki/Modding
• https://theindiestone.com/forums/index.php?/topic/16535-help-how-to-upload-project-zomboid-mods-to-workshop/
minor pumice
minor pumice
timber river
# unborn valley thank you

https://github.com/FWolfe/Zomboid-Modding-Guide

Give this a read through but for right this moment you need to structure your mod correctly (Mod Structure section)

I'd recommend grabbing a mod out of your WhateverDriveSteamIsIN\steamapps\workshop\content\108600 folder and using that as a general reference for mod structure.

For testing, I always use my mods folder In C Drive (C:\Users[whatever]\Zomboid\mods), it will show up in your mod list if you place it there.

For when it is ready to publish, move your finished mod over to C:\Users[whatever]\Zomboid\Workshop, you may need to fiddle with it a bit (there is extra mod structure steps for this, as well as proper preview image requirements) and use the in game workshop publisher (Workshop from the main menu)

GitHub

Guide to modding various aspects of Project Zomboid - GitHub - FWolfe/Zomboid-Modding-Guide: Guide to modding various aspects of Project Zomboid

minor pumice
unborn valley
timber river
frank elbow
#

There are resources in the pins and threads of this channel that can help you learn. I also recommend reading through "Programming in Lua"

minor pumice
frank elbow
#

I think most people tend to post it here and in pz_chat or general_chat. As long as you don't go overboard with the text (just a link and a short explanation should suffice) no one will mind

minor pumice
timber river
#

If you use chatGPT, it is really only good for a novice (like myself) to get existing code explained, ask questions about pieces of code, veryyyyy limited, pointed edited to existing code (with small snippets of reference material so chatGPT knows a bit about what is going on). But it has to be extremely small and limited in scope. It is wholey inadequate to just say "Hey chatGPT, make this mod for project zomboid pls"

#

And for a set of "eyes" to spot any syntax errors you might have made. Pretty useful for that.

unborn valley
#

@timber river @frank elbow

I understand ChatGPT is not perfect and will need correcting. I've done a little C# programming in Unity Engine one my own titles from scratch, but I was never very good at adjusting my code to match other API's.

#

I just figured this right-click onMouseUp() would be a simple enough mod to get my feet wet... and it drives me insane when playing the game and the context menu pops up in the middle of melee attacking zombies.

timber river
#

Yea if you have a bit of experience you'll be good

sick bluff
#

Chat gpt has an database cutoff from.september 2021, use perplexity ai for code that needs to be up to date

#

Specially with the crafting rework that is soon to come

frank elbow
#

You can do what you wish, but I think familiarizing yourself with the API would be far more helpful than asking a language model to generate code that you'll ultimately have to considerably adjust

#

Looking at the code of existing mods is a good way to start

timber river
unborn valley
drifting cipher
#

Tell me, is it possible to remove the choice of a piece of clothing at the start when creating a character. If the setting is "all clothes are available".
Someone made a mod?

unborn valley
timber river
#

File is reference material from the Insurgent Mod
I could use a bit of help here yall. I'm working on a proof of concept patch for Insurgent mod. This (to my understanding) is the function that is called when a player is spawned with the insurgent profession. It adds items directly to the player inventory.

At the bottom is code to call this function OnNewGame. I've tried removing this (replacing it with my own function that will do a similar thing) failure(don't understand why)
I've tried overwriting the function to do what I want it to do failure(apparently one cannot overwrite a local function)

I'm currently looking for a way to just brute force this and just remove the items added by this function using my own function (that will then add its own items where I want them). Anyone have any insights into this? Ever dealt with removing items that can give me a nudge in the right direction? (Soul mentioned a function he knew of but that's been buried so I'm waiting for more info from him)
Know why this function is still being called even though it has been removed from the event?

bronze sinew
sour island
#

The require should ensure their file is loaded first -- which it needs to be in order to call on to change stuff around.

timber river
# sour island The require should ensure their file is loaded first -- which it needs to be in ...

Yea I've gone through a few different scenarios to try and overwrite this function, can't say I 100% did require but I fore sure got my file to load after the original file (with the same function name, etc) but I couldn't get it to actually overwrite (my code is totally inundated with print() lines now to see what was failing haha)

so can I overwrite local function Code in Original.lua with local function Code in PatchOriginal.lua? I forget where I read it but apparently it might not be possible to overwrite local functions like that?

sour island
#

If the function is local you cannot overwrite it using preferred methods.

#

You'll have to name your file the exact same name, and place it in the exact same folder. This will overwrite the entire file and is generally to be avoided.

#

Is the mod author not available to perhaps make their mod friendlier to adapt?

timber river
sour island
#

I mean, it would make their life easier to know -- then their mod would have a bit more longevity to it

#

If they don't want to inundate the global table but still make their functions accessible they can make it a returnable module.

#
local anyName = {}

function anyName.doThing() end

return anyName

to call on it:

---has to include/match the Lua sub-directory the file is from
local thisThing = require "client/file where anyName is"
thisThing.doThing()

@timber river Written on the phone -- if you wanted to forward him/her this info.

timber river
#

Yea I'll get a little group chat going with them here shortly

#

thx for the help as always chuck!

sour island
#

No problem, always nice to see modders adding onto each others work

wet sandal
timber river
#

Inability to modify the InsurgentBeginGame function is the real issue here, don't need to mess with events if that could be changed

wet sandal
#

Ah, I didn't see the DM

#

I can just make it accessible in an update for you

sour island
#

Oh it's yours Notloc - didn't know 😅

timber river
#

Haha I would have tagged him but you know how some folks can be about server pings 😂

#

I appreciate it Notloc!

stone garden
bronze sinew
#

Is it possible to add a paintable symbol to the game? Like the ones you can paint on walls?

bronze sinew
#

Thanks man!

red tiger
#

Good morning.

wet sandal
sour island
#

Ah, nice

red tiger
wet sandal
red tiger
#

This is a lateral planning problem that needs to be thought about throughout both the planning and production phases.

#

One suggestion that universally works for the people I taught code is to write your code for others to read and understand it. (Even if this isn't the case)

#

If it takes you more than 2-3 seconds to understand the code that you write after not seeing it for a couple weeks, write comments to explain the process.

#

If your code is very nested, break it up into functions that gives human-legible names that are simple.

#

If you have too many parameters for a function, consolidate them into tables.

#

If you have files with more than a thousand lines in it (or 2K with documentation), consider breaking it up.

#

These are rules I suggest to people who ask me how to improve their code.

timber river
#

Me... just asking chatGPT to explain it cus chatGPT doesn't judge and won't call me stupid for not knowing the simple stuff

red tiger
#

Trust people with more than a decades' experience, not some silly bot that can't make explicit and decisive statements.

timber river
#

clearly my friend... you have spent zero time in the Arma 3 mod community stressed

red tiger
ancient grail
red tiger
#

Had my fair share of modding communities. Every community has people who think they know what's the right answer when programming literally exists because there's no singular right answer. =)

stone garden
ancient grail
#

Really now? If thats true then shouldnt you be learning to mod?

red tiger
#

When I taught people to code, I taught them that the answer is more personal than official.

wet sandal
#

I am not that organized

stone garden
#

:/

ancient grail
#

Yeah so much for determination huh?

red tiger
willow estuary
red tiger
#

@wet sandal

#

Maybe UML can help too.

wet sandal
#

Yea I make UMLs and plans for highly specific bits when I get stuck or have a problem

red tiger
#

I use this. It's a very unpopular tool in modding communities because it means more work. It's like being at a job sometimes working for big company projects. You'd be surprised how much insight a graph could give if you visualize it.

wet sandal
#

But in general I don't have the attention span for full project planning

red tiger
#

Modding is about having fun.

#

Maybe that's what you're doing but not realizing it.

#

I do it all the time. 1000% guilty.

#

Planning is also taking care of yourself throughout the process.

#

The number one thing I saw tearing apart people when in Programming courses was these unrealistic and impossible expectations to perform well or know something or be good at something they haven't tried or won't need when programming.

#

So think about those things too. Maybe your code doesn't need to be cleaned as much.

red tiger
#

Maybe your code is already good.

red tiger
#

There's so many ways to organize your projects. Find one that feels comfortable with you and try it out. See if it works. Modify it to suit you.

wet sandal
#

I'm like 99% sure I have ADHD, just on a waitlist for over a year now >_>

#

So I do things in a way that keeps me interested

ancient grail
#

You have a point. I usually have high tolerance for people but its just not right to take advantage of people . And im not lashing out . Im just trying to make em see whats wrong with what his doing. And also offered to teach him to mod alot of times. .

Anyways wont happen again

red tiger
#

I put myself in dark rooms and only have a screen in front of me with the code.

#

Ambient music, beats with no lyrics, halogen lighting.

#

Hope those suggestions helps you in some way. =)

sour island
# stone garden no because im lazy

Being realistic, your idea is complex and specific, you are not looking to do it yourself, and not willing/able to pay -- I don't think you're going to find someone who happens to like your idea so much that they spend weeks on it.

stone garden
sour island
#

I was not planning to do that, no

willow estuary
stone garden
#

i just wanted to be funny :(

quartz badge
#

does anyone know what could be causing this kind of problem? i created a clothing item that uses no tint, yet when I spawn it it has a tint, and if I wear it it disappears and if i drop it it temporarily makes me invisible

#

nvm my item names were not matching

quartz badge
#

how do you create a contextmenu?

civic forge
quartz badge
#

does anyone know how to remove the "ContextMenu_" before the option?

blazing pond
#

i've come here for help because i'm apparently a brainlet and can not create my own mod

#

anyone willing to help me?

fading horizon
#

finally got all my backpacks working

#

i found out if you use multiple textures / icons for the same item to get different colors, the world ground model will be the same texture regardless

#

so i had to create different items for each color

dusty wigeon
#

under the lua/shared/Translate folder create a txt doc that is called ContextMenu_EN or whatever language you make it

quartz badge
#

pretty sure you have to define them

#

more than just making a name of a button

#

idk how though

dusty wigeon
#

If I was home I'd sit down and show you what I'm saying

sour island
#

Rush is correct

dusty wigeon
#

So for your translation it would look like this.

ContextMenu_Pants Tucked = "Pants Tucked"

#

I've had this exact issue several times with my mod before I even posted it so I get the frustration

quartz badge
#

I did

#

The button got all fucked up and i couldnt wear them anymore

sudden mauve
#

I wanna get involved with the modding community, idk about coding but i know how to design 2D stuff, like thumbnails, icons and huds

blazing pond
#

hey why does this happen?

undone tapir
#

Life force being sucked out by a skin walker.

ancient grail
ancient grail
ancient grail
ancient grail
blazing pond
ancient grail
#

The animation ?

#

You can just open up one of the animation files and just randomly play with the models animation

echo fiber
# sudden mauve I wanna get involved with the modding community, idk about coding but i know how...

so shockingly the game is not 2D, the icons and some other small things are but most are 3D models in low poly, if you do still wish to learn i suggest 3 programs to help you get started!

Blender - 3D modeling program Free and amazing

Krita - amazing for anything on the 2D side of things

Visual Studio Code - anything and all things for coding!

now for creating a mod its self you will need to learn the file structure a bit as if you mess one thing up even a missing letter or CAP letter the mod breaks. so for examples i suggest looking into other peoples mods to see how they have there folders set up, and you can even use some of them to learn how the code is written but amazingly you can also just look right into the games files for 100% of all of the codes there is also a website that gives you every code that PZ uses to call for in the code special terms like ZombRand (random function making it so what you call is random) if you need further help i dont mind stopping what im doing to help you out 🙂 hope this helps!

fading horizon
#

which one of these do y'all think looks better?

undone tapir
#

First

sudden mauve
echo fiber
#

okay i actually might need help here XD

trying to damage the player threw a function, atm i have

bodyDamage:setHealth(math.max(((bodydamage:getHealth())-(0.5)),0));

but it keeps breaking, is it not bodyDamage? or is it stats?? or am i writing this all wrong?

#

wait i have a lower case one sec let me try again

bronze yoke
#

it's setOverallBodyHealth, not setHealth

echo fiber
bronze yoke
#

it's a method of BodyDamage yeah

echo fiber
echo fiber
bronze yoke
#

if you just want to damage the player i think ReduceGeneralHealth(damage) is better

echo fiber
bronze yoke
#

just bodyDamage:ReduceGeneralHealth(1)

echo fiber
#

will try that now! thank you albion!

echo fiber
#

players can now OD on drugs haha

#

so quick question on a balance for drugs, wanted to make it a full OD on a random function hit, i have the whole code down and it works but wanted to know if a 1/50 chance to OD on doing the drugs is to harsh? like it makes you ask should i use it but do you think full death is a bad balance or should we go with like half damage for it?

blazing pond
#

idk if it's cause i used anim template or the ik one

ancient grail
#

I just used a delayed effect so players can shoot more needles

echo fiber
#

if that makes sense

echo fiber
#

is there a way to call a function when eating a food, but like a specific food?

#

cuz i know of onEat

#

but i want to make it so when they use and item called Crack it would call so would it be

onEat.Crack?

echo fiber
#

so ^ that did not work how do i call for something specific when someone eats something like i said before

sour island
#

Check cigarettes for an example

#

You can use the same function for all drugs and differentiate based on item type if you prefer

#
----- OnEat_Cigarettes IS NOT RECIPE CODE.  IT IS CALLED BY IsoGameCharacter.Eat() -----
-- smoking cigarettes gives more bonus to a smoker
function OnEat_Cigarettes(food, character, percent)
    local script = food:getScriptItem()
    percent = percent * (food:getStressChange() * 100) / script:getStressChange()
    local bodyDamage = character:getBodyDamage()
    local stats = character:getStats()
    if character:HasTrait("Smoker") then
        bodyDamage:setUnhappynessLevel(bodyDamage:getUnhappynessLevel() - 10 * percent);
        if bodyDamage:getUnhappynessLevel() < 0 then
            bodyDamage:setUnhappynessLevel(0);
        end
        stats:setStress(stats:getStress() - 10 * percent);
        if stats:getStress() < 0 then
            stats:setStress(0);
        end
        local reduceSFC = stats:getMaxStressFromCigarettes()
        stats:setStressFromCigarettes(stats:getStressFromCigarettes() - reduceSFC * percent);
        character:setTimeSinceLastSmoke(stats:getStressFromCigarettes() / stats:getMaxStressFromCigarettes());
    else
--        bodyDamage:setUnhappynessLevel(bodyDamage:getUnhappynessLevel() + 5);
--        if bodyDamage:getUnhappynessLevel() > 100 then
--            bodyDamage:setUnhappynessLevel(100);
--        end
        bodyDamage:setFoodSicknessLevel(bodyDamage:getFoodSicknessLevel() + 14 * percent);
        if bodyDamage:getFoodSicknessLevel() > 100 then
            bodyDamage:setFoodSicknessLevel(100);
        end
    end
end
timber river
#

Is there a guide for making 3D models and textures for zomboid? I'd like to make a Walther PDP or P99 for Brita Weapons but I'm not sure exactly how to get started with that should have checked the modeling channel lol

bronze sinew
bronze sinew
#

like perspectives kinda. think of it where you have a piece of clay and your molding it into the object you want

#

I suck at explaining things sorry ;-;

quartz badge
#

trying to create a contextmenu translate file for my mod completely broke it

#

how do i fix

quartz badge
#

basically the items have no description and can no longer be worn, and the the option to wear them is broken

#

idk what to fix it since even after removing the translate files it still is broken

fast galleon
primal vapor
#

Hi, does someone has a guide to GlobalModData or how I can receive and update other player mod data?

fading horizon
#

ERROR: General , 1682073065721> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: setTint of non-table: null at KahluaThread.tableget line:1689. ERROR: General , 1682073065722> DebugLogStream.printException> Stack trace: java.lang.RuntimeException: attempted index: setTint of non-table: null

#

does anyone know what may be causing this error?

#

is there something wrong with my texture? that's the only thing i can think of regarding an error in setting tint

#

its an exact copy of another item just with a different name and texture. The other item works fine

nimble spoke
ancient grail
#

Im not sure how the hackers code work
Like do they actually turn on admin?
So isAdmin() is actually true? And setaccess is actually admin?

If this the case i think i have an idea to defeat em by creating a mod that checks if your admin
If you are then check a global list of steamids and username
If its also true then safe but if not then auto ban

Now the list of steam id and username is a modpatch that rhe server will have to manually do

nimble spoke
ancient grail
#

Ouch

#

Debug is a staple for me

nimble spoke
#

We created a list of people allowed to use debug mode and if a player isnt in the list that player is kicked out

ancient grail
#

3 super important stuff that needs collecrive effort to fix

1 the steam update
2 the hackers
3 the modpackers

(In no particular order)

primal vapor
nimble spoke
#

Steam update will never be fixed. And modpacking is an attempt to reduce that issue. Wanna 'fix' steam update? Don't add hundreds of mods to a server

ancient grail
#

I have an idea about the steam update too but idk if its feasible

Basically the setup is no steam but takes the update from steam
So external tools are involved
Basically the client doesnt check steam since jts a no steam server
And if the mod idoesnt match it means the server updated
So now the server will update the client

If this is even remotely possible idk.. just a concept

primal vapor
nimble spoke
nimble spoke
primal vapor
#

Okay, thank you, now I need to figure out how to use them correctly

#

For now I will try to see how other mods do it more, thanks again

fading horizon
#

is there a way to add an item (a backpack) to the distributions that zombies wear besides creating an entirely new outfit?

opal linden
#

question - is it possible to make a mod that lets you play music from the player's library on their computer compatible with true music?

#

and how difficult would it be to make it work in MP, so others can hear the music too

fading horizon
nimble spoke
fading horizon
#

doing it this way will make it incompatible with other mods that edit the same outfits i'm assuming

#

since its being completely overridden instead of patched

#

I guess making an entirely new outfit based on the outfit I want to edit is going to be the way to go so theres no conflict

ancient grail
quartz badge
nimble spoke
quartz badge
#

@fast galleon

#

contextmenu_en on the left, example of item on the right

#

this is what hte button looks like now ingame

#

when its pressed the character does the animation of wearing it, but nothing happens

#

if anyone can help feel free

nimble spoke
#

Remove ContextMenu_ from the item

quartz badge
#

i did that just now, still broke in same way

nimble spoke
#

What is it showing now?

quartz badge
echo fiber
# quartz badge

you have to create a context menu for that dont you? thats what i did

quartz badge
#

thats what im trying to do

#

i dont know how and no one is telling me how other than just make a translation file

echo fiber
quartz badge
#

thats what i did

echo fiber
#

file structure the same?

quartz badge
#

yes

echo fiber
#

dont have alot of time my self atm, but can you send me a photo of what yours looks like, sometimes a cap letter or a missing , can just break stuff

quartz badge
echo fiber
#

o my bad just had to scroll up >.<

#

can you show me the item that is using the context menu, like the item file not the actual item

quartz badge
echo fiber
#

okay so i assume you have a custom context menu script? can i see where you are calling the context menu,

nimble spoke
#

Missing commas in there

quartz badge
#

thats what it probably is

#

lmao

quartz badge
timber river
#

Am I stupid? It doesn't look like it's even calling the translate file

quartz badge
#

the "UntuckPants" is calling ContextMenu_UntuckPants

#

it was the commas, @nimble spoke

#

mod works perfectly now

#

i keep forgetting stupid little details lmao

timber river
#

🎉

nimble spoke
#

👍

echo fiber
#

where you are calling for the context menu, i assume your using the recipe context menu to "create" a context menu then crafting the item but so somewhere there has to be where you are calling the context menu its self,

where ever you are calling it it has to say ContextMenu_TuckPants

quartz badge
#

thanks for helping me notice my own stupidity lol

echo fiber
#

even people who have been doing this for awhile will forget them lol

nimble spoke
echo fiber
#

i use recipes for all my menus XD

echo fiber
fast galleon
#

yeah, the missing commas. In the top picture it was confusing if you cropped that it not.
You should avoid pictures for code when possible and use.

` single line`
or ` x3 for block
quartz badge
#

is there a .fbx of the open balaclava anywhere?

nimble spoke
red tiger
#

@nimble spoke Inform me on the details when / if you can. Depending on the severity, I may work on a fix.

frosty estuary
#

What's the minimum value I can put on a item distribution table? 0.1 or it can go lower like 0.01?

fast galleon
nimble spoke
nimble spoke
red tiger
#

Hopefully the commissioner shares that fix.

#

I don't sit well with anti-cheat fixes that aren't published.

nimble spoke
#

I don't know what he will do, I was asked to send the files when I finished it

red tiger
#

When working on anti-cheats over the past 15 years or so when modding games, this came up a few times and I'll always say that if a big cheating issue is patched privately, your server won't be what you think it will be when all the other servers die off.

#

I'd like to release a template on how to make a Java-patch-secure anti-cheat patch for PZ at some point.

nimble spoke
#

That is only an issue in open servers, as far as I know whitelisted servers are mostly safe. The catch is people don't want debug mode completely gone from MP, probably not even the devs as they have their uses for it, so people want to have some control over a mode that everyone can turn on from their side

red tiger
#

It had controls for ~60 anti-cheat patches.

bitter bay
#

Sorry to interrupt this conversation but: I am not a mod maker, by reading codes I can kind of... do some things. Someone wanted a modified Spiffo head and I'm trying VERY hard... I came across a little problem. I'm trying to figure out what the "WorldStaticModel" for the Spiffo Head is, but no matter how hard I try to find any list on the WorldStaticModels I can't manage! Would anyone be kind enough to help me figure that part out?

red tiger
nimble spoke
bitter bay
#

I'll go find that script then! Thank you! 💛

sour island
#

Adding context menus is not that hard tbh.

There's an event for inventoryItems and one for world clicking

#

The function has particular parameters though, so it would be a good idea to look at vanilla files

red tiger
#

More and more do I want to write a computercraft mod for PZ in ASM.

#

Not with BASIC or FORTRAN emulation.

#

ASM. x86 32bit.

#

I'd write the ASM emulator in Lua.

drifting ore
#

Hello is there a function to make http request ?

red tiger
#

TIS is aware of the request for such a feature but it may not happen.

#

If you ware wanting to use HTTP requests for your server, there are options. It involves modifying the Java bytecode in order to work.

drifting ore
#

But on the server not for all client ?

red tiger
#

Yeah

#

If you want.

#

You can modify your server to take requests and have clients with a Lua mod send ClientCommands for requests that can be returned to the client.

#

I know two ways to set this up: 1 is not modifying Java.

#

It's more annoying to set up.

drifting ore
#

do you have any documentation or forum talking about that

red tiger
#

Nope. I have 10 years' experience in doing things like this to PZ.

#

I know whacky ways to get things done. =)

drifting ore
red tiger
drifting ore
red tiger
#

I don't mind although I don't have too much time

#

At work

drifting ore
#

oh : (

red tiger
#

Basically, since you can read and write to files, you can create a separate process that does HTTP work and then posts results to be digested by a Lua mod.

#

You can't run that process on the client-side but a server-side mod can.

#

Then you'd use onServerCommand and onClientCommand to send information back and forth.

white hatch
#

I have a problem. I'm trying to add a model as a cosmetic but when I equip it it doesn't show up, I thought it was a problem with the model but if I generate it with a script if it renders then I don't know what the problem is.

The code in scripts
model Glasses_Coolest_Clothes
    {
        mesh    = Static/Clothes/M_Glasses_Coolest,
        scale   = 1,
        texture = WorldItems/RadioTransmitter,
    }
The xml code
<clothingItem>
    <m_MaleModel>static\clothes\m_glasses_coolest</m_MaleModel>
    <m_FemaleModel>static\clothes\m_glasses_coolest</m_FemaleModel>
    <m_GUID>59331d9b-9fd1-40c1-9fe6-c672967adcc6</m_GUID>
    <m_Static>true</m_Static>
    <m_AllowRandomHue>false</m_AllowRandomHue>
    <m_AllowRandomTint>false</m_AllowRandomTint>
    <m_AttachBone>Bip01_Head</m_AttachBone>
    <m_MasksFolder>none</m_MasksFolder>
    <textureChoices>reflectiveglasses</textureChoices>
</clothingItem>
#

I've been having this problem since yesterday and it's my first time modding project zomboid, so I'm a bit lost.

nimble spoke
#

Do you have that GUID in your fileGuidTable.xml?

#

You don't need a model script for clothes, unless you need it as a world static model

white hatch
# nimble spoke Do you have that GUID in your fileGuidTable.xml?

Yes
<?xml version="1.0" encoding="utf-8"?> <fileGuidTable> <files> <path>media/clothing/clothingItems/Glasses_Coolest.xml</path> <guid>cf36be6a-cf10-4e97-8c01-bdb216d4732f</guid> </files> <files> <path>media/clothing/clothingItems/Glasses_coolest_too.xml</path> <guid>59331d9b-9fd1-40c1-9fe6-c672967adcc6</guid> </files> </fileGuidTable>

nimble spoke
#

also make sure the texture path and name in that xml is correct

red tiger
#

Three back-ticks and xml beside it makes that text look prettier. =3

nimble spoke
#

And must not be a GUID used by another item in the game

white hatch
#

now i have to fix the model

red tiger
#

I need to buy a mic and record tutorials on how to do some stuff and post YouTube videos.

bronze sinew
#

omg that would help so many people lol

tawdry solar
red tiger
#

Mics are expensive.

#

I could get a low-mid one but I was spoiled when I bought a 400 USD one last year.. Had to sell it.

#

It was in perfect condition and I used it for like 400 hours.

red tiger
tawdry solar
#

was it any good

red tiger
#

Yeah. Needs a cloudlifter.

#

It's a quieter mic.

tawdry solar
#

cloudlifter?

red tiger
#

Might grab something small and then get to recording.

undone tapir
#

Samson Q2U

#

Dynamic XLR and USB

red tiger
#

USB microphones are horrendous.

#

They're the ones that picks up the most noise.

tawdry solar
bronze sinew
#

I have a USB mic lmao

tawdry solar
#

it works fine ig

#

no clue what to make smh

bronze sinew
#

you could make tutorial videos without a mic

tawdry solar
#

cause people can have hard time reading text

bronze sinew
#

true

red tiger
#

lol

#

It'd be good to have videos of people walking through certain modding techniques because it's easier to throw those videos at people who come in here and also we'd have an interactive example.

bronze sinew
#

that would be better lol

tranquil kindle
#

Hello, im not sure if its the right place to ask, but i have to start somewhere. Im trying to learn to make small mods that add items or diffrent use for items. For one im trying now i'd need to rotate model of crowbar upside down. I noticed that threads here are of great help especially with 3d modeling as i was never able to import X format files into my blender but i made it with this link from thread https://github.com/oguna/Blender-XFileImporter , however im not sure if this addon should also allow me to export it as X file and i simply missed something or i need to look somewhere else and it servers just as viewer so i can see how it looks like?

GitHub

Import DirectX-X-MeshFile to Blender. Contribute to oguna/Blender-XFileImporter development by creating an account on GitHub.

nimble spoke
willow estuary
#

I can't really think of any good reason to use the .x files for PZ modding in that fbx is more straightforward to work with and blender is free and seems to be the common standard for modelling anyways.
The reason PZ uses .x for some files is that our main modeller, Martin, is a career modeller and is used to using fancier software with the .x format.

tranquil kindle
#

does that mean i can for example import crowbar x file, export it modified as fbx file and use it to create "new" item using this model? There is no rule that if like melee weapons are made from X files, then any new item someone makes has to be in X format?

willow estuary
#

None.

#

You can absolutely convert PZ .x models to fbx format to create new models.

bronze sinew
willow estuary
#

No you can, and should, use fbx format for weapons etc really.

#

The only reason PZ uses x format for many models is that Martin is used to using that format really.

bronze sinew
#

ah, alright thank you : )

willow estuary
#

Rockstar Mark uses fbx models instead. We use x format for weapons because, even if Mark makes a weapon model in fbx, Martin will still be the person who properly sets up that model for use as a weapon.

red tiger
#

I need to take a look at the X importer. I keep saying it.. then projects get in the way.

#

IIRC importing .X animations is a current issue with Blender.

#

Or was it FBX...

#

I have notes for it somewhere.

faint jewel
#

FBX > .x any day

#

.x is a microsoft created format that was primarily for xbox and microsoft pc games. it has been greatly depreciated.

nimble spoke
faint jewel
#

yes

frank elbow
#

So yes, but it's limited

drifting ore
frank elbow
#

What's your use case (if you don't mind my asking)? API requests of some sort?

drifting ore
#

so yes by a api

nimble spoke
frank elbow
fading horizon
white hatch
echo fiber
#

quick question might seem silly, but are we aloud to use cuss words in our mods, lol dont want the mod getting taken down for using a bad word xD

bronze yoke
#

you're allowed to cuss!

echo fiber
echo fiber
bronze yoke
echo fiber
dusty wigeon
#

proud moment for my first mod

echo fiber
#

how would i go about making the tooltip go down a line so its not so long...

sour island
#

Add \n

echo fiber
echo fiber
#

like this?

#

it didnt work >.< it puts the \n in the text its self

ocean sphinx
#

does anyone want to help commission a wheelchair mod?

sour island
bronze yoke
#

i think it's something else for tooltips

#

i'll see if i can dig it out of one of my mods

echo fiber
#

im looking for it on google in the mean time if you find it before me please let me know XD

bronze yoke
#

oh i think i used it in literacy

#

that's for a skill tooltip but it'd probably be the same

#

<LINE>

sour island
#

I think I'm recalling using draw text for custom tooltip

#

Tooltips should honestly wrap long lines though

bronze yoke
#

definitely

echo fiber
#

i shal try the <LINE>

bronze yoke
#

yeah, try it out

minor pumice
bronze yoke
#

oh i see <br> in Tooltip_EN

#

that might be the one you're looking for

#

i thought it was something like that

timber river
#

is there a wait to overwrite the require line in the mod.info file?

echo fiber
echo fiber
bronze yoke
#

<LINE> was what i used in another mod, not sure if both would work (they do seem to have the same syntax) but they might differ slightly so i'd go with <br> since vanilla uses it for the same reason

echo fiber
#

<LINE> does not work on tooltip just tired, going to do <br> lol

minor pumice
nimble spoke
echo fiber
echo fiber
dusty wigeon
minor pumice
echo fiber
dusty wigeon
#

yea what he said hes my partner in modding lol

#

i take the profit while he does the work lol

#

jk

minor pumice
#

gz @dusty wigeon I can't say that much from my first mod 😮

dusty wigeon
#

when was yours posted and what was it

echo fiber
#

ill also be working on his translation files to add Russian and Japanize

timber river
#

What's the current version number rn? 41.81?

minor pumice
timber river
#

sounds more right...

echo fiber
#

im in game one sec can check

timber river
#

I'd boot up but my entire mod list is loaded rn... takes like 5 min haha

#

thx Val

echo fiber
#

41.78.16

timber river
#

nice! thx!

echo fiber
#

anytime 🙂

minor pumice
trim mist
#

Hey everyone!
I'm making a small traits mod as my first mod for the game. I'm a software engineer professionally but never worked with LUA. Can anyone tell me how I can make traits do more than just edit skills?

#

I've tried looking that up, and the best I can find is the github repo for MoreTraits (thanks hypnotoad!), but there's no clear connection about when/where functions are called

minor pumice
echo fiber
trim mist
# trim mist I've tried looking that up, and the best I can find is the github repo for MoreT...
GitHub

Adds more traits to Project Zomboid. Contribute to hypnotoadtrance/MoreTraits development by creating an account on GitHub.

GitHub

Adds more traits to Project Zomboid. Contribute to hypnotoadtrance/MoreTraits development by creating an account on GitHub.

minor pumice
trim mist
#

I've looked for it but I haven't been able to find a git repo for it anywhere

minor pumice
minor pumice
trim mist
#

i can? 👀 how?

#

or is there documentation on that anywhere i can read?

minor pumice
trim mist
#

bet! Thank you

minor pumice
bronze yoke
trim mist
#

so i'm just blind

bronze yoke
#

learning from existing mods is probably the best way to learn zomboid modding (on top of asking questions here) but i'd recommend looking for a mod a bit less dense than this one to learn from

trim mist
#

I'll try to keep it simple. Most traits seem to be simple to add at least.

#

It really didn't help that the first trait that I wanted to add affected vision, and uhhhhhh that seems really complicated. And nobody replies in here when that gets brought up, according to the logs

#

What i would do to talk to the author of the blind mod

echo fiber
bronze yoke
#

affects vision? depending on what you want to do it might be totally impossible 😅 that's probably why nobody responds

#

the line of sight stuff is hardcoded into java, but if you just want some screen effects and stuff like the blind trait that should be fine, though not something many people have experience with

trim mist
#

well, changing the radius of the vision cone. Kind of like shortsighted/eagle eyed

#

and depending on how complicated i can get with it, excluding a bit of the vision cone directly in front of the player

bronze yoke
#

yeah, afraid there isn't much you can do with the vision cone

trim mist
#

yep, even in the vision mods they do some hacky stuff with the search radius and zooming

#

so can't touch the vision codes directly it would seem, unless there's a way to overwrite vanilla java

bronze yoke
#

the vision cone is very hardcoded, it's part of the lighting engine

#

you can overwrite java but it requires manual installation of either your mod or some kind of java modloader (not sure if there still is one or not, if there's a java modding community it's not here)

bronze sinew
trim mist
#

You can take a look yourself. They wrote a shader in their mod, you can take a look at it following the instructions above

knotty canyon
#

Hi guys, is there any free server hosting for project zomboid? please 😦

bronze sinew
#

oh, alright thanks man! : D

red tiger
#

Going to stay up somewhat tonight and continue to work on the VSCode extension for ZedScript. Working on the linter. =)

#

I think I know how I want to implement it. Been sitting on it for a week.

#

=)

red tiger
#

My linter is going to use rulesets and recursive logic.

#

Going to be fun when I start seeing the results.

dusty wigeon
#

i thought this drug mod was gonna be something quick i did not realize how deep this rabbit hole could go

#

i mean its playable the way it is but everything i want it to be holy cow

red tiger
#

But make the journey fun and worth having.

dusty wigeon
#

100 percent worth it

bronze sinew
dusty wigeon
#

me and val have been working on 3d models and textures this week as well as some lets say interesting things to make it more exciting

red tiger
#

Throwing code into the void however this is my current design for my linter:

#

Just wrote all of it. Haven't tested it yet.

fading horizon
#

i'm so confused. I've made a custom fanny pack item as well as several other custom backpacks. All of the backpacks work fine with absolutely no issues.

For some reason, the fanny pack is only visible sometimes.

I'll start a new game, it works and the model shows. Shut down the game, literally don't touch any files, start another new game, and suddenly it's not visible anymore.

Does anyone have any idea what could be causing this? All file paths are correct, the model shows like 30% of the time, and no errors are occurring. It's literally only happening on the fanny pack item and nothing else. It seems to work at complete random. I've changed the GUID a few times to make sure it wasn't a conflicting GUID either. I've tested it with no other mods enabled as well, so it's not a mod conflict.

#

like how could it show, absolutely nothing changes, then it no longer shows

ancient grail
#

Show the clothing script

fading horizon
#
item Bag_Goth_FannyBack
        {
                Type                    = Container,
                DisplayName             = Goth Fanny Pack (Back),
                ClothingItem            = Bag_Goth_FannyBack,
                BodyLocation            = FannyPackBack,
                BloodLocation           = Trousers,
                Icon                    = FannyPack,
                WeightReduction            = 65,
                Capacity            = 2,
                ClothingItemExtra       = Bag_Goth_FannyFront,
                ClothingItemExtraOption = FannyPack_WearFront,
                clothingExtraSubmenu    = FannyPack_WearBack,
                CanBeEquipped           = FannyPackFront,
                OpenSound               = OpenBag,
                CloseSound              = CloseBag,
                PutInSound              = PutItemInBag,
                RunSpeedModifier        = 0.98,
        }

        item Bag_Goth_FannyFront
        {
                Type                    = Container,
                DisplayName             = Goth Fanny Pack (Front),
                ClothingItem            = Bag_Goth_FannyFront,
                BodyLocation            = FannyPackFront,
                BloodLocation           = Trousers,
                Icon                    = FannyPack,
                WeightReduction            = 65,
                Capacity            = 2,
                ClothingItemExtra       = Bag_Goth_FannyBack,
                ClothingItemExtraOption = FannyPack_WearBack,
                clothingExtraSubmenu    = FannyPack_WearFront,
                CanBeEquipped           = FannyPackBack,
                OpenSound               = OpenBag,
                CloseSound              = CloseBag,
                PutInSound              = PutItemInBag,
                RunSpeedModifier        = 0.98,
        }
ancient grail
fading horizon
#

xml below

#
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
    <m_MaleModel>Skinned\Backpacks\Bag_Fanny_BatFront</m_MaleModel>
    <m_FemaleModel>Skinned\Backpacks\Bag_Fanny_BatFront</m_FemaleModel>
    <m_GUID>4b86d75f-5f7f-4f10-9128-e27645d36990</m_GUID>
    <m_Static>false</m_Static>
    <m_AllowRandomHue>false</m_AllowRandomHue>
    <m_AllowRandomTint>false</m_AllowRandomTint>
    <m_AttachBone>Bip01_Pelvis</m_AttachBone>
    <textureChoices>clothes\backpacks\bag_fanny_bat</textureChoices>
</clothingItem>```
#
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
    <m_MaleModel>Skinned\Backpacks\Bag_Fanny_BatBack</m_MaleModel>
    <m_FemaleModel>Skinned\Backpacks\Bag_Fanny_BatBack</m_FemaleModel>
    <m_GUID>3b7a4919-da45-4a93-a40e-1fef8a4a43f0</m_GUID>
    <m_Static>false</m_Static>
    <m_AllowRandomHue>false</m_AllowRandomHue>
    <m_AllowRandomTint>false</m_AllowRandomTint>
    <m_AttachBone>Bip01_Pelvis</m_AttachBone>
    <textureChoices>clothes\backpacks\bag_fanny_bat</textureChoices>
</clothingItem>```
#

And I assure you the paths are correct because otherwise, it wouldn't show at all

ancient grail
#

The xml

#

Oopps

fading horizon
#
.....................
<files>
   <path>media/clothing/clothingItems/Bag_Goth_FannyFront.xml</path>
   <guid>4b86d75f-5f7f-4f10-9128-e27645d36990</guid>
 </files>
 <files>
   <path>media/clothing/clothingItems/Bag_Goth_FannyBack.xml</path>
   <guid>3b7a4919-da45-4a93-a40e-1fef8a4a43f0</guid>
  </files>
</fileGuidTable>
#

fileGuidTable.xml excerpt is above

ancient grail
#

Could it be the blood?

#

I dont see anything wrong..

fading horizon
#

wait

#

it could be

#

i just loaded in a character where it didn't work

#

and i think there was blood on the pants

#

maybe it is an issue with the blood location

#

removing that line and testing it now

ancient grail
#

Cuz your location look ot says trousers

#

Ok

fading horizon
#

i had copied that from a similar item script that used the same thing

#

and theirs presumably works

ancient grail
#

Lets hope its just the blood location

#

You copied from a mod?or vanilla?

fading horizon
#

mod

#

i tried copying vanilla, ran into the same issue

#

so i tried copying the mod, which was slightly different

#

which seemed to work for a while

#

but now i'm having the same issue

#

nope

#

blood location was not the issue

#

still not visible

ancient grail
#

Check directory spelling? Idk

#

Or your texture?

fading horizon
#

if there was an issue there, it wouldn't work at all

#

but it works sometimes

ancient grail
#

Altho to have an item than occasionally shows upis sorta trippyand might be a happy accident

fading horizon
#

normals are fine

#

i know the one wing is flipped but that wouldn't affect the entire thing

#

and when it does work, the wing is still visible so theres no issue there

ancient grail
#

Maybe it shouldnt be normal? Jk

fading horizon
#

about to just give up on it honestly as badly as I want it to work

#

bc i'm totally stumped

ancient grail
#

Maybeyou havean item that masks it

#

Tryremoving all clothing

fading horizon
#

i didn't think of that

#

good idea

#

testing now

#

well actually it shouldn't be that

#

i use a saved preset character almost 100% of the time

#

with the same clothes

#

and it works sometimes and sometimes not

#

but i'm still testing this

#

randomly working

#

so now i'm quitting to desktop

#

restarting the game

#

and going to start a new save

#

ive touched absolutely nothing

#

okay it worked again

#

reloading again

ancient grail
#

Whe. It doesnt load is it just doing idle anim

ancient grail
fading horizon
#

well its worked three times in a row now

#

and nothing has changed since it was last not working

#

waiting for an idle anim to play to see if that's the issue

ancient grail
#

Ye maybe just reload

fading horizon
#

well this is weird

#

i just spawned in

#

wearing no shoes

#

my character has no feet lol

#

interesting

#

now the fanny pack doesn't work either

#

it was not during an idle animation

#

oh shoot

#

you were right

#

some clothing is masking it

#

okay ive located the issue

#

for some reason, equipping that sweater makes the fanny pack invisible and also removes the feet?

#

and that's a vanilla sweater

#

so it is somehow being masked by clothing

#

do you know how to fix that?

#

hmm

#

it seems wearing anything big on the torso makes it disappear

#

oh wow

#

that's literally how vanilla works

#

like the vanilla fanny pack does the same thing

#

wooow

#

okay, so does anyone know of a way to override or disable the masking so it's always visible?

red tiger
#

Will likely work on the vscode extension tomorrow. Good night.

ancient grail
#

Ah wait i have an idea
Create newattachmment body location

#

You jist wanted to make a simple clothing mod
You ended up doing a pz clothing mask overhaul lol

fading horizon
#

might just keep it as it is

#

because this seems like a pain in the butt lol

autumn temple
#

I have a question. is it possible to have a custom audio file playing while a VHS is playing? or is that not possible since TV's only have 1 audio file for when something is playing on it.

bronze yoke
#

you can definitely use lua to play audio when a certain line plays, not sure how to mute the regular noise though

autumn temple
#

alright, thanks for verifying that it is possible

fading horizon
#

this is what ended up fixing it

#

created a new body location

#

i swore i was done but then i found another backpack to add

faint jewel
#

i already made something similar.

#

the round bags really do look good ingame.

fading horizon
#

those looks great!

#

good job!

fast galleon
#

are there any scenarios with options available?

ancient grail
#

is there a way to remove the shadow

fading horizon
#

have you tried waiting for night time

#

fr though i have no idea sorry haha

#

kitty backpack is progressing nicely

fast galleon
ancient grail
#

Cuz i was doing a swim mod but the. Theres aproblem cuz theres a shadow