#mod_development

1 messages · Page 271 of 1

past ridge
#

is it the textures folder or?

#

someone plz help me out lol

#

this is my first time making a mod

tranquil kindle
# past ridge

In textures folder and in your case if you icon is "Beans" in item script, in texture folder icon should be named "Item_Beans"

past ridge
tranquil kindle
past ridge
#

so i put item_ before the name right?

tranquil kindle
#

On icon, yes. Im not sure if lower/uppercase makes a diffrenct, but just to be sure have i in Item uppercase

past ridge
#

ok thanks

tranquil kindle
#

And you only name image file like that, in script you igonre "Item_"

past ridge
#

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

past ridge
tranquil kindle
bright fog
#

My main suggestion is, did you try reading the code ?

past ridge
#

how do i add that

#

sorry im very new to modding

tranquil kindle
#

So what exacly what you managed so far?

#

From what i see you want to make canned hamburger

past ridge
#

ive added the textures into the textures folder

#

ive renamed it

#

ive added the values for nutrition

#

added the icons

#

with ur help

tranquil kindle
#

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

past ridge
#

ah alr

tranquil kindle
#

You can either create new txt file or include it in one above

past ridge
#

im just reskining the beans and changing the values

#

and name

#

as a new item

#

so ill use the canned beans

tranquil kindle
#
    {
        mesh = CanClosed,
    }
#

Thats script for can you want to use i assume

past ridge
#

yes, but what about like textures?

tranquil kindle
#

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,
    }
past ridge
#

ah thanks

tranquil kindle
#

Its for open can, but if you browse models_items.txt you can find most of vanila models there.

past ridge
#

is this the right place to put it?

tranquil kindle
#

Nope

past ridge
#

oh where do i place it?

tranquil kindle
#

definetly not in the middle of your itemscript

past ridge
#

ignore the recipes

#

im gonna remove those

tranquil kindle
#

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
{

past ridge
#

i am so sorry for sounding like a idiot lol

#

im very new to coding so im a bit slow

tranquil kindle
#

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,
}
past ridge
#

i dont want to use a custom model

tranquil kindle
#

You want to use custom texture, but still same model as vanila cans, thats why you add same "mesh", but texture is diffrent

past ridge
ancient grail
tranquil kindle
#

remove that line about "location of your texture" after "texture = WorldItems/cannedburgerclosed, " it was just for you to know,

past ridge
#

oh yeah i forgot

#

oops

#

didnt save it

tranquil kindle
#

You have your item id inside of your model script

ancient grail
#

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

past ridge
#

bruh why isnt it saving

#

wtf for some reason its not saving

#

ah nvm i fixed it

#

is this better?

tranquil kindle
#

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.

past ridge
#

sorry its becuase im very new to coding lol

#

i probably look like a idiot rn

tranquil kindle
#
{
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,
}
}
tranquil kindle
#

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.

past ridge
tranquil kindle
past ridge
ebon dagger
copper grotto
#

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

spice python
#

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)

maiden arrow
#

Does anyone know where the texture is for the cigarette icon?

#

It's not inside media/textures

tranquil kindle
maiden arrow
#

Just curious about the resolution of icons honestly

tranquil kindle
#

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

maiden arrow
#

Thank you for the information

proven ember
#

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

flat robin
#

Hello comrades! Does anyone know how to create posters? How object on wall, of course

crude forum
#

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

ebon dagger
crude forum
#

thank you!

slim sparrow
#

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

ancient grail
ancient grail
ancient grail
crude forum
flat robin
verbal yew
#

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
maiden arrow
#

Does anyone know how to go about adding a custom player status, similar to hunger and thirst?

verbal yew
maiden arrow
#

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)

gilded crescent
#

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

ancient grail
gilded crescent
maiden arrow
ancient grail
#

something like that

ancient grail
#

why not

flat seal
#

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?

bright fog
#

Use mod manager server tbf

flat seal
#

I am doing the rented server thingy

flat seal
bright fog
#

And thus you can use it

potent loom
#

What I want for Christmas is CarController.ClientControls finally exposed in Lua (after 5 years it would be cool to have npcs driving cars)

ancient grail
#

ahh you want for MP

bright fog
#

I think I've seen a concept for driving NPC ?

honest spade
#

is there any way to disable slots? e.g. the back slot

