#mod_development

1 messages · Page 200 of 1

tough grotto
#

no unfortunatly, im just working on custom recipes for wilderness surviva

vague hedge
#

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.

tough grotto
#

trying to deconstruct how "essentials crafting" works so i can do what i need

vague hedge
#

So for Hydrocraft, I think I found the foraging file that affects foraging.

tough grotto
#

cause essentials crafting is good but its not QUITE what i need

tough grotto
#

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

vague hedge
#

Alr, lemme check into the files

tough grotto
#

that way when animals gets released in the next update i can turn PZ into green hell xD

vague hedge
#

So does the mod make any changes to foraging?

#

the Essential Crafting mod*

tough grotto
#

i think it adds cotton balls to forage loot

bronze yoke
#

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

tough grotto
#

but i want it NOW

#

xD

vague hedge
#

Looking into the files, it doesn't seem to add or ange anything to foraging in the lua

tough grotto
#

EssentialCrafting>Media>lua>shared>foraging @vague hedge

vague hedge
#

nvm

#

yeah ty

tough grotto
#

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);

vague hedge
#

Ok, so you want to do what again?

#

like add what items to foraging*

tough grotto
#

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

vague hedge
tough grotto
#

yeah thats what it looks like

vague hedge
#

Lets say for instance, you want to add a spoon to foraging

#

lemme see if I can give a sort of basic layout

tough grotto
#

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

vague hedge
bronze yoke
#

an odd detail is that the require line actually does nothing at all

tough grotto
#

the "local cotton balls" is just a local definition to tell the script what item it is

bronze yoke
#

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

vague hedge
tough grotto
#

id assume you would just get the local item definition from the vanilla items listing and it would work

vague hedge
#

Then try that

tough grotto
#

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
)

vague hedge
#

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?

tough grotto
#

i dont think i need the help anymore im just getting my thoughts out on paper at this point

vague hedge
#

Ah ok

tough grotto
#

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

vague hedge
#

@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

bronze yoke
tough grotto
#

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?

vague hedge
#

So if I put in "Category:Trading," it will crate a category called Trading?

bronze yoke
#

yeah, you'll need to add a translation string for it to display properly but it shouldn't need any special initialisation or anything

bronze yoke
#

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

vague hedge
#

looking into a guide rq

bronze yoke
#

it looks like you need an IGUI_ItemCat_MyCat = "MyCat", entry in a lua/shared/Translate/EN/IG_UI_EN.txt

vague hedge
bronze yoke
#

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

vague hedge
#

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

bronze yoke
#

just doing Category=Trading creates the category

#

there is no initialisation

vague hedge
#

I wonder why it isnt then

#

wait, checking smth..

plucky nova
#

thanks bro

vague hedge
#

Nope, still having issues..

#

Can't open the crafting menu in game, gives 1-2 error pop ups

tough grotto
#

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

mellow frigate
neon bronze
#

OnEat or OnCreate

tough grotto
#

what folder is it in?

foggy finch
#

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

plucky nova
#

so, about this, would there be any way to position the model better? because, as you can see, the models are currently placed incorrectly

dark wedge
plucky nova
#

so maybe i just put the items in the wrong spot?

dark wedge
#

If that's the case, then yea probably just need to play with it until you find the sweet spot

plucky nova
#

i guess? but theres only really two options ive seen lol

#

"hand item" and just "hand"

plucky nova
#

made that a mod, i mean

foggy finch
tough grotto
#

does anyone else use itemzed?

marsh sonnet
#

How would I go about making custom roads and being able to use them in the map creator?

glossy merlin
#

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.

foggy finch
#

and a link if possible to the mod

marsh sonnet
#

Why not just use the actual mod itself? Are you just gonna rip the code lol ?

foggy finch
#

-_-

#

littearly i know about this mod

marsh sonnet
#

so why ask then wtf? That's literally what you've asked for...

foggy finch
#

... okay then how can i implemtent it

marsh sonnet
#

