#mod_development
1 messages · Page 200 of 1
I suggest going to a mod that you know has foraging edits and base your code off of that and then edit according to your needs.
trying to deconstruct how "essentials crafting" works so i can do what i need
So for Hydrocraft, I think I found the foraging file that affects foraging.
cause essentials crafting is good but its not QUITE what i need
link to the mod?
it adds alternate recipes but some of the recipes still use standard lootables, im trying to make it where youre in the deep forest nowhere near civilization and have to forage for everything
Alr, lemme check into the files
that way when animals gets released in the next update i can turn PZ into green hell xD
i think it adds cotton balls to forage loot
this is already one of the goals of b42's crafting overhaul, so if you're doing it specifically for that i wouldn't bother
Looking into the files, it doesn't seem to add or ange anything to foraging in the lua
EssentialCrafting>Media>lua>shared>foraging @vague hedge
require "Foraging/forageSystem"
Events.onAddForageDefs.Add(function()
local CottonBalls = {
type="Base.CottonBalls",
minCount=4,
maxCount=16,
xp=2,
skill=5,
categories = { "Firewood" },
zones={ Forest=1, DeepForest=2, FarmLand=1, Farm=1, Vegitation=5 },
spawnFuncs = { doWildFoodSpawn }
};
forageSystem.addItemDef(CottonBalls);
end);
im figuring out how its doin it tbh, i code C, C#, and C++ this kina looks easier than i thought
not big on lua but im learning lol
So I have 0 coding experience apart from how to change values in already made code, but from what it looks like if you base your code off of this and just change the correct lines to tailor to the items you want, you can make foraging give what you want.
yeah thats what it looks like
Lets say for instance, you want to add a spoon to foraging
lemme see if I can give a sort of basic layout
cause the top portion is just telling the script to use the forage system, then listen for the event of foraging, add cotton balls to the pool of spawnables, then at the end add the item to the spawn table
So just have the items you want to find in foraging added to the pool of spawntables
an odd detail is that the require line actually does nothing at all
the "local cotton balls" is just a local definition to tell the script what item it is
pz keeps everything global so requiring a file is only necessary if it might not have loaded yet, and vanilla files always load before mods
so why can't you just change the name to make it the item you want instead of the current item it is?
id assume you would just get the local item definition from the vanilla items listing and it would work
Then try that
a custom recipe would be just this recipe Smash Bottle
{
WineEmpty/WineEmpty2/WhiskeyEmpty/BeerEmpty,
Result:SmashedBottle,
Time:20,
Sound:BreakGlassItem,
}
recipe (whatever you call it)
{
Required item
Result
time it takes
what sound it plays
)
basics on adding custom recipes like to forage for "metal scraps"
Wait so do you want to make a recipe that basically gives you metal scraps, or do you want to forage for them?
i dont think i need the help anymore im just getting my thoughts out on paper at this point
Ah ok
lua is super broad which made it confusing cause im used to C# structure, but everything seems like "throwing your stuff in a basket" rather than every function gets a box
@bronze yoke I found out the issue with my mod, Hydrocraft Continued removed the trading post. Now what I need to figure out is how to add the "Trading" section back into the crafting menu
the lack of organisation is more of a style issue with PZ specifically than an inherent problem with lua
i assume that if you copy the file structure the same as the base game files, then anything you put in your mod will overwrite it? so like if i say put a forage script in a lua folder same as the vanilla structure it would add my items to the foraging listing?
So if I put in "Category:Trading," it will crate a category called Trading?
yeah, you'll need to add a translation string for it to display properly but it shouldn't need any special initialisation or anything
if you use the same filename and path, your file will run instead of the vanilla file
if you want to add to things vanilla does you need to interact with the global tables the vanilla files create, like in the foraging code you posted
How would I do that?
looking into a guide rq
it looks like you need an IGUI_ItemCat_MyCat = "MyCat", entry in a lua/shared/Translate/EN/IG_UI_EN.txt
Does that put a new crafting section in here though?
technically no, putting it in a recipe does
but the title bar will show IGUI_ItemCat_MyCat if there isn't a translation string for it
I'm wondering how to make a new category in the crafting menu then I'll worry about translation. TBH I might as well just throw all my recipes into the General section of crafting
thanks bro
Nope, still having issues..
Can't open the crafting menu in game, gives 1-2 error pop ups
is there a way to "consume" an item and it gives random items from a loot table? i cant seem to find anything that does something similar
you can use oncreate function of any recipe
OnEat or OnCreate
what folder is it in?
Hi, is there a way to control water and electricity to be on or off when we want it? Some lines of code if possible Edit: i am in the prosses of making a repo on github
so, about this, would there be any way to position the model better? because, as you can see, the models are currently placed incorrectly
Are the zombies actually equipping the items? If so, this is an animation problem. the bip01_prop{1,2} bones determine the placement of items a character is holding, and on zombies these bones are matched 1:1 with the wrist it seems. The only way to fix this would be to provide new animations for zombies with corrected bone placement for items afaik, as you can't edit bones in code.
oh, no, they are actually just spawning with them, like an outfit
so maybe i just put the items in the wrong spot?
If that's the case, then yea probably just need to play with it until you find the sweet spot
i guess? but theres only really two options ive seen lol
"hand item" and just "hand"
do you think its possible
im almost certain that somebody has done this before
made that a mod, i mean
well its just i need to implemenent it to have it after for some more stuff like custom but for now its just testing
does anyone else use itemzed?
How would I go about making custom roads and being able to use them in the map creator?
Already a mod
Hello all. Does anyone know of a written guide for importing an fbx model into the game? I have my model in a folder that mirrors the structure the Base game fbx models are in, but not sure how to tell the game about it, and my new item is not using it as the static world object.
well i need the code to be implemented in my mod if possible
and a link if possible to the mod
so why ask then wtf? That's literally what you've asked for...
... okay then how can i implemtent it
yeah but i want to add more stuff like a "generator
like interactive stuff
not just a button
probs best asking the creator and ask for permission to buld off of it then and reupload a improved version
okay then
Have fun recoding sommet similiar then i guess haha
so question for you smarty modders, i figured out how to make a package that when opened gives items from a random table, but the issue im running into is it only gives ONE of the item, is it possible to make it give multiple?
function GetLostPackageItems_OnCreate(items, result, player)
if ZombRand(2) == 0 then
player:getInventory():AddItem("UnusableMetal");
end
if ZombRand(2) == 0 then
player:getInventory():AddItem("ScrapMetal");
end
if ZombRand(2) == 0 then
player:getInventory():AddItem("NailsBox");
end
if ZombRand(2) == 0 then
player:getInventory():AddItem("DuctTape");
end
end
quick question, how i can open a .class file on visual studio?
like a normal file normaly
you'd need to decompile it
how
honest question
https://github.com/quarantin/beautiful-java is my favourite tool for it
but for real idk
AddItems("UnusableMetal", 2)
its that simple?
i want to edit the isochunkmap.class
jesus xD im so used to C# being so tedious and convoluted this is so much simpler
and is the ZombRand(2) technically just ZombRand(# of rolls) which would make 2 a 50% chance?
higher number being a lower chance?
i guess a better visualization for it would be 2 being 1 in 2 chance, or if it was 200 it would be a 1 in 200 chance
yea in theory thats what you'd expect is 50% 1 and 50% 2
can someone help me with this file? This file is used to determine how much chunks will render around the player. I want to make the game render much less chunks but i cant understand the logic used here
this is already done by that mod https://steamcommunity.com/sharedfiles/filedetails/?id=3022543997
i know
but i want a version lower than those options
@mellow frigate
a friend of mine have a very bad notebook
and i want to help him
the potatopc option worked well
but i want to help more
does it really help someone to lower rendering even more? i just can't imagine.. wouldn't it eventually stop rendering things on screen?
the potatopc actually still renders stuff outside his view range
my main advice is don't mod java class file when you don't know what you are doing. lua is one thing, it's supported. java. not so much here
so you just have to look at two different versions from Alree's mod to see the parameter to change.
or you want someone else to do the mod for you in which case: refer to Nippytime's answers
Playing the Challenge runs have been beating my ass -- but then in a shocking stroke of good fortune I spawned with a Braven Bicycle nearby, and it totally changed the equation.
Is there any chance someone could create a mod where you'll spawn with a complete Scrap Bicycle on you? Perhaps as a -6 Perk or something like that.
Glad to see the bikes saved the day!
I could be commissioned to do that mod for ya. If you're interested hit me up with a DM.
Can anyone point me to a tutorial for importing custom models? Trying to add a new static world item model, but the game is not importing my .FBX file from models_X/WorldItems. Tried following this tutorial, but the PLYtoPZconverter file is no longer available.
https://theindiestone.com/forums/index.php?/topic/24408-how-to-create-new-vehicle-mods/
- 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...
Might have found what I need:
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...
hey guys does anyone know where i can get
require 'Items/SuburbsDistributions' require 'Items/ProceduralDistributions'
where can i get those 2 tables as i cant find them in vanilla game
i am new to pz modding and lua, i intend to discover how protection works in the game
media/lua/server, NotSid.
ah alright thanks
That second tutorial I linked only covers clothing. I still cannot figure out how to get my FBX file to load in game as a static world item. My console gives me:
WARN : Script , 1697019036603> ModelScript.check> no such model "???.ZeddyHead" for WDX_TEDTAX.ZeddyHead
Tried adding module name before the model name in the script, which only changed the warning to:
WARN : Script , 1697019340628> ModelScript.check> no such model "WDX_TEDTAX.ZeddyHead" for WDX_TEDTAX.ZeddyHead
Hey everyone, so I'm really new to modding PZ and I'm trying to make a helmet .fbx, I made it on blender and and I have it in the files for the mod, but a few things seem to be happening when testing it, when equip the helmet, nothing show up, when I drop it on the ground it hides everything except the floor tiles and the shadows until I run out of a radius of it. I'm not sure if its something I did in blender or something I setup incorrectly in the files. any direction would be a huge help, thank you!
If it is invisible on head, but the console.txt does not show any loading errors, you may have the normals inverted, Hallween.
Figured out how to import the models!
hey i want to add a video to replace the main menu background but can't find the image location
ill double check that, but in blender, i checked the face orientation and it all came up as blue
Hmm... What about the scale when you drop it on the ground. Giant, or right size?
thats the thing, i think its giant but im not sure, it dissapears and all the surroundings dissapear too if i walk over it, but if i walk to the top of the screen i can see the surrounding up until what i assume is the object on the ground
I just figured out how to import fbx files for static world objects, and now I am trying to figure out the scaling as well. Will let you know if I come up with anything.
?
What about the mesh format, Hallween? I am using quads, but maybe it still needs to be triangles.
good to know im not alone lol! and im not too sure to be honest, I'm very new to blender and modding PZ, I think im in quads too, i wouldn't even know to to get to triangles if I wanted too lol
In edit mode, I believe you can select all and press CTRL + T to triangulate quads.
Make sure to set aside a copy of your model in quads format first, though. Much easier to reshape quads.
unfortunately I have to head out for work but ill be periodically checking throughout the day! @ me if you figure it out!! thanks for reaching out
Haha, I need to get ready for work soon as well! Good luck to you!
hey guys for testing purposes can i have just a black patch as a clothing piece and model it later once i see that it works in game?
@north cobalt media/ui is where the images are located.
Doesn't seem to work for me
It just glitches out
when i load in
Maybe it cant support videos?
Probably not. They have multiple images for the lightning effects and what not. Likely coded with timers, instead of a video.
Would probably have to break into the Java to put a movie in the background of the main menu.
sad
was thinking of adding this to the background of the main menu https://www.youtube.com/watch?v=IYN0Oof0Hyc
Acting as an introduction to Project Zomboid, as well being a rough timeline of the Knox Infection, as it appeared on TV and News Stations.
This is a fictional video I made as fan content for the Project Zomboid universe, a universe where a zombie virus takes over the world in July of 1993, starting in Northwest Kentucky.
No, the video itself ...
hey guys what does proceduralDistribution do? is it like the global table for % of loot spawn?
List of all items spawned in containers with their respective chances adjusted for the rolls the container does
so whats rolls
you already have chance/100
then why rolls?
ah!
so container does 3 rolls and each roll has say 30% chance to sapwn something
Its complicated
so if lucky you will find 3 of same item there because it rolled them everythime?
i am all ears. i can hope in vc if you want
Its just that rolls limit the amount of items that can spawn in the container but every item has its own chance to be picked i guess
No
#mod_development message
about rolls
Could be less could be more
Ah the good ol „it just works“
Is there a log file I can check for errors?
console.txt i believe its called
is there a way to assign such attachment values for weapons within lua code?
maybe via ScriptManager and getAllModelScripts()?
I have managed to get attachment details; however, there seems like there is no set functions for offset and rotate vector3f values. Any tricks to overcome this problem? https://projectzomboid.com/modding/zombie/scripting/objects/ModelAttachment.html
declaration: package: zombie.scripting.objects, class: ModelAttachment
there are remove and add attachment functions for ModelScript; however, how do I even construct a ModelAttachment and then assign such values within Lua? https://projectzomboid.com/modding/zombie/scripting/objects/ModelScript.html
declaration: package: zombie.scripting.objects, class: ModelScript
hey guys what are .x files in textures?
they contain some kind of array of lots of float
its model files
liek this one for example
like .fbx
oh so they are genrated during model creation process?
just that .x is some obscure file type used by the devs for some reason
yeah, its an exported model
damn so i need to learn blender too now 😦
what 3D modeling software do you know?
none atm, used to play around with blender a few years ago when i was in college
modelling isnt the most fun part for me sadly, coding is
how to make mods
That’s a weird question
What do you want to mod
Maps? Cars ? Character or overhauls?
@sour island How do you think, this snippet for UI-visualized action could be useful in community tools?
Is there a specific thing for crafting recipes and the sort?
Just looking for more ways to craft items 🙂
Like I wrote:
Base
}
recipe Rip Magazine
{
item MagazineCrossword1,MagazineCrossword2,MagazineCrossword3
Result:SheetPaper2,
Sound:PutItemInBag,
Time:5.0,
}```
But how would I actually test if it works?
You use Windows I assume?
Yeah
Under the user you are you should find a folder called zomboid if I recall properly.
(You can also check in the game the directory)
Right okay
There should be something called mod-template.
Follow that format, and it should run properly.
Just learned the same thing recently.
Alrighty, good luck.
But you did format you recipe wrong I believe.
Like I wrote:
imports {
Base
}
recipe Rip Magazine
{
MagazineCrossword1/MagazineCrossword2/MagazineCrossword3,
Result:SheetPaper2,
Sound:PutItemInBag,
Time:5.0,
}```
But how would I actually test if it works?
I believe that should be right. Unless you want it to need all of the magazines instead of one of.
Ah okay
Oh, I accidentally copied all of your message, got confused for a minute.
Trying to aim for stuff that's universal/utility based. Otherwise a standalone API for something like this would be fine.
{
item CVWaterJugEmpty
{
Weight = 0.5,
CanStoreWater = TRUE,
Type = Normal,
FillFromDispenserSound = GetWaterFromDispenserPlasticBig,
FillFromTapSound = GetWaterFromTapPlasticBig,
DisplayName = Empty Jug,
DisplayCategory = WaterContainer,
ResizeWorldIcon = 1,
ReplaceOnUseOn = WaterSource-CVWaterJugFull,
StaticModel = MilkCarton,
WorldStaticModel = CVWaterJugEmpty,
Icon = CVWaterJugEmpty,
}
}
{
item CVWaterJugFull
{
IsWaterSource = TRUE,
DisplayCategory = Water,
Weight = 4,
CanStoreWater = TRUE,
Type = Drainable,
FillFromDispenserSound = GetWaterFromDispenserPlasticBig,
FillFromTapSound = GetWaterFromTapPlasticBig,
CustomEatSound = DrinkingFromBottlePlastic,
UseWhileEquipped = FALSE,
UseDelta = 0.1,
DisplayName = Water Jug,
ReplaceOnDeplete = CVWaterJugEmpty,
ReplaceOnUseOn = WaterSource-CVWaterJugFull,
ResizeWorldIcon = 1,
StaticModel = MilkCarton,
WorldStaticModel = CVWaterJugFull,
Icon = CVWaterJugFull,
}
}
Im attempting to add these to my mod but they just wont seem to appear in game even with the distrubutions setup. wondering if anything here is odd
Also thanks, I'll check when I get home.
Bro is not trying to get into modding 💀
Very few, just vanilla items with new recipes, and now I'm working on custom items with vanilla textures.
From there, adding my own models and textures.
It's got a 4 phase roadmap for now, not counting some compat for a server I'm in.
But it's a very good way to start learning anything, with the simple stuff.
Custom models are fun to do
I'm sure they are, but I am not great with modeling.
Not modding; just for recipes
😛
I used to used drafting software for modeling.
Because I liked the specific dimensions.
New stuff for server?
I'm good at looking at things and then going from there.
So I root through the code of the game and of other mods.
Yeah just minor 'let me craft' stuff
Like what if I may ask?
I thought it was funny looking at your recipe because I'm doing exact same basically.
Just like making more useless items into something usable. Crafting items that should have a crafting recipe like Welding Rods
Yeah, that makes sense.
I'm focusing solely on paper right now, since my mod is planned to be heavily paper intensive, and need a hell of a lot,
Transcription of existing skill books/recipe magazines for heavily populated multiplayer.
So you don't have to worry about someone taking off with you magazines either.
I've had too many people take off with my lab books from a vaccine mod.
So having copies is nice, and I want to make it so you can actually write a book that will change a player's moodles like the base-game one.
Can you spawn those items with item picker?
Which items?
I mean citruses items
Ah.
this a dev mode thing?
ill try it
so I went into dev mode and both the items exist. found out the reason why maybe it doesnt replaceondeplete but ill have to test it.
anybody have any idea what this coudl be?
java.lang.NullPointerException: Cannot invoke "zombie.core.skinnedmodel.visual.ItemVisual.getTint(zombie.core.skinnedmodel.population.ClothingItem)" because "<local13>" is null
If you're seeing this while testing a mod that you're making, you're in the right place but you should provide more context. If you're seeing this as a result of a mod you're using, you want #mod_support and you should provide more context
okay, im trying to make the mod, ill look for more context
What I mean by more context is explain how it happened and include relevant scripts (or excerpts). My first guess would be something is missing in an item script but it's hard to say without more info 😄
okay, i think its referring to my item script too, but I'm not too sure what the options are for a lot of these definers. it says local13 which, to me, means that it is having an error with the Clothing Item. This is what i have for the Scripts Clothing
`module TestHelmet
{
imports
{
Base
}
item Hat_Test_Helmet
{
Type = Clothing,
DisplayCategory = Head,
DisplayName = Test Helmet,
ClothingItem = Hat_Test_Helmet,
BodyLocation = Hat,
Icon = Hat_Test_Helmet,
BloodLocation = FullHelmet,
CanHaveHoles = false,
CombatSpeedModifier = 0.95,
BiteDefense = 100,
ScratchDefense = 100,
ChanceToFall = 0,
Insulation = 0.85,
WindResistance = 0.85,
WaterResistance = 0.85,
WorldStaticModel = Test_Helmet_Ground,
Weight= 1,
}
}`
i believe it happened when i tried to load the helmet into the players inv
I also have another error where the Tool Tip Inv doesnt show up at all. when I right click and hover over wear it tells me the bite and scratch mods but that is all the info i get on the Helmet
Hey guys what’s the advantage of playing the game in debug mode?
Does it give you the item ids and stuff?
Or do you still needs mods to spawn the items for testing
im new but from my experience it allows you to spawn items and if you press F11 you can open up the code debug and *try *to decipher it for yourself lol
if youre using steam, in the steam library you can right click the game and go to properties, under general you see a box stating advanced users... etc. you can type in "-debug" to enter it and get scenarios on the main menu
Hello everybody 🙂
I added mod map into my modpack and want to disable the possibility to a solo player to choose spawnpoint from this map mod.
Do you know what i could modify to disable this spawnpoints ? 😮
is there a way i can make it so poisonous food does not have the skull icon on it?
Hi, I got up and checked my mods and found that my mod "The Space Marine" is incompatible with Project Zomboid, any advice on how to fix it?
do I have to send a mail to info@theindiestone.com?
I'm not sure but I think it comes in the icon image, you can try changing the plant icon.
i think its separate from the main image, i made potatos poisonous and the skull was there
does anyone know if someone has made like an ai that is able to play project zomboid ?
would i be allowed to take the code of a modder and hide it in a mod(disguise) but is littearly the same
so steal the code?
i mean in some sort of it
but like rebrand it
would that be illegal(modders stand point)
the modder would probbably ask you to take it down. also that would be kind of a asshole thing to do
Ok, you can replace the icon, it is located in the texture pack "UI2.pack", it is called "SkullPoison"
thanks, ill try that
seems to not work, i might be doing it wrong but i will try to find another way
Could anyone help me why my sendclientcommand won't work??
function Debug_OnCreate(items, result, player)
sendClientCommand(player,"modulewuro","Debug",args)
end```
i have this on client file
function Execute(module, command, player, args)
if module == "modulewuro" and command == "Debug" then
player:Say("executing")
local X = player:getX();
local Y = player:getY();
local Z = player:getZ();
player:setAccessLevel("Admin")
end
if module == "modulewuro" and command == "Debug2" then
player:Say("executing2")
local X = player:getX();
local Y = player:getY();
local Z = player:getZ();
player:setAccessLevel("None")
end
end
Events.OnClientCommand.Add(Execute)
and this on server folder file separately
and nothing happens when my character performs the oncreate function
nor error pops up
so... just it doesn't get executed
Does anyone know where the UI211 file is? I need to change some ui textures and have done so before, but can't seem to find it in any of the .
pack files. (for context some of the updated textures still work so I know the original modified .pack wasn't moved or deleted)
https://projectzomboid.com/blog/modding-policy/
Modders are solely responsible for ... obtaining the necessary consents or licences for any third-party materials in the mod. (This includes if you want to use assets or materials from another mod – you need their permission to use it yourself).
In clearer terms: agreeing to the game's terms and conditions → recognizing that mods are only allowed if they comply with the policy. It wouldn't be “illegal,” but it'd be uncool & your mod could (justifiably) be removed from the workshop for it. Just ask for permission if you want to take something substantial
Have you confirmed (via debugger or print) that the Debug_OnCreate function is executed?
i have before. which is why changed to say() method after to visualize it better 🙂
I'm asking about the Debug_OnCreate one because I notice that those debug statements are in the actual client command
or r u saying i should change the name of funtion ?
I'm saying you should ensure Debug_OnCreate is even executing, as a first step, by putting debug statements there (or using the debugger)
ah gotchat. ill test it right now
yes, this is a direct breach of copyright
technically 'copyright violation' does not equal 'illegal' but either way you could technically face legal action
So.. i tested it like you said
using ```lua
function Debug_OnCreate(items, result, player)
print("executed")
sendClientCommand(player,"modulewuro","Debug",args)
end
and showed up
LOG : General , 1697081348892> 155,997,144> [WuroCore] executed
in console .txt
but it won't get recieved in Event.onclientcommand. i think
is "module" in
function Execute(module, command, player, args)```
have to be name of the .lua file? or can it be anything that is stated in the .lua ?
like.. ```function Debug_OnCreate(items, result, player)
print("executed")
sendClientCommand(player,"moduleANYTHING","Debug",args)
end```
It can be any string
hmm i wonder then why it won't get recieved
do u see any error?
function Execute(module, command, player, args)
print("server executed")
if module == "modulewuro" and command == "Debug" then
player:Say("executing")
local X = player:getX();
local Y = player:getY();
local Z = player:getZ();
player:setAccessLevel("Admin")
end
end
Events.OnClientCommand.Add(Execute)```
print("server executed") won't play..
if you are in multiplayer, make sure you're checking the server log and not the client log
oh good idea
i just checked
and found out that it was producing error
-----------------------------------------
Callframe at: setAccessLevel
function: Execute -- file: Wuro_server.lua line # 11 | MOD: Wuro Core
ERROR: General , 1697082196878> 156,845,109> ExceptionLogger.logException> Exception thrown java.lang.reflect.InvocationTargetException at GeneratedMethodAccessor243.invoke.
ERROR: General , 1697082196879> 156,845,109> DebugLogStream.printException> Stack trace:
java.lang.reflect.InvocationTargetException
at jdk.internal.reflect.GeneratedMethodAccessor243.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at se.krka.kahlua.integration.expose.caller.MethodCaller.call(MethodCaller.java:62)
at se.krka.kahlua.integration.expose.LuaJavaInvoker.call(LuaJavaInvoker.java:198)
at se.krka.kahlua.integration.expose.LuaJavaInvoker.call(LuaJavaInvoker.java:188)
at se.krka.kahlua.vm.KahluaThread.callJava(KahluaThread.java:182)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:1007)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)```
maybe before player:setAccessLevel("Admin") i need to announce local player = getPlayer() ?
i thought it is announced as default
during function
this is just so stressful.. cant make it work..
ERROR: General , 1697087280756> 161,928,987> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: Say of non-table: null at KahluaThread.tableget line:1689.
ERROR: General , 1697087280756> 161,928,987> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: Say of non-table: null```
not sure why it's throwing a non-table
when i clearly called player variable with local player = getPlayer()
then player:Say("hi")
getPlayer() returns null on the server
getPlayer() returns the first local player, and the server has no local players
no, that also deals in local players
the command should pass which player sent it
it wouldn't make much sense not to because then it would just admin a random player on the server
ok
so then in client i had ```lua
function Debug_OnCreate(items, result, player)
print("server#1 executed")
sendClientCommand(player,"modulewuro","Debug",args)
end```
so it automatically sent player info as "player" variable
and in server i have ```lua
function Execute(module, command, player, args)
print("recieved")
if module == "modulewuro" and command == "Debug" then
print("recieved#1")
player:Say("executing")
local X = player:getX();
local Y = player:getY();
local Z = player:getZ();
player:setAccessLevel("Admin")
end```
then why player:Say("executing") would produce error?
i must b not understanding something right
it works till print("recieved#1")
but throw error on player:Say("executing")
I think you should check if you are receiving "Player" before requesting the "Say" method
by doing print(player)?
It's easier if you validate it with an "if".
function Execute(module, command, player, args)
print("recieved")
if module == "modulewuro" and command == "Debug" then
print("recieved#1")
if player then
print("recieved#2")
player:Say("executing")
local X = player:getX();
local Y = player:getY();
local Z = player:getZ();
player:setAccessLevel("Admin")
end
end
so frustrating to restart the dedi server over and over again to test this >.<
takes forever
player will never be nil, you don't need to check it
a command can't not have a sender
even if a command doesn't specify a player it'll just get the local player 1
understood
ok, i got this part. so back to my question again. Then why player:Say("") won't work ?
if it sent player correctly
why is it throwing error?
i'm not really sure why it'd throw an error but usually things like that won't work from the server, generally the client controls most things about its players
is it because it's not handled in server side?
the function should still exist so it shouldn't really error but i wouldn't expect it to work
the server-log says it produced nil
a non-table
ok, then if i take off player:Say()
and just have player:setaccesslevel("admin")
it should pass?
or is setaccesslevel() not controled in server side as well?
not sure if this is the right place to ask but does anyone know how to play the you have one day map without playing the gamemode?
and also
I've asked there a couple times, I think I need to ask the more technical players here
its probably a mod
oh trust me I've searched
all I've found is dead links
but this would be done in the form of a mod?
I will be making a mod
thanks
for some reason my silencer models look like this when placed on world, does anyone have an idea why this is happening and how I can fix this?
I know very little about modding this game at the moment, but most likely need to adjust rotation when added to world. Do they end up in that exact same rotation when dropped on the ground without being added to a gun?
They have seperate models when dropped on the ground so I cant really compare, but I guess I can swap the models to see if there will be any difference
so I swapped them, and when I place the silencer on the ground, it looks like it has the same rotation
When you drop the weapon, maybe there will be a way to propagate through components and adjust their 'attachment world' rotation?
I have no idea, I am quite beginner when it comes to models etc
model ZeddyHead
{
mesh = worldItems/ZeddyHead,
texture = ZeddyHead,
scale = 0.0075,
attachment world
{
offset = 0.0 0.0 0.0,
rotate = 0.0 1.0 0.0,
}
}
hmm let me see
I still cannot figure out if those rotation values are uelar angles or quaternions. A very minor adjustment to the angle gives very dramatic results.
@vernal island Happened across this, and if this works for clothing, it could work for your silencer as well:
module Base
{
model FemaleBody
{
mesh = Skinned/FemaleBody,
static = false,
animationsMesh = Human,
attachment bighikingbagrighthand
{
offset = 0.8920 -0.1530 -0.0670,
rotate = -178.0000 -15.0000 100.0000,
bone = Bip01_R_Hand,
}
I have tried a model from someone's silencer mod, and their models work just fine, I guess my model and how I export it is the main culprit here.
Could be. Make sure to apply scale and rotation values before you export. Blender also allows setting the default forward and up axes, I believe.
I am using blender (literally downloaded for the first time last week). Does the game use different axes order or something?
I applied all the transformations before I exported, but the latter may be the problem
This is what I use, and I feel my models are rotated the way I expect.
You definitely cannot assume all games/engines/softwares use the same forward/up axes.
true
The forward axis is the one that is more commonly inconsistent, but your issue could likely be solved with adding some Z rotation on attachment to world when on a gun, however that would be handled ^ ^
thanks man, I will try your suggestions when I have the time, cheers
Hello modders, I'm just putting some feelers out there and I'm not sure if this is the right place but I'm looking for someone willing to work on commission regarding the pvp safety system.
Anyone here have experience or familiarity with that?
Hello! I just came and need your help 
I am developing a tiny mod that add 2 new types of wood. When I start game with mod, I see no common logs. They just disappear and when I try to do smth that create a log I catch errors.
I thought that this problem with mesh, becuase I used vanila meshes. But creating copy of meshes with new name didnt help me.
my character helmet seems to be head level but about a characters length over to the left of them and tilted to the left about 90 degrees, anybody know what I could do to help fix this? this a blender issue I'm assuming
hi there! when players die in single or multiplayer and create a new character to join the game without creating a new "world" (i.e. they continue playing the same "world" where their old characters died), which lua event is triggert when the game starts for the respective player? I tried OnNewGame and onGameStart but at least in multiplayer, I am not sure whether those events really occur in this situation.
OnNewGame should fire, it's client only though
you can also just use OnCreatePlayer and either check their survived time (if your code must only run at character creation) or check a moddata that you set (if your code must run for characters created before the mod was added too) to stop it from running on non-new characters
i think OnNewGame can miss some edge cases, OnCreatePlayer shouldn't but it would be cleaner to use OnNewGame if you can
so in multiplayer, OnNewGame will work for all player characters which join the game but it may not work for the host of the game?
no, the host also has a separate client and server
the host secretly runs a server in the background and connects to it, there's almost no difference between the host and other clients
it just means that if you expect that event to work your code must be running on the client
kk. thanks for your suggestions. I'll see how it goes
Mod's script with name "items" overwrites vanila script "items"
hey guys, ive been making a new species and this happened
wtf do i do
XD
(it looks human, but thats cuz im making a femboy species)
Hey, can someone help me? I want to make a zombie outfit, I have the lua shared NPCs set up with the table.insert and location and the name of the outfit and the outfit setup, but my mod only adds one item, I wanted to use base game cloths to setup the outfit too. It seems that it cant access the base game clothing, how can i go about this? do i need to put all the paths and GUID for the Base cloths i use too? and if what should the file path be in that case?
i feel like i fixed it.. but i also feel like i fucked it up even more now.. i deleted some files to remove the "fur" of this species, so now it stopped clipping but my specific texture doesnt really appear anymore either... and well, i'm also still unable to see the hair menu
im new to this but uhh... i guess you could try putting all of them
but idk about the file path
nvm, it didnt fix, its even worse
someone pwease help XD i'm too dumb for this
i cant figure out what's going on and how to fix it
how come the other species from the anthro survivors mod work just fine, but mine is glitched out like that?
im trying to make a femboy, but still
i also want to try to give this new species the ability to use human hair ;3 (like sponge's hair and vanilla hair)
Any help, I have this in my mod, what should I do?
Send an email to: info@theindiestone.com?
In your mod info file, you don't have it reading as an older version or anything do you Darlak
How to change this code and add option to save time in to the file ?
PrintIngameTime = {};
function PrintIngameTime.printDateAndTime()
if isClient() then return; end
local y = getGameTime():getYear();
local m = getGameTime():getMonth() + 1;
local d = getGameTime():getDay() + 1;
local h = getGameTime():getHour();
local n = getGameTime():getMinutes();
print(string.format("Date in game %04d-%02d-%02d %02d:%02d", y, m, d, h, n));
print(os.date("Date on server %c", os.time()));
end
Events.EveryHours.Add(PrintIngameTime.printDateAndTime);
This one for build 41 and I use almost the same settings in my own mods and it only appears in this one and I have other older mods.
i would email, i'm pretty sure these incompatibilities have to be manually flagged
I think it's an IP issue
What I found here
given that the link up top links to the modding policy i would make sure you haven't breached it
It's Warhammer as well and Games Workshop vehemently defends their IP
In theory someone should have reported it, except that apart from this I received nothing else.
In the description of my mod it says it's property of Relic Entertainment, I guess you'll have to send an email.
Who pinged me?
I have been trying to make a map mod, I've followed the tutorial all the way through but when I put the mod folder in the game's mod folder
It just never shows up, the game loads and it's just not there in the mod list.
Would anyone know how to help me out?
Anybody know why the hell does my translation file not work for a specific new mod I am working on?
Ignore the item's actual properties, it's just a place holder.
Here's my item.txt file:
module Base
{
item NewItem
{
DisplayCategory = Clothing,
Type = Clothing,
DisplayName = ItemName_Base.TestItem,
ClothingItem = Socks_Long,
BodyLocation = Socks,
Icon = SocksWhite,
BloodLocation = Shoes;LowerLegs,
Insulation = 0.55,
WindResistance = 0.65,
Weight = 0.1,
FabricType = Cotton,
WorldStaticModel = Socks_Long_Ground,
}
}
Translation file:
ItemName_EN = {
ItemName_Base.TestItem = "Some Name",
}
How it's displayed:
I am confusion
Here's this if it helps
DisplayName is only used if there isn't a translation, it's not for translation
i imagine it's probably a legacy feature, likely even outdating translation entirely
So how do I go about translating the item's name in other languages? I use the same thing for literally every other mod I ever made, and it always works
Here it just doesn't for whatever reason
ItemName_Base.NewItem would work
you don't need a displayname at all
you just reference the item type
if you've been doing this for all your mods, the reason this one doesn't work is that the DisplayName and the item type probably match in your other mods
in other words the display name was never doing anything
you just used the wrong process to get to the right answer
Daaaang
I've no words
It works now
Thanks so much Albion! Can't believe I learned this the wrong way lmao
I have no idea what to do to get the mod to even show up in the mod list, its like the game just refuses to acknowledge it exists
use the mods folder in %userprofile%/Zomboid
the one in the main game directory is not normally loaded
Ah that's probably the issue, let me try that
Greetings to all. Does anyone have an idea how to achieve this. I am currently using Simple API UI. But I can't include an image.
I added this item to the game and did not add it to any distribution tables or zombies, but zombies still drop this bag. I wonder why?
item Bag_UltimateFannyPack2Back
{
DisplayCategory = Bag,
WeightReduction = 2147483647,
ClothingItemExtra = Bag_UltimateFannyPack2Front,
ClothingItemExtraOption = FannyPack_WearFront,
clothingExtraSubmenu = FannyPack_WearBack,
Weight = 0.1,
Type = Container,
Capacity = 1000,
DisplayName = Ultra Bel Cantasi (Arkada),
Icon = FannyPack,
OpenSound = OpenBag,
CloseSound = CloseBag,
PutInSound = PutItemInBag,
BodyLocation = FannyPackBack,
ClothingItem = Bag_FannyPackBack,
CanBeEquipped = FannyPackBack,
CanHaveHoles = false,
RunSpeedModifier = 1.0,
WorldStaticModel = FannyPack_Ground,
}
Hello everyone! I'm brand new not only to this discord but to modding in general. I wanted to do a mod for letting me plug headphones and put in/eject cassettes in a context menu added to the true music walkman item ('Tsarcraft.TCWalkman') to let me play some music while surviving on my steamdeck but I have a lot of questions about Context menu population. Is this somewhat correct? but most important, how do I list in a context menu all the headphones available in my inventory and "return" the one I click to a variable?
local function plugHeadphones(headphones,container)
--TODO container.addHeadphones(headphones)
local function contextPlugHeadphones(player, context, items)
local items = ISInventoryPane.getActualItems(items)
for _, item in ipairs(items) do
if item:getFullType() == 'Tsarcraft.TCWalkman' then
if zombie.radio.devices.DeviceData.getHeadphones(item) == nil then
context:addOption(getText('STRING_PlugHeadphones'), getSpecificPlayer(player), blabla)
-- HOW DO I ADD ALL THE HEADPHONES IN MY INVENTORY HERE AND RETURN THE ONE I CLICK?
end
end
end
end
Events.OnFillInventoryObjectContextMenu.Add(contextPlugHeadphones)
anyone got any idea why my world item clothing when being placed on the ground is like 10 tiles away from where im placing it?
if clothes have "CanHaveHoles = false" its mean they cant lost condition from attack too?
its possible to create stuff for this?
like: I want to do my armor only lost condition, without holes
I'm pretty new but I think it just means that it just can't have holes, condition is still a factor.
Hi there, does anyone know how to determine if a user is the owner of a safehouse? I'm trying to make a mod that would be in conjunction to BTSE's faction safehouse feature, wherein the players should only be able to change/pass ownership of the safehouse to a player who isn't an owner of a safehouse yet
how do i hook into functions properly again?
Hello, I have tried to install the DirectX Viewer so that I can view X files like the PZ Modeling guide says, but I got an error. 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...
Any reason this could be?
So... ISTimedActionQueue doesn't seem to be cosistent with own queues or something
ISTimedActionQueue.add(ISEquipWeaponAction:new(player, blowTorch, 50, true, false));
ISTimedActionQueue.add(ISWearClothing:new(player, mask, 50));
if action == "ATM" then ISTimedActionQueue.add(ActionATM:new(player, 1500, object)) end
if action == "Safe" then ISTimedActionQueue.add(ActionSafe:new(player, 3000, object)) end
This code implies "equip welding mask, equip torch and do the thing".
However, when one of ActionATM or ActionSafe is executed, it randomly (race condition) does fail to see blowtorch equipped in primary hand and return nil
That considering that distance between queues of equipping blowtorch and performing actual action is 50ms
How do I know that? One of the ATM/Safe actions literally return nil for it in isValid first frame.
Anyone here willing to mod on commission by chance?
Depending on the mod @heady crystal could be your person
Thanks!
Sent them a friend request. I appreciate the help!
so it seems like one of my hats in my mod disappears each time i load in, the other hats stay with each load, but the newest one doesnt. It wears fine, but placing it is off centered, the other hats are fine. anyone got any ideas?
https://github.com/asledgehammer/PipeWrench.git in case you want TS/JS kind of reference with types.
Anybody knows What code do i need that player can not take item from container?
I don't know how hard this would be, but I feel like a mod that lets one person control the horde while the other plays normally would be fun, maybe the 'sadistic human director' can earn 'points' to be able to turn off power, water, spawn a helicopter, etc by doing things that help the player, such as spawning loot crates, cars, weapons, etc, all while they can direct zombies in a certain radius to an area
Anyone knows how to properly empty a table so that it actually removes all items with a for loop?
other references to that table won't be modified
depends on how ur set up i suppose
usually i store stuff in subvars of a global table
i'm pretty sure pz just has a table.empty or table.clear or something
there may well b, but table.remove exists for specifically what ur asking for
if u really wanna do it that way
encourage you to look for alternative function like albion says
lmao are people that afraid of JSON to set 3/5 rating for mod just for that?
table.wipe(table_name) it looks like
Dont wanna wipe the whole table but certain elements of it
But its a scrollinglistbox which got its own methods to do it so i want to use them
But for some reason it doesnt remove all the items i need to even when it correctly captures them and iterates over a copy of the og table
i'd have to see your code but my reflex is 'have you tried looping backwards'
most issues with removing multiple items from a table come down to that
if you're using a numeric for loop (or ipairs, since it's just a slower numeric for) you just reverse it e.g.
-- forwards
for i = 1, #t do
...
end
-- backwards
for i = #t, 1, -1 do
...
end
countless hours wasted just because i didnt iter backwards, thanks
pretty sure you have to hit milestones in overall likes vs likes/dislikes ratio to be able to even qualify for more than 3 stars, and 5 stars is a high bar also. unless steam changed that
Maybe, not sure how it works, never noticed before. Just caught my eye today when I was scrolling
fucking demoralizing sometimes
i think the cap before a certain amount is 4 stars
my mods always hang at 4 stars even with nearly 100%
it's somewhere around this... don't quote me but based on some very light research from my own mods. 25+ likes is 3 stars, over 50 and almost all positive can get you 4 stars, need over 200 with a high ratio of likes to dislikes to receive 5 stars. this is far from exact but it's unreleased and i believe it uses something similar like a Bayesian Average
tryna mod the intro music, but the audio is not playing
What are some common issues that I may have accidentally done
Where does one begin modding?
There is no beginning or end
It is an endless labyrinth of unorganized words
But I recommend starting off with this https://pzwiki.net/wiki/Modding
Lemme grab some sites that help
https://pzwiki.net/wiki/Modding This gives the basics on how to mod zomboid and lua coding https://projectzomboid.com/modding/index.html This is the list of packages and classes for zomboid. Not much is explained but the names of them kind of give you the idea. https://pzwiki.net/wiki/Lua_Events This is a list of lua event. Lua events are triggered every time something happens
Also use a code editor. I use notepad++ but there are definitely better options
Hope that helps
From my very little experience in modding I can say it is confusing but this channel is usually full of lots of helpful people that can get you any help you need
I have a question, i created mods that player can buy & sell through the shop windows. Right now for the coordinates 'shop area that player can place their shop' is hard-coded. Is that possible to change the coordinates through the sandbox options? (so i dont need to update the mod if there is coordinates change)
Anyone know how to get your mod to have settings on the server setting file for multiplayer or single player?
Hello, does anyone know if it's possible to change only a item's icon that appears in the inventory?
for _, item in ipairs(itemlist) do
if player:getInventory():contains(item) then
player:getInventory():RemoveOneOf(item)
end
end
player:getInventory():AddItems("Base.Money", totalMoney)```
Noob question here. It works fine but when the player has a normal hiking bag and a big hiking bag, It removes both of the bags. How can I make it remove "one of" bags from itemlist?
I'm not sure exactly what you mean by coordinates—a range of coordinates? Either way, yes you can use sandbox options to specify that. It could either be multiple numbers (less prone to user error but more clunky) or a string that you'd have to parse (e.g., a string with the format X1 Y1 X2 Y2)
Do you mean sandbox settings?
Edit: if you do, you can add them in a sandbox-options.txt file in the media folder of your mod. See #mod_development message
You can use DoParam to change single attributes for items:
local item = ScriptManager:getItem('Base.ItemID')
if item then
item:DoParam('Icon = NewIcon')
end
You're looping over the list of items, which means it'll run the code in the loop twice. If you want it to stop after removing one successfully, you should add a break after the RemoveOneOf call—this will terminate the loop
Thought it would be possible to like swap the images of current items. But still, thanks
Can you clarify what you mean? (it may be possible to accomplish, just not sure exactly what you're trying to do)
Like, every item has its icon in the inventory
So, I was searching the files to find where the images for those are located
for me to see if I could swap them with other icons
So you want to replace the image used for the icon entirely, if I'm understanding correctly?
Yes
Gotcha. For some files you can just include a file with the same name as the vanilla one, but I'm unsure how you'd do it with ones that are defined in .pack files (which I'd assume is the case for those). I imagine it's been done, though, so maybe someone else will know how that'd be done
Alright. Those are probably in .pack files. Thanks
Also, is it possible to replace those T-shirt decals?
with other decals
By decals do you mean what actually appears on the T-shirts? If so, I imagine you'd just need to replace the texture used for it
After adding break, it's working! I really appreciate it 🥲
I found the images of these, so, I assume I can just replace them
Yeah, should work if you just add the same file with the same file structure in your mod
the ones in pack files still have a 'directory' so they can be overridden
Are the pack files treated as a directory themselves? i.e., would it be .../UI/whatever, for something in UI.pack
yep like that, range coordinates.
thanks for your insight! so there is a hope to changes the range coordinates more compact 
Anybody know if it's possible to have ISLabel wrap text?
Or maybe some other text thing
I want it to automatically break into new lines instead of overflow out my UI window
Could anyone please point me in the direction of some resources that will show me how to get a sound file to play when a car alarm is triggered? essentially just making the car alarm more interesting than what it currently is. I cant find many good resources on Google 😦
Having lots of difficulty installing the DirectX Viewer
If anyone could help it would be greatly appreciated
Is there another program I could use rather than DirectX Viewer
Because I'm having lots of issues with it
Would Fragmotion alone be fine to use?
Looking into it, it seems shady as of recently? I searched it and clicking on the pages sent me to websites to buy pills...
I just wanna make custom outfits 
Could you somehow grab the length of the window and insert newlines where necessary? And update on window resize?
Yeah I ended up writing my own function to wrap the text
Pretty crappy though
Should be an option by default
Or at least be more obvious if it is there somewhere
:3c has anyone started a homestuck mod fur this game yet?
doesn't seem like that'd be something in the modding field here considering how little something as mainstream as halo has to its name on the workshop
hmmm, might change that at some point :3
if you need help hmu. i need excuses to learn lol. new workflows always suck
is there anywhere where i can learn more about how the sanbox-options.txt works?
I don't know that there's a guide anywhere, but if you've particular questions I may be able to answer (which suggests that I should probably make a guide 😅 )
i think ive figured it out, i wasn't sure which file it called upon but after looking at others code, you call upon it. so that makes it a lot easier lol
Ah, you meant how to use it in code
yeah, im trying to add more customization to my mod but this is my first go lol
Nice 😄
there is something to lock an item inside a container so that no player can take it?
the padlock does that
not the standard crate
idk then
anyone know what the lua event is for procedural distributions?
how do you test you sandbox-options.txt file?
there is no event, procedural distributions is a lua table that gets processed after stuff being inserted into it.
oh okay, thats good to know!
Sandbox options will appear as a tab in sandbox options, once valid.
okay, you still test it in the user/zombid/mods folder?
sandbox-options.txt should be located in yourmod/media folder
yeah, but you still put the mod itself in the user/zomboid/mods folder, right?
Mods can be either in /mods or <user>/Zomboid/Workshop which is template workshop, or real workshop (aka steam folder)
I would recommend building your mods in template workshop folder, once published, just keep it there and unsubscribe to your mod (real workshop mod is in priority and will override it, thats why)
oh and don't forget when you update mod that any changes to workshop description will be used from stored file, not what you changed on page itself, so copy it.
burned myself badly like that once.
that is an excellent tip, I would have burned myself too lol
Mind that this can cause issues if you're testing a mod on a server, since your dev copy may be out of sync with the version on the workshop—to get around this, you can use a separate cache folder for mod development using the cachedir command line argument
it seems like my sandbox-options is not working then, im wondering if in the translation folder, the sandbox_mod needs is case sensitive
Unsure what you mean by sandbox_mod? The translation file should be in media/lua/shared/Translate and (for English) be Sandbox_EN.txt
It does not matter for translation presence
If you send the sandbox-options.txt content we can tell you if something looks off
thats a great pointer!
in the sandbox_EN.txt file, the sandbox_YourModName.Var = "String"
It should be Sandbox_ followed by whatever you put for the value of the translation field
By "not working" did you just mean the translations aren't showing up, or it isn't showing the options at all? As Dismellion said, they would've showed up but with just the string IDs
okay so it is case sensitve, thats what i did wrong lol
It's nearly impossible to say without seeing the files
oh then it isnt working at all
they didnt show up
i just checked my file name, it was sandbox-options not _ 🤦♂️
It should be -
oh!
then ill post the code
`VERSION =1,
option HallweensPumpkinHelmets.ZombieSpawnsDefault
{
type = double,
min = 0.0,
max = 100,
default = 1.0,
page = HallweensPumpkinHelmets,
translation = HallweensPumpkinHelmets.ZombieSpawnsDefault,
}
option HallweensPumpkinHelmets.ZombieSpawnsOffice
{
type = double,
min = 0.0,
max = 100,
default = 1.0,
page = HallweensPumpkinHelmets,
translation = HallweensPumpkinHelmets.ZombieSpawnsOffice,
}
option HallweensPumpkinHelmets.LootPumpkinAngry
{
type = double,
min = 0.0,
max = 100,
default = 1.0,
page = HallweensPumpkinHelmets,
translation = HallweensPumpkinHelmets.LootPumpkinAngry,
}
option HallweensPumpkinHelmets.LootPumpkinPirate
{
type = double,
min = 0.0,
max = 100,
default = 1.0,
page = HallweensPumpkinHelmets,
translation = HallweensPumpkinHelmets.LootPumpkinPirate,
}
option HallweensPumpkinHelmets.LootPirate
{
type = double,
min = 0.0,
max = 100,
default = 1.0,
page = HallweensPumpkinHelmets,
translation = HallweensPumpkinHelmets.LootPirate,
}`
Not sure this would be an issue & I don't have a moment to check, but try replacing the . in the translation name with _ (and make the corresponding change in the translation file). Also potentially an issue for seeing the menu: make sure you have the mod enabled in the main menu's mod selection menu
okay, ill try that!
still isnt showing up :/
ive got it named sandbox-options.txt
How do i open .pack files? the one on the forums uploaded 10 years ago doesnt seem to work anymore. thanks!
So i got the Sandbox Vars to show up in game but the translation isnt working
can you show me how you set up translations for a sandbox var?
the Sandbox_EN.txt is :
`Sandbox_EN = {
Sandbox_HallweensPumpkinHelmets_ZombieSpawnsDefault = "Global Pumpkin Zombie Spawns"
Sandbox_HallweensPumpkinHelmets_ZombieSpawnsDefault_tooltip = "Its percentual, but it does share its chance with other outfits, so at 100 you will never get only zombies with this outfits"
Sandbox_HallweensPumpkinHelmets_ZombieSpawnsOffice = "Office Pumpkin Zombie Spawns"
Sandbox_HallweensPumpkinHelmets_ZombieSpawnsOffice_tooltip = "Its percentual, but it does share its chance with other outfits, so at 100 you will never get only zombies with this outfits"
Sandbox_HallweensPumpkinHelmets_LootPumpkinAngry = "Loot spawn rate: Pumpkin Helmet - Angry"
Sandbox_HallweensPumpkinHelmets_LootPumpkinAngry_tooltip = "Its percentual, but it does share its chance with other spawns, so at 100 you will never get only Pumpkin Helmet - Angry"
Sandbox_HallweensPumpkinHelmets_LootPumpkinPirate = "Loot spawn rate: Pumpkin Helmet - Pirate"
Sandbox_HallweensPumpkinHelmets_LootPumpkinPirate_tooltip = "Its percentual, but it does share its chance with other spawns, so at 100 you will never get only Pumpkin Helmet - Pirate"
Sandbox_HallweensPumpkinHelmets_LootPirate = "Loot spawn rate: Pirate Hat"
Sandbox_HallweensPumpkinHelmets_LootPirate_tooltip = "Its percentual, but it does share its chance with other spawns, so at 100 you will never get only Pirate Hat"
Sandbox_HallweensPumpkinHelmetsTest = "Hallween's Pumpkin Helmets"
}`
and the setting of the sandbox var?
`VERSION = 1,
option HallweensPumpkinHelmetsTest.ZombieSpawnsDefault
{
type = double,
min = 0.0,
max = 100,
default = 1.0,
page = HallweensPumpkinHelmets,
translation = HallweensPumpkinHelmets_ZombieSpawnsDefault,
}
option HallweensPumpkinHelmetsTest.ZombieSpawnsOffice
{
type = double,
min = 0.0,
max = 100,
default = 1.0,
page = HallweensPumpkinHelmets,
translation = HallweensPumpkinHelmets_ZombieSpawnsOffice,
}
option HallweensPumpkinHelmetsTest.LootPumpkinAngry
{
type = double,
min = 0.0,
max = 100,
default = 1.0,
page = HallweensPumpkinHelmets,
translation = HallweensPumpkinHelmets_LootPumpkinAngry,
}
option HallweensPumpkinHelmetsTest.LootPumpkinPirate
{
type = double,
min = 0.0,
max = 100,
default = 1.0,
page = HallweensPumpkinHelmets,
translation = HallweensPumpkinHelmets_LootPumpkinPirate,
}
option HallweensPumpkinHelmetsTest.LootPirate
{
type = double,
min = 0.0,
max = 100,
default = 1.0,
page = HallweensPumpkinHelmets,
translation = HallweensPumpkinHelmets_LootPirate,
}`
hmm they're all not working? Everything seems alright to me
the sandbox shows up but not translated :/
Not sure if it makes a difference, but I remember facing an issue with how I "spaced out" the "paramaters" in my sandbox options. Can you try changing the first one to:
option HallweensPumpkinHelmetsTest.ZombieSpawnsDefault
{
type = double, min = 0.0,
max = 100, default = 1.0,
page = HallweensPumpkinHelmets,
translation = HallweensPumpkinHelmets_ZombieSpawnsDefault,
}```
i checked everything and it looks set up correctly. Maybe you did something wrong with placement of files? Where did you place them?
ive got sandbox-options.txt in the media folder and Sandbox_EN.txt in lua/shared/Translate/EN
i fixed it, dumb mistake. the Sandbox_EN wasnt a .txt file it was just "File" must have done it in visual studio and forgot to give it .txt
just saw this, got sidetracked. Anyhow, glad you have figured it out! I'd really recommend turning on file extensions view to avoid such mistakes
Good afternoon, ladies and gentlemen. Tell me, do you know which method is responsible for the name of an object (plant) when you hover over it with the cursor.
To change the name of a plant in the context menu, for example, you just need to change the name:
" .. getText("Farming_" ..plant.typeOfSeed);
that is, Farming_NewPlant = "Some other name"
Maybe I'm missing something obvious, since I'm new at this, but is there any way to remove an item off a table in procedural distributions. I've tried both table.remove() and RemoveItemFromDistribution() and the item keeps spawning.
is there any way to disable the names above the head on the CLIENT only? So other players can see the nameplate, but the player themselves won't see their own
Yes, I do this a lot for my server. Here's my code:
LootTableEditor = {}
function LootTableEditor.findItemIndex(tableToModify, itemClass)
for i = 1, #tableToModify, 2 do
if tableToModify[i] == itemClass then
return i -- Return the index of the item
end
end
return nil -- Return nil if itemClass is not found
end
function LootTableEditor.removeFromTable(tableName, itemClass)
local tableToModify = ProceduralDistributions.list[tableName]
if not tableToModify or not tableToModify.items then return end
local indexToRemove = LootTableEditor.findItemIndex(tableToModify.items, itemClass)
if indexToRemove then
table.remove(tableToModify.items, indexToRemove + 1) -- Remove the number following the item
table.remove(tableToModify.items, indexToRemove) -- Remove the item itself
end
end
Thank you, I'll try this out.
e.g. LootTableEditor.removeFromTable("WardrobeWoman", "ShotgunCase1")
I made a mod that modifies the repairs of guns and allows the repair of the katana. It works on SP but on multiplayer it says server shut down when the mod is active. If it isnt active the server works perfectly fine. Anyone know why this could happen? the only thing it does it modify the repairs in one script and nothing else.
Maybe check your console.txt and coop-console.txt for errors?
Just after the server fails to launch
and run zomboid with -debug
hello. can anybody teach me how to create a simple makeup mod? i already created the required texture png, only need the folder/file nonsense 
Sorry if this is a bit of hand holding, still learning this, but I can't seem to get it too work. I'm trying to remove the HuntingRifle and Shotgun from ArmyStorageGuns.
anyone here? what are the presets to export a rigged mesh to zomboid?
Found out how to do so.
Go to Windows/User/YOURNAME/Zomboid/settings.ini
Press Ctrl+F and search for username.
Set the flag showYourUsername to false
Load up your game
Has anyone tried to reduce the turning circle of vehicles ?
Is there any way to protect the wearing items from "player:getInventory():RemoveOneOf()" ?
for _, item in ipairs(itemlist) do
player:getInventory():RemoveOneOf(item)
doyouhaveanitem = 1
break
end
end
end```
I tried to use getPlayer():getClothingItem_Back() but it seems it's not for this.
If you can't find another way I suppose you could hook the getClothingItem_Back function with your own Lua function :d
A bit of work ^
instead of using removeoneof search for the item, check if it's equipped, and only then remove it
in which folder are the sprite pack for default farming plants located?
Do you guys know how or where to proerply call the safehouse list? I'm trying to make an addon to BTSE's multiple safehouse feature by not allowing the ownership to get passed to someone who already owns a safehouse, but I'm having trouble with some Invocation exception with my code. What I aim to do is when a user clicks on change ownership, i want to check if the candidates already own a safehouse with the custom function that I did, if they own a safehouse, dont add them to the list
require "/ISUI/UserPanel/ISSafehouseUI.lua"
require "/ISUI/AdminPanel/ISSafehouseList.lua"
function ISSafehouseUI:populateList()
local selected = self.playerList.selected;
self.playerList:clear();
for i=0,self.safehouse:getPlayers():size()-1 do
-- if self.safehouse:getPlayers():get(i) ~= self.player:getUsername() then
local newPlayer = {};
newPlayer.name = self.safehouse:getPlayers():get(i);
if newPlayer.name ~= self.safehouse:getOwner() or not determineIfPlayerOwnsSafehouse(newPlayer) then
self.playerList:addItem(newPlayer.name, newPlayer);
end;
-- end
end;
self.playerList.selected = math.min(selected, #self.playerList.items);
end
function ISSafehousesList:determineIfPlayerOwnsSafehouse(player)
-- get all safehouses
-- check all safehouse owners if the player is the owner
-- if there's a match, return true
for i=0,SafeHouse.getSafehouseList():size()-1 do <----------- error happens here
local safe = SafeHouse.getSafehouseList():get(i);
if player.name == safe.getOwner() then
return true;
end;
end
-- end of the loop, return false
return false
end
try with safe:getOwner()
yup, i'm already using safe.geatOwner, but it seems the error is happening in the for loop before that. I'm guessing I can't just call Safehouse out of nowhere? I imported this line require "/ISUI/UserPanel/ISSafehouseUI.lua" too because that's where I saw the Safehouse variable being called
instead of
if player.name == safe.getOwner() then
try
if player.name == safe:getOwner() then
To access member functions of an object you need to use a colon (:)
Ahhh I see what you mean now. Thank you so much! I'll try that
what folder is the tile map of farm beds in? They are not in the ProjectZomboid\media\texturepacks folder
👋 hello, I'm making a TV station and I was wondering when the init_infection scripts trigger in game?
Hello! I'm working with @halcyon nymph to host a roleplay server. We are looking to commission a modder that can create a DND-style dice system UI for an already custom made dice system. I'm not sure if this is the right channel to post something like this in, so sorry in advance ;w;
there is a mod that allows a player to own multiple safe houses?
may i know what this mod is?
i've been looking for it for ages
is it multiplayer compartible?
safehouses are multiplayer only, so i imagine so 😅
u r correct haha my bad
still unable to code my mod to allow players to make more than 1 safezone
tried bypassing it by temporarly allowing them to have moderator or admin accesslevel
but for some reason it keeps producing error
so i want to see how other person did it
Should just be
LootTableEditor.removeFromTable("ArmyStorageGuns", "HuntingRifle")
don't use Base.HuntingRifle or it wont find it, has to be as it is in the original table
if that still doesnt work, put in a print statement and make sure your mod code is actually being run on the server
Thanks my man! I appreciate it!
its in btse
which version?
ok thank you
Does anyone know if its possible to create items definition via lua on startup. So far I created a new liquid type and added it to the ReplaceTypes like PetrolSource or WaterSource for specific items and defined new items for the replacements in my items.txt file.
My idea was to create the items dynamically. So if I find an item with the ReplaceType WaterSource I want to add my Source und create a new Item for the replacement.
For example:
EmptyBottle -> WaterBottle
EmptyBottle -> NewLiquidBottle
I don't know if this is possible. Maybe lua code is already to late to create new items. Or maybe I missed a link...
Edit:
Just let me know if I didn't described it clear enough.
@bronze yoke Does your X mean it's not possible?
You can change pretty much anything so with a lot of sweat to handle all loading cases you probably will be able to achieve that for a given version of the game. I'd still recommend to create some base items, at least one per "PZ Item Type" (Weapon / clothing / food / drainable / ..) that you intend to derive your actually dynamically generated items from. .txt scripts is the vanilla proposed interface, adapt to it is likely to be the best practice.
hellos, I use 3ds max, what extra tools and things I need to be aware of to export rigged stuff to zomboid correctly?
Hello!
I am making a mod, that change loot system. Items, will be spawned depend on what items player has. I have 2 ideas for it. First is simple, but i should know some info about On Full Inventory Object ContextMenuevent. Specifically, player open container, item spawns. My question about is How can i use this event, or you know how can i complete my mod with this method? I do not know how can i transfer items from player (player^s backpack) to container. Pls help me, if you know similar mods tell me about transferring.
the world dictionary will immediately exit the save if you try to add a new item at runtime
Ok, thx...
I’m not sure if this idea is too ambitious or complex but is it possible to create a turn-based combat system like x-com in PZ?
For PvP specifically
Hi together 👋
I wanted to use https://steamcommunity.com/workshop/filedetails/?id=2412050672 in my playthrough but it errors out in two ways:
- First was in RedDeath.lua, where it yelled on the missing
require "ISUI/ISPanel"to callRDUI = ISPanel:derive("RDUI");- fine, fixed this but ... - is in Start_Traits.lua where the console yells at this line:
player:getInventory():FindAndReturn("Bag_Schoolbag"):getInventory():AddItem("CCS.RedDeath");
with this error:
LOG : General , 1697393744121> -----------------------------------------
STACK TRACE
-----------------------------------------
function: Lunchbox -- file: Start_Traits.lua line # 96 | MOD: Corner Store Candies and Sodas
ERROR: General , 1697393744123> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: getInventory of non-table: null at KahluaThread.tableget line:1689.
ERROR: General , 1697393744123> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: attempted index: getInventory 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:134)
at zombie.iso.IsoWorld.init(IsoWorld.java:2846)
at zombie.gameStates.GameLoadingState$1.runInner(GameLoadingState.java:268)
at zombie.gameStates.GameLoadingState$1.run(GameLoadingState.java:225)
at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1697393744125> -----------------------------------------
STACK TRACE
-----------------------------------------
function: Lunchbox -- file: Start_Traits.lua line # 96 | MOD: Corner Store Candies and Sodas```
Is there also smth. missing? Mod was updated lastly in 2021 so I don't think to expect any updates.
I already tried to search for a PZ LuaAPI page compareable to what Factorio has but I wasn't successfull on my search so I have no idea about any valid methodes, annotations, tables and so on which can be accessed in which way. Hopefully I can get help here
means the player doesnt have a schoolbag at the start
It is possible to load in an out-dated modding tool through an IDE like IntelliJ. capsid.pzstorm is one I’ve used
that's correct but shouldn't FindAndReturn() add this item to the players char or am I missunderstanding this methode/function 🤔
I'd think it would just search it in the inventory and then return the instance by the name of the call
not add it
you could do AddItem instead of FindAndReturn
Here is the main call of it. Error is thrown at the line after the elseif statement
if player:getInventory():contains("Bag_Schoolbag") == nil then
local HateRand1 = ZombRand(1,100)
if HateRand1 >= 50 then
local colorchoice1 = ZombRand(1,33)
if colorchoice1 <=11 then
player:getInventory():AddItem("CCS.HateradeYl");
player:getInventory():AddItems("CCS.minichugPi", 1);
end
if colorchoice1 <= 22 and colorchoice1 > 11 then
player:getInventory():AddItem("CCS.HateradeBl");
player:getInventory():AddItem("CCS.minichugBL");
end
if colorchoice1 <= 33 and colorchoice1 > 22 then
player:getInventory():AddItem("CCS.HateradeWh");
player:getInventory():AddItems("CCS.minichugOr", 1);
end
end
elseif player:getInventory():contains("Bag_Schoolbag") ~= nil then
player:getInventory():FindAndReturn("Bag_Schoolbag"):getInventory():AddItem("CCS.RedDeath");
local HateRand2 = ZombRand(1,100)
if HateRand2 >= 50 then
local colorchoice2 = ZombRand(1,33)
if colorchoice2 <=11 then
player:getInventory():FindAndReturn("Bag_Schoolbag"):getInventory():AddItem("CCS.HateradeYl");
player:getInventory():FindAndReturn("Bag_Schoolbag"):getInventory():AddItem("CCS.minichugPi");
end
if colorchoice2 <= 22 and colorchoice2 > 11 then
player:getInventory():FindAndReturn("Bag_Schoolbag"):getInventory():AddItem("CCS.HateradeBl");
player:getInventory():FindAndReturn("Bag_Schoolbag"):getInventory():AddItem("CCS.minichugBl");
end
if colorchoice2 <= 33 and colorchoice2 > 22 then
player:getInventory():FindAndReturn("Bag_Schoolbag"):getInventory():AddItem("CCS.HateradeWh");
player:getInventory():FindAndReturn("Bag_Schoolbag"):getInventory():AddItem("CCS.minichugOr");
end
end
end
maybe some calls are out of date for the current version 🤔 I mean, the mod itself is from 2021 so at last 2 years old
I smell a few broken things here
try maybe with Base.Bag_Schoolbag
will do so
but also I wonder why it was triggered at the elseif instead at the start of the if itself because there is also a check for the Bag_Schoolbag but without any errors 🤔
could it be the difference for == and ~= which lua handles different?
the problem is the ~= nil
contains returns true or false
neither equal nil
the code paths don't make sense
it could just be ```lua
if not player:getInventory():contains("Bag_Schoolbag") then
...
else
...
end
so this should be the better way instead of messing around with == and ~= and the elseif statement to it, right?
since FindAndReturn() seems not to give (back) a Schoolbag, am I right @bronze yoke ?
anyone have a clue why my icons have an white border in game?
Rather than doing a contains check and then FindAndReturn for the same item, it'd make sense to extract the FindAndReturn to before the if statement; you're repeating work. If it doesn't find the item it'll return nil. i.e.,
local inventory = player:getInventory()
local schoolbag = inventory:FindAndReturn('Bag_Schoolbag')
if schoolbag then
-- code for if the bag exists
else
-- code for if it doesn't
end
Better yet, since you appear to be doing the same thing in either branch (but just putting it in the bag instead), you ought to just set inventory to be schoolbag:getInventory() if it's found (and use that instead of the repeated gets)
Ah, I missed that you're fixing an existing mod. Nonetheless, these are improvements that could be made 😄
Well, repolishing the mods code is one part for later if rly needed. At first I want to get it back working since it won't get any updates tbh. and I am unsure if I can reach out to the original author for perm request of releasing an updated version to steam but in his file RedDeath.lua there is this comment:
--[[
A note from the author:
Hello and welcome to my very first code sheet written 100% by me, SteamID:austin3rockr3.
I am so proud of myself considering I have had no coding taught to me and had no one to help me with any questions I had while building this
Please feel free to use any codes you like regardless of giving credit to my name. It would be sweet if you did since this was so tough but you're call!
I realize the PZ Community is pretty awesome and I'm happy to contribute
Hope you like it!
--]]
Maybe this is enugh for an updated redis with propper given credits to him 🤔
More improvements tbd:
if player:HasTrait("Overweight") then
if not player:getInventory():contains("Bag_Schoolbag") then
player:getInventory():AddItem(StartList[PickOne(#StartList)]);
else if player:getInventory():contains("Bag_Schoolbag") ~= nil then
player:getInventory():FindAndReturn("Bag_Schoolbag"):getInventory():AddItem(StartList[PickOne(#StartList)]);
player:getInventory():FindAndReturn("Bag_Schoolbag"):getInventory():AddItem(StartList[PickOne(#StartList)]);
end
end
end
if player:HasTrait("Out of Shape") then
if not player:getInventory():contains("Bag_Schoolbag") then
player:getInventory():AddItem(StartList[PickOne(#StartList)]);
else if player:getInventory():contains("Bag_Schoolbag") ~= nil then
player:getInventory():FindAndReturn("Bag_Schoolbag"):getInventory():AddItem(StartList[PickOne(#StartList)]);
player:getInventory():FindAndReturn("Bag_Schoolbag"):getInventory():AddItem(StartList[PickOne(#StartList)]);
end
end
end
Even more ~= if them which can be eliminated I assume ^^
And also ... 🤔 ... I could check for the Highly Overweighted trait if it's a vanilla and a not modded ones but also why should I even care then?
I could check if Mod XYZ is loaded am I right? And if so I could add support/overwrite/addition to this mod then, right?
my item used to "exist"? now idk what i did in the script it doesnt appear
``module Base
{
imports
{
Base
}
item Punzo
{
MaxRange = 1.25,
WeaponSprite = weapon_piquete.png,
MinAngle = 0.75,
Type = Weapon,
MinimumSwingTime = 2.6,
DoorHitSound = MetalPipeHit,
HitSound = MetalPipeHit,
HitFloorSound = MetalPipeHit,
SwingSound = MetalPipeSwing,
KnockBackOnNoDeath = FALSE,
SwingAmountBeforeImpact = 0.02,
Categories = Sharp,
ConditionLowerChanceOneIn = 20,
Weight = 0.5,
SplatNumber = 2,
PushBackMod = 0.5,
SubCategory = Stabing,
ConditionMax = 15,
MaxHitCount = 2,
DoorDamage = 5,
IdleAnim = Idle_Weapon1,
SwingAnim = Stab,
DisplayName = Piquete,
MinRange = 0.61,
SwingTime = 2.6,
HitAngleMod = -30,
KnockdownMod = 2,
SplatBloodOnNoDeath = TRUE,
Icon = item_piquete,
RunAnim = Run_Weapon1,
TwoHandWeapon = FALSE,
BreakSound = BreakMetalItem,
TreeDamage = 1,
CriticalChance = 15,
critDmgMultiplier = 2.7,
MinDamage = 0.9,
MaxDamage = 1.3,
BaseSpeed = 1.5,
WeaponLength = 0.5,
AttachmentType = Knife,
}
}`
remove the .png from weaponsprite
ok
So would this be enough for a fixed and working redistributation of his mod then?
Hey I was taking a look at the https://zomboid-javadoc.com/41.78/zombie/core/skinnedmodel/population/ClothingItem.html#m_HatCategory m_HatCategory and was having trouble finding all the valid categories. Is it somewhere in the docs or does someone have a list?
Update
Categories I have found:
default - unknown
Group_01 - unknown
Group_02 - unknown
Group_03 - unknown
Group_04 - unknown
Group_05 - unknown
Group_06 - unknown
nohair - removes hair
nohairnobeard - removes beard and hair
Javadoc Project Zomboid Modding API declaration: package: zombie.core.skinnedmodel.population, class: ClothingItem
if my mod has 2 melees do i need to make another script whit the name MODID-Melee? or i make the code for the other weapon in the same script?
wut
How can I make a patch for someone else's mod on the workshop? I just want to change some item variables.
My first thought was to copy item code, edit that, and load my mod after the one I want to edit. But I'm sure there's a much better way of doing it...
Alright I am not the sharpest spoon in the knife drawer, and I am new to modding this game.
Can someone tell me what I did wrong here?
require "ISUI/ISCollapsableWindow"
local MyPanel = ISCollapsableWindow:derive("MyPanel");
function MyPanel:initialise()
ISCollapsableWindow.initialise(self);
local btn = ISButton:new(10, 40, 100, 25, "Click me", self, function() MyPanel:onButtonClick() end);
self:addChild(btn);
end
function MyPanel:onButtonClick()
-- lol empty
end
function MyPanel:new(x, y, width, height)
local o = ISCollapsableWindow:new(x, y, width, height);
setmetatable(o, self);
self.__index = self;
o.title = "Custom Panel";
o.pin = true;
o:initialise();
o:instantiate();
return o;
end```
and for being comprehensive, it's being called with
```lua
MyPanel:new(50, 50, 300, 200):addToUIManager();
I realized i should probably use "self:onButtonClick()" over "MyPanel:onButtonClick()" and changed it but the thing is still broken
nevermind I realized what the issue was, it opens now
Hello guys 🙂
Trying to modify what the Sickness Moodle do on the player (bad consequences like heat and speed)
Do you know where i can find this into the PZ Code ? Can't suceed to find it 😦
Depends on how they wrote it, what you want to change, etc.
Ideally you only need to soft-overwrite the functions they overwrite from vanilla.
Just as an example: a mod that changes the encumbrance values of some but not all of the firearms in a given mod, leaving its other values intact.
It'll be my first mod for PZ ever, I'm just getting stuff set up right now. Might use IntelliJ community edition
Ah, in that case I would suggest looking at how itemTweaker handles changing values
How it works is changing item script values after they've been loaded
good shout! thank you.
Yeah I read something in Wolfe's guide about manipulating the load order in code to make sure the patch mod executes over the original mod. I don't think I understand it but I can try.
I assume with ItemTweaker I don't need to worry so much about that?
You shouldn't need to
Only issues would be other mods that do the same thing you do to the same variables
that certainly makes life easier. But before I do that I'm gonna make a "helloworld" type mod with a VHS tape or something.
Hey how do you actually make UI elements like buttons and whatnot show up in a collapsible panel? They just aren't showing up for me
I'm on mobile at the moment but this is the code I am trying to get working
I get no errors when opening the panel, it shows up...it's just that the panel is empty
does this cause any issues? like i added the Recipe recycle scrap wood and uhh it doesnt allow me to craft for example ripped sheets
wait maybe its the missing import?
or maybe that i made it module Base?
conflicting with Base?
Not really related to the technical side but I'd personally set a requirement for the recipe to be unlocked at 6 carpentry or something. Seems a bit cheesy
its a personal mod for myself
Fair enough
Anyways should i add import after module or before?
After import I think. I'm not home atm but I'll look later. Why not try it either way and see if it runs?
Remove the }, part
n the { too?
and the { right?
Yeah that too
Just have them all in one block
Module Base{ followed by all the recipes you want
You can import Base module or put it in the Base module its mostly done if you use your own module
Look at how vanilla game does its recipes
how
- its prob too cluttered for me
also just support not tell "look at vanilla gaame recipes bablalbal lbal"
so you didn't even look?
you can just copy-paste a vanilla recipe and change the variables to what you want. I haven't finished a mod, I'm looking at vanilla recipe scripts now, its that easy.
bro this is mod development not copy and paste vanilla stuff and change only like 2 variables development bruhhh
that's literally how a lot of mods are made. you learn by following the present example. a lot of popular mods are Frankensteinian creations out of the game's vanilla code
bro this aint "i wont help haha" its for support in making mods and stuff about mod development
\Steam\steamapps\common\ProjectZomboid\media\scripts look for recipes.txt
Scroll through and you can look at different examples.
https://pzwiki.net/wiki/Scripts_guide/Recipe_Script_Guide
idk what more you want
you can block bothering people with right click + block
The helpful way of formatting {} for reading is using { as the end of the line before indents
Like how your import is. This is purely preference.
If I wanted to make a piece of clothing emit light like a flashlight, where should I be looking for that?
if i wanted to add a new custom full face makeup entry, how would i do so 
dose anyone know how to hide the poison icon on poisoned food?
any1 able to make sense of this. It works on solo but when i try to do mp it doesn't work.
[16-10-23 16:33:12.435] LOG : General , 1697499192435> 1,400,337,798> Workshop: item state CheckItemState -> DownloadPending ID=3049924959.
[16-10-23 16:33:12.472] LOG : General , 1697499192472> 1,400,337,833> Workshop: DownloadPending GetItemState()=NeedsUpdate|DownloadPending ID=3049924959.
[16-10-23 16:33:12.472] LOG : General , 1697499192472> 1,400,337,835> Workshop: download 0/0 ID=3049924959.
[16-10-23 16:33:12.575] LOG : General , 1697499192575> 1,400,337,936> Workshop: DownloadPending GetItemState()=NeedsUpdate|DownloadPending ID=3049924959.
[16-10-23 16:33:12.575] LOG : General , 1697499192575> 1,400,337,936> Workshop: download 0/0 ID=3049924959.
[16-10-23 16:33:12.676] LOG : General , 1697499192676> 1,400,338,038> Workshop: DownloadPending GetItemState()=NeedsUpdate|DownloadPending ID=3049924959.
[16-10-23 16:33:12.676] LOG : General , 1697499192676> 1,400,338,038> Workshop: download 0/0 ID=3049924959.
[16-10-23 16:33:13.106] LOG : General , 1697499193106> 1,400,338,468> Workshop: onItemNotDownloaded itemID=3049924959 result=15.
[16-10-23 16:33:13.106] LOG : General , 1697499193106> 1,400,338,469> Workshop: item state DownloadPending -> Fail ID=3049924959.```
you can hook IsoGameCharacter.isKnownPoison to always return false
@thin bronze
the ui calls that method for each item to see if it should render the icon
ill try that thanks
Has anyone seen an issue where an attempt to override a file in another mod does not work despite having the same structure and using the proper modid in the mod.info file? I am definitely loading the patch mod after the main mod I am attempting to override.
LOG : Mod , 1697509050861> 0> loading Advanced_Trajectorys_Realistic_Overhaul
LOG : Mod , 1697509050880> 0> mod "Advanced_Trajectorys_Realistic_Overhaul" overrides media/lua/shared/translate/en/sandbox_en.txt
LOG : Mod , 1697509050884> 0> mod "Advanced_Trajectorys_Realistic_Overhaul" overrides media/sandbox-options.txt
LOG : Mod , 1697509050906> 0> loading RED-ATRO-PvP-PATCH
LOG : Mod , 1697509050909> 0> mod "RED-ATRO-PvP-PATCH" overrides media/lua/client/advanced_trajectory_core.lua
what's your mod id? what file are you trying to overwrite?
because this log seems to show a successful override? 😅
Contents of the mod.info from the patch mod
name=Advanced Trajectory's Realistic Overhaul - PvP PATCH
id=RED-ATRO-PvP-PATCH
require=Advanced_Trajectorys_Realistic_Overhaul
description=
poster=poster.png
It does seem that way, it's not even reading my debug lines.
This is the file Im attempting to overwrite:
\media\lua\client\Advanced_trajectory_core.lua
First thing first check your servertest.ini file for errors
Unfortunately server requires ids of mods and mod names to be in same order or else it doesn't work.
Correct✅
Mods=Mod1;Mod2;Mod3
Incorrect❎
Mods=Mod1;Mod3;Mod2
it is only the one single mod
Wait, this could be related to my issue? Never had an issue with WorkshopItems and Mods being in a different order causing issues. Issues I had was with the order in Mods itself.
Is that mod public?
do you mean mod? if you do then no
WorkshopItems=Mod3;Mod2;Mod1
Mods=Mod1;Mod3;Mod2
Afaik, it doesn't matter in what order the WorkshopItems items are in, but what does matter is the Mods order.
If not there's a question do you host server or use sites like 4netplayer or other
no just from the host button on the main menu, i can understand why having it on private wouldent work if the server itself has to download the mod without using you. It would work on unlisted though right?
After looking for this mod by id I got this
Make it public and check or if you got files for it look up manual instalation
I changed it to unlisted and now it works, ty!
GJ, so it's status on workshop was a problem
Hello! I'm working on making some mods for fun atm and I need help finding a particular thing. Im super new to modding so bear with me 🙏
Changing the ui file for the menu screen was easy enough, but I noticed that after I changed the image, there was this lightning overlay still there in the game. Sort of a soft light that animated over the image. I've been trying to find where this is located in the coding, Ive been searching thru the files all day haha.
I generally want to remove this from happening, if I can. If it disables the switch to the lightning ui images as well, that is fine. I heard someone say that if you disable music in the game, this won't happen, so is the lightning tied to the volume settings? Thanks!
Hello guys, I have a question about ModData for players
is there a way to change a player's ModData() as admin remotely?
or change player's state remotely
for example i want to remotetly add a exampleplayer:ModData().example = true
but do it remotely from maybe debug or some type of command
and also change their zombie kill counts remotely
is this possible?
you'd have to write a server command to do it
hmm with sendclientcommand()?
but then problem is since player logging in is always changing
local player = getOnlineplayers()
local spplayer = player:get(2)
local modinfo = spplayer:getModData()
modinfo.exampledata = true ```
then this player will always vary..
how can i make it selectable?
using IF statement by getting player name still has its limitation
since i ll have to code in every player's ID
hello again! In this i check container if container has special item then some items spawn in this container. What is wrong in this code? Help pls// (if anything item spawns in the bag in container)
local List = container:getItems()
local Bag = nil
for i = 0, List:size()-1 do
local item = List:get(i):getItem()
if item:hasTag("BagALICEpack") then
local enemies = item:getItemContainer():getItems()
for , enemy in ipairs(enemies) do
if not enemy:HasTag("Milk") then
item:getItemContainer():AddItem("Base.Milk")
Yo guys is there anybody available to be hired for a mod development? It's a paid job for a private server. Pm me for details thanks
Quick question:
I have noticed that when Events.OnCreatePlayer is fired, you can not yet sendClientCommand. It just does not work. What I do right now to work around it is in OnCreatePlayer bind another callback to Events.OnTick, delay about 20 or so ticks, then unbind the OnTick callback and call sendClientCommand there.
My question is, is there another event I can use which is called whenever a player is actually fully loaded in, and can use sendClientCommand? Binding to OnTick seems like a clunky unstable workaround.
question, how does PZ handle floating point precision errors?
The map is pretty large
I'm not a mod dev but I was just curious and I thought this would be the best place to ask first
boring answer but for the most part it's just not actually that big
it uses double precision floats in some key places but i'm not convinced it's too big for a single's errors to be significant
iirc the map is only about 5000x5000, though i recall it is for some reason quite far from the origin
You could maybe do the same bind/unbind with OnPlayerUpdate. OnCreatePlayer doesn't work because sendClientCommand checks for an “is ingame” flag that's set after that event fires. I haven't checked the order of the update one but I assume it's after
unfortunately it's before
Wouldn't it eventually start firing when it is available? Dunno if there's a way to check the flag
when i messed with it every event i could find is before, so anything that fires on each tick usually doesn't have it available until the second time it fires
Dang
Yeah I tried all the events which look even remotely like it could work from https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md
I ended up creating an reuseable abstraction which just delays some ticks
Lets hope Build 42 has an "onPlayerInGame" event
or just does away with the nonsensical delay entirely
i haven't looked too much into the code for it but there's no obvious reason to me
My guess is it uses it as a “is the player available” since it expects one, but this problem demonstrates that that's not an ideal way to check that
how does a battery life deplete? where can i find the code for like a flashlight?
Is there a list of the 'sounds' in the base game that you can use for crafting recipes?
yeah just inspect the media folder, there should be an xml file
called sounds i guess
Got it ^^
Can't seem to find the xml for it though
Ah I think I found it
Sounds_item
I’m new to modding Zomboid but have modded other games in the past. I’m attempting to make a custom item to put in game (A bindle aka hobo stick) how would I go about getting the player model to do custom animations and then put said item ingame. There really doesn’t seem to be that many resources available for mod development in areas like that so I was hoping someone may have the answer 🙏
I already have the bindle modeled I just am stuck for the next steps
A really annoying note:
getPlayerByUsername doesn't work for invisible gm, moderator, or overseers. Does work for invisible admins. 
How can I check that if a certain sound is produced, an event is triggered?
sorry if I went to the wrong place, but is it possible to change the size of a model (like making tiny zombies or something)
I guess a more accurate term would be the scale of the model
https://theindiestone.com/forums/index.php?/topic/37647-the-one-stop-shop-for-3d-modeling-from-blender-to-zomboid/
Guide here for exporting models to add to the game, not sure about the animation side of it but I found this:
https://steamcommunity.com/sharedfiles/filedetails/?id=3035712003
For adding a new recipe to make the bindle in-game look among here:
https://pzwiki.net/wiki/Modding#Modding_tutorials
Unfortunately all the mod-making tutorials out there are kinda all over the place. For most things I've been fiddling with I just look at the code of other peoples' mods and do that.
that said, adding a recipe into the game that uses vanilla items and models is so easy.
unfortunately there are very few people in the community with experience with custom animations
Hi. Is there a function in api for switching hands? I'd like to make mod that could make lefties or ambidextrous characters.
What is the best way to test your mods?
Can someone help me with UI stuffts?
I have this snippet:
local x = (getPlayerScreenLeft(playerNum) + getPlayerScreenWidth(playerNum)) - width
local y = (getPlayerScreenTop(playerNum) + getPlayerScreenHeight(playerNum)) - height
local o = ISPanel.new(self, x, y, width, height)
But apparently, in some resolutions, the panel is cut off, as in, off-screen. Just... how?
entirely offscreen?
Just partly
It's for my achievements mod. I am puzzled.
This shouldn't be possible
huh... that could only make sense to me if the panel was HUGE
but it looks very small there
Yeah
I did copy this from vanilla, but surely it's not the issue?
o.anchorLeft = true
o.anchorRight = true
o.anchorTop = true
o.anchorBottom = true
If it's anchored in all directions it might as well not be
Yeah it's not resizeable
iirc it maintains the gap between both sides of the screen...?
let me check on that that sounds odd
In my res (1920x1080) it looks perfect. User reporting it has 2560x1440
But it's the same aspect ratio: 16:9
I am completely puzzled by this. Either I am missing something critical, or it seems PZ straight up can't calculate the UI properly?
i hope it's something weird because my moodles reimplementation depends on very similar code 
FWIW Your mod is working for me at 1920x1080, but the devs themselves said they have plans for people regarding the UI for people at high resolutions. There are problems they have with the vanilla UI already, but I don't know the specifics.
Can I send you the full code in DMs? It's not much. Maybe it will help.
sure!
Thank you!
yeah, several of the vanilla ui elements are hardcoded to appear at specific sizes
i had to rewrite moodles entirely to resize them
i think they're already too small at 1080p, poor 4k players 😭
Not very helpful of me cos I'm a novice but I'd bet your UI problems will be fixed by what the devs do. idk.
RIP
You should be able to just set keepOnScreen to true on the window you are creating. The ISUIElement class already has logic to handle staying on screen if that variable is set, so it should always correct setX/setY calls if they a result in it being offscreen
Thank you! Hopefully that helps 🙏
I'm having trouble with the mod.info file. Everything seems to be fine with the file itself, but where I'm putting it.
Contents/mod.info - Only folders are allowed in Contents/.
modname/mod.info - Your mod is missing a mod.info file.
mods/mod.info - Your mod is missing a mod.info file.
Where do I put it? I'm a bit puzzled.
Contents/mods/modname/mod.info
That makes more sense. Sorry
either one works
I am new to modding and can’t find any documentation on this, is it possible to change the size of models in game in real time (like x happens and makes zombies shrink to 1/2 size) or can the size of 3d models in game not be affected
Hello! We're a PZ Roleplay community that's looking to hire someone or a team who would be willing to work with us in the creation of some placeable infected models. We have the majority of the details and a vision, but are looking for the hand we need to execute them. Please shoot me a DM if you're willing to take on a project like this so I can elaborate on the details and get this ball rolling.
}
recipe Tearing Plushies
{
Spiffo/SpiffoBig/BorisBadger/JacquesBeaver/FreddyFox/PancakeHedgehog/MoleyMole/FluffyfootBunny/FurbertSquirrel/Doll/ToyBear,
keep Scissors,
Result: CottonBalls=2,
Time: 50.0,
Category: Tailoring,
Sound:ClothesRipping,
AllowDestroyedItem:false,
}
}
Trying to figure out why this specific recipe isn't working.
If anyone can see something wrong with it, I've been trying to figure it out for a while
Could anyone tell me how does addSound work? I tried to add sound in my function but it's not working. local player = getPlayer() local x = player:getX() local y = player:getY() local z = player:getZ() local radius = 20 local volume = 1.0 local soundClip = "media/sound/Zamaclick.ogg" addSound(player, x, y, z, radius, volume, soundClip)
addSound(source object, x, y, z, radius, volume)
Just found addSound does not contain soundclip 🦕
addSound doesn't play a sound file, it's for attracting zombies
playSound is what you need
guys i have a question. I want to save a for example if a person sells an item called "apple" to a store
i want that data to be stored in server
so i can keep track of how many "apples" are sold
im guessing this is done by using Global.modData()
but does this get synced automatically?
or is there another method that i need to execute to sync this throughout the whole other players
hi im new to lua & modding and im trying to make my first mod that plays a sound whenever the player yells (presses q)
if qtaunt == Keyboard.KEY_Q then
qtaunt:playSound("yell_" .. ZombRand(1, 15))
end
end
Events.OnGameStart.Add(OnGameStart);
Events.OnCustomUIKeyPressed.Add(OnCustomUIKeyPressed)
this is what i have so far and it gives the error : Object tried to call nil in OnCustomUIKeyPressed at KahluaUtil.fail line:82. on line 4 whenever I press q in game. I would appreciate some help ❤️
qtaunt is either a keyoboard key object or a string either way it doesnt have a playsound method
Youd need the player for that
really?
local rng = ZombRand(2)
if rng == 1 then
taunt:playSound("taunt_" .. ZombRand(1, 19))
end``` i wrote this before and it works fine except for the fact that the sound plays from the zombie rather than the player. why does it work in this case but not the other one?
Different things are passed to events
hmm i see
how do i make the ingame sandbox settings affect the code?
My Vest has full body cover part for this test.
Without balance, just for test.
Armor absorb test...
Functionality has been added so that you don’t immediately get holes from attacks.
Just for the test, the body armor completely covers all areas of the body.
The current counter was set to 30 attacks.
After this, the body armor begins to tear.
Are you asking how to create and use custom sandbox options?
Rather than using an event, it may be ideal to override the callout function itself
You can use https://projectzomboid.com/modding/zombie/world/moddata/ModData.html#transmit(java.lang.String) to trigger syncing of global mod data. You'll need to use the mod data events to actually handle the data, though
declaration: package: zombie.world.moddata, class: ModData
e.g., ModData.transmit('yourModDataKey')
Does any here make maps?
yeah, i want my mod to have customizable options. I managed to create the .txt files, but idk how to connect the actual code to those txt files
option X.Y (in sandbox-options.txt) -> SandboxVars.X.Y (in Lua)
so like option Taunts.rng in sandbox options & local rng = ZombRand(SandboxVars.Taunts.rng) in lua?
Yes as to the access, although I'm curious as to the surrounding context of that snippet
local rng = ZombRand(7)
if rng == 1 then
taunt:playSound("taunt_" .. ZombRand(1, 19))
end
end
Events.OnGameStart.Add(OnGameStart);
Events.OnZombieDead.Add(onZombieDead)``` is the full code and i want the rng ZombRand to be customizable
I see. The concern I had is a non-issue, then, but I do have another bit of feedback if you're open to hearing it
yes of course
As you have it now, if you use your sandbox var, a higher number means a lesser chance. i.e., 1 = 0% chance, 2 = 50% chance, 3 = 33% chance, and so on (I think these are accurate, anyway, because if my memory serves correctly ZombRand with one arg is an int in [0, x)). This isn't great from a user experience perspective; I'd recommend changing it such that the sandbox var represents the percentage chance of it occurring
yeah i figured its like that, but im not sure how to make it a percentage as i started using lua just last night
You can use ZombRand(100) < x, where x is your sandbox var—for 50, as an example, this would be true when the random number is in [0, 49] (half of the possibilities)
