#mod_development
1 messages · Page 152 of 1
That is usually said before you find something you hadn't noticed before..... trust me, I know
if you saved it as 8-bit transparency is not the issue. What are the height and width values?
32x32
uhhhhh ok haha
As I said I have no experience with GIMP, so I have no idea how it can mess up an 8-bit png file
can you drop your image file here for me for a second
ill make it for you
id say just save as a png nothing special
save this icon and try again, i did what i do for all my icons on it so it should work without an issue
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
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?
quick question how do i get the char:say("") function to work
no if you want you can use the same model for both
You can't have multiple models like that
i see
Say, not say if I remember it correctly
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
ill just use one model for now
hey soul is there a way to randomize the say function?
It uses a string as parameter so you can randomize a string for a variable and then Say(yourVariable)
so i did it like this but so in my friends code they have ZombRand, and in my code it says its an error that its not being defined what would that be linked to, if you might know, if you dont i can try and figure it out
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)
but the code still tells me ZombRand is incorrect, is that an actual thing in the game?
ok what is the proper way to export a rigged model
Yes
remove +1 if you're changing it to ZombRand(1, 6)
this is the whole function does anything look wrong to you?
which line is generating the error?
Say, not say
You better get used to them haha
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
declaration: package: zombie.inventory, class: ItemContainer
This should check also other containers in the players inventory
thank you Dane
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
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
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
omg thank you was scratching my head cuz it was not pulling some of the table XD this just saved me hours!
DaysFresh = and Days TotallyRotten =
those two are the modifiers for the food going bad
@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,
}
yes
@echo fiber Perfect Thank you
you are more than welcome!
@echo fiber Thank you
For the moment I'll keep it simple
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,
}
Markdown makes things pretty.
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?
There's no hue setting in ZedScript. Maybe modify the way the texture is drawn in the inventory Lua file for UI.
I don't think that you can take away the hue though.
(Saturation)
MB
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
That's a GLSL shader mod.
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
No. I'm the least helpful here for common modding questions.
Tbh I doubt there is a straight up guide for. Best you can probs do is tear down a mod that adds occupations and see how they did it
Yeah I was thinking of doing that. I probably won’t start it until Friday or so because the texture is gonna take forever
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.
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
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.
=)
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
Recipe.OnCreate = {}
makes and sets a new table, all other functions are no longer valid.
ok how would i mmake it so that tthese are added to the recipe list without affecting it
skip that line
use
require "recipecode"
ok
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.
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
It could be related to removing those function? no idea
hopefully
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
I don't see one.
The best you can do from what I know is periodically check them.
yea that is what i thought.. worth asking tho lol. thank you
how impactful would it performance wise to check every min? (just curious)
Hello, I need to create and change a variable on another player, I suppose I need to use GlobalModData for this?
What if I made ComputerCraft, but instead for PZ?
I don't see that anyone's done this.
anyone know what this error means?
This is planned to be in the game but I haven't heard anything abt it in some time (idk if they'll be programmable, on second thought)
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
I'd make it use ASM.
(Screams in 1993)
I was thinking BASIC, lol
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)
If not, I'm sure modders would add it anyhow (found the video I was thinking of btw: https://www.youtube.com/watch?v=JkRHnP_sCUM)
There should be at least some sort of guide around but probably for using Profession Framework mod. It still works but is no longer necessary. If you want an example mod on how to add a simple occupation I suggest my Foraging Time mod.
Hahahahaha MSDoS
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
Has Turbo released this code into any of the BETA branches?
This depends on the rooms that the shelves will be in.
nvm, I'll just borrow some distributions from another mod that spawns where I want
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
I don’t know how to help but spawning the items in the backpack would be such a big quality of life feature honestly lol
Yes, I'm really trash at modding and coding but I wanted to do this as a proof of concept for the insurgent devs.
Among other proof of concepts, I already completely changed how Covert Operative works, my version serves as a check for other traits now, placing the silencers on the gun automatically, instead of just spawning a set of silencers on you.
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!
What are you working on
I don't believe so
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
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
There are characters? So this is for sp?
Or just male female?
Sounds very doable . Where are you on the code?
👀
Just making it extra clear
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?
This sounds like something you'd do with TileZed, but I'm uncertain because I haven't used it myself
Nonetheless, there's info on it on the wiki (https://pzwiki.net/wiki/Modding) and probably in the pins & threads in this channel
Thank you i will look into this
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?
Can you show the exact error?
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 |```
And you're calling it exactly like that? That implies getSoundManager is returning nil
yep I copied that line and pasted it here
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
I thought you had to do this in Lua:
local var = 4;
local foo = "bar" .. string(var);
Lua has .. for string concatenation
Okay PHP.. Calm down..
It should be able to concatenate without tostring, too
I remember having to encase my string concatenations to nil protect the result.
Ah, yeah idt it can concat nil but it definitely can concat numbers
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.
The (default) string metatable certainly does
You could do some freaky stuff with primitives in Lua.
Yup, debug.setmetatable is a terrible beast
People are caught up in JS magic but Lua is a lot stranger.
so what am supposed to do again to try and fix it ? i feel like it should just work but clearly does not lmao
It's like Wild-West cowboy logic.. but in Siberia.
Try it from an OnGameStart event listener
Or just check for nil
i.e.,
local soundManager = getSoundManager()
if soundManager then
-- play the sound
end
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.
The above error says otherwise
It's a static method IIRC.
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)
so i am calling it straight from the lua command line to see and it works fine
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
public Audio PlaySound(String var1, boolean var2, float var3)
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
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.
The error is saying that the value PlaySound is being called on is nil
So it shouldn't even be reaching the call
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.
not sure what you mean by that. if i get rid of this single PlaySound line everything else works just fine
this also works in SP .. but not in MP
Are you calling it from a Lua file in server/? (I think it should still work, just wondering if that could be a factor)
only got one file lol but yes media/lua/server/Main.lua
and sound is under media/sound/Testfile1.ogg
What I'm saying is always expect your code to be the source of the issue before looking into possibly claiming that the API is the issue.
Oh, huh. The server loads Lua files first
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.
oh no i def think it is my code. i hope it is at least
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?
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.
I assumed so as well but figured that could be a factor
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.
The implementation of PlaySound is a no-op on the server anyhow, so even if it worked it wouldn't work @reef karma
i see, so it no worky if in server/
The server is a packet bouncer with login credentials and map data.
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)
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...
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
You'll want to play sounds from a Lua file in client/
the complaints and questions on my mod suddenly coming in fast
i will see how to manage that
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
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
java.lang.OutOfMemoryError
This could be cause by a syntax error, right?
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
More reasons to get my linter in working order..
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)
Hello all! I'm trying to make a mod, is a simple level up sound replacer but can't make it work
There's other mods on the workshop that do this - you can take a look at how they've accomplished it.
yes, i did the same as they do. they have a script folder with a txt, the sound folder with the sound file and the mod.info and poster. i have made the same, and my mod appears in the modlist to activate. it just don't change the level up sound
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?
Show the vanilla sound script along side of your version
Probably include a screenshot of where you placed the audio file
the file is newLevelNoise.txt but it doesnt appear in vanilla folder
Are you enabling the mod from the main menu and loading a save?
enable from the mods menu after loading the save
Under [ More ] ?
It isn't that simple. I'm not at home but there is a function that returns a list of items from an inventory then you can remove them. Something like getSome(itemId, quantity)
where is "more"?
I start the game, go the mods menu, enable, accept and then in the main menu again press continue
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
Damnit. Yes please send me that when you get the chance. I've been fighting with the insurgent mod on and off all day, but this is the last real hiccup. Learning a lot today.
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
I'm starting a new one
vanila
module Base
{
sound GainExperienceLevel
{
category = Player,
clip
{
event = Game/LevelUp,
}
}
mycode
module Base
{
sound GainExperienceLevel
{
category = Player,
clip
{
file = media/sound/levelup.ogg,
volume = 0.5,
}
}
}
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

it's working! thanks both @sour island
awwwwww
Daily bump for this unsolved issue
Further information about the issue may help make it more likely to be answered. What all have you tried already to diagnose it? How does your renaming work? Stuff like that
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
There's no more detail I can post, i just replaced a text file, it works on single player but not on multiplayer, at least for me. I wonder if it's got something to do with localization, but I'd need someone else to check for me. I can't think of anything else worth saying but if you want to help and have any questions about it please by all means ask
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?
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
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
ooh nice!
idk it looks a little strange with a white background
i guess this looks decent enough?
what do y'all think
I like this one better.
or i could just scrap the wings entirely
have it just be the coffin icon
would be more identifiable i feel like
But can you fly?

Os there any way yo optimize the zeds?
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
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
just added a pink version over in #modeling
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
hey guys I just published my first mod! 😄 thanks for your help of course!
is there a channel to share the link to it?
my ISScrollingListBox is not showing a scrollbar, any potential reason?
Not enough items in it?
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!)
Nvm, somewhere in the drawing went wrong.
Look at your C:\Users\<user>\Zomboid\Workshop
I'd throw it in the showcase channel
Nvm, it doesn't look like we have a dedicated mod showcase channel (showcase is for screenshots of bases I guess). hint hint mods we really should have a mod showcase channel
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)
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
Got it, give me a sec, I will get you the guides
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/
it seems cool! gonna give it a try 😄
Alright... I suppose. As I've seen others posting mods, maybe I would post it here?
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)
hey! that mod sound right! I'd start watching vanilla files in local storage to find where is that coded and how
I will give it a try, thank you.
Posting it here might be overkill, throwing it in pz_chat maybe?
If someone with more clout here wants to tag a mod and create the "FatherSarge Memorial Mod Showcase" channel that'd be cool... haha
That code will not work. I urge you to not use ChatGPT for this. It may work with more popular libraries (although I still find it regrettable that people do this), but it routinely generates made up code for PZ modding
There are resources in the pins and threads of this channel that can help you learn. I also recommend reading through "Programming in Lua"
Yes! A channel made to share our mods will be nice 😄
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
I'll post it here, since they helped here a bit 😛
https://steamcommunity.com/sharedfiles/filedetails/?id=2964763551
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.
@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.
Yea if you have a bit of experience you'll be good
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
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
A right and/or left click mod already exists as well if you'd like to use that for reference, if nothing else you can take snippets you want to use and feed them to chatGPT will be helpful
I'll do that now. Thanks 🙂
heck ya! what mod is that?
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?
This one does a bunch with left click:
https://steamcommunity.com/sharedfiles/filedetails/?id=2795987309
This one does stuff with right click
https://steamcommunity.com/sharedfiles/filedetails/?id=2925286254&searchtext=left+click+redux
Thank you very much! I will subscribe to these and spend some time spelunking the code. Appreciate your help 
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?
Dude thank you so much for posting this, I think it’s 90% of what I need to learn how to make my mod! : D
I am not able to look at the code directly but the event for OnCreatePlayer / OnNewGame / OnLoadGame etc behaves differently depending on SP/MP use.
However, if you're trying to patch another mod -- all you need to do is require the file you want to mess with, and either hard or soft overwrite the functions as needed.
The require should ensure their file is loaded first -- which it needs to be in order to call on to change stuff around.
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?
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?
They are still working on their next big content update, I didn't want to bother them tbh. Was just doing this to give to them as like a "hey this would be cool" proof of concept type thing. I suppose I could hit them up directly about it if I get really desperate
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.
Yea I'll get a little group chat going with them here shortly
thx for the help as always chuck!
No problem, always nice to see modders adding onto each others work
On new game is the hook that all the traits use to initialize themselves so removing it won't work as expected unless you handle that.
Nah I wasn't trying to remove that, just the calling of the InsurgentBeginGame function. That's the function I've been trying to modify, I detailed what I was doing in a DM to ya 😉
Inability to modify the InsurgentBeginGame function is the real issue here, don't need to mess with events if that could be changed
Oh it's yours Notloc - didn't know 😅
Haha I would have tagged him but you know how some folks can be about server pings 😂
I appreciate it Notloc!
can we talk in dm? is modding related stuff
Is it possible to add a paintable symbol to the game? Like the ones you can paint on walls?
Thanks man!
Good morning.
Not quite, its Mr Sunshine's mod, but I help with structure and code quality
Ah, nice
Is this a general cleanup thing or is it more specific?
General cleanup for sure, but also refactors to make it easier for more content to be added later while touching minimal code.
How do you plan and execute your mods?
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.
Me... just asking chatGPT to explain it cus chatGPT doesn't judge and won't call me stupid for not knowing the simple stuff
What a silly presumption. If someone did that without you provoking them then fuck em.
Trust people with more than a decades' experience, not some silly bot that can't make explicit and decisive statements.
clearly my friend... you have spent zero time in the Arma 3 mod community 
They're not the programming industry.
Still havent gave up i see
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. =)
yeah i have determination
Really now? If thats true then shouldnt you be learning to mod?
When I taught people to code, I taught them that the answer is more personal than official.
Plan: Decide the idea I want to pursue
Execute: Iterate until I like it
I am not that organized
no because im lazy
:/
Yeah so much for determination huh?
That's still a plan.. I don't think it'll serve you as well but it's better than being blind.
If you find someone annoying or frustrating on the discord, please just block them instead of antagonizing them or lashing out at them.
Maybe go through and try to write out your features like a business proposal.. or pretend to be the commissioner for the project. I try this sometimes to fill in those areas of concern that I might not otherwise see at all if I only think about how to make things "Simply work".
@wet sandal
Maybe UML can help too.
Yea I make UMLs and plans for highly specific bits when I get stuck or have a problem
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.
But in general I don't have the attention span for full project planning
Then don't give yourself a time-limited schedule.
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.
Apologies
Maybe your code is already good.
That's up to you. It's very good to see you concern over this. It means you want to improve and I highly commend that attitude. It's rare to see in the modding space.
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.
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
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
One thing I do when I see myself constantly drifting from a project I want to complete is to trick the mind to be absolutely obsessed with the results. Works for me sometimes.. not all the time though.
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. =)
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.
i doubt you will add an commercial plane event in expanded helicopter events
I was not planning to do that, no
Please don't start lashing out at people either.
ok sorry it was an joke dont take seriously
i just wanted to be funny :(
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
how do you create a contextmenu?
Guys, what is this?
does anyone know how to remove the "ContextMenu_" before the option?
i've come here for help because i'm apparently a brainlet and can not create my own mod
anyone willing to help me?
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
you need to create a context menu to remove the context menu if that makes sense
under the lua/shared/Translate folder create a txt doc that is called ContextMenu_EN or whatever language you make it
I tried that, it just made it completely broke
pretty sure you have to define them
more than just making a name of a button
idk how though
If I was home I'd sit down and show you what I'm saying
You need to define the translations for those options.
Rush is correct
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
I wanna get involved with the modding community, idk about coding but i know how to design 2D stuff, like thumbnails, icons and huds
hey why does this happen?
Life force being sucked out by a skin walker.
You need to create translation files
Its venom
Try and verify files
This makes sense
it's a mod i'm trying to make
The animation ?
You can just open up one of the animation files and just randomly play with the models animation
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!
First
ye i get wym, might learn blender but its very complex imo
im offering help with 2D assets to modders
ahhh lol gotcha, 3D modeling also isint as hard as one might think, made this model in 20mins with only having limited experience with it and even this is too detailed XD
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
it's setOverallBodyHealth, not setHealth
is that then set as bodyDamage?
it's a method of BodyDamage yeah
thank you ❤️ now people can OD on drugs XD
so im not getting errors but its also not dealing damage to the players over all health
if you just want to damage the player i think ReduceGeneralHealth(damage) is better
how would i type that in the function, atm i only know how to write it as show in the above code or would i write it as
bodyDamage:setReduceGeneralHealth(math.max(((bodyDamage:getReduceGeneralHealth())-(1)),0));
?
just bodyDamage:ReduceGeneralHealth(1)
will try that now! thank you albion!
it worked i am happy now cx
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?
i used the animation tutorial and made a pose using that tutorial and it ended up like this
idk if it's cause i used anim template or the ik one
My heroin has OD
I just used a delayed effect so players can shoot more needles
xD dear god lol yea i want something more on that line but want to have a drug addict trait so if players go with that they will never OD off the drugs but idk how to write in, (if player has this trait skip this function)
if that makes sense
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?
so ^ that did not work how do i call for something specific when someone eats something like i said before
In the item script, OnEat= to a global function
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
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
i kinda learned blender last saturday, its not that hard to figure out but just be patient and look at things from different views and it should help : )
different views?
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 ;-;
trying to create a contextmenu translate file for my mod completely broke it
how do i fix
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
first fix context option, then edit translation as you want. What was the problem, removing an option of clothing? Can you share the script for it?
Hi, does someone has a guide to GlobalModData or how I can receive and update other player mod data?
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
I don't know if there is a guide. You can only transmit from client to server and from server to all clients
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
I got a guy asking me to fix that and he explained to me the most common case was using debug mode to activate whatever they wanted. So we made a mod that blocks debug mode
We created a list of people allowed to use debug mode and if a player isnt in the list that player is kicked out
3 super important stuff that needs collecrive effort to fix
1 the steam update
2 the hackers
3 the modpackers
(In no particular order)
So theoretically other player can transmit variable to server so I can change it and transmit it back to server and other player receives his changed variable from server?
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
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
I’m just having a hard time figuring out client-server stuff configurations
Yes. It is actually a table so you can store a lot more if you need
You can either use request or transmit. It depends on your needs
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
is there a way to add an item (a backpack) to the distributions that zombies wear besides creating an entirely new outfit?
You can override outfits
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
is there a guide on the optimal / correct way to do this that you know of?
There is only one way as far as I know. Include the whole outfit in your xml and make the changes. You also need to include all Guid for clothes in that outfit in your fileGuidTable.xml or the zombies will appear naked
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
Dont make a mod . Go vc and add a discord bot for music.
This will work
Since you want to keep your audio file local then theres no way for them to listen to it unless you are broadcasting it thru voip
i’m not at my pc right now but i will show it soon
Not really incompatible, just that only one will actually spawn. I dont think there is a way around that as these were not planned to be changed by mods
@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
Remove ContextMenu_ from the item
i did that just now, still broke in same way
What is it showing now?
you have to create a context menu for that dont you? thats what i did
thats what im trying to do
i dont know how and no one is telling me how other than just make a translation file
thats what i did
yes
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
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
okay so i assume you have a custom context menu script? can i see where you are calling the context menu,
Missing commas in there
what do you mean "custom context menu script"
Am I stupid? It doesn't look like it's even calling the translate file
the "UntuckPants" is calling ContextMenu_UntuckPants
it was the commas, @nimble spoke
mod works perfectly now
i keep forgetting stupid little details lmao
🎉
👍
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
thanks for helping me notice my own stupidity lol
even people who have been doing this for awhile will forget them lol
Clothes do that automatically through item values.you dont need to create the context options manually
ahhhh okay, lol see my dumb self would have done that XD
i use recipes for all my menus XD
ill probs get yelled at one day for this way of doing it.. telling me i have to learn custom context menus >.<
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
is there a .fbx of the open balaclava anywhere?
This happening again?
No need for yelling, they're more versatile as you're free from recipe limitations, so you should learn how to add them
@nimble spoke Inform me on the details when / if you can. Depending on the severity, I may work on a fix.
What's the minimum value I can put on a item distribution table? 0.1 or it can go lower like 0.01?
vanilla has 0.001 for sure. If you want it to appear, it should be big enough to not be converted to 0 as a float.
I don't really have anything to say about it. As far as I know the person is satisfied with the results and never contacted me again
So there was a fix applied?
Yes, that was a commission
Huh... Ok.
Hopefully the commissioner shares that fix.
I don't sit well with anti-cheat fixes that aren't published.
I don't know what he will do, I was asked to send the files when I finished it
For sure. Not your problem. =)
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.
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
Agreed. I did just that for the anti-cheat patch I released in January of last year.
It had controls for ~60 anti-cheat patches.
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?
I mainly dabble in open-server solutions. =)
It is the model used when the item is dropped on the ground. I guess the best "list" would be the model script txt files, but not all models in there will be meant for items on the ground
I'll go find that script then! Thank you! 💛
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
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.
Hello is there a function to make http request ?
Sorry, no.
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.
But on the server not for all client ?
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.
do you have any documentation or forum talking about that
Nope. I have 10 years' experience in doing things like this to PZ.
I know whacky ways to get things done. =)
maybe we can go in mp ?
?
pm sorry
oh : (
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.
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.
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
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>
also make sure the texture path and name in that xml is correct
Three back-ticks and xml beside it makes that text look prettier. =3
These 2 must match the xml name and GUID used in that file to show up
And must not be a GUID used by another item in the game
Looks like the problem was the texture, goodbye to 5 hours of my life 
now i have to fix the model
I need to buy a mic and record tutorials on how to do some stuff and post YouTube videos.
omg that would help so many people lol
it would aha
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.
400?
i have a great one for 40£
this one
you dont need an expensive one
was it any good
Yeah. Needs a cloudlifter.
It's a quieter mic.
cloudlifter?
Might grab something small and then get to recording.
ah i use a usb
I have a USB mic lmao
you could make tutorial videos without a mic
eh it would be harder
cause people can have hard time reading text
true
Reflect on what you said.. Then never say it again.
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.
that would be better lol
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?
Blender, or at least some versions, should be able to export X without the need for an addon. But you are not limited to X, you can export as FBX and it will work
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.
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?
None.
You can absolutely convert PZ .x models to fbx format to create new models.
this is a stupid question but can i use fbx or do i have to use .x for the game to be able to use it?
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.
ah, alright thank you : )
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.
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.
FBX > .x any day
.x is a microsoft created format that was primarily for xbox and microsoft pc games. it has been greatly depreciated.
Are you using FBX for animation files?
yes
You can perform a GET request using getUrlInputStream (returns a DataInputStream on which you can call the readLine method), but that's it as far as I know
So yes, but it's limited
uh no i need a post request x )
What's your use case (if you don't mind my asking)? API requests of some sort?
to add discord role to playing player
so yes by a api
Good, good. I need to give that a try then
Gotcha
This is a cool idea. I hope you figure it out
absolutely, when i found out pz used .X files it almost gave me something, good thing it uses .FBX files too
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
you're allowed to cuss!
i have yet to find a guide anywhere that shows how to actually create one and iv looked threw tons of mods and cant figure out where this file would be stored and i feel like this would confuse me if i did find it, unless there is a guide somewhere ill have to find someone that can sit me down and teach me :/
XD thank you!
you can read the modding policy if you wonder what's allowed https://projectzomboid.com/blog/modding-policy/
omg thank you lol didnt even know there was one!
how would i go about making the tooltip go down a line so its not so long...
Add \n
thank you ❤️
like this?
it didnt work >.< it puts the \n in the text its self
does anyone want to help commission a wheelchair mod?
Odd, I feel like I've done it before
i think it's something else for tooltips
i'll see if i can dig it out of one of my mods
im looking for it on google in the mean time if you find it before me please let me know XD
oh i think i used it in literacy
that's for a skill tooltip but it'd probably be the same
<LINE>
I think I'm recalling using draw text for custom tooltip
Tooltips should honestly wrap long lines though
definitely
i shal try the <LINE>
yeah, try it out
how many time has passed since when it was released?
oh i see <br> in Tooltip_EN
that might be the one you're looking for
i thought it was something like that
its been 3-4 days now since he released it 🙂
so not <LINE> lol
<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
<LINE> does not work on tooltip just tired, going to do <br> lol
wow that's good numbers! what is the mod?
Take a look at the files in media/lua/client/Context/Inventory/
it is <br> for tool tip worked like a charm!
will do thank you Soul your always helping me ❤️
4 days ago
yeah but what's the mod! I want to give a like too (if I like it 😛 )
its called "The Krak Inn Drugs" atm we are working on the new OD feature and 3D models ❤️
yea what he said hes my partner in modding lol
i take the profit while he does the work lol
jk
gz @dusty wigeon I can't say that much from my first mod 😮
when was yours posted and what was it
ill also be working on his translation files to add Russian and Japanize
What's the current version number rn? 41.81?
it's the witcher sound for level up
https://steamcommunity.com/sharedfiles/filedetails/?id=2964763551
41.78?
sounds more right...
im in game one sec can check
41.78.16
nice! thx!
anytime 🙂
I totally bought it! does it have comptibility with "DrugMod" ?
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
want a spanish translator?
it is compatible but not sure why you would use both XD and if you want spanish translations i can add them as well for you 🙂
Here's where the traits are created, which seems pretty standard for traits mods:
https://github.com/hypnotoadtrance/MoreTraits/blob/master/Contents/mods/More Traits/media/lua/shared/NPCs/MoreTraitsMainCreationMethods.lua
But i see functions that would affect the game in here
https://github.com/hypnotoadtrance/MoreTraits/blob/master/Contents/mods/More Traits/media/lua/client/MoreTraits.lua
What connection am i missing?
have you checked the mod "dynamic traits" ? It gives the traits during the game while doing certain things or achieving some specific level of a skill
I've looked for it but I haven't been able to find a git repo for it anywhere
yeah, I'm spanish but if you do it, seems nice 🙂
I was using drugmod before, I will use both and see if I keep both running or just one
you can subscribe to it and see their changes,
C:\Program Files (x86)\Steam\steamapps\workshop\content\108600\ inside here, look the ID number of the mod
bet! Thank you
usually modders leave comments on the scripts
they're all called in functions near the bottom that get added to events
AH HAH! THANK YOU
so i'm just blind
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
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
when trying to reach a mod creator, i normally comment in there mod description, might be taboo to direct message never tried lol
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
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
yeah, afraid there isn't much you can do with the vision cone
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
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)
hey if you ever get in contact with him, can you ask how he did the black and white filter? I wanna use it for the Bull mask im making lol : )
You can take a look yourself. They wrote a shader in their mod, you can take a look at it following the instructions above
Hi guys, is there any free server hosting for project zomboid? please 😦
oh, alright thanks man! : D
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.
=)
My linter is going to use rulesets and recursive logic.
Going to be fun when I start seeing the results.
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
Always expect the unexpected journey.
But make the journey fun and worth having.
100 percent worth it
I thought adding all the masks would be sorta simple but everything ive thought of adding is gonna take a long time now but its gonna be so worth it to me
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
Throwing code into the void however this is my current design for my linter:
Just wrote all of it. Haven't tested it yet.
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
Show the clothing script
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,
}

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
.....................
<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
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
i had copied that from a similar item script that used the same thing
and theirs presumably works
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
Altho to have an item than occasionally shows upis sorta trippyand might be a happy accident
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
Maybe it shouldnt be normal? Jk
about to just give up on it honestly as badly as I want it to work
bc i'm totally stumped

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
Whe. It doesnt load is it just doing idle anim
Just realized how sus the phrase was

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
Ye maybe just reload
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?
Will likely work on the vscode extension tomorrow. Good night.
You have to modify all the clothing items that areaffecting your fannypack
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
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.
you can definitely use lua to play audio when a certain line plays, not sure how to mute the regular noise though
alright, thanks for verifying that it is possible
tysm for this
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
are there any scenarios with options available?
is there a way to remove the shadow
have you tried waiting for night time

fr though i have no idea sorry haha
kitty backpack is progressing nicely
draw water on top, like splashes
@ancient grail