code it lol, or just use that mod??

#

Why are you not willing to just use that

foggy finch
#

yeah but i want to add more stuff like a "generator

#

like interactive stuff

#

not just a button

marsh sonnet
#

probs best asking the creator and ask for permission to buld off of it then and reupload a improved version

foggy finch
#

okay then

marsh sonnet
#

Have fun recoding sommet similiar then i guess haha

foggy finch
#

thats why im asking if there is a way

#

for doing it myself

tough grotto
#

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

delicate leaf
#

quick question, how i can open a .class file on visual studio?

foggy finch
delicate leaf
#

I cant

#

its encrypted

bronze yoke
#

you'd need to decompile it

delicate leaf
#

how

delicate leaf
#

honest question

bronze yoke
foggy finch
#

but for real idk

tough grotto
#

its that simple?

delicate leaf
#

i want to edit the isochunkmap.class

tough grotto
#

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

drifting ore
#

yea in theory thats what you'd expect is 50% 1 and 50% 2

delicate leaf
#

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

delicate leaf
#

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

drifting ore
#

does it really help someone to lower rendering even more? i just can't imagine.. wouldn't it eventually stop rendering things on screen?

delicate leaf
#

the potatopc actually still renders stuff outside his view range

drifting ore
#

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

delicate leaf
#

so i can lower it a bit more

#

yea thats why i asked for help here

mellow frigate
#

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

queen leaf
#

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.

heady crystal
#

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.

glossy merlin
#

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 Indie Stone Forums
  1. 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...
#
The Indie Stone Forums

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...

hasty cove
#

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

glossy merlin
#

media/lua/server, NotSid.

hasty cove
#

ah alright thanks

glossy merlin
#

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
outer yarrow
#

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!

glossy merlin
#

If it is invisible on head, but the console.txt does not show any loading errors, you may have the normals inverted, Hallween.

glossy merlin
#

Figured out how to import the models!

north cobalt
#

hey i want to add a video to replace the main menu background but can't find the image location

outer yarrow
glossy merlin
#

Hmm... What about the scale when you drop it on the ground. Giant, or right size?

outer yarrow
#

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

glossy merlin
#

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.

glossy merlin
#

What about the mesh format, Hallween? I am using quads, but maybe it still needs to be triangles.

outer yarrow
#

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

glossy merlin
#

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.

outer yarrow
#

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

glossy merlin
#

Haha, I need to get ready for work soon as well! Good luck to you!

hasty cove
#

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?

glossy merlin
#

@north cobalt media/ui is where the images are located.

north cobalt
#

It just glitches out

#

when i load in

#

Maybe it cant support videos?

glossy merlin
#

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.

north cobalt
#

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 ...

▶ Play video
hasty cove
#

hey guys what does proceduralDistribution do? is it like the global table for % of loot spawn?

neon bronze
#

List of all items spawned in containers with their respective chances adjusted for the rolls the container does

hasty cove
#

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

neon bronze
#

Its complicated

hasty cove
#

so if lucky you will find 3 of same item there because it rolled them everythime?

hasty cove
neon bronze
#

I mean it in a sense almost noone knows how exactly it works

#

Not me either

hasty cove
#

oh ok

#

but rolls has to be 3 everytime?

neon bronze
#

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

neon bronze
fast galleon
neon bronze
#

Could be less could be more

neon bronze
sour parcel
#

Is there a log file I can check for errors?

neon bronze
#

console.txt i believe its called

vernal island
#

is there a way to assign such attachment values for weapons within lua code?

#

maybe via ScriptManager and getAllModelScripts()?

vernal island
hasty cove
#

hey guys what are .x files in textures?

#

they contain some kind of array of lots of float

drifting ore
#

its model files

hasty cove
#

liek this one for example

drifting ore
#

like .fbx

hasty cove
#

oh so they are genrated during model creation process?

drifting ore
#

just that .x is some obscure file type used by the devs for some reason

#