bright fog
#

If you check out weapon condition in hotbar mods you'll have examples on how to access slots I believe

potent loom
bright fog
#

Hmmmm

ancient grail
#

wait i think i saw a gps mod that does automate the car

bright fog
ancient grail
#

sucks

potent loom
#

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.

sour island
#

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.

bronze yoke
#

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

livid badger
#

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!

random finch
#

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.

bronze yoke
#

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

random finch
#

That would be what I am looking for. Havent messed with this stuff in a while.

nimble badger
#

Is this correct? stats:getinsulation() local Tempt = player:getStats()

nimble badger
#

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

mellow frigate
nimble badger
#

Moreover I know that each body part has its own value, how would I go about extracting them, averaging them and making a list?

gleaming wedge
#

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!

ebon dagger
#

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!

ebon dagger
sour island
#

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

ebon dagger
sour island
#

Ah ok, we also have a player-support section too. 😄

ancient grail
wanton aurora
#

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

ancient grail
#

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

wanton aurora
#

@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!

ancient grail
#
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

wanton aurora
#

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

gilded crescent
ancient grail
ancient grail
#

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)

gilded crescent
dry lichen
#

Hi everyone where can I find the code in the game that allows me to take everything or transfer everything?

gleaming wedge
ancient grail
ancient grail
gleaming wedge
ancient grail
#

no its 0

gleaming wedge
#

And if i have 2 png with files the first of all files is stll 0?

ancient grail
#

nameofPNG1_0
nameofPNG2_0

gleaming wedge
#

Ok i was confused because vanilla sprites starts from random number

ancient grail
#

fir your mod with multiple tilesheet you only need 1 .tiles file and 2 .pack files since you have 2 sheets

ancient grail
#

which is what you see inside the x2 folder

gleaming wedge
#

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)

ancient grail
#

trees are complex
unlike other tiles

gleaming wedge
#

I'll see if i manage to make it works, finger crossed and thanks for the int ❤️

dry lichen
spice python
#

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:

gleaming wedge
#

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

ancient grail
#

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

edgy spear
#

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

spice python
edgy spear
# edgy spear

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

spice python
#

PopCanKvastexture in textures folder

ancient grail
#

and your model is a valid model? have checked the scale?

spice python
#

I found it in game files, just renamed it

#

Originally it was PopCanDiet.x

ancient grail
#

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

gleaming wedge
#

you don't have to copy the model file if you don't change it, just use the original name, i have done it

ancient grail
#

also your file is short
next time pls just paste the script

ancient grail
spice python
#

One minute

ancient grail
#

you can still create custom model script with custom texture
while using vanilla mesh

gleaming wedge
#

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

gleaming wedge
# spice python 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

spice python
#

It works, thank you again

bronze yoke
maiden arrow
#

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?

gleaming wedge
#

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

maiden arrow
#

Okay I will just redraw them myself, thank you anyways

bright fog
maiden arrow
#

I already use it for myself but none of my modded moodles match it so

random finch
#

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

maiden arrow
#

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

bronze yoke
#

getTexture("path")

maiden arrow
#

ty

bronze yoke
# random finch Looking at `ISFactionAddPlayerUI.lua`: Lines 152-154 Where are they getting `se...
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
gleaming wedge
#

someone knows about new codes in the new release? I'm hoping for recipes that doesn't require a result

edgy spear
bronze yoke
#

pzstorm? that's ancient, i'm not sure it even still works

edgy spear
#

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

bronze yoke
#

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

edgy spear
#

couldn't reaaaally get the second thing to work myself 😦

bronze yoke
#

sorry to ping, but i think @grizzled fulcrum might know more about this than i do?

grizzled fulcrum
#

coming out with somethign similar soon but just need time to work

grizzled fulcrum
#

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

bronze yoke
grizzled fulcrum
#

oh wrong name I think

bronze yoke
grizzled fulcrum
#

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

gleaming wedge
#

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

maiden arrow
#

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

gleaming wedge
#

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

bronze yoke
#

add AllowRottenItem:true, to your recipe definition

gleaming wedge
#

thanks!

bronze yoke
#

rotten items aren't usually different items but the crafting system rejects anything rotten by default

gleaming wedge
#

worked thanks a lot!

#

really hope they give us recipes without result, my mod would be so much lighter and quicker to edit

