#mod_development

1 messages · Page 191 of 1

sour island
#

The issue is if you need it to load after -- afaik there's no way to ensure your mod loads before another in code

quasi kernel
#

Agony

sour island
#

Would be nice though lol

#

You could I guess deactivate / reactivate the mod

#

If you can't manipulate the load order list directly

#

🤔

quasi kernel
#

Maybe

sour island
#

Out of the house all day, so I just have suggestions

#

No proofs from me 😅

quasi kernel
#

Hehe thas fair

limpid leaf
#

I'm trying to figure out how guns spawn for my own mod. I've noticed that a bedside table can spawn an m9 with mags and ammo, but in the loot tables the BedroomSideTable only has the handguns, not mags and ammo. Does anyone know where the logic for spawning the extra stuff is?

neon bronze
#

Distributions.lua i think its called

#

Its just tables upon tables where its determined how much it rolls for what items with corresponding chances

limpid leaf
#

Yeah that's where I've looked. There's one called ProceduralDistributions.lua as well and they both work together. One has the loot tables and one has how the containers use the tables if I understand it correctly. None of them reference mags and ammo when it comes to some containers that very much do spawn those items. So I suspect there's additional logic somewhere else

crystal terrace
#

and you're right both tables work together to spawn items

limpid leaf
#

Yep! I did some testing and they definitely spawn directly in the side table as well as in the gun cases

mellow frigate
#

Hello there anyone knows where I can find the icon for dead & zombified moodles

tiny karma
#

making a mod via Java drunk

bronze yoke
mellow frigate
#

I do not have any Moodles folder under ui ! what have I done (not a real question)

sour island
tiny karma
#

I have it legitimately working now that ss was from last night

mellow frigate
bronze yoke
#

i just copied it from statsapi, which just copied the reference vanilla uses, so i wouldn't know which texture pack it's in

mellow frigate
#

anyway thanx, the exact name helped

keen silo
#

@bronze yoke I'm working on adding voiceover to the Automated Emergency Broadcast system. The problem I have is that there are a lot of possible combinations for what is being said. Is there a simple way to say to project zomboid "Play this sound, then this sound then this sound"? or will I have to code it in LUA?

bronze yoke
#

you will have to code it in lua

keen silo
sour island
#

May not be that hard to do, as you can check if a certain sound is playing or not

#

Unfortunately there isn't a clean play in order feature - that I know of

covert summit
#

I'm making an add-on for More Builds Reloaded using Dirk and Dylan mod tiles. I think this is a useful thing, given that there are a huge number of different things that could be built using the resources of the original game. I would like to add support for Hydrocraft, but probably it will be superfluous.

keen silo
#

@bronze yoke do you know where the Dynamic Weather Station (Automated Emergency Broadcast System) lines are stored?

bronze yoke
#

no

keen silo
#

found it: DynamicRadio_EN.txt on lua/shared/Translate/EN

#

(will have to add [cdt] commands to the file though, but when I have the sounds)

sharp timber
tiny karma
sharp timber
#

i've launched the game in with -debug but idk the key to make that window show up

#

besides f11 for errors

bronze yoke
#

click the button that looks like a bug at the bottom of the top-left buttons

sharp timber
#

ded i see now

#

ty

sour island
#

Also happens to be self-updating if you're into that sort of thing, and have some useful snippets.

sharp timber
#

ooo, i will subscribe and try it out

#

will i be able to set moodle levels for the character

tiny karma
#

while LUA’s versatility, simplicity, and accessibility makes it a good language for modding, some stuff just doesn’t work due to the fact you are limited to a single threaded, interpreted, and loose programming language

fast galleon
#

But, just in case: you should know that we do plan to implement an anticheat solution like BattleEye at some point. The work done to streamline this for MP might not be usable in the future (or might be further set apart from the main audience of the game than even now).

https://theindiestone.com/forums/index.php?/topic/62821-modding-java-without-requiring-manual-install/&do=findComment&comment=375207

tiny karma
#

there’s ways to turn battle eye off

fast galleon
#

@quasi kernel
btw, have you checked the logs for file loads? It would be easy to see which file is loaded before a specific file in case it also requires the file you want.

quasi kernel
sour island
sour island
tiny karma
sour island
#

The unfortunate thing is something like that takes a lot more know-how.

fast galleon
sour island
tiny karma
quasi kernel
fast galleon
sour island
#

Probably actually

#

Yeah that is the one I was thinking of

tiny karma
#

Storm works by making the mods show within the in-game mod manager

fast galleon
quasi kernel
#

LGR technically doesn't.

#

It's starts with LG then does the farming part.

fast galleon
#

it does, Farming/

quasi kernel
#

I mean, sure, but wouldn't file load order still be taken into account?

#

Mine is similarly under Farming/

fast galleon
#

would help if you posted the logs

quasi kernel
#

Starts from farming_vegetableconf.lua and ends at LGfarming_vegetableconf.lua

#

Mine doesn't step in until later. Line is just..

LOG  : Lua         , 1692981116601> Loading: C:/Users/#####/Zomboid/Workshop/UltimateFarmingPatch/Contents/mods/UFP/media/lua/server/Farming/FarmingPatchconf.lua
tiny karma
quasi kernel
#

They both fall under a /media/lua/server/Farming/ path

karmic fog
#

I have a problem with the implementation of a backpack.

I made it a skinned model, placing the backpack on the right spot in the blender app. Parenting the bones, assigning all of the backpack vertices to the backpack bone.
Though, the game shows me this error. And I believe this small string of white and black is my backpack smushed together into a line

#

Does anybody know what hell im doing wrong? dead

sour island
#
  • a few new things like an inpsect panel that displays modData and java fields for the object
fast galleon
#

It seems like his file overrides are loaded together with vanilla files and LeGourmetRevolution/media/lua/server/Map/MapObjects/MOFarming.lua might require LeGourmetRevolution/media/lua/server/Farming/LGfarming_vegetableconf.lua

karmic fog
#

One problem though!

I have the model referenced in the script, and made an FBX file for it too. Yet it drops with its icon, not the worlditem model.
I don't have it referenced anywhere else, but I don't see where I should pika

#

Though, eh.. Is this the chat for it? It's the implementation of it, but not the modelling itself - Does it still go to #modeling?

sour island
#

Well you're here - so I can say you need a model script afaik

karmic fog
#

A model script?

#

Ah, damn. I think i know what you are talking about

#

You mean this, right?

karmic fog
#

Do I need the same model thingy for making them equipable by hands?

#

Hold on, I'll just take a look on how other mods do it nodding

trim mist
#

Do you think that there's a way to mod player models to be more dynamic? Like if you have a certain amount in strength your arms/chest get bigger, or vice versa

#

I feel like that might be a java mod thing

keen silo
#

nvm found it, it was with f11, errors :p

#

Does anybody know the temperature range in game?

I need to record every possible number from negative to positive with celcius and farenheith

#

like 21.1 C, 21.2C, 21.3C etc

quasi kernel
tiny karma
#

oopsies

quasi kernel
#

@fast galleon You were right. It was required in that map file.

#

Now it's a matter of figuring out how to load before it

sour island
#

Load the other mod before or your own?

#

If you want to load something else first require does that

weary knoll
ornate field
#

I'm making a profession mod, how do I add items to the player's inventory on spawn?

mellow frigate
trim mist
lavish shadow
#

Hi if anyone is interested i would pay for someone who would make me a private mods of a Chevrolet Aveo5 2007 :)) (would be for me and my wife to play with our car ingame)

ancient grail
mellow frigate
chrome veldt
#

Hey guys, I'm not sure how modData works, can you create world modData? Like each world has its modData

drifting ore
#

How does the run speed modifier work

#

On clothing

mellow frigate
drifting ore
#

so it does not matter what it is on jackets

#

does not change

vagrant valley
#

Combat speed works i think

#

But even that seems contentious

chrome veldt
#

Yes, thanks, I tried before but was using ModData:get() instead of ModData.get() ^^'

drifting ore
#

is there some easy way to make your own jacket textures

drifting ore
#

can you reload textures in game?

jolly goblet
#

Hi everyone, I have a question.
I have a map and I want to set an element to a specific location.
For example a note above the table, how do I do that?

vagrant valley
#

Hello

#

Is there a possibility to randomize the results from crafting something?

vapid escarp
#

hello everyone

#

im trying to make a mod where a player can spawn in st. peregrin hospital in lousiville as a patient.

i got the spawnpoints down, and a function that removes all clothing and items and put on a hospital gown. but i want it so that when a player spawns ONLY in the hospital, it will call that function.

however, i have absolutely no idea on how to code. ive been just reverse engineering other mods and using chatgpt.

i also added a trait "Injured". just like what it says, a player will spawn in injured with fractures, scratches, bandages, and splints. yet again, i don't know how to do that.

boreal rose
#

so if I were to say, double the door damage of all vanilla weapons in my mod, would I simply (through all the correct directories), have a item_weapons.txt file, which I assume would replace items_weapons.txt with a modified copy?