yeah, its an exported model

hasty cove
#

damn so i need to learn blender too now 😦

drifting ore
#

what 3D modeling software do you know?

hasty cove
#

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

cedar shard
#

how to make mods

hasty cove
#

That’s a weird question

#

What do you want to mod

#

Maps? Cars ? Character or overhauls?

nova socket
stray willow
#

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?
sour parcel
#

You use Windows I assume?

stray willow
sour parcel
#

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)

stray willow
#

Right okay

sour parcel
#

There should be something called mod-template.

#

Follow that format, and it should run properly.

#

Just learned the same thing recently.

stray willow
#

Cool cool - thanks I'll try it out and pop back in here if I have issues

#

🙂

sour parcel
#

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.

stray willow
#

Ah okay

sour parcel
#

Oh, I accidentally copied all of your message, got confused for a minute.

sour island
sudden kestrel
#
{
    
    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

sour parcel
neon bronze
sour parcel
#

:?

#

What do you mean?

#

He's learning slowly.

neon bronze
#

Nono we just from the same different server

#

Inside joke more or less

sour parcel
#

Oh, alrighty.

#

My first mod is still scripting like that.

neon bronze
#

Yea its great for starting out

#

Scripting i mean

sour parcel
#

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.

neon bronze
#

Custom models are fun to do

sour parcel
#

I'm sure they are, but I am not great with modeling.

stray willow
#

😛

sour parcel
#

I used to used drafting software for modeling.

#

Because I liked the specific dimensions.

neon bronze
#

Yea i got two left hands with blender 💀

#

Cant model the side of a barn

neon bronze
sour parcel
#

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.

stray willow
sour parcel
#

Like what if I may ask?

#

I thought it was funny looking at your recipe because I'm doing exact same basically.

stray willow
sour parcel
#

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.

neon bronze
#

Can you spawn those items with item picker?

sour parcel
#

Which items?

neon bronze
#

I mean citruses items

sour parcel
#

Ah.

sudden kestrel
neon bronze
#

Ywa

#

With -debug in start options

sudden kestrel
#

ill try it

cedar shard
#

i'm too lazy to model

sudden kestrel
# neon bronze Ywa

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.

outer yarrow
#

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

frank elbow
outer yarrow
#

okay, im trying to make the mod, ill look for more context

frank elbow
#

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 😄

outer yarrow
#

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

hasty cove
#

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

outer yarrow
#

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

hasty cove
#

Ah alright thanks

#

So just launch a solo world and get on to testing

outer yarrow
#

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

hasty cove
#

👍🏿

#

Thanks

#

Anyone aware of these errors?

tiny wolf
#

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 ? 😮

thin bronze
#

is there a way i can make it so poisonous food does not have the skull icon on it?

azure rivet
#

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?

azure rivet
thin bronze
#

i think its separate from the main image, i made potatos poisonous and the skull was there

finite tiger
#

does anyone know if someone has made like an ai that is able to play project zomboid ?

foggy finch
#

would i be allowed to take the code of a modder and hide it in a mod(disguise) but is littearly the same

foggy finch
#

i mean in some sort of it

#

but like rebrand it

#

would that be illegal(modders stand point)

thin bronze
#

the modder would probbably ask you to take it down. also that would be kind of a asshole thing to do

azure rivet
thin bronze
#

thanks, ill try that

thin bronze
#

seems to not work, i might be doing it wrong but i will try to find another way

open drum
#

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

wise spire
#

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)

frank elbow
#

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

frank elbow
open drum
frank elbow
open drum
#

its in client recipe text file for me

#

is that waht u r asking ?

open drum
frank elbow
open drum
bronze yoke
#

technically 'copyright violation' does not equal 'illegal' but either way you could technically face legal action