bronze yoke
#

b42 probably will

gleaming wedge
#

finger crossed

tranquil kindle
gleaming wedge
tranquil kindle
#

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

bronze yoke
#

recipes currently need a result defined because it's used for the recipe icon and stuff

tranquil kindle
#

And it gives you items with onCreate function

bronze yoke
#

i imagine a recipe rework isn't going to have those same limitations

tranquil kindle
#

Yeah, thats is true, but other than that

#

What if it makes a result that doesnt exist?

bronze yoke
#

everything explodes because it needs the item to exist to get its icon

tranquil kindle
#

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.

gleaming wedge
#

in different forums people says that i't not possible so i was sure ç_ç

tranquil kindle
#

Might i ask what would you need recipe without result for, unless you want it to give result via oncreate function?

gleaming wedge
#

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

random finch
#

Has anyone managed to verify java files via mod? Was thinking about it in the case you wanted to prevent cheating on a server.

grizzled fulcrum
#

if that were possible, @red tiger would've done it already

bronze yoke
#

it'd have to be a client java mod

random finch
#

You can't do anything simple such as getting a filesize at a certain path?

#

Not even a checksum

red tiger
random finch
red tiger
#

Just clocked out for lunch

red tiger
random finch
#

Im all ears

red tiger
random finch
red tiger
#

One works off of loading code from the server machine.

#

I provide a loading framework and encryption

random finch
#

Im going to read more about it in your discord

tight shoal
#

Hello all ! I'm looking some ressources to begin in mod development, any ressources list / tutorials listed here to start with ?

wide shale
#

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

low lily
#

wishing I was a tester so I could play unstable rn

edgy spear
grizzled fulcrum
#

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)

frank elbow
#

It's also possible to do it using javac directly, of course

grizzled fulcrum
#

yeah I tried that but it's too tedious for me 😂

frank elbow
#

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

grizzled fulcrum
#

dam thats smart

#

im alergic to batch though I can't STAND it

edgy spear
#

i'm assuming that's what you meant

grizzled fulcrum
#

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

jolly goblet
#

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

ebon dagger
#

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

either is acceptable, testing would be better if you have the resources though

ebon dagger
ebon dagger
# jolly goblet Hello everyone! 🚧 I'm working on a mod for Project Zomboid focused on adding A...

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.

rose notch
#

Do upscaling textures (ie clothing textures) work in this game?

maiden arrow
spice python
#

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.

fleet bridge
#

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

ebon dagger
jolly goblet
# ebon dagger As long as any AI players need can remain LOCAL, I think people would embrace th...

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

spice python
spice python
#

Now I know I made a mistake somewhere

dry lichen
ancient grail
true nova
#

anyone know how to make a solid invisible tile?

cinder flower
#

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

ancient grail
#

you can also just spawn directly the blank sprite and give it property i think that should work

ancient grail
true nova
#

thats what i was gonna do next thanks dude. i tried doing properties but i think i need a sprite to work with

true nova
ancient grail
#

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

ancient grail
true nova
#

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

cinder flower
#

I see ty guys

ancient grail
ancient grail
true nova
true nova
ancient grail
#

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

limber venture
#

Hello everyone, I wanted to ask you a question. How do I open the context menu when I click on the door?\

true nova
limber venture
#

add context option

#

I'm making a mod for opening the foot from the door, but I can only do animations.

true nova
#

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

true nova
#

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

limber venture
#

thx

limber venture
#

I think I forgot to add a function...

true nova
#

context:addOption("test door",door,createTestOption)

limber venture
#

i remake code

true nova
#

worldobjects is an array and has to be iterated through differently

limber venture
#

hmm

#

What can I do?

true nova
#
for i=0, worldObjects:size()-1 do
    local door = worldObjects:get(i)
if instanceof(door,"isoDoor")

limber venture
#

like this?

#

oops

#

i remake instanceof

true nova
#

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)

limber venture
#

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

jolly goblet
# limber venture Hello everyone, I wanted to ask you a question. How do I open the context menu w...
--[[
    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)
true nova
#

Sry i'm working on stuff, glad someone could help out proper

limber venture
#

I still need help hahaha

true nova
#

hold on i can see

limber venture
#

okayyy

jolly goblet
limber venture
true nova
#

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

jolly goblet
limber venture
jolly goblet
#
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))