drifting ore
#

How do i fix the sides of the collar

hushed hill
#

is a .dae file important for putting a model into mods

#

or is the .fbx file only needed

drifting ore
#

.fbx

#

No .dae

hushed hill
#

if my fbx model already has textures do i still need a seperate folder for the clothing

drifting ore
#

What do you mean by that? Do you mean do you still ned a texture file?

hushed hill
#

yeah

drifting ore
#

I think the answer is yes and also the model should have no texture

#

So you will still need a texture png

hushed hill
#

well do the textures have to be combined into one png

vagrant valley
#

The game will not read textures save in fbx

#

You need a separate texture file

#

And in their own folder

hushed hill
#

but do the textures have to be in one file

#

or does the game read seperate files

drifting ore
#

Do you mean like multiple textures in one png?

hushed hill
#

yeah

drifting ore
#

I dont think thats possible

#

I am pretty sure you need for each

hushed hill
drifting ore
#

one png

hushed hill
#

so i dont need to put the textures in one png

drifting ore
#

Yea you dont you need a seprate png for each texture

#

so if you have jacket and hat you make hat.png which is its texture and jacket.png

#

so not one png

hushed hill
#

like a path for every part of the mesh to their textures

drifting ore
drifting ore
hushed hill
#

im trying to say that i want to put a model into the game and turn my character into that model

vagrant valley
#

Change some stuff here and there

drifting ore
#

Yea i figured just dont know which part to texture on the png

#

I tried the whole collar but it did not help

drifting ore
hushed hill
#

yeah but like make it a fullsuit

drifting ore
#

Oh well i dont know anything bout changing the char model sorry i only added clothing and stuff like that

hushed hill
#

since coding isnt really my thing

drifting ore
#

this is a good guide

#

its on web archive cus it was removed

hushed hill
#

oh

#

does it include fullsuits

drifting ore
#

They only showed how to add a jacket but i would assume the process is simliar

drifting ore
hushed hill
#

well

#

incase that guide sort of helps

#

is there anybody in the server whos fond of dealing with models

#

and making mods

#

about models

drifting ore
#

idk which channel tbh is better that or this

boreal rose
#

hm. I uploaded a mod to the workshop, I subscribed to it, but it doesn't seem to appear in my ingame mod list.
Is this due to the waiting period of it being processed for verification?

hushed hill
#

its probably downloading

#

is the mod big like brita's armor pack

boreal rose
#

no

#

it's just a script text file

hushed hill
#

did you try resubscribing

boreal rose
#

I simply just made the saucepan deal 9999 damage to doors to see if that would work by changing that value to 9999 and then uploading said text file within all the correct directories

#

then uh went and submitted it

#

anyway yea I'll try doing that

hushed hill
#

if resubscribing doesnt work its probably going through what you suggested as verification

boreal rose
#

yeah

#

that would make logical sense

#

This is how the directories are supposed to be done right?
(for submission via the workshop tool ingame)

hushed hill
#

uh

#

i think its supposed to be an xml file but i dunno im just starting to mod

boreal rose
#

Ah well

#

I noticed for a mod that only needs to adjust an items stats

#

I looked at another mod as to how they did it

#

a mod called "double durability" and it does essentially the same thing I did

hushed hill
#

did you code it to change the sauce pans durability

boreal rose
#

anyway this point is kinda moot since the mod doesn't even show up for selection to be loaded ingame anyway

hushed hill
#

and also since youre looking at other script mods does the directory follow the other mods directories

drifting ore
#

I havent uploaded a mod yet only working on one but if your uploading it from the game i dont think it needs that structure i think only the second and ofc its sub contents SaucepaDoorBreaker

#

So you would drag that one into your mods folder in the user dir and then load the game and then upload

hushed hill
#

whats a fileguidtable.xml

boreal rose
#

this was basically a modified Mod Template but instead of it going to maps it went to scripts for item_weapons.txt

#

anyway this point is moot until I see my mod (which is presumably still in verification)

#

once I do see that it works, then I can move on to other silly item stat edits

drifting ore
hushed hill
#

whats a guid

#

and how do i make a guid

drifting ore
#

GUID (aka UUID) is an acronym for 'Globally Unique Identifier' (or 'Universally Unique Identifier'). It is a 128-bit integer number used to identify resources. The term GUID is generally used by developers working with Microsoft technologies, while UUID is used commonly used elsewhere.

hushed hill
#

does the game need a guid to make the mod work

drifting ore
#

From what i know so far i know that clothing items do need them

#

so yes

boreal rose
#

if I ever get indepth into modding I will probably try some other things
Like making the composter also able to compost non-rotten foods

drifting ore
#

You could probably do it

#

Even now

hushed hill
#

to be honest with you all i just wanna add kazuma kiryu into project zomboid

boreal rose
#

ends up messing up and somehow makes all items in the game that doesn't have a rot tag compostable

#

well I'll get there

#

eventually

hushed hill
#

good luck to us both

boreal rose
#

yes

drifting ore
#

I am pretty sure it would just be 2/3 lines

#

by removing the check if the food is rotten

hushed hill
#

do people who mod use free models in mods

drifting ore
#

Only clothing

drifting ore
hushed hill
#

then how does satispie do it

#

i look up to that person

drifting ore
#

who is that

hushed hill
#

person who puts character models into fullsuits to use in project zomboid

drifting ore
#

Oh i see

#

You could get one of his mods and follow what he did

hushed hill
#

i started playing project zomboid a week ago so if theyre controversial its not on purpose

#

i did

#

i got 3

drifting ore
#

got 3?

hushed hill
#

yeah

#

3 mods

drifting ore
#

oh

#

you did follow structure?

#

i mean you just need to follow it and then replace the models, textures and rename stuff in the scripts if you want to do it like he did

hushed hill
#

well

#

the problem is

#

he uses guids

#

and im not into coding

#

so i copied the folders

#

and im here because

#

i dont know if i should put multiple textures into one png like they did

drifting ore
#

can you screenshot the png when u open it?

hushed hill
#

my model has 29 textures

#

sure

#

heres smasher from cyberpunk

#

heres ghost

drifting ore
#

okay

#

well if he did it like that just replcae the textures in the png too

hushed hill
#

and heres leon

drifting ore
#

yea just replace each texture in that file then

#

with your own

hushed hill
#

i dont know what the px size should be when putting it there

hushed hill
hushed hill
#

and i have to choose which one i should replace

#

and also my model has source pngs

#

like the whitish crystal purple images that probably form the mesh

drifting ore
#

Hmm yea idk sorry i think it would be best if you just dmed him or i guess wait for someone who knows

hushed hill
#

i dont know what satispies profiles are other than steam

drifting ore
#

Yea trying messaging him on steam

hushed hill
#

hes also the guy who made easily find the key

#

or girl

boreal rose
#

I think I found the issue about why it isn't appearing for me, and it was because I forgot to change the mod id

boreal rose
#

At the very least, it appears as a "local" mod now that I can load

#

that's probably why the workshop one hasn't shown itself

drifting ore
#

do you have one in the user dir?

#

a copy of the mod folder

boreal rose
#

it works now pog

#

all doors now fall to the mighty saucepan

drifting ore
boreal rose
#

now the question is if other people can actually see it and load it in game

#

I got some friends who I'll ask to try...

drifting ore
#

I can test

boreal rose
drifting ore
#

it will but i found it already

boreal rose
#

if it doesn't load in game...well I'll sleep on it and check what's wrong tomorrow

#

I can confirm the mod does show up for my friends so that's nice
Now he just has to find a saucepan ingame lol

#

he's new to the game so it might take awhile to get one :/

drifting ore
#

Il test it rn now sorry i had to eat

hushed hill
#

search a kitchen

drifting ore
#

il spawn one in

boreal rose
#

yeah

hushed hill
#

also frosty in testing out what you said about the copying the textures

boreal rose
#

okay

hushed hill
#

im*

boreal rose
#

you don't need to test it frostyy

#

my friend found a saucepan and broke a door instantly lol

drifting ore
#

ah lol

boreal rose
#

this is a good step

drifting ore
#

nice good to hear it works

boreal rose
#

now to actually test some silly stuff

#

I wanted to experiment with changing the range of weapons

#

and other stats

drifting ore
#

yea would not be too hard

boreal rose
#

and test if say, I have this mod before the load order of another mod that doubles the durability of all weapons, would the default door damage stat in their items_weapons.txt file override mine

#

should be simple to test

drifting ore
#

i think you needd to load other first

#

then your last

#

so it overrides all the others

#

or idk

#

tbh

boreal rose
#

but then if that's the case, wouldn't my default durability values override their mod
Anyway, easily solved with a bit of testing
If it does override, seek solutions that may just mean changing it to be a lua script that specifically targets the stats of items or something idk

hushed hill
#

does this work

drifting ore
#

i think it would as long as the textures are correct

hushed hill
#

the shirt and pants are combined into one image in the original file

#

whats the fbx inside this file for

drifting ore
#

for ground items etc stuff like that