open drum
#

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```

frank elbow
#

It can be any string

open drum
#

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..

bronze yoke
#

if you are in multiplayer, make sure you're checking the server log and not the client log

open drum
#

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

open drum
#

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")

bronze yoke
#

getPlayer() returns null on the server

#

getPlayer() returns the first local player, and the server has no local players

open drum
#

i see

#

what should i use instead then?

#

getSpecificPlayer() ?

bronze yoke
#

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

open drum
#

ok

open drum
#

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")

jolly goblet
#

I think you should check if you are receiving "Player" before requesting the "Say" method

jolly goblet
#

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
open drum
#

so frustrating to restart the dedi server over and over again to test this >.<

#

takes forever

bronze yoke
#

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

open drum
#

if it sent player correctly

#

why is it throwing error?

bronze yoke
#

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

open drum
#

is it because it's not handled in server side?

bronze yoke
#

the function should still exist so it shouldn't really error but i wouldn't expect it to work

open drum
#

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?

tardy basin
#

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?

tardy basin
north cobalt
#

its probably a mod

tardy basin
#

all I've found is dead links

north cobalt
#

idk tthen

tardy basin
#

but this would be done in the form of a mod?

north cobalt
#

yep

#

idk

north cobalt
#

This chat is about making mods

#

not talking bout em

#

🤓

tardy basin
#

I will be making a mod

north cobalt
#

ok

#

gl then

tardy basin
#

thanks

vernal island
#

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?

glossy merlin
#

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?

vernal island
#

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

glossy merlin
#

When you drop the weapon, maybe there will be a way to propagate through components and adjust their 'attachment world' rotation?

vernal island
#

I have no idea, I am quite beginner when it comes to models etc

glossy merlin
#
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,
    }    
}
vernal island
#

hmm let me see

glossy merlin
#

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.

glossy merlin
#

@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,
       }
vernal island
#

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.

glossy merlin
#

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.

vernal island
#

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

glossy merlin
#

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.

vernal island
#

true

glossy merlin
#

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 ^ ^

vernal island
#

thanks man, I will try your suggestions when I have the time, cheers

untold radish
#

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?

torpid saddle
#

Hello! I just came and need your help ded
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.

outer yarrow
#

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

small topaz
#

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.

bronze yoke
#

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

small topaz
bronze yoke
#

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

small topaz
#

kk. thanks for your suggestions. I'll see how it goes

torpid saddle
drifting ore
#

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)

outer yarrow
#

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?

drifting ore
#

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

drifting ore
#

but idk about the file path

drifting ore
#

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)

azure rivet
eternal garnet
vague rose
#

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);

azure rivet
bronze yoke
#

i would email, i'm pretty sure these incompatibilities have to be manually flagged

bronze yoke
#

given that the link up top links to the modding policy i would make sure you haven't breached it

eternal garnet
#

It's Warhammer as well and Games Workshop vehemently defends their IP

azure rivet
#

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.

drifting ore
#

Who pinged me?

worthy thorn
#

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?

heady crystal
#

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

worthy thorn
#

Here's this if it helps

bronze yoke
#

i imagine it's probably a legacy feature, likely even outdating translation entirely

heady crystal
#

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

bronze yoke
#

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

heady crystal
#

Daaaang

#

I've no words

#

It works now

#

Thanks so much Albion! Can't believe I learned this the wrong way lmao

worthy thorn
#

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

bronze yoke
#

the one in the main game directory is not normally loaded

worthy thorn
#

Ah that's probably the issue, let me try that

jolly goblet
#

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.

modern hamlet
#

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,
}

twin fossil
#

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)

outer yarrow
#

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?

verbal yew
#

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

outer yarrow
#

I'm pretty new but I think it just means that it just can't have holes, condition is still a factor.

upper python
#

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

twin fossil
#

Is there some documentation on events?

#

And objects?

neon bronze
#

how do i hook into functions properly again?

winged hollow
#

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/

The Indie Stone Forums

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?

nova socket
#

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.

untold radish
#

Anyone here willing to mod on commission by chance?

tranquil kindle
untold radish
#

Sent them a friend request. I appreciate the help!

outer yarrow
#

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?

nova socket
fringe heart
#

Anybody knows What code do i need that player can not take item from container?

hazy rapids
#

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

neon bronze
#

Anyone knows how to properly empty a table so that it actually removes all items with a for loop?

weak sierra
#

why not just

#

table_name = {}

bronze yoke
#

other references to that table won't be modified

weak sierra
#

depends on how ur set up i suppose

#

usually i store stuff in subvars of a global table

bronze yoke
#

i'm pretty sure pz just has a table.empty or table.clear or something

weak sierra
#

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

nova socket
#

lmao are people that afraid of JSON to set 3/5 rating for mod just for that?

bronze yoke
#

table.wipe(table_name) it looks like

neon bronze
#

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

bronze yoke
#

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

neon bronze
#

Yea i think backwards is the goto here

#

How do i do that exactly 😅

bronze yoke
#

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
neon bronze
drifting ore
nova socket
#

fucking demoralizing sometimes

bronze yoke
#

i think the cap before a certain amount is 4 stars

#

my mods always hang at 4 stars even with nearly 100%

drifting ore
#

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

unique roost
#

tryna mod the intro music, but the audio is not playing

#

What are some common issues that I may have accidentally done

onyx compass
#

Where does one begin modding?

covert carbon
#

It is an endless labyrinth of unorganized words

onyx compass
#

So, there's no starting modding at all?

#

Oh!

covert carbon
#

Lemme grab some sites that help

#

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

drifting ore
#

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)

outer yarrow
#

Anyone know how to get your mod to have settings on the server setting file for multiplayer or single player?

drifting ore
#

Hello, does anyone know if it's possible to change only a item's icon that appears in the inventory?

cedar anvil
#

    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?
frank elbow
frank elbow
frank elbow
frank elbow
drifting ore
frank elbow
drifting ore
#

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

frank elbow
#

So you want to replace the image used for the icon entirely, if I'm understanding correctly?

frank elbow
#

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

drifting ore
#

Also, is it possible to replace those T-shirt decals?

#

with other decals

frank elbow
#

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

cedar anvil
drifting ore
frank elbow
bronze yoke
#

the ones in pack files still have a 'directory' so they can be overridden

frank elbow
#

Are the pack files treated as a directory themselves? i.e., would it be .../UI/whatever, for something in UI.pack

drifting ore
heady crystal
#

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

chrome star
#

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 😦

winged hollow
#

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 elxoxcry

pulsar rock
heady crystal
#

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

mossy mortar
#

:3c has anyone started a homestuck mod fur this game yet?

bright wolf
mossy mortar
#

hmmm, might change that at some point :3

bright wolf
outer yarrow
#

is there anywhere where i can learn more about how the sanbox-options.txt works?

frank elbow
outer yarrow
#

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

frank elbow
#

Ah, you meant how to use it in code

outer yarrow
#

yeah, im trying to add more customization to my mod but this is my first go lol

frank elbow
#

Nice 😄

grizzled fable
#

there is something to lock an item inside a container so that no player can take it?

grizzled fable
drifting ore
#

idk then

outer yarrow
#

anyone know what the lua event is for procedural distributions?

outer yarrow
#

how do you test you sandbox-options.txt file?

nova socket
nova socket
outer yarrow
#

okay, you still test it in the user/zombid/mods folder?

nova socket
#

sandbox-options.txt should be located in yourmod/media folder

outer yarrow
#

yeah, but you still put the mod itself in the user/zomboid/mods folder, right?

nova socket
#

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.

outer yarrow
#

that is an excellent tip, I would have burned myself too lol

frank elbow
outer yarrow
#

it seems like my sandbox-options is not working then, im wondering if in the translation folder, the sandbox_mod needs is case sensitive

frank elbow
#

Unsure what you mean by sandbox_mod? The translation file should be in media/lua/shared/Translate and (for English) be Sandbox_EN.txt

nova socket
#

It does not matter for translation presence

frank elbow
#

If you send the sandbox-options.txt content we can tell you if something looks off

nova socket
#

Your sandbox options will just show up untranslated anyways

#

If valid*

outer yarrow
frank elbow
#

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

outer yarrow
#

okay so it is case sensitve, thats what i did wrong lol

frank elbow
#

It's nearly impossible to say without seeing the files

outer yarrow
#

oh then it isnt working at all

#

they didnt show up

#

i just checked my file name, it was sandbox-options not _ 🤦‍♂️

frank elbow
#

It should be -

outer yarrow
#

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,
}`