limber venture
#

wait a minute

#

hold hold

#

wait

#

my directory

#

maybe

#

bad

#

its client?

jolly goblet
#

I just wanted to remind you about the route.
Contents/mods/yourMod/media/lua/client/doorClick.lua

limber venture
#

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?

#

?

limber venture
#

okay

#

wait

#

no

limber venture
#

and not message

jolly goblet
#

show your code... and the path where you have it...

limber venture
#

the path from above

jolly goblet
#

have you updated the game? When you change the game files you must update them otherwise you will not see any effect.

limber venture
#

yea

#

and i updated the mod

jolly goblet
#

Do you get an error or the message simply does not appear?

limber venture
grizzled fulcrum
#

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

jolly goblet
# limber venture does not appear

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

worldobjects shouuuuuld be okay for doors

grizzled fulcrum
#

fair, I will never trust it though after what happened to me before with it

bronze yoke
#

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

grizzled fulcrum
#

I figured that the door can't be on anything other than aligned to a square so I just use that for objects

bronze yoke
crystal crypt
#

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 ?

jolly goblet
crystal crypt
jolly goblet
# crystal crypt 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.

fleet bridge
#
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

bronze yoke
#

need to declare local tick = 0 before the function declaration

fleet bridge
#

thanks, yep

#

i dont remember when OnTick starts running, but you can start the OnTick when game starts

bronze yoke
#

it only fires in-game either way

fleet bridge
#

then should be fine either way

fleet bridge
#

its output from LLM

#

which isn't to say its bad, its a great learning tool

bronze yoke
#

oh, you really did use ai, because this setGamePaused function literally does not exist U_U

fleet bridge
bronze yoke
#

please don't just throw people's questions into ai and not even check if the answer is correct?

jolly goblet
bronze yoke
#

yeah, i would guess setGameSpeed(0) pauses the game

fleet bridge
#

public static void setGameSpeed(int NewSpeed)

crystal crypt
fleet bridge
#

a little over 2 seconds iirc

crystal crypt
#

thnkss

bronze yoke
#

ticks aren't a set amount of real time

#

they're tied entirely to framerate

crystal crypt
#

it didint work

jolly goblet
#
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.

crystal crypt
#

how could i reduce the time before pausing ?

true nova
#

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

random finch
#

Has anyone figured out a way for items/item models to have collision such as textures/vehicles?

jolly goblet
#

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 🙂

random finch
#

For example, a crate or a wall

ancient grail
#

collide with what?

random finch
#

they dont use 3d models but use textures if I am not mistaken

ancient grail
#

inventory item?

jolly goblet
bronze yoke
#

no, the game does use flat sprites for most objects

ancient grail
#

youre probably refering to the world
they are made of sprites
those are the 2d

random finch
#

Ive never messed with 3d or textures so that seems about right

ancient grail
#

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

random finch
#

I was more concerned with player collision but vic collision is something to keep in mind

random finch
ancient grail
#

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

wide shale
#

Hello, may i ask how i can implement a function that triggers on:
self.character:reportEvent("EventEating");

jolly goblet
#

I don't know how objects work

random finch
#

Gonna look at how crates are handled to get an idea

ancient grail
ancient grail
random finch
bronze yoke
#

crates are all sprites

wide shale
#

maybe tree collision?

ancient grail
#

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)

bronze yoke
#

if you want an object that's collideable in world you might just want a tile object rather than an item model

random finch
ancient grail
#

thats an item

#

which mod did that came from?
afaik thats not vanilla

random finch
#

Yah its vanilla

#

Maybe unused

#

I did also notice the crate textures

ancient grail
#

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

random finch
#

This is a crate

ancient grail
#

thats sprite

ancient grail
random finch
#

right, what I thought until i looked at the 3D crate file

bronze yoke
#

yeah, i've never seen these models before, definitely not used

random finch
#

Interesting, that clears up a lot

bronze yoke
#

generally if something can't be freely rotated in-game it is probably a sprite

random finch
#

I mean, I can just roll with textures rather than insiting on a 3D model

ancient grail
#

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

random finch
#

Mailbox has no collison irc but ill check

ancient grail
#

it has a broken sprite so i assumed so

true nova
#

only collision with cars i think

ancient grail
random finch
#

No collision with player or cars