#

but not the stuff you wear

hushed hill
#

do i need it

#

like important

#

even though i want it to be in the crafting menu

mellow frigate
drifting ore
#
    FirstAidKit = {
        rolls = 1,
        items = {
            "AlcoholWipes", 50,
            "AlcoholWipes", 20,
            "AlcoholWipes", 10,
            "Bandage", 50,
            "Bandage", 20,
            "Bandage", 10,
            "Bandaid", 50,
            "Bandaid", 20,
            "Bandaid", 10,
            "Coldpack", 10,
            "CottonBalls", 10,
            "Disinfectant", 10,
            "Scissors", 10,
            "SutureNeedle", 50,
            "SutureNeedle", 20,
            "SutureNeedle", 10,
            "SutureNeedleHolder", 20,
            "Tweezers", 10,
        },
        junk = {
            rolls = 1,
            items = {
                
            }
        },
        fillRand = 0,
    },

What doe the numbers next to the item names mean?

remote sonnet
#

Spawnchance out of a 100

drifting ore
#

ah so anything 100 or above meants it will spawn 100%

vagrant valley
#

Rolls is how many times that probability will be done

drifting ore
#

thanks guys

remote sonnet
drifting ore
#

yea i saw that one

#

i also have another question releated to textures

remote sonnet
#

Well shoot.

drifting ore
#

i made post actually before

#

but yea thats the question

remote sonnet
#

Ah well I can't answer that. Hope someone else can! 😄

#

My attempt would be to look at some original files and see how the pz guys did it.

drifting ore
#

I did and its all the same

hushed hill
#

hey guys

#

good news

#

its in the game

#

i can see the mod

#

but

#

bad news

#

the model didnt load in

#

what should i do

mellow frigate
hushed hill
#

oh wait just refreshed

#

my browser said it redirected too many times

mellow frigate
#

steam warns for external redirection, just read their messages.

vagrant valley
#

Is there a possibility of randomizing the results you get from recipes?

hushed hill
#

probably a mod does

drifting ore
tardy wren
#

Hello, I crave a sanity check

#
player:getInventory():AddItem(item:getModData().ropeItems or "Base.Rope")
sour island
tardy wren
#

This line should add whatever item is stored in the ropeItems table of the items modData, or if there is none, a "Base.Rope"?

drifting ore
#

Hey Finn I have a question

sour island
#

If the condition meets the result using condition or default is fine

#

So what you have should work as long as .ropeItems is only ever set to a string or nil

tardy wren
#

Okay, thanks

#

I wanted to write a quick nullcheck to make sure my items spawned in via cheat menus will still work

drifting ore
vagrant valley
#

It has to be 100 or less

#

It's a percentage

drifting ore
#

Other stuff has 200 in the file too

#

And it spawns always

sour island
#

I think firstaidkits have a special case check for item types

#

I faintly recall seeing that when rooting around stuff

drifting ore
#

How can i allow it to spawn

sour island
#

Uhhh I would have to check what's happening internally

vagrant valley
#

Try using a different container

tardy wren
#

string.find(itemType, "[bB]ucket")

sour island
#

If it's despawning or preventing the spawn on creation you'll have to tie into onFill events and make sure it only fires once

tardy wren
#

This should return true whenever ItemType contains the word bucket regardless of casing, right?

drifting ore
sour island
#

It would be java stuff misread, sorry

#

You would use Events.OnFillInventoryContainer.add()

#

And you can tack on a modData value to the item so it's only ran once

tardy wren
#

Help me I am going insane over a bucket

sour island
tardy wren
sour island
#

I would use lower() if if were me

drifting ore
sour island
#

You can find uses in the vanilla files

tardy wren
drifting ore
#

Do you know in which file i can find the use of that function

tardy wren
#

Btw, any way to check an item's mod data in-game? Besides printing, any usable mods?

sour island
#

Current Lua is 3.5

tardy wren
#

...you meant 5.4.6?

sour island
#

Yes lol sorry 5.1 then, the current Lua was 5.3 - when did 5.4 come out?

#

Or maybe I'm misremembering and the current KahLua is 5.3, and PZ uses a modified older one that used 5.1 🤔

#

Point is, there's a few sleeker features not present

tardy wren
#

Well, I've looked up the reference manual for 3.1 and it had the same pattern matching so I think I am good

sour island
# drifting ore Finn

Not off top of my head, I would recommend if you're not already, to use an IDE so you can parse the files easier

#

Maybe check out one of the decompilers

drifting ore
#

I am using VSCode

sour island
#

Do you have the install directory decompiled? You can parse around and learn a lot from the java

drifting ore
#

Nope I dont

#

wait im stupid

#

i think i found the reason

tardy wren
#

Am I trying too hard

#

I'm trying to maintain compatibility with unknown modded buckets

drifting ore
#

@sour island I fixed it

sour island
tardy wren
#

It doesn't even exist in vanilla

sour island
#

Oh then... Like...

#

You're offering potential support to other mods - can't really predict items

#

You could use name but then you'll grab stuff like "bucket hat"

drifting ore
#

Finn do you know textures and stuff

tardy wren
#

Well, if said bucket is waterproof...

#

Anyway... I'll leave it at that

ornate field
#

How do I make it so that if I choose a profession it gets to pick an exclusive trait only available to it?

drifting ore
#

I mean I guess you would give it when they pick it so something like lumberjack

#

So there is no need to be avaible to pick part

ornate field
drifting ore
sour island
drifting ore
#

Like good with them

#

And stuff releated to them

sour island
#

I've studied art, but not really 3D computer stuff - my goto method is hammering something until I don't hate it

drifting ore
#

I am having an issue with one

sour island
#

#modeling may be better at helping with the technical aspects

#

But I can give an opinion if you show a screenshot

#

Oh you already posted there - looks like the UV map for those edges gets a bit wonky

#

I had some issues lining stuff up on the mr.X spiffo due to this - I'm not sure how to overcome that short of trial and error

#

You could grab another clothing item and if the texture is the same and it has a collar maybe try to match it - looks like it's getting stretched around the neck area and some of your details aren't even on the UV

drifting ore
covert summit
#

Can someone explain why, when viewing the pak file from the Dirk tile mod, I see an object such as storage_ddd_01_30, or 01_38, but they are missing in the world_filler file. Why?

#

There is shelves in a pack file without line in worldfiller. Is it normal?

sour island
#

So dropping the color count to 6 did not help the compression issues

#

Not sure why getTexture() does this 😦

true nova
#

when using your method of hiding the recipe it still shows up in the crafting menu if i set is hidden to false in the recipe scripts, it also doesn't show in the craft menu at all if it's true. is there a way to make it not show in the menu at all if it's set to hidden through the sandbox options?

sour island
#

Also it's almost non existent with the boards but there is some color compression - and those only have 3 colors

fast galleon
#

if you need to reverse it use if not option then and the script should account for the default behaviour

true nova
# fast galleon it applies when you load the save

ok so if i use the sandbox options to set the recipe to hidden and its set false in the scripts it will still show up upon loading the game likely because sandbox loads after items, but upon reloading the game they will become hidden?

sour island
#

Oh, there's a texture compression option - I feel like I never noticed that 🤔

fast galleon
#

I used IsHidden:true, in my scripts

sour island
#

Yep, that was it - texture compression was the issue - but why is it hammering these texture so hard?

fast galleon
#

as I said before, it might be safe to load a file with recipe scripts instead, just don't use that method with item scripts.

drifting ore
#

table.insert(ProceduralDistributions["list"]["ArmyStorageOutfit"].items, 8);

does this mean the chance to spawn is 1 in 8?

bronze yoke
#

8% base chance

drifting ore
#

i mean would that be really rare or

bronze yoke
#

default loot settings reduce that by a further 60%, but the zombie density of the area increases it, so there's no exact value

#

best to just judge it based on the chances of other items

drifting ore
#

where can i see them

bronze yoke
#

server/Items/ProceduralDistributions.lua

true nova
# fast galleon The event that I use applies when you load the save, if you change the options w...

I'm testing in mutiplayer and when setting isHidden:true and then setting items to not be hidden with sandbox options before starting the game they do not show in the crafting menu at all. they do still show in the context menu on the crafting items in inventory, despite reloading the game to see if that would change anything. If i set isHidden:false then they show in crafting menu but any that are set to be hidden in options are still there but greyed out and not craftable.

fast galleon
#

@true nova
add prints

it's likely that the recipes aren't found, try printing them from console. If there are multiple recipes with same name then you need a different approach, loop through all the recipes.

context menu is affected by the canPerform function I mentioned before.

ocean coral
#

Does anyone know if there is a way for me to turn chunk_data from a map on my hosted world into a mod to upload to steam workshop? We're trying to move a mansion I built but when we directly transferred the chunk_data to the server it broke so many different things so I'd like to try it as a mod instead. Weird part about the situation though is when I direct transferred to a separate hosted world of my own it worked just fine.

drifting ore
#

When i put on my custom boots my char becomes this

true nova
true nova
#