frank elbow
#

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

outer yarrow
#

okay, ill try that!

#

still isnt showing up :/

#

ive got it named sandbox-options.txt

earnest grove
#

How do i open .pack files? the one on the forums uploaded 10 years ago doesnt seem to work anymore. thanks!

outer yarrow
#

So i got the Sandbox Vars to show up in game but the translation isnt working

hollow current
outer yarrow
#

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"

}`

hollow current
#

and the setting of the sandbox var?

outer yarrow
#

`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,
}`

hollow current
#

hmm they're all not working? Everything seems alright to me

outer yarrow
#

the sandbox shows up but not translated :/

hollow current
#

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,
}```
outer yarrow
#

ill give that a go!

#

still no translation :/

hollow current
#

i checked everything and it looks set up correctly. Maybe you did something wrong with placement of files? Where did you place them?

outer yarrow
#

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

hollow current
livid badger
#

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"

brazen loom
#

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.

mighty ether
#

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

woeful plover
# brazen loom Maybe I'm missing something obvious, since I'm new at this, but is there any way...

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
woeful plover
#

e.g. LootTableEditor.removeFromTable("WardrobeWoman", "ShotgunCase1")

remote hollow
#

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.

woeful plover
#

Just after the server fails to launch

#

and run zomboid with -debug