ancient grail
#

for players thats different

random finch
#

Ahh wait

ancient grail
#

what do you intend to do

random finch
#

Im admin

#

mybad

true nova
#

well and they dont really touch i think it just breaks when you drive through it

ancient grail
#

it will all depend on what their goals are

ancient grail
random finch
# ancient grail what do you intend to do

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.

jolly goblet
random finch
#

In the future, so i dont cause confusion, how should I refer to 3D objects vs Sprite objects?

random finch
jolly goblet
#

that's how everything works. kitchens, stoves, microwaves, etc.

#

but weapons and flasks don't work like that.

random finch
#

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.

bronze yoke
#

i think they have a set up for that yeah

wide shale
#

That's fine. I just wonder if there is a function type that triggers on this event eating:
self.character:reportEvent("EventEating");

jolly goblet
wide shale
#

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

jolly goblet
#

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
wide shale
#

yes, but how should i overwrite this without messing the original code?

jolly goblet
#

Do you have the counter function created?

limber peak
#

Didnt know where to post this but Made my first Mode of PZ

jolly goblet
limber peak
true nova
#

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?

ancient grail
# random finch In the future, so i dont cause confusion, how should I refer to 3D objects vs Sp...

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

ancient grail
ancient grail
true nova
# ancient grail show code

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

fleet bridge
#

you need to add the item on the server as well

#

if you're adding it to a container

ancient grail
#

if its on the container then lect is right

fleet bridge
#

if its server run code, then AddItem would work iirc

fleet bridge
#

but if its client side, it's just gonna thanos out of existence because the item doesnt exits on the server

wide shale
true nova
#

i need to transmit every item?

ancient grail
wide shale
#

but i want to extend instead of redefine so the whole game wont crash on eating if i mess up my part

ancient grail
#

hooking is extending

wide shale
#

Oh

#

thank you

true nova
#

with what functions do i transmit an inventory item?

ancient grail
#

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

wide shale
ancient grail
bronze yoke
#

the only time this works is if the container hasn't been sent to the clients yet (so generally just the OnFillContainer event)

ancient grail
#

for taking items refer to gatcha mod
for spawning items refer to pack a punch

bronze yoke
#

managing containers on the server side is actually really annoying, the vanilla lua doesn't even do it at all

true nova
#

i assume addItemOnServer with item container

#

im working with a mod that supposedly worked server side, that is a lie

fleet bridge
grizzled fulcrum
#

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

bronze yoke
#

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

grizzled fulcrum
#

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

bronze yoke
#

i thought it did

grizzled fulcrum
#

also what does this mean in lotzed

#

lootzed

#

Generic02?

grizzled fulcrum
bronze yoke
#

that dropdown usually contains the different procedural distributions that can spawn in that container

#

might mean something different for corpses though

grizzled fulcrum
#

hmm ok

#

nevermind I know exactly why, thanks

jolly goblet
grizzled fulcrum
#

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.

bronze yoke
#

that would be an issue either way

grizzled fulcrum
#

it did not work though 😦

#

testing some more...

jolly goblet
grizzled fulcrum
#

hey albion. if I paste code into the lua console, does it need to be all on one line for it to execute?

bronze yoke
#

no

#

it also doesn't seem to respect the character limit when you paste (lol?)

grizzled fulcrum
#

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

bronze yoke
#

exiting the save reloads lua

grizzled fulcrum
#

and theres no way to execute code in the console in the menu 😭

jolly goblet
grizzled fulcrum
#

I just did 💀

dry lichen
# ancient grail show us the code you used that didnt work

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

maiden arrow
#

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

maiden arrow
#

Is there no delta time in the game or what lol

grizzled fulcrum
jolly goblet
#

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)
maiden arrow
#

¯_(ツ)_/¯

maiden arrow
#

rip

grizzled fulcrum
#

no clue if this is still relevant after so many years but

maiden arrow
#

Wild

#

Thanks for info tho

bronze yoke
maiden arrow
#

I see

bronze yoke
#

48 timed action ticks = 1 real life second with the default 1 hour days

maiden arrow
#

ah makes sense

#

I assumed it was 60

#

Thank you

bronze yoke
#

for some reason a lot of things in this game centre around 48/s, never been too sure why

maiden arrow
#

Quite the unusual number