that was it and i was actually using my item names which is weird that it worked anyways. thanks for the help!

weary knoll
cinder oyster
#

Is there a name for the filetype for most of the 3d models that modders make their clothes in? If I wanted to import an X file into blender to do some retextures, would I need a plugin for it?

keen silo
sour island
#

Not out yet

keen silo
#

looks pretty cool

sour island
#

ty

keen silo
#

I suppose it would have support for multiplayer, right?

sour island
#

I have not tested it- but yes

keen silo
#

this is a question kinda far into the future, but would you consider adding an AI addon? that uses either the future NPC update once it's released, or requires current Superb survivors mod?

sour island
#

For this mod?

dim coyote
#

Hey folks, just looking for some people to play with.

keen silo
#

I gather the mod itself would be just the games

sour island
#

Yes, I don't really think making AI players would be all that fun tbh - and pretty limiting

keen silo
weary knoll
sour island
#

I blew up the models and then smoothed their edges - unless you mean the faces being in pain

true nova
# sour island

that's awesome i dont think ive seen that so i wouldnt have made the connection. Love your mod insert in the top of yours

jolly goblet
#

Hi everyone, I have a question.
I have a map and I want to set an element to a specific location.
For example a note above the table, how do I do that?

#

The idea is that when players enter the map they can find certain clues and items that will help it continue as a story.

ancient grail
#

Can someone help me with logic
The thing i must do is this

Player die once they respawn in safehouse

Player die again within 12hrs
Wont

#

How do i set the moddata of the player

ancient grail
#

?

#
    local sq = getCell():getGridSquare(7098, 8369, 0);
        sq:AddWorldInventoryItem("Base.Plank", ZombRand(0.1, 0.5), ZombRand(0.1, 0.5), 0);

this is from vanilla

ancient grail
true nova
#

timeOfDeath i would think. i cant find its class anywhere but it appears to be used at the postdeath screen i think to time skip

#

theres also getTimestamp() which is an actual function that returns the time when it's called

ancient grail
#

Thank you i will look into it

sonic needle
#

yeah i forgot i can do it myself lol

#

@sour island do iiiit

ancient grail
#

does the player moddata get transfered to the new player created? cuz iirc it will only stay on the corpse then transfer to the zed if it becomes zed

bronze yoke
#

no

muted garnet
#

How can I add bloodiness to the instrument in hand and certain items of clothing in the perform function?

hushed hill
#

whats static

jolly goblet
#

Hey guys... How use addZombie()?

true nova
jolly goblet
# jolly goblet Hey guys... How use addZombie()?

I have this function but, not work for me... 😦

    local cell = getCell();

    local x = 3145;
    local y = 7223;
    local z = 0;

    local square = cell:getGridSquare(x, y, z);

    addZombies(square);
    print("-- ADD ZOMBIES");
end```
muted garnet
true nova
true nova
verbal yew
magic nymph
#

Does anyone know how to view certain tiles from the game file? Something like d_plants_1_38

#

or maybe someone exstracted all the tiles and posted them on a website?

hushed hill
#

my mod doesnt appear when i search for it in the hat or helmet list

hollow current
#

Hello! So, I am trying to block the player's ability to do anything within my code. I was succesful in implementing that in a previous mod using a timed action and by using

self.action:setBlockMovementEtc(true)```

In the mod I am currently working on, I don't use timed actions, so I just use

```lua
character:setBlockMovement(true)```

While this does block the player's movement, it still allows him to do other actions like manage inventory items, smoke, use weapons, etc. Is there a way to totally block his ability to do such things without having to use timed actions?
sour island
hollow current
sour island
#

How large is the mod?

ancient grail
# hollow current Hello! So, I am trying to block the player's ability to do anything within my co...
local function disabler(player, bool)
    player:setIgnoreInputsForDirection(bool)
    player:setAuthorizeMeleeAction(bool)
    player:setIgnoreMovement(bool) 
    player:setCanShout(bool)
    --player:setZombiesDontAttack(bool)
    --player:setAvoidDamage(bool)
    player:setBlockMovement(bool)
    JoypadState.disableClimbOver = bool
    JoypadState.disableSmashWindow = bool
    JoypadState.disableReload = bool
    JoypadState.disableGrab = bool
    JoypadState.disableInvInteraction = bool
    JoypadState.disableYInventory = bool
    JoypadState.disableControllerPrompt = bool
    JoypadState.disableMovement = bool
    ISBackButtonWheel.disablePlayerInfo = bool
    ISBackButtonWheel.disableCrafting = bool
    ISBackButtonWheel.disableTime = bool
    ISBackButtonWheel.disableMoveable = bool
    ISBackButtonWheel.disableZoomOut = bool
    ISBackButtonWheel.disableZoomIn = bool
end

Hi bud hope this helps you somehowmaybe just pick a few of those to disable or all of em

hollow current
hollow current
ancient grail
manic relic
#

question, what position does a melee weapon need to be to show up correctly?

#

I rotated the model 180 degrees because the survivor was holding it backwards and now.... well it explains it selfe

#

and the blender view

hollow current
ancient grail
cinder oyster
manic relic
#

hmmm

#

that does make sense in a way

#

Thanks :D

manic relic
drifting ore
#

Whats the attechment type in items

hollow current
#

@ancient grail By the way it still allows for interaction with inventory items, as well as health interaction (bandaging wounds, etc). Those are two major issues, any idea of a function to disable those?

ancient grail
#

you could force close the menus tho

hollow current
#

if I can just disable the ability to do stuff within those menus, it'd be way better than force closing the menus

#

also some functions within this function use "not bool" instead of "bool", thought i'd let you know in case something isn't working correctly with you

atomic crow
#

This might be an odd request, and unfortunately I have no experience on the code side of zomboid modding, but would anybody know how to make a patch for Noir's Rifle Slings to change the amount it reduces the attached weapon's weight and also allow the player to wear more than one of the slings?

ornate field
#

local function getsword(player)
if player:HasProfession("sworduser") then
player:getInventory():AddItem("WazuraWeapons.CuttingJian");
end
end

Events.OnNewGame.Add(getsword);

Does anyone know why this isn't working?

faint jewel
# manic relic

remember to ALWAYS reset your transforms before exporting (Ctrl+A -> all transforms)

manic relic
#

I did that, dont worry

#

just had to find the right position

drifting ore
#

is this the right way to add multiple items

table.insert(ProceduralDistributions["list"]["BarShelfLiquor"].items, "Item", "Item", "Item");
ancient grail
drifting ore
#

i can only add a single item like that yea?

ancient grail
#

you can create tables if you want

#

as reference


require "Items/ProceduralDistributions"
 
local stuff = {
    {item="Base.MortarWeapon", location="ArmyStorageGuns", rate=0.4},
    {item="Base.MortarWeapon", location="ArmySurplusBackpacks", rate=ZombRandFloat(0.1, 5)},
    {item="Base.MortarWeapon", location="ArmyStorageGuns", rate=0.4},

    {item="Base.MortarRound", location="ArmyStorageAmmunition", rate=5},
    {item="Base.MortarRound", location="ArmySurplusMisc", rate=1},
    {item="Base.MortarRound", location="ArmySurplusBackpacks", rate=0.4},
    {item="Base.MortarRound", location="ArmySurplusTools", rate=0.3},

    {item="Base.RepairKit", location="ArmyStorageAmmunition", rate=2},
    {item="Base.RepairKit",location="ArmyStorageOutfit", rate=1},
    {item="Base.RepairKit", location="ArmySurplusBackpacks", rate=0.2},
}

for k, v in pairs(stuff) do 
    if isDebugEnabled() then    
        print(stuff[k].location)
        print(stuff[k].item)
        print(stuff[k].rate)
    end 
    table.insert(ProceduralDistributions.list[stuff[k].location].items, stuff[k].item)
    table.insert(ProceduralDistributions.list[stuff[k].location].items, stuff[k].rate)
 end 
manic relic
#

so the mod is working now

#

like it should

#

but everytime I hit an zombie / get blood on my axe

#

the axe head just turns red

#

funny thing is, the handle works like it should. With blood getting on it and not just turning red

#