boreal garnet
#

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 bunnydance

brazen loom
rapid orbit
#

anyone here? what are the presets to export a rigged mesh to zomboid?

mighty ether
north drift
#

Has anyone tried to reduce the turning circle of vehicles ?

cedar anvil
#

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.

undone crag
#

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 ^

bronze yoke
#

instead of using removeoneof search for the item, check if it's equipped, and only then remove it

livid badger
#

in which folder are the sprite pack for default farming plants located?

upper python
#

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
upper python
# coarse sinew 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

coarse sinew
upper python
livid badger
#

what folder is the tile map of farm beds in? They are not in the ProjectZomboid\media\texturepacks folder

elfin mulch
#

👋 hello, I'm making a TV station and I was wondering when the init_infection scripts trigger in game?

knotty frigate
#

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;

open drum
open drum
#

i've been looking for it for ages

#

is it multiplayer compartible?

bronze yoke
#

safehouses are multiplayer only, so i imagine so 😅

open drum
#

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

woeful plover
twin fossil
open drum
#

@upper python

#

could you tell me which mod it was?

upper python
#

its in btse

open drum
#

which version?

upper python
#

or if not btse, faction safehouses with your friends

#

its i btse QoL i believe

open drum
#

ok thank you

blissful salmon
#

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.

blissful salmon
#

@bronze yoke Does your X mean it's not possible?

mellow frigate
# blissful salmon <@119473430289448961> 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.

rapid orbit
#

hellos, I use 3ds max, what extra tools and things I need to be aware of to export rigged stuff to zomboid correctly?

fringe heart
#

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.

bronze yoke
indigo hearth
#

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

wintry hedge
#

Hi together 👋
I wanted to use https://steamcommunity.com/workshop/filedetails/?id=2412050672 in my playthrough but it errors out in two ways:

  1. First was in RedDeath.lua, where it yelled on the missing require "ISUI/ISPanel" to call RDUI = ISPanel:derive("RDUI"); - fine, fixed this but ...
  2. 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

neon bronze
#

means the player doesnt have a schoolbag at the start

