#mod_development
1 messages · Page 271 of 1
In textures folder and in your case if you icon is "Beans" in item script, in texture folder icon should be named "Item_Beans"
so do i make a folder called icon inside textures and put it in there
All you need is to put your icons in Texture folder, no more subfolders needed
ohh alr ty
so i put item_ before the name right?
On icon, yes. Im not sure if lower/uppercase makes a diffrenct, but just to be sure have i in Item uppercase
ok thanks
And you only name image file like that, in script you igonre "Item_"
but one more thing, how do i make these textures apply to like the can model for this custom item?
i want this to be the texture of the item when its placed
or when its being eaten
i put these into the texture folder
@tranquil kindle
You have your model script?
My main suggestion is, did you try reading the code ?
sorry?
how do i add that
sorry im very new to modding
So what exacly what you managed so far?
From what i see you want to make canned hamburger
yes
ive added the textures into the textures folder
ive renamed it
ive added the values for nutrition
added the icons
with ur help
If you visit project zomboid main folder, media>scripts>>models_items.txt there are all model scipts
to use your own model/texture you need one
ah alr
You can either create new txt file or include it in one above
im just reskining the beans and changing the values
and name
as a new item
so ill use the canned beans
yes, but what about like textures?
Thing is, im not sure why some of vanila items dont specify textures, i have my theory about it but i'd have to check.
Here is for other can too:
model CanOpenBolognese
{
mesh = CanOpen,
texture = WorldItems/TinnedBolognese,
}
ah thanks
Its for open can, but if you browse models_items.txt you can find most of vanila models there.
is this the right place to put it?
Nope
oh where do i place it?
definetly not in the middle of your itemscript
Just...dont make your own modules for your first mod, if you're starting. That can cause you issues that you might not know. so for now
module CB
{
imports
{
base
}
``` make it
module Base
{
Second
put your model:
model YourModelName
{
mesh = CanOpen,
texture = WorldItems/YourtextureName, --- location of your texture, or just put it in WorldItems
}
Outside of your Item script
by that i mean something like this
module Base
model YourModelName
{
mesh = CanOpen,
texture = WorldItems/YourtextureName, --- location of your texture, or just put it in WorldItems
}
item CannedBurger
{
DisplayName = Canned Burger,
DisplayCategory = Food,
Type = Food,
Weight = 0.8,
Icon = cannedburger,
CannedFood = TRUE,
CantEat = TRUE,
Packaged = TRUE,
Calories = 440,
Carbohydrates = 0,
Lipids = 32,
Proteins = 21,
StaticModel = CanClosed,
WorldStaticModel = CanClosed,
Tags = HasMetal,
}
so on the second line what should i put it as for the normal can model
i dont want to use a custom model
You want to use custom texture, but still same model as vanila cans, thats why you add same "mesh", but texture is diffrent
oh ok so ill just put it as cannedburger
@tranquil kindle is this correct?
hold on i saw a error so i fixed it
remove that line about "location of your texture" after "texture = WorldItems/cannedburgerclosed, " it was just for you to know,
You have your item id inside of your model script
iirc udderly evelyn managed to do this
cuz k remember before she launched her server that this was part of her todo list
woops ment to reply to this
but her mod isnt public i think
bruh why isnt it saving
wtf for some reason its not saving
ah nvm i fixed it
is this better?
Your use of brackets is bad, after each "model xxx" or "item xxx" you open Bracket : "{"
then you put your stuff like displayname and stats etc. Once your done, you finish it with Closing bracket " } ". Same with model. Also as you start "module Base " after that you put open Bracket, then Closing one at the very bottom of your file.
{
model cannedburger
{
mesh = CanClosed,
texture = WorldItems/cannedburgerclosed,
}
item CannedBurger
{
DisplayName = Canned Burger,
DisplayCategory = Food,
Type = Food,
Weight = 0.8,
Icon = cannedburger,
CannedFood = TRUE,
CantEat = TRUE,
Packaged = TRUE,
Calories = 440,
Carbohydrates = 0,
Lipids = 32,
Proteins = 21,
StaticModel = CanClosed,
WorldStaticModel = CanClosed,
Tags = HasMetal,
}
model cannedburgeropened
{
mesh = CanOpen,
texture = WorldItems/cannedburgeropen,
}
item CannedBurger
{
DisplayName = Opened Canned Burger,
DisplayCategory = Food,
Type = Food,
Weight = 0.8,
Icon = opencannedburger,
EvolvedRecipe = Omelette:8;Soup:24;Stew:24;RicePot:24;RicePan:24;Sandwich:8;Sandwich Baguette:8;Toast:8;Salad:8,
EvolvedRecipeName = OpenCanburger,
FoodType = canburger,
CannedFood = TRUE,
EatType = can,
Packaged = TRUE,
ReplaceOnUse = TinCanEmpty,
DaysFresh = 3,
DaysTotallyRotten = 5,
HungerChange = -25,
UnhappyChange = 15,
Calories = 440,
Carbohydrates = 0,
Lipids =32,
Proteins = 21,
StaticModel = CanOpen,
WorldStaticModel = CanOpen,
Tags = HasMetal,
}
}
Also it still wont make your model appear on item because
WorldStaticModel = CanClosed,
Should be
StaticModel = cannedburger, (its model script you made above) - this line is for appearing in hands
WorldStaticModel = cannedburger, (This line is for model to appear when placed on ground)
I am going off for today so good luck.
is it fixed in this version?
Yes
cheers
Awesome, thanks! I'll take a look at Udderlys mods and maybe reach out to ask.
Hi, please can someone show me how to make sprinters and add more hp on specific zombie with my moded outfit? Its my first mod, i spend over 40hours over other mods but I wasnt able to found a code I can use or uderstand how it works. thaks you all for help
Hello, I am totally new in programming and modding, so I decided to make a simple mod, that adds Kvas (traditional russian drink) to the game. But I encountered several problems. Icon in inventory looks like "?" and model on the ground is same. Also while drinking Kvas, the game freezes until character stops drinking. Can anyone help me with the mod? (sorry for bad eng)
Does anyone know where the texture is for the cigarette icon?
It's not inside media/textures
Most likely .pack files
Just curious about the resolution of icons honestly
32x32 pixels
They do get scaled down in most cases, but not all of them. Once i tried putting 1920x1080 icon out of curiosity and it did indeed scaled down to fit all places, but one. If your item is attachable to belt/other slot and can be seen on hotbar, it will cover exacly how many pixels it has. In conclusion, hotbar do use full resolution of icon.
So its best practice to have it max 32x32 size
Thank you for the information
Hello everyone, I hope you're having wonderful Sunday. Tiny question - how to get current zombie sight range sandbox setting? Range in number of tiles to be more precise
Hello comrades! Does anyone know how to create posters? How object on wall, of course
Sorry for the total-new-player/modder question, but how would I go about disabling certain needs for players with a certain trait or profession (Hunger, Thirst), once I figure it out, I'd like to add a new need in its place. I recognize this is probably a bit complex and above my skill level, but with the Lua guide I think I can possibly figure it out
I would look at some of the trait mods, for examples on best practices. More Traits is a really good example with many types of traits.
You are going to need to use one of the lua events (good info here: https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md)
thank you!
Hi @sour island , sorry for the ping but I just saw your Shop and Traders mod and I thinks it's fantastic, but I have a question. Will be a future update that includes a "safezone" for the players to be able to hang out and buy stuff without pvp, no zombies, unbreakable objects from the safezone, etc? Thanks
ive done this
check out android trait mod
need to learn how to make tiles
rename your icon add Item_
as prefix
(just the filename, not on the script)
setWalkType()
Thank you!
Thanks sir
https://steamcommunity.com/sharedfiles/filedetails/?id=3244271329
you should use this workaround for zombie hp on server.
for speed on specific zombie like outfit
something like this:
local zReJuggernautOutfits = {
"zReJuggernaut", -- YOUR OUTFITS NAME HERE
}
local function zReZombieisJuggernaut(zombie)
local zombieOutfit = zombie:getOutfitName()
for _, v in pairs(zReJuggernautOutfits) do
if v == zombieOutfit then
return true
end
end
return false
end
local last_event = 0;
local function zRe_updateAllZombies()
local now = getTimeInMillis();
if now - last_event > 9000 then -- 9 sec
local bob = IsoZombie.new(nil)
local speedType = zRefindField(bob, "public int zombie.characters.IsoZombie.speedType")
local client = isClient()
local zs = getCell():getZombieList()
local sz = zs:size()
for i = 0, sz - 1 do
local z = zs:get(i)
if not (client and z:isRemoteZombie()) and zReZombieisJuggernaut(z) then
zRe_updateZombie(z, speedType)
end
end
last_event = now
end
end
Events.OnTick.Add(zRe_updateAllZombies)
local function zRe_updateZombie(zombie, speedType)
local zModData = zombie:getModData()
local speedTypeVal = getClassFieldVal(zombie, speedType)
local square = zombie:getCurrentSquare()
local squareXVal = square and square:getX() or 0
local squareYVal = square and square:getY() or 0
if (speedTypeVal == zModData.ZBLTspeed and
(math.sqrt((squareXVal - zModData.ZBLTx)*(squareXVal - zModData.ZBLTx) + (squareYVal - zModData.ZBLTy)*(squareYVal - zModData.ZBLTy)) <= 30))
or (not square) then
zModData.ZBLTx = squareXVal
zModData.ZBLTy = squareYVal
return
end
if zombie:isCrawling() and shouldBeStanding(zombie) then
zombie:toggleCrawling()
zombie:setCanWalk(true);
end
zombie:setWalkType("sprint1");
--- TOUGHNESS
-- Here should be Glytch3r stuff for thoughness zombie
zModData.ZBLTspeed = getClassFieldVal(zombie, speedType)
zModData.ZBLTx = squareXVal
zModData.ZBLTy = squareYVal
return false
end
Does anyone know how to go about adding a custom player status, similar to hunger and thirst?
Thanks you too sir!
ouch... miss click, sorry
up
Does anyone know how to go about adding a custom player status, similar to hunger and thirst?
I figured it might be the case so I assume I have to handle all the logic myself and make a custom moodle with the moodle framework? (Sorry for ping)
Anyone know the easiest and most efficient way to add a lengthy list of knives to a crafting recipe? Maybe by grabbing all short blades if possible? I just am not sure what the code for that would be
nvm I think I figured it out thanks to a quick peak at how common sense handles opening cans with knives
im actually using a different damage system now
got the idea from slayer
instead just cancel the damage then reduce the hp just a little
you can use moddata
Now i just need to figure out how to get hatchets only
I'm unfamiliar, can you point me somewhere
zombie:getModData().yourData = 10
getPlayer():getModData().isData = true
something like that
hi can I ask something?
why not
Question should i put folder map too? or only workshop and mod ID?
Workshop ID: 2886919248
Mod ID: RiversidemansionBrang
Map Folder: riversidemansion
is this right?
Use mod manager server tbf
I am doing the rented server thingy
I can use it too in rented server?
If you can upload files to the server, then you can set it up from your computer
And thus you can use it
What I want for Christmas is CarController.ClientControls finally exposed in Lua (after 5 years it would be cool to have npcs driving cars)
thought you already did that?
ahh you want for MP
I think I've seen a concept for driving NPC ?
is there any way to disable slots? e.g. the back slot
👁️👄👁️
Probably yes, it's handled in lua
If you check out weapon condition in hotbar mods you'll have examples on how to access slots I believe
Lets say i mean single player only. I dont see a viable way to steer the wheels.
Hmmmm
right right cuz it only has forward direction
wait i think i saw a gps mod that does automate the car
Pretty sure it just changes the orientation of the car and doesn't allow steering
sucks
Exactly
You can only move the car by regulator you cannot turn, use break. And all that only if isoplayer is behind the wheel so thats single player only.
Alot of the car stuff is under exposed- hopefully with the elevation changes more stuff is opened up. 👉👈
To clarify, the main object is exposed - but almost all the sub-objects are not. Stuff for gear control, steering etc.
I am curious why the child objects to exposed parents wouldn't be also exposed - if there's a case where that would cause a problem.
some things aren't exposed because they just didn't think to
from what i remember most of the vehicle nested classes don't really have methods so they aren't really great for interop to begin with
Hi everyone,
In my mod, when a tree dries out, it turns into ISO.tree (e_americanholly_1_3). I want it to transform into a custom tree instead of the vanilla one.
Do I need to:
Create my own tileset with the appropriate settings?
Add it to the mod files?
Specify the sprite name I used in the tile settings?
Has anyone done something like this before? Any advice or examples would be greatly appreciated!
Anyone know if an already initiated/instantiated ISLabel can be changed? In this case I want the label text to be changed.
I could just close then reopen the panel, but I wanted to see if i could avoid that.
don't you just change the text? the game doesn't really cache any ui stuff so just changing any properties should take effect immediately
label:setName("new text")
That would be what I am looking for. Havent messed with this stuff in a while.
Is this correct? stats:getinsulation() local Tempt = player:getStats()
this is the complete code, its meant to activate when player insulation max is reached, preventing cold moodle from appearing : `require "MF_ISMoodle"
MF.createMoodle(Insulated);
print(isWorking)
stats:getinsulation()
local Tempt = player:getStats()
if Tempt >= 1
require "MF_ISMoodle"
local moodle = MF.getMoodle("Insulated");
MF.getMoodle(,playerNum):setValue(1)--float
print(Insulated)
else
if Tempt <= 1
require "MF_ISMoodle"
local moodle = MF.getMoodle("Insulated");
MF.getMoodle(,playerNum):setValue(0)--float
print(Insulated)
self:drawTexture(getTexture("media/Resources/MDBTemperature.png"), wiggleX, 0, 1, 1, 1, 1);
self:mouseOverMoodle(getText("MoodleInsulated"), getText("MoodleInsulated"))`
require "MF_ISMoodle"
MF.getMoodle("Insulated",playerNum):setValue(myNewMoodleValue)--if "Insulated" is the name of your moodle
Yes, insulated is the name of my moodle, is player:getStats() able to retrieve insulation values?
Moreover I know that each body part has its own value, how would I go about extracting them, averaging them and making a list?
Hi all! I am trying to add some sprites, i found a lot of tuts on how to do packs but none of them explain how to reference the sprites in the pack within the lua... i mean, the numbers after the png name. anyone have a link, or explanation, for that? thanks in advance!
Resposted from general:
NEED HELP MODDING? Me Help U!
Anyone need help installing mods for PZ or ANY other game, I am yer homie.
I help mod games on the side, for free, and always willing to help.
DM’s are open and I also have a discord channel devoted to modding games.
I can help mod several thousand games if you need help.
MLEP!
https://discord.com/channels/136501320340209664/1125248330595848192
There's a request section here- of people looking to have made (although generally not for free, but there's no rules against it.)
Ironically, we had someone looking for a WWE12K (or whatever the game is called) a week or so ago because they just googled "video game mod commissions" and just hopped into the discord blind
Hey Finn!!!! Bro…. Your heli….
I love U lol. Forgive my spam on your GitHub.
I don’t MAKE mods tho, just offering help to add them to games.
I.e. I can help people make sure EHE works on their PZ servers
Ah ok, we also have a player-support section too. 😄
you can make moveable item
you can use brushtool
there are also several lua functions to force spawn it or as a moveable o
item
they are vanilla functions you just have to dig deeper
try looking at the single player scenarios or build menu
im afk so i couldnt send exact snippets
goodluck
Hey. I have a question about items tags. I made recipes for crafting and they work if I specify each item by their name in the "keep" field. It also works if I specify the "SharpKnife" tag. However, if I specify "ChopTree" or "CutPlant", the recipe does not appear in game, as if I do not have an item with such a tag. But of course, I have all vanilla axes, all of them have this tag. Has anyone encountered this or smthing similar? Or maybe someone have an idea of what the problem is?
Example: this works:"keep [Recipe.GetItemTypes.SharpKnife],". This also works:"keep HuntingKnife/KitchenKnife/Axe/HandAxe/AxeStone/WoodAxe,"
this doesn't work:"keep [Recipe.GetItemTypes.CutPlant],"
game version: 41.78.16. No other mods enabled
look at server/recipecode.lua
other tags did something like this
function Recipe.GetItemTypes.SharpKnife(scriptItems)
scriptItems:addAll(getScriptManager():getItemsTag("SharpKnife"))
addExistingItemType(scriptItems, "FlintKnife")
addExistingItemType(scriptItems, "HuntingKnife")
addExistingItemType(scriptItems, "KitchenKnife")
addExistingItemType(scriptItems, "Machete")
end
but cutplant did not
you could do it yourself in order for the thing to work
im not 100% sure about this
but this is the only explanation i could think of
@ancient grail yes, you are right, there are no such tags in this file. Strange, but they are on the wiki in the modding section. Maybe I misunderstood something idk
thanks!
no i mean there is the tags for the item script youre not wrong there youre searching from the table with this
[Recipe.GetItemTypes.CutPlant]
and vanilla didnt add the tagged item into that table
am i making sense?
local function addExistingItemType(scriptItems, type)
local all = getScriptManager():getItemsByType(type)
for i=1,all:size() do
local scriptItem = all:get(i-1)
if not scriptItems:contains(scriptItem) then
scriptItems:add(scriptItem)
end
end
end
function Recipe.GetItemTypes.SharpKnife(scriptItems)
scriptItems:addAll(getScriptManager():getItemsTag("CutPlant"))
addExistingItemType(scriptItems, "HandAxe")
...
end
heres what im suggesting you try
just manually add it to a server lua
and each of those cutplant items
addExistingItemType(scriptItems, "add them here")
@wanton aurora am i making sense? let me know if this helps or you need further clarifications
yep, i understood what you meant. I don't know if I did it right, but I added this lua script and it worked:
require "recipecode";
local function addExistingItemType(scriptItems, type)
local all = getScriptManager():getItemsByType(type)
for i=1,all:size() do
local scriptItem = all:get(i-1)
if not scriptItems:contains(scriptItem) then
scriptItems:add(scriptItem)
end
end
end
function Recipe.GetItemTypes.ChopTree(scriptItems)
scriptItems:addAll(getScriptManager():getItemsTag("ChopTree"))
addExistingItemType(scriptItems, "HandAxe")
addExistingItemType(scriptItems, "AxeStone")
addExistingItemType(scriptItems, "Axe")
addExistingItemType(scriptItems, "WoodAxe")
end
the only thing i wanted to clarify is, won't this conflict with mods that also bind vanilla items to this tags? I'm bad at lua syntax, but maybe my mod will overwrite a similar function (Recipe.GetItemTypes.ChopTree) of a mod that will be lower in priority? I wouldn't want to let that happen
Not to steal from this but I was just trying to figure out how to do this myself the other day, would this in theory make it so modded items with that tag work as well? I know that works when using "SharpKnife" so I imagine anything with "CutPlant" or "ChopTree" would work the same,
it shouldnt
you can add to those tags and youre also not limited to the vanilla tags yiu make up your own if youre worried about conflict
Sweet thank you
i dont get what you mean by priority
other mods that does the same function no matter how many mods that does this
wont matter
cuz the thing that the function
addExisitingItemType does is that it adds those items to the table if they arent in it yet
so mod a adds itemd 1 2 3
and mod b adds 1 3 5
you will have
1 2 3 5
inside the table
goodluck guys
come to think
i wonder why vanilla didnt just add them (i know there no purpose for the vanilla code but could have atleast added them maybe just for modders who does script items avoid having to do the lua)
Yeah, It would have been nice to have those added in by default
Hi everyone where can I find the code in the game that allows me to take everything or transfer everything?
Hey thanks for the reply but i am referring to a simpler thing... The string name to use to point at the exact sprite 😂 it's silly probably but i have no clue... The code is ready i miss only that hahaha
client/TimedActions/ISGrabItemAction.lua
you just need to get the spritename?
you can use tilepicker and just count or press f2 while debug mod to look at the sprites
So let's say i have my sprites png inside the pack whose name is lemontree... The first sprite is lemontree_1?
no its 0
just a reminder
after you upload your tile mod
add your tiledef here
https://pzwiki.net/wiki/List_of_Tiledefs_in_use_by_mods
And if i have 2 png with files the first of all files is stll 0?
Yeah will do!
nameofPNG1_0
nameofPNG2_0
Ok i was confused because vanilla sprites starts from random number
fir your mod with multiple tilesheet you only need 1 .tiles file and 2 .pack files since you have 2 sheets
those are not tilesheet
thos are just spritesheet
that is used for some other purposes other than tiles
the tilesheets are named from 0
which is what you see inside the x2 folder
I am tring to farm trees, i noticed all the farming sprites are in packs so i assumed was required (also to make car stomp on them)
trees are complex
unlike other tiles
I'll see if i manage to make it works, finger crossed and thanks for the int ❤️
Thank à lot i need it to créateur à déposit all in ground
Hello, I have a problem with my mod. I am trying to add one soft drink, but I encountered a problem with 3d models. Item on the ground looks like icon in the iventory (2d sprite). I just dont understand how to solve my problem. Code below:
Have you tried using an existing 3d model (mesh) and just mess up with the texture and icon?
Things so small doesn't really matter to make a proper 3d model, editin the texture could be enough and is a lot easier
is your icon filenamed
Item_kvas.png ?
it should be
add the prefix to the filename only
oh sorry too tired i misunderunderstood
where are your files located?
these ones
PopCanKvas,
PopCanKvastexture
is there any kind of detailed guide on decompiling and compiling class files back on zombie\ with intellj?
i've copied one of them to my empty java project's src\ directory, opened it through intellj and copypasted the whole stuff to a new .java file with the same filename
then tried either build project or "recompile" (filename).java but couldn't get anything to work
found nothing on my output directory other than few xmls
1 second, let me check
the "zombie.iso isn't corresponded to file path" error made me create empty zombie\iso\ directory inside src and put the .java file there
then recompiled the file which gave me:
would i have to decompile every single class file on those zombie\ directory to .java and paste them alongside? 😭
PopCanKvas is in model_x folder
PopCanKvastexture in textures folder
and your model is a valid model? have checked the scale?
idk if this is the reason but it could be
use
module Base {}
for the model maybe
i never tried doing a model other a custom module
make sure the folder names are correct
you don't have to copy the model file if you don't change it, just use the original name, i have done it
also your file is short
next time pls just paste the script
ye try using vanilla like what they said
One minute
you can still create custom model script with custom texture
while using vanilla mesh
model Plate_Spaghetti_Ground
{
mesh = WorldItems/Plate,
texture = WorldItems_ItalianFood/PlateSpaghetti,
scale = 0.25,
}
this works, mesh is copied from the actual plate item{}, and for the texture I copied the plate texture file with a different name and just photoshopped it
Thanks a lot
sorry i've been imprecise, the mesh string (along with the scale, which is very important) is copied from the model Plate_Ground{} youcan find it in media\scripts\models_items.txt
It works, thank you again
you can put the game's class files into a jar and compile against it to resolve these missing dependencies
I am trying to add custom moodles for my mod but I want them to look compatible with plain moodles but when I try to unpack the .pack file for the mod it is just empty?
if you just need the image to make the new one cohesive to the vanilla style i'd find more easy to just screenshot the game or search for them on google
if you need more technical thing i don't know sorry
Okay I will just redraw them myself, thank you anyways
You can most likely find them on the wiki too
I was thinking for this mod specifically, not the default game moodles
https://steamcommunity.com/sharedfiles/filedetails/?id=3008416736&searchtext=plain+moodles
I already use it for myself but none of my modded moodles match it so
Looking at ISFactionAddPlayerUI.lua:
Lines 152-154
Where are they getting self.factionUI?
self.factionUI.isOwner = false;
self.factionUI:populateList();
self.factionUI:updateButtons();
I don't see a function for it anywhere
Looking at lua files and java source finding nothing
How do I pass a texture as an argument?
Making a moodle with moodle framework but :setPicture() has a "texture" argument and the name of the png doesn't seem to work
getTexture("path")
ty
function ISFactionUI:onClick(button)
...
if button.internal == "ADDPLAYER" then
local factionUI = ISFactionAddPlayerUI:new(getCore():getScreenWidth() / 2 - 200,getCore():getScreenHeight() / 2 - 175, 400, 350, self.faction, self.player);
factionUI:initialise()
factionUI:addToUIManager()
factionUI.factionUI = self;
self.addPlayerUI = factionUI;
end
...
end
```it's set when the object is created, but weirdly from outside of the constructor
someone knows about new codes in the new release? I'm hoping for recipes that doesn't require a result
ah, i came up with using storm since people told me it's more flexible than recompiling them manually
but then stuck on building jar with my modified .java file 😭
pzstorm? that's ancient, i'm not sure it even still works
i don't even have the slightest knowledge on these, just had to edited some of my visuals
how else would you usually edit them then? 😮
most people just don't, java modding is very niche, but for those who do it's what you were doing at the start - just decompiling files, editing them, and recompiling them
i don't think there's any java mod loader/toolset that's still being actively developed or even still works
yeah i'm assuming i would have to decompile by opening the class file i'm willing to edit using intellj and copypasta everything over to a new .java file with same filename
but then i'm missing most of the original packages which you suggested me to pack them all to a single jar file
couldn't reaaaally get the second thing to work myself 😦
sorry to ping, but i think @grizzled fulcrum might know more about this than i do?
ikr, tried adapting it but i's a big pain to work with
coming out with somethign similar soon but just need time to work
so basically you set your project up in intellij so that the compiled class files of the base game are used as "dependencies" (not really) and you compile your .java file with those class files
but yeah you have to decompile it probably with fernflower or vineflower to get the original source to edit
I'd just use that one thing by demiurgequantified thing I dont know the name
its on github
that will automatically decompile the game for you assuming you hjave intellij installed (I'd personally just do it manually with fernflower decompiler)
there's a lot to it that I want to simplify but it comes at the cost of more complexity for the maintainer
beautiful java? that's not made by me 😭
oh wrong name I think
maybe it's like quarantined
thats it yeah
it sounds similar 😭
but that's the easiest thing I can think of right now for decompilation
also one thing that im gonna have is parameter names in the source 😄
no more var1 var2 var3, but I have to change each one, which thankfully they're not that hard to sight read
Someone knows how i can tell a recipe that it can accept a rotten item? as soon as it rot seems like the recipe doesn't work anymore
I think rotten food counts as a different item completely but I could be wrong
you can try making another recipe using the rotten item
it looks so indeed, but in the item list there are no items with rotten in the name so i don't know how to refer to it
add AllowRottenItem:true, to your recipe definition
thanks!
rotten items aren't usually different items but the crafting system rejects anything rotten by default
worked thanks a lot!
really hope they give us recipes without result, my mod would be so much lighter and quicker to edit
b42 probably will
finger crossed
RemoveResultItem:true, doesn't cut it?
O_O gonna try
its already in game, used in ripping clothing for example.
{
[Recipe.GetItemTypes.RipClothing_Cotton],
Result:RippedSheets,
RemoveResultItem:true,
InSameInventory:true,
Sound:ClothesRipping,
Time:100.0,
AnimNode:RipSheets,
OnCreate:Recipe.OnCreate.RipClothing,
OnTest:Recipe.OnTest.IsNotWorn,
}
recipes currently need a result defined because it's used for the recipe icon and stuff
And it gives you items with onCreate function
i imagine a recipe rework isn't going to have those same limitations
Yeah, thats is true, but other than that
What if it makes a result that doesnt exist?
everything explodes because it needs the item to exist to get its icon
If you'd just make item without display name and icon that would look like there is nothing, maybe transparent png would do? Just for it to be result of recipe that will have removeresult true.
IT WORKED I LOVE YOU
in different forums people says that i't not possible so i was sure ç_ç
Might i ask what would you need recipe without result for, unless you want it to give result via oncreate function?
yes for that indeed
I am extracting seed from the fruits, instead of writing a recipe for each fruit I can write only one and manage to trasfronm the name from fruit to seed in the lua function
and going to do the same for seed bags open/close
Has anyone managed to verify java files via mod? Was thinking about it in the case you wanted to prevent cheating on a server.
not really, I don't even think you can access the file path of the game install from lua letalone generate a checksum for it
if that were possible, @red tiger would've done it already
it'd have to be a client java mod
You can't do anything simple such as getting a filesize at a certain path?
Not even a checksum
There's funner ways to prevent cheating
Hrmm, how should i be thinking about it?
Give me a minute
Just clocked out for lunch
So I wrote two anticheats
Im all ears
One scans network traffic, one checks clients clientside lua.
Ahh, I think I saw you talking about this in the asledgehammer discord a while back
I just released the 2nd one.
One works off of loading code from the server machine.
I provide a loading framework and encryption
Im going to read more about it in your discord
Hello all ! I'm looking some ressources to begin in mod development, any ressources list / tutorials listed here to start with ?
I'm looking at lua.org, pzwiki.net, theindiestone.com/forums
I wonder where the onEat function define which item it takes, i cant seem to find the related files to link them together
Is there a way to have on"CustomAction"?
wishing I was a tester so I could play unstable rn
could you also let me know how you 'add' those base class files as dependencies for my project?
it looks like it's something to do with modules on project structure
jab was gonna make a guide for this 😭
basically in your project structure menu thing File > Project Structure
go to settings and modules and then
you go to the dependencies and add the dir of the classes (I think its ok to just select the ProjectZomboid folder as the dir)
It's also possible to do it using javac directly, of course
yeah I tried that but it's too tedious for me 😂
I just set up a two-line build script that's just setting GAME_PATH to the pz directory + javac -cp %GAME_PATH%;%GAME_PATH%\* -d %~dp0..\ --release 17 -Xlint:none %~dp0*.java
😭
i'm assuming that's what you meant
YA
btw irrelevant to that but make sure you're using java 17
as the project's java ver
which in your case looks like you're using java 1.8
don't add the zombie folder
add the ProjectZomboid folder
because zombie is a package. their class files are scattered all through the root folder of the game for whatever reason
Hello everyone! 🚧
I'm working on a mod for Project Zomboid focused on adding AI NPCs for the conversational part. I'm using Ollama 3.1 locally to manage interactions, which will give a unique and dynamic touch to the dialogues.
I know this kind of project is ambitious and, unfortunately, I don't have all the time I would like to dedicate to it, but I'm moving forward little by little in my free time. My plan is to make the best use of my time and have something solid by the time the long-awaited Build 42 arrives, as it will surely bring changes that will require adapting part of the code.
Thank you for your patience and support! If you have ideas or suggestions, they are always welcome. 🙌
Question for all the modders here, which do you find better process for when you release a mod? Particularly a BIGGER mod with lots of changes or changes to major systems.
- Post it on the workshop, with warnings and instructions to not just add this to your long time server etc. and that the mod still needs lots of testing and adjusting
OR
- Host a server myself and seek out beta testers to try things out?
either is acceptable, testing would be better if you have the resources though
In games I mod, testing is best.
Look at the instant negative feedback over Lifestyles when the latest update was shadow dropped.
10/10 a fun mod. But soooo much was added, a lot of players freaked when they felt they just lost their ability to play music.
Testing = early feedback = less headaches later
As long as any AI players need can remain LOCAL, I think people would embrace this.
Chatbot AI’s that require access to ChatGPT or other external programs are a major red flag for people who don’t want that.
But if it can be managed locally, and free, people eat it up!
The Skyrim AI mods for example, or even the chatGPT mod for Cyberpunk are more or less just a gimmick and the vast majority of people just don’t use it.
Free. Local. Simple. = downloads and up votes.
Do upscaling textures (ie clothing textures) work in this game?
In my opinion, testing in a controller environment is better because you would otherwise be relying on the end user to be able to identify and debug report it to you
Hello, I have a question about Procedural Distribution. Is there a way to exactly know if an item spawns in the game or not? Or just running and opening containers witch should have the item? I set the spawn odds to 99 but I still cant find my item in the game.
Use debug and turn on lootzed in cheat menu
Right click container and open lootzed, then bottom right corner there should be a drop-down menu to show different container distribution for that type
Check console.txt for your item to see if the script worked, then see if you can spawn it in admin mode, and finally yeah, you gotta look around. What container type did you put it in?
I focused my work on the MML oLlama model because it is OpenSource, free and not that bad. Using a powerful model like chatGPT involves high costs due to the amount of tokens that must be sent. I think the path I have followed is an optimal solution. But it is still an experimental process, PZ does not allow interaction with anything of this style so my experiment has been based on tricks to achieve it. Thank you very much for your comment. Knowing the concerns of the end players is always good to be able to improve over time.
Hello, your question is very interesting. I would recommend that after your internal testing stage is over, where you have validated that all your three nationalities are working without problems, you then publish a beta of your mod, and indicate and warn the public that you are working on a preliminary version of your work and that they should leave a comment if they find any bug or incompatibility with any other mod.☺️
This was helpful, thank you
I put it in fridge
Now I know I made a mistake somewhere
Anyone know how to create a script to have à drop all to ground from à contenair i try many things but nothing work
https://steamcommunity.com/sharedfiles/filedetails/?id=3377272557
show us the code you used
that didnt work
anyone know how to make a solid invisible tile?
quick question for food item
if in a recipe I only want to consume certain potion of ingredient
like soysauce
i had Soysauce;1, and Soysauce=1,
both consume the whole soysauce
easiest way is to spawn something solid an actual sprite
then change its sprite
you can also just spawn directly the blank sprite and give it property i think that should work
i think that only works for drainables
thats what i was gonna do next thanks dude. i tried doing properties but i think i need a sprite to work with
if you're trying this with a regular recipe youll need to use oncreate. it may allow this with evolved recipes but that is just for cooking food
no you can just pick any spritesheet that is blank
in theory it should work
but if it doesnt
then just pick a broken floor
or copy the floor sprite from the target square
you could also make your own system using moddata
@cinder flower
i just attempt with this but it appears the properties comes back as nil
local props = obj:getProperties()
props:Set(IsoFlagType.solid)
i may just use a bad sprite to start
oh wait it works! it just gives me errors
I see ty guys
tf is this guys problem
it was a valid solution
https://discord.com/channels/136501320340209664/1313843405658521610
whats the error
lol guy has specific issue only to them, refuses to reinstall. fix my game for me but also shut up
yeah thats what im gona do
i had an error that didnt make sense so of course restarting fixes it
how to reset debug options
backup then delete the following files (default locations):
%userprofile%\Zomboid\debuglog.ini
%userprofile%\Zomboid\debugChunkState-options.ini
%userprofile%\Zomboid\debug-options.ini
Hello everyone, I wanted to ask you a question. How do I open the context menu when I click on the door?\
Are you wanting to add a context option to a door or just how to open context menu?
add context option
I'm making a mod for opening the foot from the door, but I can only do animations.
ok context is handled in events
this is for world object context
it passes an array of world objects in the square
you just need to check if its the one you want then add the context option
and a function that will do the action you want when clicked
adding the option is not too difficult
context:addOption(name, target, onSelect, param1, param2,...)
name is the text you want to appear , target i think is the first parameter passed to your function which is what onSelect is and the paramaters after that dont need to be filled
thx
I made a little code and checked, what could be wrong with it?
I think I forgot to add a function...
context:addOption("test door",door,createTestOption)
worldobjects is an array and has to be iterated through differently
for i=0, worldObjects:size()-1 do
local door = worldObjects:get(i)
if instanceof(door,"isoDoor")
to add a function to the option you dont need to fill its parameters just the name ```lua
local addPunchOption = context:addOption("punch door",door,punchdoorfunction)
to be honest, I don't quite understand where to enter this code, my native language is not English, and it's hard for me to understand you
my translator is not working well
--[[
This function adds a custom option to the context menu when you right-click on a door.
It works for all doors in the game and adds an option with specific functionality.
--]]
-- Main function to add a custom option to the context menu
local function addCustomDoorOption(playerIndex, context, worldObjects)
-- Iterate through all objects in the area where the click occurred
for _, obj in ipairs(worldObjects) do
-- Check if the object is a door
if instanceof(obj, "IsoDoor") then
-- Add an option to the context menu
local doorOption = context:addOption("Magically open door", obj, function(door)
-- Implement your custom logic here
-- For example, print a message when the option is clicked
print("You magically opened the door: " .. tostring(door))
-- If you want to implement an effect, you can use game functions here
if door:isLocked() then
door:setLocked(false) -- Unlock the door
end
door:ToggleDoor(false) -- Open the door
end)
-- Add a tooltip to explain what the option does
local tooltip = ISWorldObjectContextMenu.addToolTip()
tooltip:setName("Magically open door")
tooltip.description = "Use your mystical powers to open this door, even if it's locked!"
doorOption.toolTip = tooltip
end
end
end
-- Register the event so this function is called when the context menu is opened
Events.OnFillWorldObjectContextMenu.Add(addCustomDoorOption)
tusm
Sry i'm working on stuff, glad someone could help out proper
not working
you helped me well, I hope you will continue to help me with this mod
I still need help hahaha
hold on i can see
okayyy
What error are you getting?
yeah i dont see anything wrong with the code and i was wrong about the worldobjects being an array 😭 why must they sneak them in and give me ptsd so much
hahaha, nah, idk
Sorry, I don't understand Russian. My English is bad.
in general, there is no this button
local function yourCustomAction(door)
-- Implement your custom logic here
-- For example, print a message when the option is clicked
print("You magically opened the door: " .. tostring(door))
end
local function addCustomDoorOption(playerIndex, context, worldObjects)
-- Iterate through all objects in the area where the click occurred
for _, obj in ipairs(worldObjects) do
-- Check if the object is a door
if instanceof(obj, "IsoDoor") then
-- Add an option to the context menu
local doorOption = context:addOption("Magically open door", obj, yourCustomAction)
-- Add a tooltip to explain what the option does
local tooltip = ISWorldObjectContextMenu.addToolTip()
tooltip:setName("Magically open door")
tooltip.description = "Use your mystical powers to open this door, even if it's locked!"
doorOption.toolTip = tooltip
end
end
end
-- Register the event so this function is called when the context menu is opened
Events.OnFillWorldObjectContextMenu.Add(addCustomDoorOption)
Check the console log there should be a message... and the door ID.
print("You magically opened the door: " .. tostring(door))
I just wanted to remind you about the route.
Contents/mods/yourMod/media/lua/client/doorClick.lua
or server
ohh
oky
my directory right
Check the console log there should be a message... and the door ID.
print("You magically opened the door: " .. tostring(door))
Where should I put this?
?
show your code... and the path where you have it...
the path from above
have you updated the game? When you change the game files you must update them otherwise you will not see any effect.
Do you get an error or the message simply does not appear?
does not appear
Keep in mind that the worldObjects can be buggy
The array that is passed as the arg I mean
You probably want to try something like
local function addCustomDoorOption(playerIdx, context, worldObjects)
-- If there are none somehow, don't do anything!
if worldObjects == nil or #worldObjects == 0 then
return
end
--- @type IsoDoor
local door_obj = nil
-- Get all the objects on the square that the first worldObject lives on
-- and loop through that. This is a workaround for the worldObjects arg.
local square = worldObjects[1]:getSquare()
local objs = square:getObjects()
for i = 1, objs:size() do
local obj = objs:get(i - 1) --[[@as IsoObject]]
-- Once we get the door, don't iterate any more.
-- This also prevents duplicate context menu entries if there are multiple doors.
if instanceof(obj, "IsoDoor") then
door_obj = obj
break
end
end
-- If the door is nil here, something is wrong. Handle it however you like.
if door_obj == nil then return end
-- Create the actual option. Everything up to this point should be OK.
local doorOption = context:addOption("Magically open door", door_obj, yourCustomAction)
local tooltip = ISWorldObjectContextMenu.addTooltip()
tooltip:setName("Magically open door")
tooltip.description = "Use your mystical powers to open this door, even if it's locked!"
doorOption.tooltip = tooltip
end
actually I will add some comments too
try to change the console message to some text on the character like this:
local function yourCustomAction(door)
-- Implement your custom logic here
-- For example, print a message when the option is clicked
-- print("You magically opened the door: " .. tostring(door))
local player = getSpecificPlayer(0)
player:Say("Esta puerta es horrible" .. tostring(door))
end
worldobjects shouuuuuld be okay for doors
fair, I will never trust it though after what happened to me before with it
the downside to the square object list method is occasionally it won't be the square you're intuitively clicking on, whereas worldobjects gathers objects based on mouse position
but i've been burned by it before too 😓
i still have not been able to find any explanation for what it was doing to me
I figured that the door can't be on anything other than aligned to a square so I just use that for objects
it can't, but a door takes up more space visually than one square (because of the isometic perspective) and occasionally the first object in the object list will actually be on a different square from the door even if you're clicking on it
im trying to do a mod that when the game starts OnGameStart, the game already start paused to everything load for weak pcs, what should i do ?
Code now:
local function OnGameStart()
end
Events.OnGameStart.Add(OnGameStart)
How can i change the speed of the game to 0 to pause the game ?
hmm good point.
This doesn't work for me
-- Main function to pause the game on start
local function pauseGameOnStart()
-- Ensure the game starts paused
setGamePaused(true)
print("The game has started in a paused state.")
end
-- Hook the function to the OnGameStart event
Events.OnGameStart.Add(pauseGameOnStart)
How can i add a delay of 1 or 2 seconds before putting true on the setGamePaused?
-- Flag to ensure the game pauses only once
local gamePausedOnStart = false
-- Function to pause the game after a short delay
local function delayedPause()
if not gamePausedOnStart then
-- Pause the game
setGamePaused(true)
print("The game is now paused on start.")
gamePausedOnStart = true -- Prevent this function from running multiple times
-- Remove OnTick listener once the game is paused
Events.OnTick.Remove(delayedPause)
end
end
-- Function triggered when the game starts
local function onGameStart()
-- Add OnTick listener to handle the pause with a delay
gamePausedOnStart = false -- Reset the flag
Events.OnTick.Add(delayedPause)
end
-- Attach our function to OnGameStart
Events.OnGameStart.Add(onGameStart)
It seems to me that if you want to control the pause and then re-unite the game you would have to use something like this code. Use onTick to validate the elapsed time.
but you have to define a condition that after a certain amount of onTick has elapsed the game can resume.
local tick = 0
local function pauseGameOnStart()
if tick < 100 then tick = tick + 1 return end
tick = 0
setGamePaused(true)
print("The game has started in a paused state.")
Events.OnTick.Remove(pauseGameOnStart)
end
local function onGameStart()
Events.OnTick.Add(pauseGameOnStart)
end
Events.OnGameStart.Add(onGameStart)
you probably want to do something like that
need to declare local tick = 0 before the function declaration
thanks, yep
i dont remember when OnTick starts running, but you can start the OnTick when game starts
it only fires in-game either way
then should be fine either way
how did u learn that ?
oh, you really did use ai, because this setGamePaused function literally does not exist U_U

please don't just throw people's questions into ai and not even check if the answer is correct?
isnt it setGameSpeed haha?
I learned a lot when I created my first mod. Now I use the AI more to solve problems. But it always comes up with features that don't exist in the game. So I try to test everything it tells me.
https://steamcommunity.com/sharedfiles/filedetails/?l=spanish&id=3025333772
yeah, i would guess setGameSpeed(0) pauses the game
public static void setGameSpeed(int NewSpeed)
eres espanhol ?
declaration: package: zombie.Lua, class: LuaManager, class: GlobalObject
does this add a delay of some seconds ?
a little over 2 seconds iirc
thnkss
it didint work
local tick = 0
local function pauseGameOnStart()
if tick < 100 then tick = tick + 1 return end
tick = 0
setGameSpeed(0)
print("The game has started in a paused state.")
Events.OnTick.Remove(pauseGameOnStart)
end
local function onGameStart()
Events.OnTick.Add(pauseGameOnStart)
end
Events.OnGameStart.Add(onGameStart)
I just tried it and it works incredibly well. @fleet bridge 👍🏻
Start the game and after 2 seconds it automatically goes into pause. This feature is great for making a tutorial type lore.
how could i reduce the time before pausing ?
if tick < 50 then tick = tick +1 return end
would make it pause in half the time. just reduce that number
nvm i misread i think
yeah that should do it im just too toasty rn
Has anyone figured out a way for items/item models to have collision such as textures/vehicles?
In Project Zomboid, a "tick" represents one frame of the game.
The exact time duration of a tick depends on the game's frame rate (FPS). For example:
At** 60 FPS**, one tick is approximately** 16.67** milliseconds (1/60 seconds).
At 30 FPS, one tick is approximately** 33.33** milliseconds (1/30 seconds).
So, the time between ticks will vary depending on the performance of the system running the game.
Practical Implications
If you want to wait for, say, 1 second, you would need to count approximately 60 ticks if the game is running at** 60 FPS**.
For weaker PCs running at 30 FPS, the same 1 second would take 30 ticks.
To account for variability in frame rates, it's better to track elapsed time using a timer instead of relying on a fixed number of ticks.
sincerely: ChatGPT 🙂
wdym textures?
For example, a crate or a wall
collide with what?
they dont use 3d models but use textures if I am not mistaken
inventory item?
it uses 3d
#modeling Have you asked the people who make models and maps? Collisions are generated in the tails properties and loaded with the map.
no, the game does use flat sprites for most objects
youre probably refering to the world
they are made of sprites
those are the 2d
Ive never messed with 3d or textures so that seems about right
the world is made of png compiled into .pack files
vehicles are made of .fbx which is 3d
items are made of .fbx or .x filed
but they dont have collider when placed on the ground
you have to check for the vehicles area if it intersects with the items square
if you want vehicle colliding with world objects
then theres an event for that
I was more concerned with player collision but vic collision is something to keep in mind
This is applicable to textures only? Not 3d objects?
nope sorry theres no event for vehicle commission after all
only events for colliding with moving objects (player or zombies)
only
i would try this .aybe
getCollidedObject()
Hello, may i ask how i can implement a function that triggers on:
self.character:reportEvent("EventEating");
textures only
I don't know how objects work
Gonna look at how crates are handled to get an idea
yes that defines the sprites property which is basically setting the sprite collideable with vehicle and will change into a different sprite when collided
but that would be based on the sprite property
so doesnt apply to all world objects
you want specific crate ? or all crates?
I mean, Irc, all crates have collison and have 3D objects as well.
crates are all sprites
maybe tree collision?
you could do one of 2 things
1 you can overwrite all the crates property by making the .tile file that contains same name as vanilla
or 2 use lua to detect collission
and check object from a table (you have to put on the table each spritenames of crates)
if you want an object that's collideable in world you might just want a tile object rather than an item model
Hrmm, are these not used?
to be specific go ingame take screenshot of what you think is a crate then send here
cuz rn i think you dont know the difference between game objects yet
and thats fine
we can help you identify
This is a crate
thats sprite
it has nothing to do with this
yeah, i've never seen these models before, definitely not used
Interesting, that clears up a lot
generally if something can't be freely rotated in-game it is probably a sprite
I mean, I can just roll with textures rather than insiting on a 3D model
i havent attempted to make a container that breaks
but i think vanilla does it
check the mailbox
the mailbox should have the properties you need
Mailbox has no collison irc but ill check
it has a broken sprite so i assumed so
only collision with cars i think
yes his looking for car collission anyways
No collision with player or cars
for players thats different
Ahh wait
what do you intend to do
well and they dont really touch i think it just breaks when you drive through it
it will all depend on what their goals are
no i was replying to guns sorry
I just wanted to add a kiosk to the game with a 3D model that had the ability to rotate. Nothing special until I get to the functionality. But, when i noticed it had no collision with players/vics it threw me off.
you have to do it from the tiles as well as the christmas tree. it can be put in the game. and it can collide with it. light it with christmas lights. and rotate it. so that it shows the star in different directions.
In the future, so i dont cause confusion, how should I refer to 3D objects vs Sprite objects?
Christmas Tree being a tile object rather than an item model means it uses 4 different tiles to rotate into 4 diff positions?
exactly!
that's how everything works. kitchens, stoves, microwaves, etc.
but weapons and flasks don't work like that.
Ive never used Blender but does it allow a process for creating images from different angles so that I have todo minimal image manipulation with photoshop? May be a question for the modeling channel but what the hell we are already talking about it.
i think they have a set up for that yeah
That's fine. I just wonder if there is a function type that triggers on this event eating:
self.character:reportEvent("EventEating");
What do you need it for? Or rather, what are you trying to do?
I want to implement a function that for example:
eat a candy and update a counter on character @jolly goblet
it could be used for special effects on food or trait achievements
@wide shale Take a look. This is for taking medicine and includes the animation of eating.
I think what you are interested in is this function... in particular
function TakeDrugsOralAction:start()
if self.drug then
self.drug:setJobType(self.jobType)
self.drug:setJobDelta(0.0)
end
if self.character == self.otherPlayer then
self:setActionAnim(CharacterActionAnims.TakePills)
self.character:reportEvent("EventEating")
else
self:setActionAnim('Loot')
self.character:SetVariable('LootPosition', 'Mid')
self.character:reportEvent("EventLootItem")
end
self:setOverrideHandModels(self.item, nil)
end
yes, but how should i overwrite this without messing the original code?
Do you have the counter function created?
Didnt know where to post this but Made my first Mode of PZ
what is your mod about?
Just simple Some More XP for Skills
i have a container that spawns in with items in it. when taking items in the player inventory they disappear but placing them on the ground they do not. anyone know why this is?
if you look at the function
worldinventoryitem/inventoryitem
are the same
only difference is that one ithe first one is on the ground the second one is in a container or inventory
worldobjects on the otherhand are the ones that uses spritesheet from pack files
it can also be thumpable , floor containers moveables
moveables are both item and tileobject they can become inventoryitem or isoobject
items have sprites too but doesnt
naturally comefrom pack files
you might just need to use setdraw or something
show code
1 way s that you hook on the on eat function and then just add moddata to the player
i didn't write the parts that add the items but it just gets its item container and does :AddItem("itemname") i just swapped things for an inventory item container that is on the ground
if its on the container then lect is right
if its server run code, then AddItem would work iirc
heres how to hook
#1070852229654917180 message
but if its client side, it's just gonna thanos out of existence because the item doesnt exits on the server
yes, can i copy the function and redefine it with:
identifying the item name, like getItem()
and if match, +1 to moddata?
i need to transmit every item?
i guess
but i want to extend instead of redefine so the whole game wont crash on eating if i mess up my part
hooking is extending
with what functions do i transmit an inventory item?
you dont overwrite
basically you capture the vanilla function
use the original function
add your function modifications
then return to the original function you captured
you can also call the orig function earlier
that way no matter how many mods hook on it it will just be a matter of which one loads first this isnt full proof but this is the best solution
it will now depend on how you write it and how vanilla wrote it
Thank you, now getting used to the new terms here
you may refer to any container mod i have
weirdly no, not in most cases
the only time this works is if the container hasn't been sent to the clients yet (so generally just the OnFillContainer event)
for taking items refer to gatcha mod
for spawning items refer to pack a punch
managing containers on the server side is actually really annoying, the vanilla lua doesn't even do it at all
i assume addItemOnServer with item container
im working with a mod that supposedly worked server side, that is a lie
Ah there where I am using it. That makes sense
I do want to add some sort of item api so that we dont need to worry about server-client syncronisation
so like an container:addItem(item) would add the item and sync if needed, can be ran on both client and server
I notice this alot with inventory items duplicating/not syncing to the server so players end up with ghost/duped items
imo not much an api could do that some basic documentation wouldn't also accomplish
most things aren't that hard to do it just isn't clear how to do it
true
also, does SuburbsDistributions.all.inventorymale.item not refer to male zombie?
I am taking distribution code for zombie loot tables from another mod and they added to this table
I try the same, and zombies dont have it
i thought it did
I am probably doing something wrongm definitely
that dropdown usually contains the different procedural distributions that can spawn in that container
might mean something different for corpses though
Can you give me more context? Procedural loot generation is a bit tricky to control?
I am not sure if this is the actual issue, but I was setting a certain item and chance to nil, but it doesn't decrement the indexes above that
I use table.remove and I dont like how slow it is but it does decrement
I am testing right now if that is the actual issue or not.
that would be an issue either way
but what are you trying to get a particular loot to appear, or zombies or cars?
hey albion. if I paste code into the lua console, does it need to be all on one line for it to execute?
because I paste code in there, restart save (it doesnt reload lua) so it can execute event, and then no output from the event
and the callback is nil
callback is nil after restarting save bnut not before, it has to be reloading lua even though it doesnt???
or maybe because its in command console something happens
I just really didnt want to have to create a dummy mod to test an event
exiting the save reloads lua
and theres no way to execute code in the console in the menu 😭
You can run small commands but you can't paste a complete function.
I just did 💀
Hi Client :
-- removeAllItems.lua
function removeAllItems()
local items = getAllItems() -- Obtient tous les items à supprimer
for _, item in ipairs(items) do
dropItemToGround(item) -- Dépose l'item au sol au lieu de le supprimer
end
end
function getAllItems()
-- Cette fonction est censée retourner une liste de tous les items à manipuler
-- Implémentez la logique de collecte des items ici
return {} -- Exemple : retourner un tableau vide pour le moment
end
function dropItemToGround(item)
-- Fonction pour déposer l'item au sol
print("Item ", item, " a été déposé au sol")
-- Implémentez la logique pour déposer l'item au sol ici
end
Server :
function removeAllItemsUsingTrashCan()
local items = getAllItems() -- Obtient tous les items à manipuler
for _, item in ipairs(items) do
dropItemToGround(item) -- Dépose l'item au sol au lieu de le supprimer ou de l'envoyer dans la poubelle
end
end
[I just want a drop all item in ground when i loot a contenair
I made a timed action and it seems that the duration parameter is in ticks but after reading chat it seems that ticks are not fixed which means timed actions are shorter with higher fps..?
Is there no delta time in the game or what lol
they should be fixed for timed actions. there are updates per second but I think timed actions ticks are calculated based on the game time ( there is one)
but make your function run when a key is pressed so I can test 99% of the things that don't directly depend on an event.
local function OnKeyPressed(key)
if key == 20 then -- El código de tecla para 'T' es 20
removeAllItems()
end
end
Events.OnKeyPressed.Add(OnKeyPressed)
Well I am unsure because I tried to make my timed action some number like 3s or 10s and wasnt able to, it was always a weird fraction
¯_(ツ)_/¯
Why aren't keys enums lol
rip
no clue if this is still relevant after so many years but
they don't use the same ticks, their ticks are a constant rate dependent on day length
I see
48 timed action ticks = 1 real life second with the default 1 hour days
for some reason a lot of things in this game centre around 48/s, never been too sure why
Quite the unusual number
@bronze yoke take a look at this message
chatgpt 😭
albion knows how ticks work, it's very basic system
"they don't use the same ticks, their ticks are a constant rate dependent on day length"
you trust chatgpt way too much lol
Didnt he give someone a made up method earlier
I highly doubt chatgpt knows anything about modding pz
it can pick up stuff based on reading other people's code online, but like AI making images, it makes up information a lot of the time
more so when the task is complicated
chatgpt coders will go nowhere, I say this confidently, and by chatgpt coder I mean someone who relies on chatgpt for more than just a tool/helper
Honestly biggest issue is how small of a footprint modding information has
Poor ChatGPT is being whipped to come up with information that just isn't available
They are*; Keyboard.KEY_T == 20. Just using the number directly doesn't hurt either, though
* okay technically they're static constants but you get the idea
guess they added that since 2014 😂
I actually hate enums
Controversial
what, why?
why? they're pretty useful for specific things
Controversial indeed
like instead of using numbers, you can use words to represent hte numbers
magic numbers they call it
The only times I've run into them in PZ have caused issues cause they seem imutable (if that's the right word)
I would sure hope a constant is immutable
😭
This is why sandbox options require their own script to add more
I suppose I'd need to know what the issues were to really understand the aversion
if they're immutable then scripts wouldn't be able to change them either
For EHE I had to write up each event's options
i'm not sure exactly what you're being bottlenecked by there but it's definitely not enums
I think the scripts are loaded when they're defined
I'd like the option to dynamically generate sandbox options
But this is cause I'm lazy
You can have an enum technically change but it's like ultra mega scuffed
I don't know why they wouldn't just use a hashmap (ik im cringe)
i'm not sure exactly how they're implemented in java but i'm used to them basically just being compile time aliases to avoid magic numbers, if you need them to change at runtime you're probably using them inappropriately
the global is constructed like this
options is final but it isn't constant
as long as you dont resize it I guess you can add more but I see what you mean
why can't you resize it?
well I showed the wrong one before but anyway 😭
actually I guess you could resize this
I hate oop in lua
if you're talking about the ArrayList before that I removed because it wasn't used (that I know of) it's kinda bad to resize array
like at that point you'd just use a vector
because resizing array you need to reallocate a whole new array with the new size
so if you add to a array list, it's basically creating a new array every time with the new capacity
also final doesn't do this, final just makes the variable immutable but not the arraylist
actually I guess that's only for native arrays not ArrayList
i know you can pre-resize an arraylist to avoid repeat reallocations, i'm not sure what its default policy is though
dam I always thought ArrayList was like array
i was under the impression that arraylists basically behave as vectors though
I am actually going to look at that
I don't understand why there would be a Vector if ArrayList you can add and remove from
and scientists are still trying to work out why we called them vectors
ok tl;dr dont really use vectors
ArrayList isnt thread safe
vectors are an oopsie in the sdk I guess because they are supposed to be thread safe but fail half the time
lol
(well actually i happen to know the answer to this and it's 'the guy who proposed vectors for c++ didn't know what a vector was and every language since has just copied it')
and the grow feature is different. Vector doubles its size whengrowing wheras array list grows 50% more I guess
unironically I've never used ArrayLists to "grow" the list, because I always thought you couldn't
the more you know
that only applies to native java array
you can make ArrayList thread safe too
zomboid pretty much uses arraylists for everything ever so i'd noticed they were resizeable
is it just me or does the log output look REALLY UGGGGLY
i want to switch to slf4j/log4j
SO BAD
i dont see any codes that actually does anything excpt for prints
i think its cuz of the .x files timmings
its 4800 frames per second vanilla default
Has anyone tried to use lunarmodules/busted (lua busted) to write unit tests for pz lua mods?
Yeah
Resending what I've said here before:
I have busted unit tests for my library mod, but it's not testing PZ-specific stuff (i.e., mostly just making sure I don't break core utilities)
Theoretically would be possible to do so with a whole lot of mocking
i have a question. does zomboid lua have a debug mode to enable for testing?
yes, launch the game with the -debug launch argument
i mean in lua script, like if debug then?
if you want to check if the player is in debug mode u can do getDebug() in lua
like if getDebug() then
Hello, I would like to create a mod for knocking out the door, I have made an animation, and in the future I will import it into X format. I would really like you to help me with the code, since I do not really understand the Lua language, and I am not strong in programming, do not consider the offer to be arrogant, if you have free time, then please help me with at least small details and tips.
Are you talking about something like, right click a door, choose "break down door", and it rolls some random chances and you bust down the door?
yea
Ok, what you want is to look into FIRST, is how to make a context menu option.
Yes, I'm in the course, I was just talking about it yesterday
Ah! Well, once you have a context menu option that pops up, you are going to want it to call your break door script.
I would suggest that be a "Timed Action". That should make it pretty easy to use the functions available to doors. IE:
https://projectzomboid.com/modding/zombie/iso/objects/IsoDoor.html
declaration: package: zombie.iso.objects, class: IsoDoor
...
You made me cry.
Nah man, dont. I would look at the code for reference to get an idea on how to get it done. Your animation could be unique to his.
I think you're right.
hello! My new mod for Animal Crossing Special Characters: https://steamcommunity.com/sharedfiles/filedetails/?id=3378358285
Just one thing I will say, for the love of god don't use X format. Just stick to fbx. You can use FBX even in anims_X, it's ironic.
me personally just started using fbx
i used to do everything usong fragmotion cuz it has support for x files
last project made me sorta regret doing it using blender
cuz i didnt have access to the vanilla idle aim animation
which sorta wasted my effort on making a stance
the transition between them sorta spike due to its inaccurate leg placement and i couldnt guess where the vanilla limbs are placed
i couldnt convert x to fbx even using the addons that are used by other modders for some reason maybe its just for clothing idk
i wonder why support for it is so bad
as far as i've been able to tell it's undocumented (at least officially) but it doesn't seem like it's that niche of a format to not even have full blender support
actually i just found the documentation so i really don't get it
maybe i could look into getting blender to import them sometime, no promises though
i've done similar work before so i might be able to get somewhere with it
I remember using some plugin in maya or a plugin in blender too I dont remember
there's def a plugin for it in blender already, just dont know what its called lol
from what i understand it doesn't import animations
it looks like zomboid's xs are in the text format so it would be somewhat easy to debug, although it looks like kind of an annoying format
hasn't someone converted the X stuff to FBX already? If not I wonder if I could do that using the plugin they created them with in Maya
not as fancy as making a plugin to import them but it's something 💀
it's definitely worth a try
i don't think very many people in the community use maya so it's absolutely possible nobody tried it
I remember the animator saying thats how he exported them, created in maya
so I can export them myself for people in fbx
I will do that soon.
Also do other .X items need that treatment too or only animations?
maybe clothing items dont load all parts properly?
Hello, I have a question about Procedural Distribution. I made a simple mod that adds 1 soft drink to the game. Everything is fine with the models and scripts, but my item dont spawn in the game. I double check, but I cant find the problem. Code below:
Where can I find a list of all vanilla ContainerTypes? I checked Java/Lua source.
Maybe this will be helpful
Not exactly what I was looking for but could be related. However, they are defined in the tiledefinitions
Getting a blender plugin for X animations would be really nice
first time happening to me what do i do ? it got stucked
wow all vanilla? yes please
its still stuck
i force closed it
hopefuly that wont be an issue
lua\shared\Definitions\ContainerButtonIcons.lua container icons are the same as container types
apparently setVariable for custom animations doesnt work on SP???
turns out the plugin for maya is only for exporting and there's no plugin for importing in maya...
Tried everything I knew, but items do not spawn. I even cant see them via lootz
Your file is in the exact same folder tree as the original? Have you checked if yours get actually loaded after the original? (in the f11 panel of the -debug mode)
ok so this wont work btw
The ONLY last working tool I could find for DirectX to FBX was a 500$USD tool that was made for Win95 32-bit. There's literally nothing else that imports animations properly and stuff. It seems to be very difficult.
Not just for blender either, this is for raw file format
I am just going to pray that TIS uses gltf or fbx from now on 😭
is there any method of checking if a zombie is aggroed on the player? i want to apply certain modifiers to the zombie in these specific conditions and remove them when they lose aggro
You mean my distribution file? It is in \mods\Kvas\media\lua\server\Items
does this function only captures moving objects?
getCell():getObjectList()
Also I didnt find my distribution file in f11 panel
end
I double checked everything, but still the problem remains
zombie:getTarget()
is there a trigger i can use so i dont have to check every second if the zombie is aggro or not?
if your distrib file is not in the f11 panel then it's not loaded
How do I make it load?
Could be anything... when it happened to me was because i messed the file extension or messed the folder structure or there's an error in the code. Try with only one line that you're 100% sure it should work
Are you aware that you can filter the file list in the f11 panel? I didn't figured at first, and without that is pretty hard to find files xD
I wasnt aware until now, thank you
there's an empty bar just on top of the list, you can write the name of your file there, it's pretty easy to miss thinking it's part of the table
I am going to try to find my file with this info
another way to test if a lua file is loaded might be to just put in it a print("I am loaded") and check if it appear in the command panel. I didn't try in zomboid but usually i do that with other language
It wasnt here, wich means your right, it is not loaded.
Looking to potentially commission someone for a project zomboid coding thing
Lmk if you're interested
I am looking for a mod already using "list of items" as sandbox options (afaik a long string to parse). can anyone point me to such mod ?
@quartz kindle Can't DM you but what is it?
https://steamcommunity.com/sharedfiles/filedetails/?id=2793385743 SSR Quest system. There's a guide on the coding, but I am extremely busy with work and wouldn't have time to learn everything
Does anyone have more details on how it works? I tried to use it but I got a little lost. If anyone has a detailed article or post on how they have used it that would be great.
Like this?
thank you, yes, the Generic Zeds Loot field is what I am looking for. what's the mod name ?
Here is a guide https://docs.google.com/document/u/0/d/1FEraABocTVMiae_yKz1uSQWGcnMulJm5O4vpg-bczx8/mobilebasic#h.a9msakcemu9d, it's too big for chat gpt ?
SSR: Quest System User Manual Original: Live version: Table of contents Introduction 3 Step 1: Installation 3 Debugging in singleplayer 3 Debugging in multiplayer 4 NPC plugin comparison 4 Step 2: Project setup 5 Step 3: Character creation 6 Character properties 6 Events and Flags 6 Creat...
thanks!
https://steamcommunity.com/sharedfiles/filedetails/?id=3375311708
used sandbox option
function yourMod.SpawnToContainer(container)
local list = SandboxVars.yourMod.ItemList
local items = {}
for item in string.gmatch(list, "[^;]+") do
table.insert(items, item)
end
for _,v in ipairs(items) do
container:AddItem(v)
end
end
thx a lot
used ; as delimiter same as vanilla mod list
Base.Katana;Base.Bag_ALICEpack_Army;Base.DoubleBarrelShotgun
what are the min-max of the numeric value in ProceduralDistributions? I though it was 0-10 but then I saw more than 10... it's a percentage over 100? Or what?
it's kind of a percentage but it's further scaled by so many things that thinking of it as one isn't really helpful anymore
there's no specific minimum or maximum but values over a few hundred are all going to be 100%
you can check the actual effective spawn chance of your item in a container with lootzed
yeah i suspected that, sigh... thank you!
took me a while to realise that the uploaded mod cant be changed, so I need to reupload
is there a way to test offline without uploading?
you can just not upload it, if you had your mod ready for uploading it's already ready for offline testing
the game loads valid mods from the mods/ and workshop/ folders
does it show on the mod list if I put it in mods/ instead of uploading it in workshops/
yeah, but workshop/ works too, just don't upload it
I see, that is really useful to know 😄
I keep updating my workshop with a diff version of my texture pack but it keeps loading the older version. Are there any known issues with this?
Nvm, had to restart the client. I did it before but must have used the wrong texture pack.
same here, i am still figuring out how to update it without delete and reupload
So you have your mod in workshop folder and it was already uploaded, but you changed/added something in it, but left workshop.txt and mod.info untouched then its just same as you would upload it again, but this time it will use already given ID for your mod
yes, that is what i expected. but i tried changing some print function and test. it doesn't update somehow. (update: changed too many times, accidentally deleted the first line -> syntax error lol)
Why do you update mod to test it to begin with?
You know you can just have it unsubscribet to use local files? It will always load steam workshop before local files, so at some point you might end up doing changes over and over again and see no results only to find out you've been using steams workshop version this whole time
im just trying to figure out how private mod works
player:getTraits():insert("new_trait") <- is this how I add trait to character?
or should i use add()?
you guys probably have sub your own mod aswell as have it there on your workshop
it conflicts
add to player or create trait?
to add to player refer to this
client/ISUI/PlayerStats/ISPlayerStatsUI.lua
to create trait
client/OptionScreens/CharacterCreationProfession.lua
thank you, it is to add to player
I am not understanding what is allowing this item to be destroyed and not allowed to be rotated. I have a tile pack with 4 directional facing tiles for this item. I think I have the proper tile properties set.
Here is the item script:
`module Base
{
item Mov_PCZCore
{
DisplayCategory = Furniture,
Type = Moveable,
Icon = pczcore,
Tooltip = Tooltip_ItemTraps,
Weight = 10,
Capacity = 20,
UseWhileEquipped = FALSE,
DisplayName = PCZ Core,
WorldObjectSprite = pczcore_0,
}
}`
Here are the tilesheet properties
Text Format:
https://hastebin.skyra.pw/puqohakexa.txt
The tile properties file itself:
https://drive.google.com/file/d/1J_8L0AHyufYnzAH1xEr1zG962zQznTKj/view?usp=sharing
Alright, so I fixed the rotation issue by assigning a GroupName to each tile in properties. Still cannot figure out how to prevent it from being broken with melee.
hey how do i apply a zombie scratch/laceration/bite to a player
with infection included
on a random body part
i think they are all in bodydamage
when you are building in iso mode in buildinged, is there a way to get all the custom tilesets in without having to manually do it
declaration: package: zombie.characters.BodyDamage, class: BodyPart
You mean WorldEd?
Nvm, you mean the tool in TileZed but yah it should be the same process as making them available in TileZed. At least it worked for me:
https://www.youtube.com/watch?v=Fbvb6LeX0Sw
Quick video on getting custom tiles in the project zomboid editors (buildinged, tiled and worlded)
If you like what im doing please consider donating to my Patreon.
https://www.patreon.com/DaddyDirkieDirk
local part = ZombRand(Player:getBodyDamage():getBodyParts():size())
Player:getBodyDamage():AddDamage(part, 10)
local random = math.random(1,3)
if random == 1 then
Player:getBodyDamage():getBodyParts():get(part):SetBitten(true, true)
elseif random == 2 then
Player:getBodyDamage():getBodyParts():get(part):setScratched(true, false )
elseif random == 3 then
Player:getBodyDamage():getBodyParts():get(part):setCut(true, false)
end
uhh this does not seem to work (i think cut is lacerated)
how can i add an existing trait with player:getTraits()?
I am " " this close to the end to finish up 😄
player:getTraits():add("MyTrait")
I think you arent setting the BodyPart properly.
local bodypart = player:getBodyDamage():getBodyPart(shotpart) bodypart:SetBitten(true, true)
I used shotpart cuz i was looking at some code Ive written before but I think you get the idea
thank you 😄 i have been stuck using insert(), hard to look through the source files without hints
are you aware of the javadoc website? i think the way traits work is a little misleading even with them but generally you can find information about that kind of thing there https://projectzomboid.com/modding/
Anyone know how to make worldobjects unbreakable via attacking by players?
Set the thumpable flag on the object https://www.projectzomboid.com/modding/zombie/iso/objects/IsoThumpable.html#setIsThumpable(boolean)
declaration: package: zombie.iso.objects, class: IsoThumpable
But it depends how you place the object. Is it moveable?
Yes it is. I thought thumpable only applied to zeds?
On the contrary, zombies don't use that flag. It's only for tile objects. You can set the flag at OnObjectAdded event https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs%2FEvents.md#onobjectadded
It is always triggered when you place a moveable object, either in SP or as a client in MP.
I can start digging but off the top is this how moveables such as computers and TVs do this?
You can filter the object by sprite for example, it is the safest.
IIRC an internal function in the moveable class sets the java object with :setMovedThumpable (I think it's special for IsoTelevision), or something like that, but setting the thumpable flag does the same thing.
What the actual hell. This tile prop makes it unbreakable. Im guessing it makes it thumpable, but no telling what else it does.
I can still interact with it like a typical moveable
you can place inventory items ontop of its surface
Yup, so does IsTable but doesnt make it unbreakable with melee.
i never did any mod that involves worldobjects hp
or damaging it or whatever so i wouldnt know
most my tile mods are un sledgeable tho
Yah, thats another question, how would you set its HP, but a non concern for me right now
How did you make it unsledgeable?
Alright, Ill be looking at that next. Send me into the dark or do you by chance have reference?
you said most your tile mods, so Ill start cracking.
Chuck's protection for his shop mod https://github.com/Chuckleberry-Finn/pz-shops/blob/main/Contents%2Fmods%2Fpz-shops%2Fmedia%2Flua%2Fclient%2Fshop-disassembleProtection.lua
Is it possible to get the text from a piece of paper in game for use in mod code?
I've been getting invisible zombies on single player
The only mod that could be causing this is a recent mod I've created for personal use, but it was made in the exact same way as all my other re-texture mods.
Even after I removed the mod I was able to find a single invisible zombie.
I get an error but can't figure out how to open it. Even if I could I don't know how to figure out why this is happening.
I tried using the error magnifier, but the description wasn't very descriptive, and I don't know if I'm using it wrong or if it's just not working.
C:\username\Zomboid\console.txt is the fire where you'll find the errors
No errors related to my mod seem to be in there.
Infact there is nothing at all regarding the mod that I think is doing it.
I'm not even sure what is wrong with the mod.
All it is, is an edited version of another mod that I changed the ID and name of.
1 texture is working but it's only the female zombie 1 texture.
math.random doesn't work
unless i'm wildly mistaken, just use zombrand
Even if it does work, I wouldn't trust it over newrandom() (dont fully remember what this does but albion mentioned it ages ago) or ZombRand(1, 3)
yeah math.random doesn't exist in zomboid
ZombRand() is easy and newrandom() runs better
in this case you'd want ZombRand(1, 4) since the upper limit isn't inclusive
How does newrandom() run better? Performance?
yeah it just performs way better
ZombRand uses some weird ass high quality rng algorithm used for security and casinos and shit so it's quite slow
newrandom() just uses the stock java random function so it's a lot faster
Welp, I'm about to go crazy with it. See how it feels when its constantly being called vs ZombRand.
so to be clear newrandom() returns an object which you then call :random() on
e.g.```lua
local rand = newrandom()
rand:random(3)
-- equivalent to:
ZombRand(4)
i think if you include object creation they end up being about the same speed but obviously you can just cache one at game boot and then it's much faster than zombrand
Is it significantly better?
Does anyone know any reasons as to why textures wouldn't be registered?
For some reason mine are invisible and I'm getting errors.
Ill constantly be generating a new random number for every hit on a player so I dont think caching would work too well for my case.
cache the object, not the numbers or anything
got yuh, got yuh
like```lua
local rand = newrandom()
function myFunction()
...
rand:random()
...
end
i found where i talked about it before and i just said 'more than twice as fast' so make of that what you will i guess
This is the texture that works and one that doesn't if anyone wants to give it a look. I don't understand why the female texture works just fine, but nothing else does. I can't figure out what is different about it.
The only thing I can see right now is that the female one was originally saved in photoshop, then exported and saved in gimp a couple years later (I assume the modder was using gimp) whereas the male one just says initially saved in gimp
I wonder if gimp's png export has something to do with it?
it's usually a matter of bit depth
pz doesn't like a specific one for some reason
i forget which exactly
their files both use 32 bit depth
It's either bit depth of 8 or 32 that pz doesnt like
I think it might be 32 but I wasn't sure so I didnt point it out
wtf i didnt know there was another rand function
same way how to use? just different algo?
mostly, the specific usages are:
rand:random() -> random float between 0 and 1
rand:random(n) -> random integer between 1 and n
rand:random(m, n) -> random integer between m and n
so both limits are inclusive with it and the default lower limit is 1 not 0
ah so its a bit different from zombrand which starts at 0 and ends -1 of the count
we need more info
but usually
wrong folder structure
wrong directory
contains a file with syntax error
duplicated mod
there's also rand:seed(n) to set the seed if you want deterministic random
did you configure the modinfo