( sorry if the pictures aren't the best)

#

any way how to fix this?

#

I dont really know what could cause something like this

cinder oyster
manic relic
#

:D

cinder oyster
#

alr so with the blood

#

I'm really not sure

#

I didnt get that far

#

Maybe the actual texture for the head of the axe is too small and the blood just covers it because it is a much bigger texture

bronze yoke
#

sounds like a uv issue

drifting ore
#

How the hell do i make a t shirt there i cant find a model for it

manic relic
#

and the head model aswell

#

might look at the uv again

atomic crow
#

Okay what I'm attempting to do has suddenly gotten a bit more complex, I found another mod that did part of what I wanted, that being further reduced encumbrance of items on hotbar slots, however the other part seems a bit more difficult, or at least confusing, that being that I'm trying to allow players to wear multiple of the item at a time by creating more slots for it to be worn in. Now hopefully that's as easy as doing several more get or create location lines with slightly different variable names, but if it's any more than that I wouldn't know where to start.

limpid leaf
#

So I started tweaking Firearms B41 a couple of weeks ago and it has snowballed into redoing pretty much everything from scratch. One things I'm stuck on is how to stop a vanilla item from spawning. Hyzo made the MSR788 into a rifle that irl has an integral magazine. So the vanilla .308 magazine is not needed. Is it even possible to stop it spawning from the mod?

ancient grail
limpid leaf
#

To use the magazine again? Sure I could, but that seems like the easy thing to do :P

sour island
#

Not sure if using both conflicts - but you can also tap into the scriptmanager to make those items obsolete/hidden

#

Actually, seems lke you can't set these in lua - that'd be only recipes

#

I do think you can just overwrite the script though and add them there

limpid leaf
#

I think just renaming the item and adjusting it to use the mag again is the way to go then

slow graniteBOT
#
gvtted has been warned

Reason: Bad word usage

sharp minnow
#

I’ve been trying to wrap my head around the climate manager, does anyone know how to turn the weather off?

And with daylight - is this also managed by the Climate manager? There’s multiple entries for some of this stuff in the code docs.

crystal terrace
#

didn't really used it so far but i would also suggest looking at weather stuff in debug mode, try tweaking those settings and see the effects in-game. Gives you some insight on what's what.

sharp minnow
#

Thanks. I thought i’d managed to sort it by running some disabling commands. Maybe I’ve got some errors in my code or something.

true nova
sharp minnow
#

Nice. I think those are in my code that i’m using- I might just have messed it up so it no longer works. I’ve been having issues with fog but I need to double check those snippets. Thanks guns!

slow graniteBOT
#
ozz_24 has been warned

Reason: Bad word usage

true nova
slow graniteBOT
#
tico.w has been warned

Reason: Bad word usage

sour island
#

What is going on with all the warnings

#

Anyway, anyone well versed in client/server commands know if it is worth me concating strings into 1 big string to send over rather than a table of values?

#

I'd split the bigger string on the client side

#

This would be used for displaying other player's cursors in real time - so I'm a bit concerned over performance lmao

atomic crow
#

Question: can a clothing item have more than one bodylocation assigned to it?

trim mist
#

I'm trying to do exactly this but i'm struggling on how to write the for loop

#
for x = 0, x >= objects:size()
  do
#

except :size() doesn't return anything

#

I've been banging my head against this for an hour

trim mist
bronze yoke
#
for i = 0, objects:size()-1 do
#

you don't need to include the actual comparison in lua

#

or rather it's incorrect to do so

#

so it's likely trying to do null >= objects:size()

#

either that or it just does 0 >= objects:size(), and then it'll just try to compare a number to a boolean each loop

cobalt fiber
trim mist
#

wait reALLY?!

#

that would explain. so. so much. about my repeated difficulties with for loops

vagrant valley
#

Can you use random numbers in recipe scripts?

trim mist
#

lmao. sorry for the frustrated tone. Thank you two. I was gonna come back and edit that for clarity after I sat down and combobulated

cobalt fiber
vagrant valley
#

Ah good

#

What about recipes that use multiple items, but have different recipe results depending on those items

true nova
# vagrant valley Ah good

the simplest way id do that is writing multiple recipes with the same name. you can also use lua with oncreate to check for items change the results depending on what is put into it

vagrant valley
#

Will the recipes merge together or be separate with the same names?

true nova
#

they stay separate so i suppose if you had multiple on the same item it would show double the recipe. Id suggest writing a lua function.

vagrant valley
#

How would the lua function look like?

crystal terrace
#

Prolly like any other function that can generate random numbers

vagrant valley
#

I mean the multiple recipe thing

#

I dont want to bloat the crafting menu so much as it already is

atomic crow
vagrant valley
#

You have to make a separate item for it

bronze yoke
#

didn't see your question earlier, no that should not happen

atomic crow
#

Ah, that's a shame really, makes things far more complicated for me.

vagrant valley
#

I have practically no lua knowledge

#

So it's kinda confusing

#

I do know python

atomic crow
#

I'm just trying to make it so a player can wear multiple of a specific clothing item at a time...

#

I thought I'd found a simple solution but I clearly didn't understand the limitations of the code enough to even manage that much.

#

If anyone would be willing to walk me through this it would be greatly appreciated, I'm just trying to edit a mod to suit a specific desire, I don't need to understand the entire code, just the bits that concern what I want.

median mantle
#

Use setMultiItem in BodyLocationGroup

ancient grail
#

I did the mod its done
And i hadnt had any help whatsoever
Polt, albion

Its normal to ask for help but doesnt mean im asking people to do the mod

Pls stop convincing people false information

Enough is enough already

true nova
# vagrant valley I have practically no lua knowledge

look through the pz wiki page on scripts it covers how all script functions work as well as examples for lua code. Other peoples mods are a good source of examples as well if you find one that does something similar. I don't know exactly what you are trying to do but you are going to want to use the OnCreate function in your recipe script followed by your lua function name and then in your lua file make a function that uses a for loop to check the player inventory and if it finds the items you want for the recipe then add the result items to their inventory and remove the consumed items from it.

vagrant valley
#

I think i'll look into recipecode.lua and other mods for it, thank you for your help

true nova
crystal terrace
# vagrant valley I have practically no lua knowledge

oki so from what i understand you want to generate a random number and use that in your recipe or something like that? The trigger everyone's talking about onCreate is gonna call your lua function right. It's just a function then whatever you wanna do there or if you wanna return something or not(not sure if you can pass params to it refer to onCreate usage in vanilla files) . Correct me if i misunderstood anything.

vagrant valley
#

Yes

#

I need a random number generator

#

Like how disassembling things give random amounts of things everytime

crystal terrace
#

so then youd need to generate a value and return it i suppose to the recipe, never really worked with those. I assume you are familiar with ZombRand ? should help you with random values and then you only need to figure out how to use that value in recipe. Like whatever you return from taht random function.

#

i'd honestly start looking into vanilla usages and see if they used a value from function or something like that or maybe called a function and tweaked that value inside that function.

vagrant valley
#

I think i know what zombrand is

fast galleon
#

@vagrant valley
If you search in this channel there have been scripts for recipes that: use different number of ingredients, create random items, etc

hollow current
#

quick question --

function TimedAction:new(character, playerIndex) -- What to call in your code
    local o = {};
    setmetatable(o, self);
    self.__index = self;
    o.character = character;
    o.playerIndex = playerIndex;
    o.maxTime = 1000; -- Time taken by the action
    if o.character:isTimedActionInstant() then o.maxTime = 1; end
    return o;
end```
#

what unit of time is the maxTime? is it ticks?

vagrant valley
fast galleon
hollow current
#

I want to figure out how many ticks would it take per in-game minute

hollow current
#

alright one more thing -- If I understand correctly, timed actions duration are affected by a character's fatigue or how tired they are, is that correct?

fast galleon
#

yes

hollow current
#

Is there a way to make it so that the duration of my timed action is absolute and not affected by any external factors?

fast galleon
#
function Action:adjustMaxTime(maxTime)
    return maxTime
end

This will replace the vanilla function and not change it

hollow current
#

Will try that, thanks!

#

is there a way to completely clear the current timed actions queue/stop any ongoing timed actions and immediately start the one I set?

fast galleon
fast galleon
hollow current
#

Thanks!

atomic crow
# median mantle Use setMultiItem in BodyLocationGroup

Wouldn’t that result in me being unable to unequip them? The game generally doesn’t handle multiple items on one body location well when that method is used, hence why I tried multiple body locations to an item as my alternative.

median mantle
#

As far as I know, it does not affect to unequipping. setMultiItem in BodyLocationGroup just allow players to equip several items with specific BodyLocation
Srry, it seems to unable unequip items. My mistake.

atomic crow
#

Yeah that’s what I thought, if only it were that easy. Seems like I’ll have to make multiple versions of the same item or something…

lilac belfry
#

Hello everyone, I had a question when developing my project for PZ: "is it possible to create a map and objects on it using programming, is there an API and documentation for this?"

mellow frigate
uneven mauve
#

Heyo, can someone explain the Distributions.lua file?

From my understanding is a collection of rooms -> rooms have containers -> containers have loot tables.

I don't understand the other properties near the loot table, like min, **max **and **weightChance **do they determine which one is more likest to spawn? There's some loot tables where they all have **weightChance **of 100. There's also rolls, which appear in some room definitions with 1 or in others with a 4, why some rooms dont define a **rolls **?

bandmerch = { isShop = true, clothingrack = { procedural = true, procList = { {name="BandMerchClothes", min=0, max=99, weightChance=100}, } }, metal_shelves = { procedural = true, procList = { {name="BandMerchClothes", min=0, max=99, weightChance=100}, {name="BandMerchShelves", min=0, max=99, weightChance=100}, } }, shelves = { procedural = true, procList = { {name="BandMerchShelves", min=0, max=99, weightChance=100}, } }, },

tiny karma
#

working on BIG THINGS

next mason
#

I would like to make a mod that allows your character to stick their head outside of an open window and be able to look up, down, left and right

#

How would I go about this tho
I have absolutely zero modding experience

fast galleon
# uneven mauve Heyo, can someone explain the Distributions.lua file? From my understanding is...

distribution table selection

Game picks a distribution table based on room type and container type. That can be either a procedural distribution (selection between a number of tables) or a normal distribution table. If there's no match for the special combination it then goes to All table and container type.

distribution files

  • lua/server/items/Distributions.lua
  • lua/server/items/ProceduralDistributions.lua

Blair Algol: add items to distributions
#mod_development message

Image explanation by Commander
#mapping message

~~ selfpins distributions ~~

true nova
next mason
#

Alright, thanks much

iron iris
#

how does one open pz mods? And is there a wiki for the libraries that are available?

slow agate
#

This is an ongoing project I've been working on for about a week. I was working with NightScale5755 on this, but something came up, and he may not be able to help. There's two different armor styles, as seen in the images.
I'm posting it here to showcase what I have and the overall style of what I do, spreading some awareness to see if anyone would be interested in helping me get it into the game for the community to use. Of course, these vehicles are from Filibuster's, I only added to them.
Right side are finished/near finish (except the Corolla)
Left side is planned/WIP

#

ive already got optimization, textures, and regions for parts lined up
issue is making them exist into the game itself

ornate locust
#

How do i reload my mod in game?

faint jewel
#

nyte, you would have to edit the models themselves to use those parts. maybe talk tof ilibuster and he can work with you on it? there is also a mod out there for adding armor to regular cars, maybe they can help you make a version for filis stuff?

slow agate
#

Like on the stepside in the second image, that overlays perfectly with the bed of the truck and the fender, and doesn't affect the existing vehicle

faint jewel
#

of course. you DO know fili is redoing all of his cars though right?

slow agate
#

i did not know that, no

faint jewel
#

yeah

slow agate
#

will this mod replace his current?

faint jewel
#

yeah

#

will be an update to it.

atomic crow
#

Posting about this again to hopefully get some better assistance, I'm trying to edit an existing mod to allow multiple of a clothing item to be worn at a time. This clothing item occupies it's own modded body location and I am not against adding new body locations but adding new items entirely is something I'd like to avoid. I previously attempted to add multiple body locations to the item with pretty scuffed results. Any advice on this would be greatly appreciated.

bronze yoke
#

you can flag a bodylocation as allowing multiple items in it, but you'd have to rewrite all the equipping/unequipping logic as there's no support for it (it's only used for 'hidden' clothing like zombie damage)

atomic crow
#

How would I flag it as such? I'm not above doing something like that if I have to.

bronze yoke
#

where you create your body location, call location:setMultiItem(true)

atomic crow
#

Ah that, I might try that, I think I've found another alternative for now, as the item already has multiple equip states I think I can simply apply each of them with their own bodylocation.

jolly goblet
#

Hello everyone. I have a question... How can I make this window?

true nova
#

any good examples for adding build options to the context menu? I've looked at a few but don't fully grasp everything theyre doing

jolly goblet
#

I think this is the method, but I keep reviewing all the code because it is big.

iron iris
#

how does one begin making a pz mod? I know plenty of glua, but not pz

true nova
iron iris
#

and am 100% sane

sharp minnow
#

I've been scratcing my head around the procedural distributions - is it a requirement that the container has to be inside a room for them to work?

My entire map is technically outside - lets say I have 1,000 shelves - should this work?

Is there a hard limit of 99 ~~items ~~ containers per room, with procedural only working inside rooms?

    shelves = {
        procedural = true,
        procList = {
            {name="ShelfGeneric", min=9999, max=9999},
        }
    },
iron iris
#

oh god, pz is more tablcromancy than gmod isn't it

sharp minnow
#

my mod is 50% braincells from banging my head against my monitor screaming why doesn't this work. But that's probably just me.

iron iris
iron iris
#

try getting someone to look at it

#

take breaks

#

like seriously, I have been so burnt out from doing the same for 4k hours, that I have been hiding in this discord lol

fast galleon
sharp minnow
fast galleon
#

maybe you can add "Rooms"?

sour island
#

Anyone familiar getPlayerFromUsername() know if it works in MP?

#

Trying to check if a specific player is in a location - rather not have to rely on sending commands - I assumed the clientside IsoPlayers would share the username

#

Yeah seems like if it's called on client-side it's only grabbing coop/local players

#

Ah... I may have been missing a very obvious thing

#

Yep... I was trying to compare the modData of an object but not transmitting after adding to it

atomic crow
#

It is basically just an edit of a preexisting mod but I'm proud that I was able to get it to work.

granite ginkgo
#

Greetings,anybody who knows how to add animated parts to vehicles? I'm a little stuck

drifting ore
slow agate
drifting ore
#

Later tho busy now

drifting ore
true nova
#

i mean you can make the vanilla cookies. it would be cool to be able to make cookies with different ingredients and different hunger values. I also was thinking about the beef jerky mod and how you should be able to make the trappable animals into jerky that keeps indefinitely. Id be down to help out

drifting ore
true nova
drifting ore
#

ah

#

infinite source of food

#

Alright il get to work to make the craftable

#

first gotta add 3 new foods so you can make them with it

#

talking bout the cookie mod

true nova
sharp minnow
drifting ore
#

@true nova Should i make the single craftable or like in game a tray of them

true nova
true nova
drifting ore
#
table.insert(ProceduralDistributions["list"]["BakeryMisc"].items, "MoreCookies.CoconutCookie");
table.insert(ProceduralDistributions["list"]["BakeryMisc"].items, 10);
#

whats up with this i dont get it

#

those are line 12 and 13 above

bronze yoke
#

can you show the error?

drifting ore
#

Where can i find it

#

also my new items that i added dont show up but thats the only error i seem to get

#

is this the error: attempted index: items of non-table: null

bronze yoke
#

ProceduralDistributions["list"]["BakeryMisc"] BakeryMisc is not found

drifting ore
#

hmm weird bceause above this code i used it

#

and it works

#

it stops in middle

#

im an idiot

#

nvm is not the issue i thought

drifting ore
#

fixed all

#

i just commented it out

near hull
#

Hello, I am developing a map and I want to implement easter eggs, but I don't have the knowledge of how I can do it, could someone give me the necessary advice, please? Or if you like to work on the map with me, all the better.

faint jewel
#

what kind of easter eggs?

near hull
# faint jewel what kind of easter eggs?

Search certain areas of the map (Vanilla and mods) to find a clue that leads you to my map and you must investigate to find the point and from there you find a note that makes you go to another place and things like that. I don't know if I can explain myself

faint jewel
#

you mean you want a quest more or less?

near hull
#

One could say, Yes. Between each track you take "unique" things, it can be a backpack, a weapon that can only be obtained by discovering and exploring and things like that

drifting ore
#

Made all of the cookies craftable

fast galleon
#

I've been waiting for v.42 to see if it is fixed, until then I switched to using non procedural table with rolls.
You could ask Blair Algol, see if they plan to fix it.
Best to check bug reports and ask there.

vagrant valley
#

Would "result:getInventory():AddItem("Base.");" Work in oncreate?

#

Or does it have to be player:getInventory

neon bronze
#

I would use player:getInventory since result:getInventory would try to pull the items inventory which could fail if its not a container

vagrant valley
#

This is for crafting though

fast galleon
#

I agree that trying to get container from result might not work.

neon bronze
#

You still can get player from crafting with getPlayer()

#

Almost anything is run on the client including crafting

fast galleon
#

the oncreate has the player argument already

neon bronze
#

Oh yea thats true

#

Then it should be even easier

vagrant valley
neon bronze
#

No the player is already passed to the function

#

You have it probably as player in your onCreate function in lua

vagrant valley
#

I do have player:getInventory inside the function

neon bronze
#

Yea so just player:getInventory():AddItem(…)

vagrant valley
#

Is it a requirement to have result: at all?

neon bronze
#

Not necessarily

#

Just if you want for example set its durability to smth else than 100% or similar stuff

vagrant valley
#

Yeah

#

This isnt a crafting recipe for weapons or tools

#

Just an item

neon bronze
#

But still leave it in the function args

fast galleon
neon bronze
#

I think he means in the lua function

vagrant valley
#

Still about oncreate

#

For the actual recipe script yeah it break everything

fast galleon
#

just covering the bases, the arguments are: items, result, player. So you always have a result.

vagrant valley
#

I'll add it in some way or another

sharp minnow
broken cloak
#

any idea how to parse json file to lua table?

drifting ore
#

where can i find the code which changes food to rotten after an amount of time

#

i am looking to change a food to something else if its in a container for x amount of time

#

anyone with some starter code?

granite ginkgo
#

so,anyone experienced with animated vehicles around here??

primal hearth
#

yo! i'm trying to make some custom signs to place in-game for a roleplay server i own. I've got the photoshop part down with the correct sizing and chopping it up, but i have no idea where to go from here.

#

I see a lot of packs have a .tiles and .packs file

#

I just have no idea how to do any of that lol. anyone have a tutorial or could help me out?

#

im on a lil bit of a time crunch to get it out.

#

thanks!

ancient grail
weary knoll
#

all 121 dances are in, they occur based on what genre of music you're listening to, player dancing skill and how often any specific dance move was used (to reduce repetitiveness). Goal now is polish each and make the transitions more seamless

primal hearth
#

Which from his tutorial he used the TilesZed

#

But he didn't explain uploading it as a mod and getting it ready

fast galleon
vagrant valley
#

How do you define the required number of items in oncreate?

crystal terrace
#

I think you'd need to create custom tiles and then prolly make a map by placing those tiles onto vanilla or your own custom map.

fast galleon
#

ok but graffiti signs also need lua to work. I have a mod with signs that already overwrites the necessary functions is rather easy to add more signs. Might need some changes depending on the tileset.

crystal terrace
#

Or if you can work with what poltergeist is suggesting, you might need to add your tiles tho. I only have a little bit of experience with maps and tiles so this is just an idea that might help.

fast galleon
fast galleon
vagrant valley
fast galleon
drifting ore
#

i am looking to change a food to something else if its in a X container for X amount of time anyone know how i can start?

fast galleon
drifting ore
#

does it really affect perfomance much

vapid quest
#

how can i send message in chat? i tried sendServerCommand

sour island
#
[29-08-23 12:42:57.171] ERROR: General     , 1693309377171> 151,477,366> java.lang.NullPointerException: Cannot read field "x" because "<local2>" is null.
[29-08-23 12:42:57.171] ERROR: General     , 1693309377171> 151,477,366>     at zombie.network.packets.PlayerDataRequestPacket.process(PlayerDataRequestPacket.java:21).
[29-08-23 12:42:57.171] ERROR: General     , 1693309377171> 151,477,366>     at zombie.network.GameServer.receivePlayerDataRequest(GameServer.java:5221).
[29-08-23 12:42:57.171] ERROR: General     , 1693309377171> 151,477,366>     at zombie.network.PacketTypes$PacketType.onServerPacket(PacketTypes.java:358).
[29-08-23 12:42:57.171] ERROR: General     , 1693309377171> 151,477,366>     at zombie.network.GameServer.mainLoopDealWithNetData(GameServer.java:1532).
[29-08-23 12:42:57.171] ERROR: General     , 1693309377171> 151,477,366>     at zombie.network.GameServer.main(GameServer.java:800).
[29-08-23 12:42:57.171] ERROR: General     , 1693309377171> 151,477,366>     at zombie.SSROverride.main(SSROverride.java:75).```

[29-08-23 12:41:18.756] LOG : Network , 1693309278756> 151,378,949> [29-08-23 12:41:18.756] > ZNet: RakNetRecvFrom: Unknown sender 76561198116570803.


[29-08-23 12:35:41.775] LOG : Network , 1693308941775> 151,041,964> Received packet type=GlobalModDataRequest connection is null..

Getting reports of this kind - looking at the java the error is from the data request being unable to find the IsoPlayer. The error also implies no connection being found to send requested data to. I'm curious what could cause this?
bronze yoke
#

what are you trying to do?

sour island
#

They claim it's being caused by my shops mod

#

That having the UI open causes these errors over time

#

The system sends the shop catalogue through global modData when there is a change to a shop

#

My guess is sending every shop when only one is changed is coming back to bite me in the butt

#

However, no one else has reported issues - but this server is also making very large shops + player owned shops

#

I'm just worried I'll mess with the system to send only partial updates and they still get errors

#
  • risk breaking things for the other people who don't have this issue lol
#

Requesting modData last time I checked doesn't have an argument for a specific address - is that still true?

sour island
muted garnet
#

How to add code that will update character`s gloves for this code:

    local wornItems = self.character:getWornItems()

    for i = 0, wornItems:size() - 1 do

        local item = wornItems:get(i):getItem()

        if item:getType() == "Gloves_Surgical" then
            if item:getBloodLevel() < 100 then
                item:setBloodLevel(100);
            end
        end
    end

this code not working:

    self.character:resetModel();
    sendClothing(self.character);
    triggerEvent("OnClothingUpdated", self.character)
jade pulsar
#

does anyone know how to mod in or add radius bonus for foraging?

#

I am creating custom professions and traits for my mod using Profession Framework by @quasi geode , and I wanted to add/edit radius bonus, ignore weather/darkness etc. to each individual profession - is this something possible to add to a mod such a mine?

#

I've been looking online about modding custom radius bonus, but to no avail. Any help provided or pointers to a good/right source would be much appreciated, really

ancient grail
muted garnet
bronze yoke
#

you can set blood from the health menu in debug, i would look at how that updates it

errant bluff
#

@pulsar heath Is there any possibility to connect your integration to StreamerBot?
This way ingame events could trigger actions in the program.

modern hamlet
#

How can I play a sound for players in a large area in multiplayer?

local emitter = getWorld():getFreeEmitter()
emitter:setPos(x, y, 0)
emitter:playAmbientSound(clip)

I tried this but only my char hears the sound.

steel locust
#

Silly question, but lets say I have two recipes with the name "Craft Bronze Nail", but the recipes themselves are different (i.e. one of them uses bronze ingots and a hammer, the other uses bronze scraps and pliers), and a skill magazine that teaches "Craft Bronze Nail", will it teach both versions of the recipe? Will that cause any issues, other than meaning I can't teach one without teaching the other?

#

I'm leaning towards "yes it'll teach both" but I just want to check with someone who's more familiar.

bronze yoke
#

it'll teach both

#

a character's 'known recipes' is actually just a list of names so as long as they have the same name

steel locust
jolly goblet
#

Hi Z's
How can I do the zombie population increases terribly at night and is normal during the day.???

hot void
cobalt fiber
#

Hi people!
I'm working on a mod to add some extra functionality to generators (cough cough power-sharing cough cough). While testing, I noticed a weird issue with total power consumption, here are the shots:

#

On the first 2 screenshots, the +0.02 is normal, it's like a own generator consumption, but as I put more fridges, the value escalates drastically, which doesn't make any sense

#

And this gets even weirder the more items the generator is powering

#

What I really want to know is if this is intentional or a error in the code

#

I took a look at the calculations done on the IsoGenerator java class, and oh boy it's a mess

#

Looks like the "Power Consumption:" string part has the correct values, I'll maybe use it to try "fixing" this weird issue

crystal terrace
#

interesting idea, always wanted to be able to use generators like this.

vapid quest
#

hello, i need help
i need to send random messages in chat on server but there are no messages in chat and no errors or warnings

code:


local function sendMsgInChat()
    local randIndex = math.random(1, #messages)
    local randMsg = messages[randIndex]

    sendServerCommand('chat', '[SERVER]: '..randMsg)
end

Events.EveryHours.Add(sendMsgInChat)```
crystal terrace
bronze yoke
#

math.random is not available in pz, use ZombRand

#

there's also no sendServerCommand that only takes two string arguments - you might be misunderstanding it's purpose, it's for lua to communicate between client and server, it doesn't send a chat command

vapid quest
vapid quest
#

thanks

crystal terrace
#

that too 👀 , didnt see the math.random there.

vapid quest
cobalt fiber
balmy terrace
#

hey, could i ask a probably silly question about mod development?

crystal terrace
vagrant valley
#

I think i should make separate recipes before trying to mess around in oncreate to merge recipes together

#

I'd hate the bloat in the crafting menu but i'll learn to deal with it later

balmy terrace
cobalt fiber
#

The main issue right now is multiplayer, I need to mess with the Global ModData sync between server and clients

crystal terrace
#

It's just when you do ask something specific people who know stuff might respond. There's no conversation, it's a place for modding questions😀.

cobalt fiber
#

And I've didn't even touch on that topic yet moley

crystal terrace
#

I have had some luck with that although I never needed it lol

balmy terrace
cobalt fiber
balmy terrace
#

that aside, the reason this might be kind of a "simple question" is because i do not understand why the for-each loop i'm putting for an iterator through the players list isn't doing anything
this is a function i have being called on every minute in-game just to test things out and get used to it
local function DebugListener() local players = getOnlinePlayers() if players == nil and players <= 0 then players = {getPlayer()} end print(ipairs(players)) for id in ipairs(players) do print("it's working!") end end

bronze yoke
#

the majority of questions here are asked by newcomers, even if it feels too simple the questions here are often quite simple

vagrant valley
#

Yeah

#

I have like no idea how to code in lua

#

Though i know a lot more about modelling

bronze yoke
#

ah so this is an annoying pz thing

#

getOnlinePlayers doesn't return a table, it returns an ArrayList - a java object that ipairs doesn't work on

#

to imitate a foreach through an arraylist you can do```lua
for i = 0, players:size()-1 do
local player = players:get(i)

end

balmy terrace
#

i looked it up and people online said that ipairs worked with arrays... but not ArrayLists. argggh

bronze yoke
#

i think in most lua implementations the native language types do work with the basic lua functions like ipairs, but pz uses a pretty old and... frankly not very good one

balmy terrace
#

thank you a lot, it would have taken me ages to notice that

vagrant valley
#

@bronze yoke Are you familiar with OnCreate and recipe scripts in general?

bronze yoke
#

yeah i'd say so

#

i spend almost all of my modding time in lua so i'm not a script expert

#

but i've written enough oncreates

vagrant valley
#

Well script is just script

#

I think i've figured them pretty much

crystal terrace
cobalt fiber
vagrant valley
cobalt fiber
#

The shots I've put here where done in vanilla

#

So yeah, the issue with total consumption in on vanilla code, actually, the IsoGenerator class code ded

vagrant valley
#

I could have used separate recipe scripts for one single type but that didnt feel too comfortable for me

bronze yoke
#

should be possible, it passes the item list to the oncreate and there's a script parameter to have it not actually spawn the result in the script

crystal terrace
bronze yoke
#

you do still need to have a result in the script since it's used for the recipe icon and stuff, everything explodes if you don't have one

crystal terrace
balmy terrace
#

if you're explaining the forge forums... yeah fair

vagrant valley
cobalt fiber
#

My question is really why that happens

#

Because it doesn't make any sense

crystal terrace
#

Oki my bad I thought it was something with your modded

cobalt fiber
#

No problem 😉

vagrant valley
#

@bronze yoke Anyway, can i send you the oncreate script i wrote in dms?

balmy terrace
#

ty yall

bronze yoke
vagrant valley
#

That's fine

#

I have all day

vapid quest
#

i tried to fix the code and i have an error

code:


local function sendMsgToAll()
    local randIndex = ZombRand(1, #messsages)
    local randMsg = messsages[randIndex]

    sendServerCommand('server', 'servermsg', '[SERVER]: '..randMsg)
end

Events.EveryOneMinute.Add(sendMsgToAll)```
#

error:

    at se.krka.kahlua.integration.expose.MultiLuaJavaInvoker.call(MultiLuaJavaInvoker.java:112)
    at se.krka.kahlua.vm.KahluaThread.callJava(KahluaThread.java:182)
    at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:1007)
    at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
    at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
    at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
    at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
    at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
    at zombie.Lua.Event.trigger(Event.java:64)
    at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:65)
    at zombie.GameTime.update(GameTime.java:680)
    at zombie.gameStates.IngameState.UpdateStuff(IngameState.java:566)
    at zombie.gameStates.IngameState.updateInternal(IngameState.java:1623)
    at zombie.gameStates.IngameState.update(IngameState.java:1333)
    at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:101)
    at zombie.GameWindow.logic(GameWindow.java:298)
    at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:71)
    at zombie.GameWindow.frameStep(GameWindow.java:765)
    at zombie.GameWindow.run_ez(GameWindow.java:681)
    at zombie.GameWindow.mainThread(GameWindow.java:495)
    at java.base/java.lang.Thread.run(Unknown Source)
