#mod_development
1 messages ยท Page 170 of 1
But as you can see here it's just checking if there's a light, and if so, it'll check if the light is on and do some stuff based on the battery, which is not an issue for me cause mine is always at 100%
So it's not really doing anything important
And that's all my leads
And before you ask, I did use part:setLightActive while creating the light part and it didn't do anything
@heady crystal hey quick question, do you know how to stop zombies spawning with bandages on?
Nope I don't mess much with zombie code
Barely did, only for the camo mod
I know there's a method for adding them
But I didn't find anything for removing them as I messed through the code and docs to make the camo mod
I could be wrong though
where abouts were you looking to add them?
I found a file called clothing_zeddmg.txt
could this be it?
i am very sorry to tell you this is probably dead code
i looked around the java, and while those methods have a *lot* of code associated with them, i couldn't see anywhere they actually *do* anything
so i tried commenting out the method calls and headlights still work perfectly
test it further yourself but i don't think this code is actually responsible for headlights, or maybe anything at all
@heady crystal & @bronze yoke
ProjectZomboid\media\scripts\vehicles\template_headlight.txt
module Base
{
template vehicle Headlight
{
lua
{
create = Vehicles.Create.Headlight,
init = Vehicles.Init.Headlight,
update = Vehicles.Update.Headlight,
}
}
}
Vehicles.Create.Headlight and the others are globals functions defined in the server directory.
When a vehicle spawn or is loaded on the map for the first time it has to create vehicle parts with random values so those global functions are used.
Vehicles.Update.Headlight is also called every ten minutes.
It is serverside
As I said above, Vehicles.Create.Headlight doesn't handle the light itself, it just creates the part as any other function. And Vehicles.Update.Headlight also doesn't seem to do anything regarding to the light itself. It only works if you reload.
I needed whatever actually makes the light function
Because you probably need to transmit something i'll take a look
I thought about that but then why doesn't the vanilla code do it
If it's just hidden I'll be mad
I used vehicle:transmitPartModData(part) after creating it and it didn't do anything
setLightActive update flag in serverside so it should technically update clients eventually
VehicleManager is in charge of updating all vehicles based on the flags set to the vehicle.
Can we force it to update when we want it to?
VehicleManager is updated in IsoWorld update.
So if the flag has changed it should technically send the update to clients
is it working in singleplayer? not sure we should worry about synchronisation yet
Nope, not by creating the item and the spotlight
I'll try activating it on creation and then on update
Try adding a print too to make sure you actually reach that part of the code?
wh
WHAT
Ok I am even more confused
So this whole time, I was testing it on one type of bicycle, the one that is guaranteed to have a headlight. It is using a template of mine for the headlight.
And the headlight spawns and all, but it doesn't work until you reload.
But now I tried it on a bicycle that uses the SAME template, and.... it works
Mind you I am not even checking anything cause obviously these functions will only trigger from my code
It's just creating the headlight and that's it
Everything is the same

So it's working or not?
It works on one of the bicycles and not in the other that has the same code and txt structure
So both and neither?
Id have to see it's hard to tell whats going on here
haha most likely yes
Omg
Reloading fixed it!
Sorry I was also messing with some animations
This is so messed up, I'm not even gonna question it lmao
Like both bicycles share literally the same txt file with some small performance tweaks and models, and the code isn't differentiating between them. It should just work. This is so weird.
๐ฅบ It's beautiful
Nooo I hit a tree 
yay!
Yay for hitting a tree 
i need to do something like this myself soon so i'm glad the entire puzzle was solved for me 
I've been working with those functions for a while now in my upcoming mechanic mod
@heady crystal don't forget to hook those functions correctly for mod compats
I do it this way so that I can reload and test changes.
_Vehicles_Update_Engine = _Vehicles_Update_Engine or Vehicles.Update.Engine
---@param vehicle BaseVehicle
---@param part VehiclePart
function Vehicles.Update.Engine(vehicle, part, elapsedMinutes, ...)
--- do stuff
return _Vehicles_Update_Engine(vehicle, part, elapsedMinutes, ...)
end
Thanks for the tip!
ahahah
Yeah this update adresses most of the issues the mod had. Well, out of what I can fix that is.
Tandem bike soon!
Also I reeeeeally could use that OnVehicleCrash and similar functions ๐คง
I do my own spin on it but it's not great
I thought about that, but past me decided to do an occasional check that tests the current engine damage vs the previous cached one and based on that calls it a collision
won't this break if two different mods do it?
Current me isn't gonna bother fixing it cause it works great
It will break the load order

@bronze yoke So if an other mod was init after, and you reload the one before, that latest one wont be there anymore
I just call my own custom function for this
The vanilla is already super simple nothing special about it, so there's no need. For my stuff that is, engine for instance is more complex from what I saw but I don't need to mess with that.
But technically only a reload would break something cause in normal game script do not reload
what i mean is even without reloads if two mods use this method of hooking then only one mod will ever be applied at a time
hum no it takes the latest function if it exist already or it take the default one.
so it follow the chain
it takes the already stored one if it exists, and the first mod will store it, so it always overwrites previous mods