jolly goblet
grizzled fulcrum
#

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"

bronze yoke
#

you trust chatgpt way too much lol

maiden arrow
#

Didnt he give someone a made up method earlier

#

I highly doubt chatgpt knows anything about modding pz

grizzled fulcrum
#

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

sour island
#

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

frank elbow
grizzled fulcrum
#

guess they added that since 2014 😂

sour island
#

I actually hate enums

frank elbow
#

Controversial

bronze yoke
#

what, why?

grizzled fulcrum
#

why? they're pretty useful for specific things

maiden arrow
#

Controversial indeed

grizzled fulcrum
#

like instead of using numbers, you can use words to represent hte numbers

#

magic numbers they call it

sour island
#

The only times I've run into them in PZ have caused issues cause they seem imutable (if that's the right word)

frank elbow
#

I would sure hope a constant is immutable

grizzled fulcrum
#

😭

sour island
#

This is why sandbox options require their own script to add more

frank elbow
#

I suppose I'd need to know what the issues were to really understand the aversion

sour island
#

And why I can't have dynamically generated sandbox options

#

Mostly this

bronze yoke
#

if they're immutable then scripts wouldn't be able to change them either

sour island
#

For EHE I had to write up each event's options

bronze yoke
#

i'm not sure exactly what you're being bottlenecked by there but it's definitely not enums

sour island
#

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

grizzled fulcrum
#

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)

bronze yoke
#

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

grizzled fulcrum
#

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

bronze yoke
#

why can't you resize it?

grizzled fulcrum
#

well I showed the wrong one before but anyway 😭

#

actually I guess you could resize this

maiden arrow
#

I hate oop in lua

grizzled fulcrum
#

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

bronze yoke
#

i know you can pre-resize an arraylist to avoid repeat reallocations, i'm not sure what its default policy is though

grizzled fulcrum
#

dam I always thought ArrayList was like array

bronze yoke
#

i was under the impression that arraylists basically behave as vectors though

grizzled fulcrum
#

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

bronze yoke
#

and scientists are still trying to work out why we called them vectors

grizzled fulcrum
#

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

bronze yoke
#

lol

bronze yoke
grizzled fulcrum
#

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

bronze yoke
#

zomboid pretty much uses arraylists for everything ever so i'd noticed they were resizeable

grizzled fulcrum
#

is it just me or does the log output look REALLY UGGGGLY

#

i want to switch to slf4j/log4j

#

SO BAD

ancient grail
ancient grail
gilded hawk
#

Has anyone tried to use lunarmodules/busted (lua busted) to write unit tests for pz lua mods?

frank elbow
#

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

wide shale
#

i have a question. does zomboid lua have a debug mode to enable for testing?

bronze yoke
#

yes, launch the game with the -debug launch argument

wide shale
#

i mean in lua script, like if debug then?

grizzled fulcrum
#

if you want to check if the player is in debug mode u can do getDebug() in lua

#

like if getDebug() then

limber venture
#

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.

ebon dagger
#

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?

limber venture
#

yea

ebon dagger
#

Ok, what you want is to look into FIRST, is how to make a context menu option.

limber venture
ebon dagger
#

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

random finch
limber venture
#

I think you're right.

grizzled fulcrum
ancient grail
# grizzled fulcrum Just one thing I will say, for the love of god don't use X format. Just stick to...

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

bronze yoke
#

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

grizzled fulcrum
#

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

bronze yoke
#

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

grizzled fulcrum
#

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 💀

bronze yoke
#

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

grizzled fulcrum
#

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?

spice python
#

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:

random finch
#

Where can I find a list of all vanilla ContainerTypes? I checked Java/Lua source.

random finch
#

Not exactly what I was looking for but could be related. However, they are defined in the tiledefinitions

maiden arrow
#

Getting a blender plugin for X animations would be really nice

ancient grail
#

first time happening to me what do i do ? it got stucked

ancient grail
#

its still stuck

#

i force closed it

#

hopefuly that wont be an issue

coarse sinew
ancient grail
#

apparently setVariable for custom animations doesnt work on SP???

grizzled fulcrum
ancient grail
spice python
gleaming wedge
grizzled fulcrum
#

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 😭

honest spade
#

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

spice python
ancient grail
#

does this function only captures moving objects?

getCell():getObjectList()    
    