indigo hearth
#

It is possible to load in an out-dated modding tool through an IDE like IntelliJ. capsid.pzstorm is one I’ve used

wintry hedge
neon bronze
#

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

wintry hedge
#

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

neon bronze
#

try maybe with Base.Bag_Schoolbag

wintry hedge
#

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?

bronze yoke
#

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

wintry hedge
#

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 ?

polar gyro
#

anyone have a clue why my icons have an white border in game?

frank elbow
# wintry hedge so this should be the better way instead of messing around with `==` and `~=` an...

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 😄

wintry hedge
# frank elbow Rather than doing a `contains` check and then `FindAndReturn` for the same item,...

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 🤔

wintry hedge
# frank elbow Ah, I missed that you're fixing an existing mod. Nonetheless, these are improvem...

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?

modern oar
#

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,
}
}`

neon bronze
modern oar
#

ok

wintry hedge
cloud sapphire
#

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

modern oar
#

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?

undone crag
#

wut

zinc barn
#

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...

worthy thorn
#

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

worthy thorn
#

nevermind I realized what the issue was, it opens now

tiny wolf
#

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 😦

sour island
#

Ideally you only need to soft-overwrite the functions they overwrite from vanilla.

zinc barn
sour island
#

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

zinc barn
sour island
#

You shouldn't need to

#

Only issues would be other mods that do the same thing you do to the same variables

zinc barn
#

that certainly makes life easier. But before I do that I'm gonna make a "helloworld" type mod with a VHS tape or something.

worthy thorn
#

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

worthy thorn
#

I get no errors when opening the panel, it shows up...it's just that the panel is empty

knotty solstice
#

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?

worthy thorn
#

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

knotty solstice
worthy thorn
#

Fair enough

knotty solstice
#

Anyways should i add import after module or before?

knotty solstice
#

Uhh

#

Do i add module after import or before import?

#

And do i add a ,?

knotty solstice
#

can anyone help me? please

#

guess this channel is dead. ded

zinc barn
knotty solstice
#

n the { too?

knotty solstice
neon bronze
#

Yeah that too

#

Just have them all in one block

#

Module Base{ followed by all the recipes you want

knotty solstice
#

do i not need to import base?

#

or is it supposed to be Base? module

neon bronze
#

You can import Base module or put it in the Base module its mostly done if you use your own module

knotty solstice
#

so like this?

#

or is it incorrect?

neon bronze
#

Look at how vanilla game does its recipes

knotty solstice
#

how

#
  • its prob too cluttered for me
#

also just support not tell "look at vanilla gaame recipes bablalbal lbal"

zinc barn
knotty solstice
zinc barn
knotty solstice
#

bro this aint "i wont help haha" its for support in making mods and stuff about mod development

zinc barn
#

idk what more you want

mellow frigate
sour island
#

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.

outer yarrow
#

If I wanted to make a piece of clothing emit light like a flashlight, where should I be looking for that?

boreal garnet
#

if i wanted to add a new custom full face makeup entry, how would i do so aphid

thin bronze
#

dose anyone know how to hide the poison icon on poisoned food?

remote hollow
#

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.```
bronze yoke
#

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

thin bronze
#

ill try that thanks

random finch
#

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
bronze yoke
#

what's your mod id? what file are you trying to overwrite?

#

because this log seems to show a successful override? 😅

random finch
#

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

main rose
remote hollow
random finch
#

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.

main rose
remote hollow
#

do you mean mod? if you do then no

random finch
#
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.

main rose
#

Jup

#

Try setting it to public if you are an author

main rose
remote hollow
#

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?

main rose
remote hollow
main rose
tepid cosmos
#

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!

open drum
#

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?

bronze yoke
#

you'd have to write a server command to do it

open drum
#

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

fringe heart
#

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")

pastel raptor
#

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

robust briar
#

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.

mellow night
#

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

bronze yoke
#

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

frank elbow
bronze yoke
#

unfortunately it's before