-- mod1.lua
_FuncName = _FuncName or FuncName -- _FuncName now points to the vanilla function
function FuncName()
_FuncName()
print("mod 1!")
end
-- mod2.lua
_FuncName = _FuncName or FuncName -- _FuncName already exists pointing to the vanilla function, so we use that
function FuncName()
_funcName()
print("mod 2!")
end
```mod 2 will overwrite mod 1
Does either of you have experience with AnimSets, the xml files?
just a little
i've helped debug it but never used it myself
Ngl you have to actually reload the game from zero to test stuff there and I am just lazy rn lol
Ah ok then
I just wanted to make sure there are no or conditions basically
So here's my code for triggering the bike idle animation:
<m_Conditions>
<m_Name>BikeType</m_Name>
<m_Type>STRING</m_Type>
<m_StringValue>Base.BicycleRegular</m_StringValue>
</m_Conditions>
I tried adding a second <m_StringValue> with the Scrap bicycle variant but it didn't work, so I am just using a separate file for it rn.
But I found out there's some vanilla files that have multiple <m_Conditions>, but it's probably a and rather than an or
i think it's an and
Yeah it makes more sense that way
Well it's true now thats a bummer lol

I hate to have to reload the save to test changes in hooks. I supose a prefix name would solve it if it's unique but will saturate the global env even more
Hooking into a static function - Allowing file reload when debugging
Cache the original function the first time it's loaded, when reloaded the cache will be taken.
--- Prefix with your own mod id or it will override each other
MyModId_Vehicles_Update_Tire = MyModId_Vehicles_Update_Tire or Vehicles.Update.Tire
--- Override original function
function Vehicles.Update.Tire(vehicle, part, elapsedMinutes, ...)
--- do some stuff
--- return the cached function call
return MyModId_Vehicles_Update_Tire(vehicle, part, elapsedMinutes, ...)
end
Original function: the function taken from TIS lua.
Cached function: the cached reference of the original function state before this current file was first loaded.
I wish I knew what sets it off other than hello
loll oh thats what happening here xD
ya
So an update to PZ-Rosetta: I can now spit out typings for Umbrella that include definitions and documentation I wrote.
This is what an example currently looks like.
I know Braven is still working on the bike mod (the headlight questions from earlier) but I'm so excited to see Braven's Bicyles Redux in the suggested mods! I need bicycles. ๐ฒ
isn't it already public?
how funny on a scale from Clown to Monty Python would you set this one? "java function with boolean return value called from lua interpret false as nil making the result comparison to false : false instead of true".
implicit evaluation?
I lost hours on this and probably some life expectancy too.
like "true" == true in JavaScript.
it's more like the opposite
I can do
if(array.length) {
// Do stuff since the array is populated
}
``` in JS.
Just wasted some time of my own lol
I'm not sure that's right, it probably returns null?
yes it was null and I was comparing to another (lua) function returning false => results are interpreted as different
Any idea how I can replace temporarily a nested function ? My target is ISContextDisassemble.lua self.createMenu ```ISWorldMenuElements = ISWorldMenuElements or {};
function ISWorldMenuElements.ContextDisassemble()
local self = ISMenuElement.new();
function self.init()
end
function self.createMenu( _data )
...```
can I override ISWorldMenuElements.createMenu ?
Basic lua:
not zx returns true if zx is nil or false
checking zx == false, or zx == nil will give different result for false and nil.
when you use the AddXP event what are the booleans at the back of the function?
one of them is a callback to the OnXpGained event but i don't know what the other one is.
Player:getXp():AddXP(Perk, Amount, false, false, false)
AddXP(PerkFactory.Perk type, float amount, boolean callLua, boolean doXPBoost, boolean remote)
what is doXPBoost?
whether to apply xp multipliers
i think its broken for the protein bonus then
it is
i just figured it after 20 minutes of trying to figure out where the extra 2.25 xp was coming from in a pushup
lmao
It is public, I just assumed they were still making adjustments based on questions from earlier.
๐ ๐ Has anyone had any luck creating sandbox options that appear in the server "Edit Settings" screen?
I'm currently trying to test multiple users by using the -nosteam startup flag if there's any chance that makes a difference
you need to enable mod in main menu
Yup that was it. Thank you. Glad I didn't spend an hour trying to figure this out.
So just to confirm I understand what's going on. The mods used by the server must be selected via the "mods used by this server" view and to adjust sandbox variables the mod just needs to be enabled on the host's client? **The host doesn't also have to have the mods enabled for the server to run? **
makes perfect sense in hindsight. I just hadn't considered it.
it's only going to load the files for the mods you have activated, not the mods that will be activated in the future
where can I hook light switch on/off by left click ? (same for curtain open/close)
looks like ISObjectClickHandler
sure, DM me
I wonder why ISObjectClickHandleris server side.
print in the serverCommands handler is not working? For example this print in server file should work? I have issue with debugging server commands handler
local OnClientCommand = function(module, command, player, args)
print('Oh, hi Mark!')
end
Events.OnClientCommand.Add(OnClientCommand)
Are you checking the right file? Host server prints to coop-console.txt for example. It could be wrong machine too?
Oh! Thanks. I only looked at the terminal and the lua console, damn
Is it me, or is that not really intuitive? ๐
probably old code, anyway server/anyscript.lua runs on both client and server
which is why sometimes you have to use isServer() if you don't want it to run on the player machine.
Tho I don't think client/ runs on the server.
Howdy. Got a question for you all, do any of you know if there is a way to detect if a helicopter event is active? I'm in the process of looking myself, my servers got a few folks who are hard of hearing or deaf, im looking to take advantage of the moodle framework as an indicator for those people, so they know when a Heli is flying over head
the helicopter class isn't exposed so i can't really see any way to judge if it's active or not
you could just assume it's active between gametime's getHelicopterStartHour getHelicopterEndHour on getHelicopterDay
Yeaaah I just stumbled across that and was considering if it was dumb or not. Ill give that one a try, thanks
it probably won't work with admin spawned helicopters but i don't see any way to actually check the helicopter's state
Hmm true. Luckily we don't really go around spawning helis, so it wont be a maassive issue
sides, some information for folks will be better then none I reckon
this is actually working quite nice... Now to tackle the issue of proximity to player! Anyway thanks for the help!
I am looking to commission someone who is good at making cars in pz for a small car pack (Around 6 vehicles) of quality around KI5's vehicles, if anyone knows someone I'd be glad
@faint jewel
Im having an issue with using
OnCanPerform:HardenSpearCampfireOn,
My function is just in a regular file, as follows
function HardenSpearCampfireOn(recipe, playerObj) return true end
am I missing something?
Also, how can I get the recipe object to give me a reference to the NearObject IsoObject rather than a string representing the argument defined in the script?
what is the issue?
I get a lua error where the function HardenSpearCampfireOn can't be found when its specified as the OnCanPerform parameter of a recipe
what is the filepath of the file containing the function? e.g. media/lua/shared/myfile.lua
its in media/lua/server/myfile.txt
it must be a .lua file
Ah, duh
I looked at other mods, and I overlooked I use the same editor for text and lua files and thats why I messed it up
Also is there any kind of importing that has to be done when defining a Moveable, or do you just write the object in a lua file and the game automatically adds it to the building context menus?
the building context menus are like ULTRA hardcoded iirc and crazy annoying to add to
So if I want to add an object as a "workstation" or whatever that gives bonuses to recipes crafted at it....?
Basically, you can store all your tools at a workstation, and if you do your assembling and disassembling at it you get bonus yields and more xp. I also want to make it a requirement for some recipes as a NearObject
Actually, I want to do the same thing generally for other professions like tailoring and first aid. Having designated stations that give bonuses to those skills when you work at them, and rewarding you for organizing your base so that each station has a designated room
I have a feeling my life would be easier writing core mods first, doing stuff to change how fluids and structures are handled or imported
i'm new to modding and i felt like making a mod to add a over/under shotgun, right?
-i followed this tutorial that shows a template for adding a gun, and i have no clue where to find the installed mod in my files to get access to the template
-and i need to know where i can find the stats for the DB shotgun.
media/scripts
got it, thanks
I am attempting to unpack a .pack file
tilezed seems to have an option for this but I can't select the file I am attempting to read
I have the same question lol
I used to do it in the past and totally forgot
it's a small icon in the upper left
It's not well labeled
you click the File Text
gl
thanks
different issue, the shotguns stats are changed, but the model is that of the normal double barrel
and i also am following a tutorial that explains doing an AR, so i've got alot of holes in my information and understanding
(i have no idea what i should post for someone helping to see)
Hey everyone. I'm having a small problem getting the profession screen to sort traits in multiplayer. I have the following code that works perfectly from a client lua file in single player:
local ccp = MainScreen.instance.charCreationProfession
CharacterCreationMain.sort(ccp.listboxTrait.items)
CharacterCreationMain.invertSort(ccp.listboxBadTrait.items)
CharacterCreationMain.sort(ccp.listboxTraitSelected.items)
The client file apparently isn't called when creating a player for a server, so I tried this in a server file and shared file. Both fail to declare the variable ccp claiming attempted index: instance of non-table: null at KahluaThread.tableget line:1689. Maybe I'm trying the wrong thing? Does anyone have advice on how to sort traits in multiplayer?
if it doesn't bother anyone, i could use some help.
i'm still having this issue
{
mesh = weapons/firearm/OverUnderCLOSED,
texture = weapon/firearm/OverUnderTEXTURE
attachment world
{
offset = 0.0000 0.0000 0.0000,
rotate = 0.0000 0.0000 0.0000,
}
}
model OverUnderShotgun_OPEN
{
mesh = weapons/firearm/OverUnderOPEN,
}
}
}```
my code for getting the model
Try check "CoopCharacterCreation"
the model for the opened shotgun is just the normal DB model, but the model for the closed version just doesn't appear
I tried CoopCharacterCreationMain and didn't have any luck. I'll try this though.
It's not easy to help without have mod
Send me in pm, I will check. Maybe I will can help
Can I have my mod be configurable through other means than sandbox options? Like, can I add a custom server option or something?
I need to have a multiplayer mod be configurable server-side, and I cannot use Sandbox Options
You could read/write a file
@tardy wren check for getFileReader() and getFileWriter()
From a modders perspective, I make it configurable from lua.
Hey! Just reading through the API, if I wanted to get all the ISO objects within 5 tiles of a player, do I need to iterate through them one by one or is there a built in method to do this? Also, if the former is the solution, is there a function that allows me to check if there's an iso object at a given (x,y) value?
Sandbox is still my favorite cause it transmit changes
So save to file on the server? And transmit it to players over GlobalMkdData
yep
About that... It's for a.mod that fixes the issue of sandbox not transmitting changes
hum
The only reason for that issue I have found is when you install "a butt load" of mods
It works with vanilla or only some mods
interesting
Yes. Our .modded server suffers because players log in and sometimes play with outdated sandbox settings
If an admin updates it at runtime, they get transmitted to the players no problem
make clients request the server to do that when they join
That action requires an admin client account
I tried that
I got that part to work by transmitting sandbox options via mod data
Also firgot to mention, the only open function I found that does that sends the client's (outdated) options to the server and sets them
oh nightmare
for clarity, can you tell if you tried using the SandboxVars?
Yes
SandboxVars is nothing more than SandboxOptions serialised into a Lua array
Afaik
and you check them at what stage?
I don't remember... I think I send an update request on the first player update
I don't check if they're outdated... I just send
you could probably just send the SandboxVars table as is through a servercommand
i don't think it has anything weird in there you wouldn't want
or would cause issues with servercommand
You know... I didn't think of that. I used Eve's odd serialisation method
Loading them straight from and into SandboxOptions
i think you would need them into SandboxOptions for them to save (maybe, and not super important they save when you're doing this every join anyway) but i recall seeing a FromLua that might do that
I could've sworn FromLua grabs the file or local cache... I don't know, I wrote that part a few months ago now, and verified that it works
I'm thinking of a completely different issue right now, guys. I modified metadata of SandboxOptions.SendToServer() to make the server update its ModData cache of SandboxOptions. That function blocks non-admins and the server from updating the vars through it
So I wanted a non-sandbox config option to release that block, cause... Well, it might be a security concern, though lua checksum should handle it
your problem is that in shared or server, the file will run on the server, which doesn't run the client folder so the ui objects it creates do not exist in its lua environment
attempted index: instance of non-table: null tells us that not only the object doesn't exist, but the class doesn't exist at all
I'm trying to think of an intelligent response but my brain is ๐ง right now. If I want to sort traits from the CoopCharacterCreation page (view? is it even a page?) should I be trying to do this from a client file or a shared/server file? I believe I need to continue trying to do this from the client file. If I put it in shared or server no client will ever hit that code?
it will hit that code, but so will the server - you can stop that with a not isServer() check but i don't really see any benefit to doing things outside of the client folder
Follow up question while I have your attention. I'm really sorry that I can't seem to keep my grubby paws out of your codebase... ๐ฌ This is the response I was working on right when you posted your response:
Update on this question #mod_development message about sorting traits on the Coop Profession screen. I've determined my first (and maybe only) problem is that my code doesn't even execute. I'm using Albion's Trait sandbox code which can be seen here https://github.com/demiurgeQuantified/Zombie-Contagion/blob/develop/Contents/mods/ZContagion_Traits/media/lua/client/zcontagion/traitcode.lua.
I >>think<< this code detects when the sandbox options screen is accessed to add/remove traits as needed. I believe it's handled here on line 3, 5, and 6: If I'm reading this right, Albion saves the old version of the SandboxOptionsScreen.setSandboxVars function and then creates an identical function that will get called instead?
3 local old_setSandboxVars = SandboxOptionsScreen.setSandboxVars
4 ---@param self SandboxOptionsScreen
5 SandboxOptionsScreen.setSandboxVars = function(self)
6 old_setSandboxVars(self)
I tried to do the same thing in my own code, watching for the CoopCharacterCreationProfession page, but I must be doing it super wrong or have completely misunderstood what I'm doing because this doesn't trigger.
local old_CoopCharacterCreationProfession = CoopCharacterCreationProfession.new
CoopCharacterCreationProfession.new = function(self)
old_CoopCharacterCreationProfession(self)
print("does this print in the logs?")
end
I'm not getting any errors so I can't really figure out what I should try next.
yeah, that's what it should do
i don't know why it's not executing, but it has some major issues if it did:
- you need to copy all the parameters of the original function and pass them to your copy
- the original function returns a value, you need to make sure you return the same value (or a replaced value if that's your intent with overriding the function)
e.g.
local old_CoopCharacterCreationProfession = CoopCharacterCreationProfession.new
CoopCharacterCreationProfession.new = function(self, x, y, width, height)
local oldValue = old_CoopCharacterCreationProfession(self, x, y, width, height)
print("does this print in the logs?")
return oldValue -- if your extra code all runs before you call the original, you don't need to store the return value in a parameter like this
end
Ah I see. I just grabbed any function poorly assuming old_CoopCharacterCreationProfession(self) would just... fix all that. ๐ฌ
Collide, still curious if you got your sandboxvar-defined trait costs working. Also what do you mean the traits arent sorting? Aren't they regularly sorted by cost...?
i wonder if you should hook CharacterCreationProfession.new instead? maybe this one is only used for splitscreen players or something? (otherwise why make it its own class?)
this one calls that one anyway, so it would affect both that way
funny you should ask that. Albion's code worked flawlessly here https://github.com/demiurgeQuantified/Zombie-Contagion/tree/develop/Contents/mods/ZContagion_Traits
Oh shoot. I hadn't even considered that all the Coop functions might be meant for splitscreen.
actually, this one is not even used ๐จ
oh, wait, i missed something
but yeah i wonder if the coop variants are only when creating player 2 onwards instead of for player 1
I should have figured albion figured that out herself at one point lmao
@trim mist it really was as simple as copying his her https://github.com/demiurgeQuantified/Zombie-Contagion/blob/develop/Contents/mods/ZContagion_Traits/media/lua/client/zcontagion/traitcode.lua and https://github.com/demiurgeQuantified/Zombie-Contagion/blob/develop/Contents/mods/ZContagion_Traits/media/lua/shared/zcontagion/traits.lua files directly into my project and renaming the trait to match my own. I've been staring at this exact code for over a week and I'd be happy to help you get it integrated if Albion somehow isn't around ๐
her!
NOOOO!
๐ are your pronouns not she/her
Sorry!
hehe don't worry, it happens about half the time
I've been SO careful because I don't know anyone's pronouns. I'm so sorry!
I'm for it
or honestly it could just be put in our nicknames
oh shoot. There's a pronouns field in the edit profile page
ahem anyway, uh, I would love to take a look at this stuff and see about integrating it. I want to make my traits mod as customizable as possible. That way I can leave balancing up to the people instead of people jumping down my throat about Bull Rush being too cheap
oh shoot shoot. Albion's pronouns are already set. That's on me then. ๐ฌ
most people don't actually have that section, they've been rolling it out for over a year and still nobody has it ๐ ๐
i just put them in my bio and hope people will see it
I feel the same. I'm trying to restore an old trait from More Traits but I always felt the old trait was way too valuable. 18 points to start the game covered in burns... I feel like it's a 10 at most. Why not let the players decide.
burn ward patient? lmao. That one is brutal
But I've been working on it so long, HypnoToad already basically reverted it hahaha
with the carrier trait, i literally could not justify any specific price, so i always wanted to make it customisable
if it's a positive trait, well it's negative for people around you, so it's not really positive if you're working with other players who don't have it... but if it's negative, well if everyone has it it just means everyone is immune from the mechanic entirely, so it's free points
With carrier it's value can also really depend on server settings. RP friendly only server is going to have a different value than a shoot on sight server.
So if the code works perfectly, what's this sorting issue you have?
oh my god i need to make a setting to have a random chance of having it, maybe even with it being secret...?
just remove the trait's icon and players will have no idea lmfao
I said what I said. If I found a bug I'm not mentioning it publicly until after its fixed. ๐
Okay, no worries lol
It's only a sorting problem in multiplayer
I doubt I could help more than albion, but I have been working on my furry traits mod since april, so there might be something I could do
What pisses me off is that MoreTraits has exactly ONE call to .sort ANYTHING. And somehow it works perfectly. I can't figure out how it works..
Is the bug present in all kinds of multiplayer? Or just coop
not sure about coop. I forgot coop even existed. I'll have to test for that next ๐
nobody remembers co-op...
does anyone play co-op anymore?
none of my irl friends will play PZ with me so I don't even play on servers. I just play SP all by myself.
it's funny, i specifically write with co-op in mind, i make sure everything properly supports multiple local players, but i have never for a second tested any of my mods in co-op
zombie contagion doesn't work in co-op actually, but the rest are designed to (hopefully) handle it properly
help me beta test my furry mod lmao
sure thing! I'm out of town this weekend but I'm happy to help. My career is QA so I feel way more at home testing than writing code.
playing remote play splitscreen with a friend before b41 mp came out is a really great memory so i do hope my mods work co-op
This is the ONLY reference to sort in the entire MoreTraits mod and it somehow sorts perfectly in SP and MP https://github.com/hypnotoadtrance/MoreTraits/blob/a685c2b07213c805f625fa3189a4d87c7c47f3b7/Contents/mods/More Traits/media/lua/shared/NPCs/MoreTraitsMainCreationMethods.lua#LL384C18-L384C18
Hi guys, one simple but newbie question here.
I designated a moddata to a player by
mod = getPlayer():getModData()
mod.test = 100
which worked like a charm.
However, I would like to delete this again.
How would I do it? Bit new to Tables functions
mod.test = nil
ah
but won't that still leave with the mod.test?
any ways to completely delete the table itself?
no, keys that point to nil are considered 'deleted'
that would actually be really cool. Send me a DM if you retain interest after this weekend!
ah gotcha
perfect. simple and effective
thanks for the help
also is there any way to bookmark discord msgs???
this just sorts the list when it's first created, if you're not messing with things live like we are it doesn't need to be sorted again
like i would like to come back to certain msg. so i can read them later
you can copy a link to a message and keep it somewhere, maybe a server only you are in or just a text document
gotcha
fwiw you can technically chat with yourself on discord by creating a group with just you in it. I use that chat to leave myself notes.
oh i didn't know about that one, that's definitely preferable to making a server
nice idea
but seriously @trim mist I'll check with you on Monday at the latest. I'm treating PZ modding as a full time job/ work experience factory while I'm unemployed. This is an extremely active community with plenty of people willing to help and that allows me to produce "stuff" that I can put on github. Helping QA mods could one day be super useful to mention in interviews if any company would get back to me.
Plus, I love this game and hate getting excited about mods and then discovering they melt the game to pieces and don't work.
Yeah I wish I could bring up this mod in any interviews but uhhhhhhhh
๐
honestly, i think you underestimate the prevalance in the industry
I wish I could be there the day Badonn is sitting in an interview reluctant to show off their furry mod, and the interviewers say, "I fucking LOVE that mod!"
i just assume that if a recruiter isn't a furry themselves, they have probably given up on trying to keep furries out by now
I can see it now on the job posting: "Company XYZ is proud to support diversity and inclusion and we are eager to share that over 50% of our company are furries!"
^^; if you both are so confident, maybe I could show this off as an example to companies lmao
I'm just afraid of being tossed for being a little out there
If I was interviewing you and you were proud of it, I'd want to see it. Interviewers are people too. But yeah, it does help to read the room. If it was my mod I wouldn't show it to a 70 year old in a suit and tie.
cringe work is better than no work
That's wise ngl
unfortunately that's most of the people I interview with.
Though....... sdklskdltksjdtkbg last interview I had
the prospective manager took me out to lunch and went on a tirade about covid conspiracies at the very end of my interview process
(it was a position in a biotech company btw)
I've heard the best way to deal with wild conspiracy theories is to one up them. You don't believe in the moon landing? Psh... look at this silly guy, believing the moon is real...
I wish there was a faster way to verify the server login screen. It takes me about 2-3 minutes per test. ๐ฆ
yeah, there's a reason i do almost all of my testing in singleplayer, even for mods that are very multiplayer oriented
I'm gonna sleep now. Thank you both for the conversation, hope you have a good night and @novel barn hope you find the solution to your mysterious sorting issue hahaha
I 100% tested everything I could in SP and I was JUST about to push and make it public, and then I spotted my trait in the wrong spot. :/
Yeah @trim mist I'm about to cash out as well
Thanks for chatting everyone! Goodnight!
gn badonn!
is it possible zombie contagion suffers the same bug?
i've been wondering about it since the start actually
the function to sort it should only get called if you went through the sandbox option screen, so it would make sense to me that it doesn't get sorted properly in multiplayer - or even the preset difficulties, though it probably isn't an issue on default settings anyway
yeah the likelyhood of anyone running into this is so astronomically small.
looks like it works ยฏ_(ใ)_/ยฏ
huh! well that's a relief
I am very confusion
has anyone here made an animation mod?
What's an overgrown zombies mod? ๐
A zombie whos overgrown with vegetation
Exactly, it would be better used with the 10 years later mod as that mod covers the map in thick vegetation
And I thought it was odd that the zombies wouldnโt also be covered in it
when it comes to the mod.info file that a mod needs, is the url= thing a requirement? if so, is there some sort of placeholder one could use if they don't plan to put a url there?
Its not mandatory
ah I see, sounds a bit like some zombies from znation ๐
Ok good news
I think I found an easier way to get this working besides using reshade, mod and another custom app
looks like some earlier reshade versions do continously log preset files for changes
so I should be able to get this to work
-In game mod detects weather, gameplay, ambient changes
-Adjusts climate. lighting and other settings to be more cinematic
-Mod writes a reshade preset directly to the file
-Since its an earlier reshade version should detect these changes
-Success
Hi there, is there a guide for modifications of AnimSets xml files ?
url= is not required, you can just remove that line
if you really want to use it I guess you could set it to your mod workshop URL or github URL etc
how do you make a broken open model for a double barrel shotgun mod
i'm trying to mod in a simple over/under shotgun
and it seems to default to the vanilla DB model when breaking open
Is there a way to check if a user has an access level through a LUA mod?
player:isAccessLevel("AccessLevel")
Reason: Bad word usage
ah I see, because for some reason my very small personal mod isn't showing up in the mod list despite seemingly nothing being particularly wrong.
maybe check your console.txt and search for your mod name or ID?
I can have a look if you upload your mod somewhere
Could you tell me where I could find the console.txt? (Also I'm not particularly certain on whether or not I upload the mod since its very small and changes like 1 thing)
in your Zomboid folder, where your saves are located
I still cannot find it (I'm using the steam version of project zomboid if it means anything)
if you're using windows it should be something like: C:/Users/YOUR_USERNAME/Zomboid/console.txt
oh wait I found the other zomboid file
how weird it creates one in userstuff
Wait theres two mod folders
One in the steam folder and another in the Zomboid one
which one am I supposed to use?
ah ok, It was the Zomboid one, thats really confusing.
the zomboid one
i'm not sure how to fix this
model OverUnderShotgun
{
mesh = weapons/firearm/OverUnder_CLOSED,
texture = weapons/firearm/OverUnder,
attachment world
{
offset = 0.0000 0.0000 0.0000,
rotate = 0.0000 0.0000 0.0000,
scale = 1,
}
}
model OverUnderShotgun_OPEN
{
mesh = weapons/firearm/OverUnder_OPEN,
}
}
Is there a list of accepted access levels / a way to check this regardless of language?
i don't think they're translated
at least not internally
iirc this method is actually fully hardcoded to accept certain strings anyway
admin, moderator, overseer, gm, observer, none
Another question:
I'm updating / fixing up an existing mod, and they seem to be hooking into the map UI. Just wondering if there's documentation on this / similar things like this / why this isn't done through an event hook. Are they not overriding the original method?
I also added some snippets which I don't fully understand, presumably due to underlying implementation reasons.
function ISWorldMap:onRightMouseUp(x, y)
if self.symbolsUI:onRightMouseUpMap(x, y) then
return true
end
(...)
local context = ISContextMenu.get(0, x + self:getAbsoluteX(), y + self:getAbsoluteY())
(...)
option = context:addOption(getText("UI_siko_MAPTeleport"), self, self.onTeleport, worldX, worldY)
end
function ISMiniMapInner:onRightMouseUp(x, y)
if not self.rightMouseDown then return end
self.rightMouseDown = false
...
if context.numOptions == 1 then
context:setVisible(false)
end
end
If anyone could give some info on these / provide links to relevant docs, I'd be very thankful!
how is a DB reload style weapon's broken open model assigned and how can i make it so it assigns the correct gun model to my gun
im at a complete loss and i dont know where to look
pm me if you want to take a look at the mod yourself
Here is your problem
@prisma wren Try create custom anim for your gun
Same as in this file, just change model in line that i point
Anybody know how to load a custom tiles file from a mod?
did you add the pack and tiles lines to mod.info?
Nope that's why I asked lol never messed with tiles before
How do I know which ID to use?
It says "This must be a unique number starting from 100"
tiledef=myTiles xxx
check link with ids
Thank you
I have no custom texture just modified the vanilla tile definitions
Mod is still not loading. My tiles file is named BravensTiles.tiles and I wrote tiledef=BravensTiles 21501

Oh, I have never overwritten vanilla. If you would rather just change sprite properties I have some scripts.
Yeah that's what I'm doing basically but it'd take quite a while to get all tiles' names to put on a script I think
It works if I just replace the file itself on my PZ folder but I wanted to include it as a mod
You create "broken" model and assign it to script. You can get double barrel shotgun script from Project zomboid>media>AnimSet>player>actions> and from here copy LoadDblBarrel, UnloadDblBarrel and RackDblBarrel, change its name to Load"yourweaponname" and do that with rest
Ugh this is irritating. It won't load if I specify tiledef

Ok I found out
My ID was too big. More tan 21k = Won't show up
Guess I'm calling dibs on 2101
You also need Rack and Unload ones
and in all of them change thing marked by Aiteron
You could take a look at my mod if you want reference, i do have similiar weapon
Additional Firearms R is the name if you feel like checking out
only 9 Weapons and i belive Double barrel rifle is first in text file, and animset only consist of 4 files, where 3 are related to reload.
rack and unload?
Yes
ye
Hope it helped you in some way
i need to have it get the file directory
what do i need to set the directory as for the model
and where do i set it
You did assing mesh and texture to that model, just like with basic one right?
thats what i mean
it still doesn't appear on reload
No model shows up, or is it still vanila model, or even reload at all doesnt work?
no model appears, reload does work
Reason: Bad word usage
Could you try checking if that "broken" model will appear in game at all?, change your basic gun sprite with "reloading" one and see if its not because of model
Hey hi
o/
i don't follow
Checking the zdoc lua, I find this for the ISWorldMap:onRightMouseUp method.
If you create a mod which also implements this method, does it override it, or "side-load"/add to it?
function ISWorldMap:onRightMouseUp(x, y)
if self.symbolsUI:onRightMouseUpMap(x, y) then
return true
end
if not getDebug() and not (isClient() and (getAccessLevel() == "admin")) then
return false
end
local playerNum = 0
local playerObj = getSpecificPlayer(0)
if not playerObj then return end -- Debug in main menu
local context = ISContextMenu.get(playerNum, x + self:getAbsoluteX(), y + self:getAbsoluteY())
local option = context:addOption("Show Cell Grid", self, function(self) self:setShowCellGrid(not self.showCellGrid) end)
context:setOptionChecked(option, self.showCellGrid)
option = context:addOption("Show Tile Grid", self, function(self) self:setShowTileGrid(not self.showTileGrid) end)
context:setOptionChecked(option, self.showTileGrid)
self.hideUnvisitedAreas = self.mapAPI:getBoolean("HideUnvisited")
option = context:addOption("Hide Unvisited Areas", self, function(self) self:setHideUnvisitedAreas(not self.hideUnvisitedAreas) end)
context:setOptionChecked(option, self.hideUnvisitedAreas)
option = context:addOption("Isometric", self, function(self) self:setIsometric(not self.isometric) end)
context:setOptionChecked(option, self.isometric)
-- DEV: Apply the style again after reloading ISMapDefinitions.lua
option = context:addOption("Reapply Style", self,
function(self)
MapUtils.initDefaultStyleV1(self)
MapUtils.overlayPaper(self)
end)
local worldX = self.mapAPI:uiToWorldX(x, y)
local worldY = self.mapAPI:uiToWorldY(x, y)
if getWorld():getMetaGrid():isValidChunk(worldX / 10, worldY / 10) then
option = context:addOption("Teleport Here", self, self.onTeleport, worldX, worldY)
end
return true
end
Fully replaces its
For example, were I to create a mod which does the same thing but with a getAccessLevel check for moderator, would this break the original?
Okay, I see.
Thanks for the swift answer!
Here one moment, Ill show you how to append to a method
I mostly want to make this method available to moderators and GMs, too. And I assume there's no way to selectively override a part of the method (the part where it checks for admin access level)
You're sure that model works and it will appear in game? I was starting with blender and had problems with making 2nd model to work.
I'm assuming through an event? Or is there a post/prefix system?
local saveTheOriginalToAVariable = ISWorldMap.onRightMouseUp
function ISWorldMap:onRightMouseUp(x, y)
saveTheOriginalToAVariable(self, x, y) -- Call the original
-- your code
end
Any idea about this one? Or am I doomed to perform code duplication?
Ye you'll likely have to duplicate some code if you can't get what you need done at the start or end
i found out the issue, i was setting the model that is replaced during the reload with the wrong name
Aight, thanks regardless!
right now i just need to fix the model for the opened model
since it's massive and facing the wrong way
i know something about it
What is this gun by the way, a vertical double barrel shotgun or rifle?
You just want to change whats in the context menu right?
Nay, I want to give everyone with an access level except for none access to the map context settings.
if not getDebug() and not (isClient() and (getAccessLevel() == "admin")) then
return false
end
This is checked here, but there's not much I can fiddle with there afaik (without copying over the entire method with a configurable / better check)
On a quick note, is decompiling Zomboid still done through that one Zomboid Decompilation tool on git? Or is there better / easier ways of doing it?
I have access to IntelliJ, for example. Not sure if there's built-in support there?
Is everything working?
what do you mean file for icons
Okay, question... Do tiles have ModData?
fbx?
did you make a mod for stakes a while ago?
I need to "tag" a tile by a player's action, be it a piece of furniture or floor, and later check if that tag is in place
No, ai didn't
ah alright
I haven't made any stakes... I did fix a hole in the back
what?
you just reminded me of some guy who made a mod for stakes leveling up spears
Anyway, yes, I need a player to modify a piece of furniture in some way(any piece of furniture) and later check if it was modified
if by tile you mean IsoObject on a square yes.
So IsoObject has ModData? Great. I reckon I have to transfer and download it all myself tho, right?
you set the modData on the IsoObject and then transmitModData from the IsoGridSquare instance the IsoObject is on.
And just to make sure, an IsoObject is anything from floorboards through refrigerators to a garden flamingo, right?
Yep!
IsoObject is the base class for all of the other IsoObject type
So... Everything has ModData? Or just about?
basically everything that exists in the world
Do they all have the same type of moddata in terms of what can be saved?
Yes, ModData is a lua table
No i mean in terms of what can be stored in it
As far as i know its mostly strings numbers and bools
Well, yes
But not like function references?
You can store a table inside a table
I... I honestly haven't tried that. It's a lua table and that can store lua data... But I don't promise it will survive a trip to the server
Ask your self if it makes sense to write what you put in to disk and reload it later without losing anything
Object references will be lost, but tables can be serialized to text no problem
Also it's not just writing to disk. It's adding whole extra data to an object
Oh sorry, i was talking about mod data
well, that kind of data *can* be added, it's only writing to and then loading from disk that's the issue - and since that's the main utility of mod data we don't generally make the distinction
Speaking of... Mod data can be uploaded to the server and downloaded... How would I make sure that a player doesn't modify a tile that's supposed to be protected by my mod? I would have to overwrite the actions related to those, but there's a delay and disconnect between requesting and downloading mod data... Right?
I could request it at the start of the action and check by the end of it...
maybe cache the result of the action until you get confirmation that it's allowed
if you can detect that
Technically you can store functions and java objects into modData, tho it will not save upon reload. So it's better not to do it. It will stay in ram only and be lost on save and load.
So moddata works kinda like a cache for certain types?
moddata works like a table
I have a question
I would like to make a mod first mod I have no experience in coding and no clue how to model I tried it on wednesday night and I'm just confused I tried using blender and I'm just wondering what should I start with like what would be the first mod I would make
You have to ask yourself that question.
fixed already
weapon icons
wow thanks.
weapon mod seems easiest imo but even then theres a ton of hurdles if ur gonna make a gun mod
but it is ultimately up to you
extremelly helpful
I dont mean it in offensive way. Thats how you start. You play game and think "Man i wish this game had XYZ"
yeah
i played the game and was like
'damn i wish there was an over/under shotgun!'
and here i am
okay my bad
working on my first gun mod for 13 hours
is there any other modeling program a idiot can use besides blender
blender is probably your best bet
its free + lots of plugins + not hard to use once you actually start getting somewhere + lots of people to ask for help
If its an new item you wish to make, first you can start by actually making this item in text file
also where are the weapon sprites stored? like for gun icons and such
But youre fine with how vanila machete works in terms of damage/weight/durability
yes I think so
is it in textures?
I think somewhere in media
but yeah
Sprites are the name of model like you have OverUnder_open, where textures are steamapps\common\ProjectZomboid\media\textures and models are in steamapps\common\ProjectZomboid\media\models_X
and in media>scripts you have text file models_items
and in blender I don't know how to make a good handle
it comes out all messed up I use the knife tool or the cut tool
if you need to have multiple parts of something to make a mesh look good
just
have multiple parts
My first models weren't great at all and they were HUGE once in game
okay
what tool did you use?
oh this seems nice
What man says, learn Extrude, how to grab edge/face/point you want
yeah
oh okay this is nice this tool
press 1, 2, and 3 on your keyboard while in edit mode to select through if you wanna select vertices, edges, or faces
that hotkey is useful
I learned something new
Nope, i was clicking on it with mouse 
how do I disable it from removing the face
I'm trying to change plant growths in the farming system.
function SFarmingSystem:growPlant(luaObject, nextGrowing, updateNbOfGrow)
This is the function I'm trying to change, but when I enter the game on my server, it throws an error. This is the error:
function: MYFarmingSystem.lua -- file: MYFarmingSystem.lua line # 5 | MOD: MadhousePayment
java.lang.RuntimeException: attempted index of non-table
Line 5 is the beginning of the function so this:
function SFarmingSystem:growPlant(luaObject, nextGrowing, updateNbOfGrow)
The script is located in the server/Farming file. When I reload the script in single player, it works as I want, but it doesn't work before. But in Multiplayer it prints the error I showed. What should I do?
your file is loading before the file that creates the SFarmingSystem class
wait
no that's not possible, i don't know why that's happening - it really only works when you reload?
does your file have a if isClient() then return end at the start? if not the multiplayer error is probably being caused by that
yea i did not add this control
I will add it and try again on the server
Could it be that the faming system of another mod I used while testing in single player is loading after mine?
An extrude of single face goes always in one direction i think
How about we move to #modeling with this convo?
sure
Well, finished that mod I was asking help with earlier. Allows server admins to change which staff roles (including "none") can access which map context menu items (such as "Teleport Here" or showing the entire map / removing fog):
https://steamcommunity.com/sharedfiles/filedetails/?id=2990319957
Might be useful for any server admins out there o/
at long last... i finished my project zomboid mod...
(i literally just updated the mod icon to be something else)
https://steamcommunity.com/sharedfiles/filedetails/?id=2990258828
Hello! So I am finally back to working on my mods after a long break -- One of the issues with one of my current mods, Everything has a name, which lets you rename items, is that renaming items isn't saved on a server. I assume that renaming an item is only saved client-side and not server-side, which is probably why its reset (?)
How do I ensure that a piece of code is running both serverside and clientside?
it's not that simple - the server and the client are completely separate, you need to send messages between them if you want something client-side to do anything on the server
doesn't vanilla have renamable items, do those save?
I suppose they do
Will look into the way they're done server-side. Fingers crossed I should be able to use the same method
Just a question real quick from a small problem I had earlier, but why does the Steam version of PZ creates a Mod folder in the common/ProjectZomboid folder but that mod folder literally doesn't work and requires people to use the "Zomboid" one thats placed in the user folder?
It confused the hell out of me and just seems slightly inconvenient, I mean, it creates a mod folder there, it just doesn't look at that at all.
i think listen servers might read from there
but they also read from the user folder so i still wouldn't really use it
I see.
anyhow, I'm probably gonna occasionally make mods for this game too since I'm "capable" (like atleast a few years worth of experience) of lua, I was just curious of a potential "first mod" idea so I can get the hang of certain things, I've looked at some docs and explainations on one of those github things but coming up with ideas is somewhat difficult for me.
Alriight so I couldn't find anything related. I created a server command instead, and tried to send it when a user changes a name. To confirm it works, I tried to print the item object -- It doesn't work. Anything I am doign wrong, in particular?
RenameEverything.lua
function ISRenameEverything:onRenameItemClick(button, player, item)
if button.internal == "OK" then
if button.parent.entry:getText() and button.parent.entry:getText() ~= "" then
if instanceof(item, "Moveable") then
item:getModData().renameEverything_name = button.parent.entry:getText()
sendServerCommand('RenameEverything', 'changeItemName', {item})
elseif instanceof(item, "Radio") then
item:getModData().renameEverything_name = button.parent.entry:getText()
sendServerCommand('RenameEverything', 'changeItemName', {item})
else
item:setName(button.parent.entry:getText());
end
local pdata = getPlayerData(player:getPlayerNum());
pdata.playerInventory:refreshBackpacks();
pdata.lootInventory:refreshBackpacks();
end
end
end```
```lua
RenameEverything_ServerCommands.lua
-- Use the RenameEverything table if it exists, otherwise, create it to hold the different functions that can be called by RenameEverything mod
RenameEverything = RenameEverything or {}
function RenameEverything.changeItemName(item)
print(item)
print(item:getModData().renameEverything_name)
end
-- Define the function that will be called when the server receives a command
function OnRenameEverythingCommand(module, command, args)
-- Check if the module is "RenameEverything" and if the command exists in the table of commands
if module == 'RenameEverything' and RenameEverything[command] ~= nil then
-- Call the appropriate function with the provided arguments
RenameEverything[command](args[1])
end
end
-- Add the OnRenameEverythingCommand function to the list of functions that will be called when the server receives a command
Events.OnServerCommand.Add(OnRenameEverythingCommand)```
-- and yes im checking for the printed message in the server console, not client-side console
I'm trying to make a gun mod for the first time. Everything was going fine until my gun wasn't appearing in game anymore, is their anyway i can fix it?
you need to send a client command
they're named after the sender
ah not server commands?
yeah, pretty much the same syntax, i think OnClientCommand throws an annoying player in the middle of the arguments but other than that it's the same
String module, String command, IsoPlayer player, table args,
alright will try that
@hollow current have you tried just item:setCustomName(true)? it looks like that flags the name to be saved
the client is usually authoritative over items so it seemed strange to me to need the server to intervene
@bronze yoke @novel barn have you had an error like this when trying to put trait costs in sandboxvars?
additionally has anyone had an issue with being unable to connect to a server after a while of it being up?
sounds like your getCost overwrite is returning a non-number
:l
option AnthroTraits.BeastOfBurden_Cost
{
type = integer, min = -15, max = 15, default = 4,
page = AnthroTraits, translation = AnthroTraits_BeastOfBurden_Cost,
}
haven't really tried that but I think I figured it out. I've been basically storing custom names for moveables and radios instances in moddata, which probably explains they didn't have any issues. Other items, I just used item:setName(). I instead set their name in moddata now and then, when I sent a client command like so:
function RenameEverything.changeItemName(item)
if isServer() then
print(item:getModData().renameEverything_name)
end
end```
It prints the name I just set, so I assume the name is saved serverside now?
I don't really see how :S the option has been defined as an int, I'm directly accessing it and returning it...
maybe i'm setting up the function improperly? This is more or less a cut-and-paste job from your contagion mod
drop a print or a breakpoint in there, but yeah i don't really see how that could break
sounds like it - moddata on items is synchronised automatically so it's a reliable way to save information
i'm curious if a setCustomName call is enough though
hmm lemme see
item.name should return the name that was set and not the actual name of the item ye?
or is it getName()
getName(), yeah
im not sure what's the best way to test this tbh. I am running a local dedicated server. I used
function RenameEverything.changeItemName(item)
if isServer() then
print(item:getName())
end
end``` to get the item's name after I set it clientside using
```lua
else
item:setName(button.parent.entry:getText());
sendClientCommand('RenameEverything', 'changeItemName', {item})
end```
It's printing the new name. I still didn't even use the setCustomName flag
which is rather weird
is it setting it BOTH serverside and clientside cause I am running the server?
item property changes should propagate automatically
@ancient grail yo buddy sup
did i misunderstand your issue? i thought they weren't saving
You might get better response from #modeling
Goodluck
I wish i know how to help but sadly i dont
Not much finishing a patch
Uhhhh if you make a patch to a mod (require it) we dont need permission right?
Or do we?
Not sure on that. I think it depends on the mod's author's license
(not legal advice) not legally since you aren't redistributing any of their code or assets but it would be nice to ask
it appears to be null. idk how
How does vanilla rename stuff?
maybe the default value isn't being read properly
Isnt setname enough?
setCustomName seems to set the flag for names to save (as well as a billion over things, in a way that i'm starting to suspect is either a logical error or quick and dirty optimisation)
setName is enough for certain items, yea, but for other items I had to go over a lot of details to get their names set correctly
idk what could be a logical error in an item:setName() tbh
Maybe cuz they used like recipe that converted the item.into something else?
what i mean is whether or not setCustomName() is set to true dictates whether about 20 or so other aspects of the item get loaded
function ISRenameEverything:onRenameItemClick(button, player, item)
if button.internal == "OK" then
if button.parent.entry:getText() and button.parent.entry:getText() ~= "" then
newName = button.parent.entry:getText()
if instanceof(item, "Moveable") then
item:getModData().renameEverything_name = newName
elseif instanceof(item, "Radio") then
item:getModData().renameEverything_name = newName
else
item:setName(button.parent.entry:getText());
sendClientCommand('RenameEverything', 'changeItemName', {item})
end
local pdata = getPlayerData(player:getPlayerNum());
pdata.playerInventory:refreshBackpacks();
pdata.lootInventory:refreshBackpacks();
end
end
end```
that isn't the case when they're being saved, so it doesn't save disk space, and many of them have their own 'please save this' flags, so it seems like a weird loading optimisation
hmm
it might be a mistake but it could just be a quick and dirty optimisation
do item names save in singleplayer? it seems like they shouldn't without setting the custom name flag
they do, yea
nah, its not that
Moveables and Radios, containers, and vehicles get their names stored into moddata cause they're rather special cases
Other stuff just use :setName()
Weird atleast now youve narrowed it down to syncing
Its being reset cuz theres no saved data.. i would suggest storing the name and when player logs in you trigger a function to rename them again
i notice it uses this setCustomName() flag for crafting, notebooks, and food, so it seems likely that is what it's intended for
Do you know how I might be able to figure this out? Maybe the issue is that these traits are being added before the sandbox options are being instantiated?
Perhaps thats the reason they all have different name setters
Then you have to filter out each itemtype
that's possible, when do you add your traits?
zombie contagion adds them on game boot iirc
mmmmm, yep, that's exactly the issue actually
wait. nvm
what I am most confused about is that I am able to retrieve the item's new custom name from a code that is running serverside, so :setName() is most definitely working for items serverside
so I am not even sure what is it about others who keep saying the items names are not saving
item properties should be expected to propagate themselves
I even tried to restart the server
local function initAnthroTraits()
...
end
...
Events.OnGameBoot.Add(initAnthroTraits);
have you reproduced the bug yourself?
no I am not able to, everything seems to be working properly
it sounds like it could be a vanilla issue
vanilla doesn't do anything special to synchronise them
so maybe these item updates are missed sometimes
Then could it be a mod conflict?
Maybe part of the issue of it not being reproduced is that im running the dedicated server locally? idk
shouldn't make a huge difference unless it's specifically to do with poor connections, the server process is still completely separate
thought so at first but then when it became a repeated issue with different individuals, I doubt it
i recommend setting the custom name flag, i don't know if it'll fix your issues but i don't even understand how your mod works without it, and vanilla uses it in every case it renames items so it must be (intended to be?) doing something
Just to extra check I will be setting the customName flag, then calling the client command to set the mod data into it if a server is running, then set the item name according to that moddata
that should fix any issues I guess
So the situation is
When you log out and relog in it resets right
I want to know what happens if the person transfers it to someone else
Then re log in
Pretty sure it will stay
Or its not even renamed at all when the other player forst recieves it
(Problem is you cant replicate the bug)
yeah, you really can't fix a bug you can't replicate, it might just be freak connection issues
someone said that his friend can't see the name he set
but again the details aren't clear
can you print the value of the sandbox option after the errors happen just to make sure the option inits correctly at all?
might have been a case of server restart as well
And does it only happen to tuff on their inventory?
Maybe its not saved locally for them
So when they login it gets reset cuz it didnt know his own name cuz of code amnesia
If its only on the inventory
Then
i can't see anything wrong with your sandbox option, but maybe an error in one further up stops the rest of the file from loading?
So thats the thing then
Its not even set
Its just local
And not saved
Its like a visual bug
Similar to when you spawn a vehicle the wrong way
No one can see it and you cant even use it but it blocks your movement as if its there
I'll just ask them for more details
Nah cuz you said the dudes friend cant see it so i doubt server restart is involved at all
yeah it might be that item names don't get synchronised immediately or something
i suspect whatever the issue is it's a vanilla issue
ye i just asked for more information before I do any changes to the code
I just tried to tack a print of the sandboxvar to the end of the function that runs during gameboot and it's still giving me a "can't concat with null" error
Damn this is hard to fix if you cant replicate it
Figuring out how to fix
vs
Figuring Out how to break
haahaha ye I am essentially trying to break my code before trying to fix it (well technically its already broken I am just trying to find out which part is broken)
maybe... the formatting for my sandbox options file is wrongly formatted
Im guessing your server has a system that compliments your mod
So it only works on your server
But for the rest they need that thing
Sorta like a dependency
Show us
I am still concerned it might be an issue where I am running a dedicated server locally. Would've tried on an actual dedicated server service -- or some server not run locally, except that it'll utilize the published code and not my local changes
try moving it up to be the first option and see if it loads then
the only reason that would behave differently is if the issue was caused by poor connection
running locally still runs a completely separate client and server process and follows the same rules for networking
aah
Okay what if, someone renames an item then logs off, and that item remain in his inventory
Technically, when he logs off, that item doesn't exist on the server anymore
trying this next, i removed the line breaks and added commas
so when the server tries to save, it doesn't include the item's name in the save
so the player relogs with the old name?
Possibly
Its pretty weird that theres a difference to local dedi and rented server host
the server should save the player when they disconnect right
otherwise it would never save disconnected players ever?
hmm ye makes sense
ye im too tired to think over this issue. I'll just wait for their reply so I have a clearer picture of what's going on
onwards to fixing another buggy mod 
Tried renaming the file to Sandbox-Options.txt, removed the commas between options, and even removed the underscore in option AnthroTraits.BeastOfBurdenCost and tried to print with the new name. All nothing
:S why is this misbehaving like this? This is such a weird thing for the game to hang on
what's the issue again?
It's saying a sandbox option is null when it seems correctly formatted and is being referenced during onGameBoot
it doesn't need to be capitalised
i've never even seen it capitalised before, i would've guessed that would break it
oh my god
did you just rename the trait or
have we been referencing BeastOfBurdenCost as BeastOfBurden**_**Cost this whole time
can you show me the code where you reference it?
here's the entire thing. It's in a lua file name AnthroTraitsMainCreationMethods.lua in media/shared/npcs
I am curious, what happens if you try to call it from another file, say, a function that gets executed while you're ig
yeah, i'm currently going in-game with that copied into one of my mods to see what happens
My speculation is that the sandbox variable hasn't even initialised yet
i believe so
or well
i believe it is not initialising because of some error, i know for a fact it should have by now
btw
require('NPCs/MainCreationMethods');
local function loadTraits()
local crybaby = TraitFactory.addTrait("Crybaby", getText("UI_trait_crybaby"), -5, getText("UI_trait_crybabydesc"), false, false);
local volatile = TraitFactory.addTrait("Volatile", getText("UI_trait_volatile"), -10, getText("UI_trait_volatiledesc"), false, false);
TraitFactory.setMutualExclusive("Crybaby", "Volatile");
TraitFactory.setMutualExclusive("Desensitized", "Crybaby");
TraitFactory.setMutualExclusive("Desensitized", "Volatile");
end
Events.OnGameBoot.Add(loadTraits);```
This is how I handle the traits in one of my mods, its prone to less errors

where is your sandbox-options.txt?
okay so pz specifically hates me lmao
shouldn't it be in media/lua/shared/NPCs btw?
well we know the file is executing so it's definiteily in lua
oops, yeah it is there. C:\Users\Zach\Zomboid\mods\AnthroTraits\media\lua\shared\NPCs
option UpgradeableVehicles.BetterWheels {
type = boolean,
default = true,
page = UpgradeableVehicles,
translation = UpgradeableVehicles_BetterWheels,
}
option UpgradeableVehicles.SecureStorage {
type = boolean,
default = false,
page = UpgradeableVehicles,
translation = UpgradeableVehicles_SecureStorage,
}
option AnthroTraits.BeastOfBurdenCost
{
type = integer, min = -15, max = 15, default = 4,
page = AnthroTraits, translation = AnthroTraits_BeastOfBurden_Cost,
}```full text of the file i copied it into, so you can look for any possible differences that might be breaking it for you but not me (though i don't see any at all)
literally the only difference is a newline between version = 1 and the start of the options, but i'm pretty much certain that's optional and i'm pretty sure one version of yours was like that anyway?
translation = AnthroTraits_BeastOfBurden_Cost
Does it make any difference if the translation file actually exists?
no, i didn't add anything to mine
are you using tabs, spaces?
okay ye im lost there's nothing else I can think of apart from the Sandbox options not being initialised correctly
mine uses spaces, but it didn't convert the tab in yours and it worked
have you tried restarting the game?
never heard of that ever being necessary but i'm at a loss here
so it's giving up halfway...?
your sandbox vars get put into an accessible table. If I can find that and see what the entries are in it, maybe I can reference it in a way it likes
have you tried spaces? maybe my ide converts them on save or something
oh yeah, sandboxvars is literally just some nested tables
that would heavily imply an error with the syntax you wrote them with! unfortunately it worked perfectly for me so ????
you haven't uploaded your mod to the workshop to test have you? i have issues with it loading the wrong version if i'm subscribed
hm?

haha np
glad we got it sorted out
I almost lost my mind with such issue before too
i'm planning on writing the sandbox option guide later tonight so anything extra that can go wrong is helpful information
You're an angel for that lmfao
Best of luck. Always nice to see an updated PZ modding guide
i'm just kind of shocked that i've never seen any documentation at all
all the information about them seems to be passed around here or copied from other mods
^
i'm not super into writing guides but i also need this information, same reason i wrote pzeventdoc
Okay, well it's all fixed now. The metatable override you gave me works flawlessly and sorts correctly. Thank you @bronze yoke and @hollow current and @ancient grail too for helping my harebrained self realize I still had my workshop folder full ๐
if i were doing multiple traits i'd probably shift towards doing things with a table, might look into doing something like that
okay
It was all albion who eventually was able to help out but it was my pleasure trying to :)
We are looking for a LUA coder to help with some coding with mods, and the server. right now we are Working On...
-Economy system
-Player trading (Vending machines for players to sell items in
-Adding more gasmask variations compatible with the new Toxic Zones
-Adding the Destroy Option for sledge hammers (Not unusable in raiding)
-Adding Vehicle respawns (Both usable and wrecks)
We would prefer someone that has went so school for it but if your good at it we may compromise I hope to see and talk to you all soon
Willing to pay 100$ per small project and for any bigger project 200+ depending on size of project
The owner Torstein (Ironside)#5615 Contact him for more details.
I am just an admin posting for Nexus Gaming
I'll send you a DM
Ngl, 1-200 bucks for someone with a degree is like, seriously low balling it.
Depends on the project honestly
Mod pricing ranges wildly
But generally, yes
You'd expect at least like 20 bucks an hour. A small project is presumably a fair bit more than 5 hours, including testing / quality / refactors based on feedback. Don't even get started on a large project 
the degree requirement is just a bit strange in general
it's a high expectation for a hobbyist sphere
Mhm, and would really warrant fairer prices
welp i do commissions fulltime and for me the rate is good., i cant complain
but im curious if you have worked on a project thats 20$ per hour
i dont think anyone would pay that much for mods
but i guess i could be wrong tho
what is weapon sprite
Eh, if you've got a degree in CS, you're pretty much guaranteed work that pays a fair bit better than 20 an hour. At least in most of Europe. I don't work mod commissions, personally.
For a pure hobbyist programmer, these rates are obviously pretty nice. But they're explicitly asking for someone with a degree.
yeah i live in a third world country and never once experienced such rates. and our economy is vastly different .. a month of salary for you is worth a year of ours
so if you work are able to save 100% of your salary of a year then youre all set for like 12 yrs here.. just saying..
what is a mesh
Hey man, more power to you being able to do these commissions then! ๐
is it the 2d thing
It's essentially any 3d model of something, its called a mesh
I'm trying to make a machete
and
where would I put it and would I do it
Not sure if this is the right place, but is there a mod that makes players invisible similar to Ghost mode, but still allows me to make noise (open doors, step on glass, shoot guns, etc.)? I've got other mods to make zombies still a lingering threat, similar to WWZ movie.
You mean the process of creating it?
no the script
You put the .fbx file in Contents\mods\Battery Jumpstarter\media\models_X\WorldItems
no I mean the actual script file the text
zomboid scripts aren't a recognised format
some guy used this a no red braces
should I name it item_whatever
witrh item
alright can I send someone my script
dm
tell me what I can add to work
what should I mesh look like
now what about a model
because if a mesh is a 3d thing
then what is a model
Any step by step vehicle modding instructions out there?
https://theindiestone.com/forums/index.php?/topic/28633-complete-vehicle-modding-tutorial/
https://theindiestone.com/forums/index.php?/topic/24408-how-to-create-new-vehicle-mods/
https://theindiestone.com/forums/index.php?/topic/24278-how-to-edit-vehicle-skins/
Hello and welcome to my tutorial. It covers full workflow of vehicle creation for PZ. If you are a complete beginner in 3D modelling, you'll have to watch/read additional tutorials, I won't cover every aspect of model creation and 'where this button is located'. I divide vehicle creation in these...
- The first thing you want to do, as with most mods is to create your mods folder structure, use the image below as a reference, replacing MOD_NAME with the name of your mod: Spoiler mods MOD_NAME mod.info MOD_NAME.png media lua client MOD_NAME.lua models Vehicles_MOD_NAME.txt scripts vehicles M...
- First create a folder structure for your mod, call the first folder something like "MyCarReskinMod". Inside that create a "media" folder, inside your media folder create 2 more folders, one called "textures" and one called "scripts". Inside the texture folder create a folder called "Vehicles" ...
Thank you!
Attempting to overwrite an object in this "Class" from authenticZ. Not really familiar with Lua's terminology.
How can I make professions?
Any guides for modding new clothing? 
I think this one
https://theindiestone.com/forums/index.php?/topic/37647-the-one-stop-shop-for-3d-modeling-from-blender-to-zomboid/
Hello and Welcome! Here you will find a concise and comprehensive guide and tutorial of making 3D models for Project Zomboid. Currently, this will mainly pertain to custom Clothing creation but may include weapon creation in the future. This will present how to create models from scratch with Ble...
Thank you!
AuthenticZ class
module AuthenticZClothing {
imports {
Base
}
[items]....
item Molotov
{
DisplayCategory = Devices,
OtherHandUse = TRUE,
MaxRange = 8,
WeaponSprite = Molotov,
Type = Weapon,
MinimumSwingTime = 1.5,
SwingAnim = Throw,
UseSelf = TRUE,
DisplayName = Molotov Cocktail,
SwingTime = 1.5,
SwingAmountBeforeImpact = 0.1,
PhysicsObject = MolotovCocktail,
MinDamage = 0,
Weight = 1.5,
MaxDamage = 0,
OtherHandRequire = Lighter,
MaxHitCount = 0,
FirePower = 90,
FireRange = 4,
Icon = Molotov,
EquipSound = MolotovCocktailEquip,
ExplosionSound = MolotovCocktailExplode,
SwingSound = MolotovCocktailThrow,
AttachmentType = Explosive,
}
...
}
my attempt at overwriting that class and adding in the inventory option and changing the weight of the Molotov Item
module AuthenticZMolotovFix {
item Molotov
{
DisplayCategory = Devices,
OtherHandUse = TRUE,
MaxRange = 8,
Type = Weapon,
MinimumSwingTime = 1.5,
SwingAnim = Throw,
UseSelf = TRUE,
DisplayName = Molotov Cocktail,
SwingTime = 1.5,
SwingAmountBeforeImpact = 0.1,
PhysicsObject = Molotov,
MinDamage = 0,
Weight = 1.0,
MaxDamage = 0,
RequireInHandOrInventory = Matches/Lighter,
MaxHitCount = 0,
Icon = Molotov,
FirePower = 90,
FireRange = 4,
Icon = Molotov,
EquipSound = MolotovCocktailEquip,
ExplosionSound = MolotovCocktailExplode,
SwingSound = MolotovCocktailThrow,
AttachmentType = Explosive,
}
}
My guess i'm missing a piece to tell it to write over the AuthenticZClothing "class"
I'm used to Java more then Lua.
Any guides for making new professions?
thanks
the first thing to know is this is not lua, it's a made up format the game uses for item definitions
these are not classes and these files do not execute
you can overwrite item definitions this way, but it's much more compatible to edit them after the game loads them using lua
otherwise if the original item gets changed, you'll need to update your copy, and two mods that overwrite the same item this way aren't compatible at all
i have no idea how to make one
local item = ScriptManager.instance:getItem("AuthenticZClothing.Molotov")
if item then
item:DoParam("Weight = 1.0")
end
ok. Is there a Lua IDE of sorts
most people use vscode, i like intellij with the emmylua plugin

if you want project zomboid intellisense in lua this project provides that when added as a library https://github.com/asledgehammer/Umbrella
btw intellij have some plugin with lua bytecode heatmap generation?
i don't even know what that means ๐
calculating weight of code line (helps for optimisation)
probably not, intellij isn't really meant to be a lua ide so i wouldn't expect it to have many specialised lua plugins

what would the texture look like
Hello ๐ , I am adding a new sprite in game, and I wonder how to make it possible to rotate it. I have south and east pointing directions. Input?
I think it should be automatic if you set the CustomName, GroupName and Facing in tilezed.
Yeah, I thought was that but apparently is not working ๐
oh maybe I am missing the GroupName. I'll try to add it and let you know if this helped @fast galleon , thanks!
Hi! What event is triggered when the server starts? I need this to initialize my logging system
Should it be "Events.OnServerStarted"? or is there a later event?
I have added CustomName, GroupName and Facing, but still not working ๐ค
module Base
{
item machetered
{
MaxRange = 1.23,
WeaponSprite = machetered,
MinAngle = 0.7,
Type = Weapon,
SwingSound = MacheteSwing,
HitFloorSound = MacheteHit,
ImpactSound = MacheteHit,
DoorHitSound = MacheteHit,
HitSound = MacheteHit,
MinimumSwingTime = 4,
KnockBackOnNoDeath = FALSE,
SwingAmountBeforeImpact = 0.02,
Categories = LongBlade,
ConditionLowerChanceOneIn = 25,
Weight = 2,
SplatNumber = 2,
PushBackMod = 0.3,
SubCategory = Swinging,
ConditionMax = 13,
MaxHitCount = 2,
DoorDamage = 10,
SwingAnim = Bat,
DisplayName = Red Handle Machete,
MinRange = 0.61,
SwingTime = 4,
KnockdownMod = 2,
SplatBloodOnNoDeath = TRUE,
Icon = machetered,
TreeDamage = 10,
CriticalChance = 20,
CritDmgMultiplier = 5,
MinDamage = 2,
MaxDamage = 3,
BaseSpeed = 1,
WeaponLength = 0.3,
DamageCategory = Slash,
DamageMakeHole = TRUE,
AttachmentType = BigBlade,
Tags = CutPlant,
DoorHitSound = MacheteHit,
HitSound = MacheteHit,
HitFloorSound = MacheteHit,
BreakSound = MacheteBreak,
SwingSound = MacheteSwing,
}
model machetered
{
mesh = weapons/1handed/rickgrimesmachete,
texture = weapons/1handed/macheteredhandle,
scale = 0.01
attachment world
{
offset = 0.0000 -0.1660 0.0070,
rotate = -180.0000 0.0000 0.0000,
}
}
}
could somone tell me whats wrong
fixxed
Is there a way to make new sprites/items to not be destroyed by explosions? For example pipe bombs and fires?
I use IsMoveable checked and North / West. I remember somebody had trouble with South / East and they added some kind of simple script.
Aha, thanks, I'll try this out then.
can someone help me with this code it would seem that its not showing up in spawn menu
Is there any way to save the current state of a map so that when the update hits, I can just reupload the map file to a new game? Raven Creek doesn't work after an update and my server has built a community there that I'd like to keep running
Just tried using North / West, but still, the sprite is not rotating ๐ญ
is this right?
i do think thats wrong
Hey, uh, anyone know where I can find the location of item sprites?
I wanna use one for a poster.png
they're in the texture packs
media/texturepacks/
i think tilezed lets you extract them?
Or just download from pzwiki
idk if there was anything like that, it just extracted into spritesheets for me
Tools > Pack files > ...
then look (half of the server members give help like this)
yeah I saw the way I wrote that and I realized that it gave off that I hadn't looked in the slightest
so i tried to specify. I didn't even know about tilezed or have it installed beforehand lol
your mod bricked mine
it only spawns your item aha
wait what
yeah it was only showing your item its fine it was my fault
ill just copy my scripts and files into a new folder
wait how did you do the distribution
i didnt
oh okay
ayo, im good at coding but bad at modeling, anyone wanna collab?
im currently making a primitive weapon pack
Any good doge mods in here? I'm just looking for a mask and a plushie
Like, to play as a doge furry?
If I have to sure