LOG  : General     , 1693352960867> 3 861 734> -----------------------------------------
STACK TRACE
-----------------------------------------
Callframe at: se.krka.kahlua.integration.expose.MultiLuaJavaInvoker@4bcfd4a1
function: sendMsgToAll -- file: main.lua line # 7```
vapid quest
#

sendServerCommand('server', 'servermsg', '[SERVER]: '..randMsg)

cobalt fiber
#

maybe use "" instead of ''

#

I think '' in lua don't work for a string

sour island
#

sendServerCommand is supposed to be on the server side

vapid quest
sour island
#

Is your code in /client/ or /shared/ ?

vapid quest
#

no

cobalt fiber
#

well, there's what @sour island said, if you are running this on client

vapid quest
#

its in server

cobalt fiber
#

will not work

#

hmmm

sour island
#

You have incorrect argument types

#

sendServerCommand(String var0, String var1, KahluaTable var2) or sendServerCommand(IsoPlayer var0, String var1, String var2, KahluaTable var3)

vapid quest
#

sorry, but have no idea how is it working

sour island
#

The last argument has to be a table

#

This is not the same thing as sending a command on the server console btw

#

So you'll need code for when the command is recieved too

cobalt fiber
#

That does not sent a message on the server chat to everyone

#

It sends a 'signal' to all client (or one specified), and the clients needs to handle the signal it receives