spice python
spice python
honest spade
#

is there a trigger i can use so i dont have to check every second if the zombie is aggro or not?

gleaming wedge
spice python
gleaming wedge
# spice python 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

spice python
#

I wasnt aware until now, thank you

gleaming wedge
spice python
#

I am going to try to find my file with this info

gleaming wedge
#

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

spice python
quartz kindle
#

Looking to potentially commission someone for a project zomboid coding thing

#

Lmk if you're interested

mellow frigate
#

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 ?

red tiger
#

@quartz kindle Can't DM you but what is it?

quartz kindle
jolly goblet
mellow frigate
coarse sinew
# jolly goblet Does anyone have more details on how it works? I tried to use it but I got a lit...
ancient grail
ancient grail
gleaming wedge
#

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?

bronze yoke
#

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

gleaming wedge
#

yeah i suspected that, sigh... thank you!

wide shale
#

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?

bronze yoke
#

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

wide shale
#

does it show on the mod list if I put it in mods/ instead of uploading it in workshops/

bronze yoke
#

yeah, but workshop/ works too, just don't upload it

wide shale
random finch
#

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.

wide shale
tranquil kindle
wide shale
#

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)

tranquil kindle
#

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

wide shale
#

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()?

ancient grail
#

it conflicts

ancient grail
#

to add to player refer to this
client/ISUI/PlayerStats/ISPlayerStatsUI.lua

to create trait
client/OptionScreens/CharacterCreationProfession.lua

wide shale
#

thank you, it is to add to player

random finch
#

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.

ornate grotto
#

hey how do i apply a zombie scratch/laceration/bite to a player

#

with infection included

ornate grotto
#

on a random body part

wide shale
#

i think they are all in bodydamage

unreal copper
#

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

random finch
ornate grotto
#
                    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)

wide shale
#

how can i add an existing trait with player:getTraits()?

#

I am " " this close to the end to finish up 😄

bronze yoke
random finch
#

I used shotpart cuz i was looking at some code Ive written before but I think you get the idea

wide shale
bronze yoke
#

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/

random finch
#

Anyone know how to make worldobjects unbreakable via attacking by players?

coarse sinew
#

But it depends how you place the object. Is it moveable?

random finch
coarse sinew
#

It is always triggered when you place a moveable object, either in SP or as a client in MP.

random finch
#

I can start digging but off the top is this how moveables such as computers and TVs do this?

coarse sinew
#

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.

random finch
#

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

ancient grail
random finch
ancient grail
#

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

random finch
#

Yah, thats another question, how would you set its HP, but a non concern for me right now

#

How did you make it unsledgeable?

ancient grail
#

hook on destroy function

random finch
#

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.

ebon dagger
#

Is it possible to get the text from a piece of paper in game for use in mod code?

gleaming sorrel
#

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.

ebon dagger
#

C:\username\Zomboid\console.txt is the fire where you'll find the errors

gleaming sorrel
#

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.

fleet bridge
#

unless i'm wildly mistaken, just use zombrand

grizzled fulcrum
#

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)

bronze yoke
#

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

random finch
#

How does newrandom() run better? Performance?

bronze yoke
#

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

random finch
#

Welp, I'm about to go crazy with it. See how it feels when its constantly being called vs ZombRand.

bronze yoke
#

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

fleet bridge
#

Is it significantly better?

bronze yoke
#

i'll try and find my performance tests

#

i remember it being at least twice as fast

gleaming sorrel
#

Does anyone know any reasons as to why textures wouldn't be registered?
For some reason mine are invisible and I'm getting errors.

random finch
#

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.

bronze yoke
#

cache the object, not the numbers or anything

random finch
#

got yuh, got yuh

bronze yoke
#

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

gleaming sorrel
grizzled fulcrum
#

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?

bronze yoke
#

it's usually a matter of bit depth

#

pz doesn't like a specific one for some reason

#

i forget which exactly

grizzled fulcrum
#

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

ancient grail
#

wtf i didnt know there was another rand function

#

same way how to use? just different algo?

bronze yoke
#

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

ancient grail
#

we need more info
but usually
wrong folder structure
wrong directory
contains a file with syntax error
duplicated mod

bronze yoke
#

there's also rand:seed(n) to set the seed if you want deterministic random

ancient grail
#

did you configure the modinfo