frank elbow
#

Wouldn't it eventually start firing when it is available? Dunno if there's a way to check the flag

bronze yoke
#

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

frank elbow
#

Dang

robust briar
#

I ended up creating an reuseable abstraction which just delays some ticks

#

Lets hope Build 42 has an "onPlayerInGame" event

bronze yoke
#

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

frank elbow
#

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

outer yarrow
#

how does a battery life deplete? where can i find the code for like a flashlight?

stray willow
#

Is there a list of the 'sounds' in the base game that you can use for crafting recipes?

tepid dawn
#

called sounds i guess

stray willow
#

Ah I think I found it

#

Sounds_item

gilded scroll
#

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

robust briar
#

A really annoying note:

getPlayerByUsername doesn't work for invisible gm, moderator, or overseers. Does work for invisible admins. RWwhyareyoulikethis

lunar shore
#

How can I check that if a certain sound is produced, an event is triggered?

short yoke
#

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)

short yoke
#

I guess a more accurate term would be the scale of the model

zinc barn
# gilded scroll I’m new to modding Zomboid but have modded other games in the past. I’m attempti...

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.

bronze yoke
#

unfortunately there are very few people in the community with experience with custom animations

pine ermine
#

Hi. Is there a function in api for switching hands? I'd like to make mod that could make lefties or ambidextrous characters.

outer yarrow
#

What is the best way to test your mods?

heady crystal
#

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?

bronze yoke
#

entirely offscreen?

heady crystal
#

Just partly

#

It's for my achievements mod. I am puzzled.

#

This shouldn't be possible

bronze yoke
#

huh... that could only make sense to me if the panel was HUGE

#

but it looks very small there

heady crystal
#

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

bronze yoke
#

only if you resize it

#

anchoring in all directions has special behaviour

heady crystal
#

Yeah it's not resizeable

bronze yoke
#

iirc it maintains the gap between both sides of the screen...?

#

let me check on that that sounds odd

heady crystal
#

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?

bronze yoke
#

i hope it's something weird because my moodles reimplementation depends on very similar code stressed

zinc barn
heady crystal
#

Ah

#

Thanks for letting me know!

heady crystal
bronze yoke
#

sure!

heady crystal
#

Thank you!

bronze yoke
#

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 😭

zinc barn
#

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.

heady crystal
#

RIP

dark wedge
heady crystal
#

Thank you! Hopefully that helps 🙏

rare copper
#

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.

bronze yoke
#

Contents/mods/modname/mod.info

rare copper
#

That makes more sense. Sorry

modern oar
#

does weapon models need to be fbx or .x?

#

because i cant see them in game

bronze yoke
#

either one works

short yoke
#

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

granite arch
#

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.

stray willow
#
  }
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

cedar anvil
#

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 🦕

bronze yoke
#

addSound doesn't play a sound file, it's for attracting zombies

neon bronze
#

playSound is what you need

open drum
#

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

feral crane
#

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 ❤️

neon bronze
#

qtaunt is either a keyoboard key object or a string either way it doesnt have a playsound method

#

Youd need the player for that

feral crane
#

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?
neon bronze
#

Different things are passed to events

feral crane
#

hmm i see

feral crane
#

how do i make the ingame sandbox settings affect the code?

verbal yew
#

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.

frank elbow
frank elbow
frank elbow
#

e.g., ModData.transmit('yourModDataKey')

icy wind
#

Does any here make maps?

frank elbow
icy wind
#

Didnt even know that channel existed lol

#

Thanks man

feral crane
frank elbow
feral crane
frank elbow
#

Yes as to the access, although I'm curious as to the surrounding context of that snippet

feral crane
#

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
frank elbow
#

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

feral crane
#

yes of course

frank elbow
#

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

feral crane
#

yeah i figured its like that, but im not sure how to make it a percentage as i started using lua just last night

frank elbow
#

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)

feral crane
#

yeah makes sense imma try that

#

thanks