sour island
#

SendServerCommand and SendClientCommand is for sending tables of simple data

#

Strings, integers, ... tables, etc

vapid quest
#

so i need another code in server that will recieve command and send message?

sour island
#

No

#

You need code in /client/ for when a server command is received

#

SendServerCommand is sending to all clients unless one isoPlayer is specified

#

Your clients will receive the three arguments/variables

#

(string)module, (string)command, and (table)data

#

You can put the message in a table as {"message"}

vapid quest
#

sendServerCommand("servermsg", "broadcast", {"[SERVER]: "..randMsg}) is this correct?

#

i think i made it

server:


local function sendMsgToAll()
    local randIndex = ZombRand(1, #messsages)
    local randMsg = messsages[randIndex]

    sendClientCommand(getPlayers(), "MessageModule", "CommandModule", {"[SERVER]: "..randMsg})
end

Events.EveryOneMinute.Add(sendMsgToAll)```

client:

```local function sendMsg(module, command, data)
    if module == "MessageModule" and command == "CommandModule" then
        local msg = data[1]
        getPlayer():sendMessage(msg)
    end
end

Events.OnClientCommand.Add(sendMsg)```
vagrant valley
#

How many time ticks are in a second?

cobalt fiber
#

and when you sent it, should really be sendServerCommand

#

the server doesn't send client commands

#

and the client don't receive client commands

vapid quest
#

thanks, i have an error in line and trying to fix it sendClientCommand(getPlayers(), "MessageModule", "CommandModule", {"[SERVER]: "..randMsg})

vapid quest
cobalt fiber
vapid quest
#

oh

#

there is error in client side in this line getPlayer():sendMessage(msg)

signal frost
#

So I'm just curious how could I make one of the vanilla cars specifically the Masterson horizon destroy trees like the super bulldozer mod?

vapid quest
signal frost
undone tapir
#

🤣

granite cedar
#

Is there any trick to changing the icon for an item? I've copied the item's script and changed the icon filename but the icon remains the same in game.

ember orchid
#

Have you tried that mod creator?

signal frost
#

I was just wondering if you would know possibly like where to look in the files I mean I was just curious lol

chrome veldt
#

Short video of PZTracker's front end part progress. I retrieved more data from the mod, made sure there was no conflicts between worlds and characters. It's looking good. I just need to figure out how to get the full map with buildings visible and how to know player's visited areas. With these I'll be able to show each character exploration on the map (being able to fetch player map annotation would be the cherry on top)

ember orchid
#

They probably did some fancy lua stuff with it, check in that folder.

trim mist
#

I developed something that I accidentally don't have use for, so y'all have it for posterity:

Right-clicking and displaying a context menu item based on sprite ID (doesn't work with items, only tiles)

function [ClassName].[FunctionName](player, context, worldobjects, _)
    for _,v in ipairs(worldobjects)
    do
        if instanceof(v, "IsoObject")
        then
            local sprite = v:getSprite();
            local spriteID = sprite:getID();
            print(spriteID);
            if spriteID == [SpriteID] -- distance to tile too
            then
                context:addOptionOnTop(getText([TextPath]), player,  function()
                    [FunctionToTrigger]
                end);
                break;
            end
        end
    end
end
...
Events.OnFillWorldObjectContextMenu.Add([ClassName].[FunctionName]);
balmy terrace
#

wth is going on here
function DataThingTable:getDataThing(player) local index = player:getUsername() return self.dataThings[index] end
causes an error in game of "getUsername of non-table: null"
and before you ask, i have checked to make sure i'm passing an IsoPlayer table/'object'
so i'm very confused

#

ok i figured it out i think
for some reason the method i defined was super weird and thought that the IsoPlayer i passed was actually the "self" variable

bronze yoke
#

when you define a function with : it creates an implicit self parameter

#

if you then call it like DataThingTable.getDataThing(player), you're passing player as the self parameter and nil as the player parameter

#

this is one of the tricks lua uses to pretend it's suitable for object oriented programming

#

basically, if you define DataThingTable:getDataThing(player) it actually creates DataThingTable.getDataThing(self, player)

#

the intention is to then call it with myObject:getDataThing(player), which actually calls DataThingTable.getDataThing(myObject, player)

#

if you're not emulating oop principles you can just avoid using the colon

balmy terrace
#

if i try to remove the colon in both the definition and the call, making it so it's actual definition is apparently just getDataThing(player), it still yells at me for "implementation not found"

#

oh wait

#

i think the thing i was feeding it into is the problem, not the actual method i m ade

#

one moment

bronze yoke
#

implementation not found is a very strange error to get, lua isn't strict about that - it should be a java method throwing that