#mod_development

1 messages · Page 204 of 1

zenith igloo
#

Im pretty much beginner too sorry cant help more :p

grim spindle
#

All good, I appreciate it

livid badger
#

I trying to spawn a tree, when my plant was rotten

    if texture ~= nil then
        self:setSpriteName(texture);
    end

    -- get current plant
    local plant = SFarmingSystem.instance:getLuaObjectAt(self.x, self.y, self.z)
    local square,x,y,z = getSquareDelta(self.x, self.y, self.z) -- 0, -2, 0

    -- remove plant 
    if plant then
        SFarmingSystem.instance:removePlant(plant)
    else
        noise('no plant found at '..self.x..','..self.y..','..self.z)
    end

    -- remove all (maybe can skip SFarmingSystem.instance:removePlant(plant) by this)
    removeAllButFloor(square)

    -- set new tree obj with rotten tree sprite
    local tree = IsoTree.new(square, texture)
    -- add tree on map
    square:AddTileObject(tree)
end

some idea what i miss here?

zenith igloo
#

function 😛

maiden sentinel
#

intending on making a weather mod, does anyone know how hard the weather system is to tinker with, and if it’s a lua script or java script?

zenith igloo
#

anyone have any idea why a simple function like :getXp() is even producing errors?

#

`local function TestFunction(player)

local playerxp = player:getXp()

end

Events.EveryOneMinute.Add(TestFunction)`

even this one.

#

basically whatever or however I use getXp only thing I get in return is errors

bronze yoke
#

because player doesn't come from anywhere

#

EveryOneMinute doesn't pass any arguments, it doesn't know what player is

zenith igloo
#

nothing changes when there is no parameter for the function and getPlayer() is used

#

it was just the last example I tried

#

even a copy paste from a working mod summons errors on solo debug mode

bronze yoke
#

what error?

zenith igloo
#

tried to call nil

#

on the getXp line

#

`local function TestFunction()

local curplayer = getPlayer()
local playerxp = curplayer:getXp()

end

Events.EveryOneMinute.Add(TestFunction)`

#

still getting the same error on the getXp line

#

like there is no Xp to call

#

but it should work from what I read

bronze yoke
#

yeah, that's very weird, that particular error should never happen

zenith igloo
#

Im literally going mad for 2 straight days 😄

bronze yoke
#

tried to call nil means that:
- curplayer *does* exist
- curplayer *is* a table
- curplayer does not have a .getXp

#

any other mods active?

zenith igloo
#

nope

wintry dune
#

Quick question, how does zombiod work using both Java and Lua? I realized that learning their syntax is important, but I would like to know why I should understand both of them and what they do.

zenith igloo
#

you dont have to play with java from what I learned just need to be able to find functions etc.

bronze yoke
#

the engine and a lot of core/sensitive stuff is written in java, lua mostly interacts with java objects and apis

zenith igloo
bronze yoke
#

java modding isn't supported so you don't need to worry about it too much beyond that it's what provides the objects and functions

zenith igloo
#

its possible if you are mad enough tho 😛

wintry dune
bronze yoke
#

lua as a language is designed to be used as part of a larger program like this

wintry dune
#

Thank u!!

zenith igloo
#

Im gonna do another restart

#

maybe reason is reloading lua too often kek

#

dont think so tho yet

bronze yoke
#

if you're reloading individual lua files using the f11 menu, yeah that constantly causes issues

zenith igloo
#

yeah most of the time.

bronze yoke
#

i recommend always reloading the save to do a full lua reload

zenith igloo
#

but it takes too much time with that way 😭

bronze yoke
#

when you reload a file it doesn't undo anything you did to the global namespace, in this case that would mean all your older event listeners are firing

zenith igloo
#

issue is I didnt try to change anything yet

#

since I couldnt pass the :getXp 😄

#

verifying the game files too rn

#

ll try again

zenith igloo
#

for now at least.

bronze yoke
#

trust me, for now

zenith igloo
#

😛

#

thanks for responding

gilded hawk
#

How can I make it so that an item can spawn and exist only if a sandbox setting is enabled? 🤔

heady crystal
#

Anybody know how to check if an item can be used as a weapon

gilded hawk
heady crystal
#

Oh nice good one

#

I had forgotten about type

gilded hawk
#

😄

heady crystal
#

I was looking for category and was like dang it! Some weapons aren't weapons lol

gilded hawk
#

Alternatively, you can also check for
MinDamage
MaxDamage

zenith igloo
#

just a guess tho didnt do it before

gilded hawk
#

Thank you, I'll give it a try

void cargo
#

Is there any way to test lua in the server console?

zenith igloo
#

is there a way to create delay for once called function like coroutines or smt in lua that ll work with pz?

void cargo
#

I'm looking for like a lua interpreter with zomboid globals, want to test out IO stuff

#

I'll just tab use debug mode console and disable all mods 🙂 would be nice to make though

dark vault
#

i looking for weather mods. Are there any good ones?

gilded hawk
# zenith igloo if sandbox var what ever is enabled this https://projectzomboid.com/modding/zom...

Found a better way

Events.OnGameStart.Add(function()
  local scriptManager = ScriptManager.instance;

  if SandboxVars.Casualoid.EnableMxMagazines  then
    return
  end

  local items = {
    "Casualoid.NutritionistMag1",
    "Casualoid.AnarchistCookbook1",
    "Casualoid.AnarchistCookbook2",
    "Casualoid.AnarchistCookbook3",
  }

  for _, name in ipairs(items) do
    local item = scriptManager:getItem(name)
    item:DoParam("OBSOLETE = true")
  end
end)
zenith igloo
#

didnt know item:DoParam("OBSOLETE = true") was a thing

#

%100 better thanks for sharing

gilded hawk
#

You are welcome! I almost forgot about it, but then it clicked back in memory

#

The interesting thing is that the game removes it entirelly from existence, it does not even appear in the item list viewer

zenith igloo
#

feel like its more like hidden and unreachable

gilded hawk
#

Yep

zenith igloo
#

yet exist

gilded hawk
#

Yep, as it appears in the loot zed view

bronze yoke
#

you can wait until OnInitGlobalModData to add entries to the loot tables, and then you will have access to sandbox options while doing so (to exclude certain items, etc)

gilded hawk
bronze yoke
#

server

#

oh right, you need to call ItemPickerJava.parse() after editing the loot tables

gilded hawk
#

Also, using the obsolete trick should allow me to remove items, even if they spawned before changing the sandbox settings to hide them 🤔

bronze yoke
#

that event happens after the game copies the loot tables to java so you have to call that to make it read the new ones

gilded hawk
zenith igloo
#

does "repeat-until" in lua not work in pz?

bronze yoke
#

it does work

zenith igloo
#

repeat i = i + 1 print(i); until (i > 100)

#

am I being dumb

bronze yoke
#

is there a local i = 0 line before this?

zenith igloo
#

yes

#

okay I saw my mistake Im an idiot

#

I think it is time to sleep its 6 am

#

forgot to call the function

#

🥲

#

asking helps even if no one answers lmao

heady crystal
#

Anybody know where in code the Player's red dot thing is rendered on the map and minimap?

loud pelican
#

is there a possible way to rotate doors guys?

#

I want to make a double door but the tool only allows me to rotate to west/north

vague dragon
#

Hi guys, i made some modifications to STALKER Armor Pack so i know how to edit a mod but i want to create one (because i love this game) i don't know how to create one so i need your help.

I tried to see if ChatGPT helps me in this task but as it says "it's an ambicious project": I'm trying to do Automatic Building, it's ambicious for me because this mod detects the container with the resources and later builds the structure (log walls for example) i don't know if this is possible but it's a QOL for a lot of people, if you can help me to understand if i can make it or i give you the inspiration to create this mod, let me know

marble pelican
#

which way do you rotate a hat in blender for it to properly sit on the character's head

livid badger
sterile belfry
#

Hello guys! I need your help...
I'm trying to change the AnimSet of a specific player.
On zomboid's java doc I've found the function SetAnimSet(AnimationSet animationSet) on zombie.core.skinnedmodel.advancedanimation.AdvancedAnimator but I can't use this function.

Someone know how to use?

mellow frigate
livid badger
#

and one more question, can i somehow use full terminal for lua code debugging in game or can only use game chat/command window

halcyon tide
#

I want to rebalance a mod with another mod’s mechanic. They both give a blind trait, but one of them allows your vision to increase based on other sounds like a zombie’s footsteps and such. I like both of them but they each have a fundamental flaw that I want to correct on my own

#

If I got the permissions from both originators, could someone help me with this task?

worthy sparrow
#

Is it possible to spawn/replace/"build" a tile using lua?

pulsar niche
#

I need to set the same item filters for the zombs not to show stuff in their inventory when I restart the game or go back into a save.

Can I tell the game to remember this stuff?

simple crow
#

Hello all. Looking to work on a mod for PZ. Haven't done any modding previously but my dayjob is dev (not games). I've done a few lua tutorials in the past. Is the pzwiki the best place to get started? Are there any sample projects out there?

untold vessel
#

Guys I can't find my lua file from the Debug options, which I imagine it means that it had not been loaded. Do I need another kind of lua file to execute it? Nvm omg I was using the mod from the Workshop instead of the mods file

worthy sparrow
mellow frigate
# simple crow Hello all. Looking to work on a mod for PZ. Haven't done any modding previously ...

Wiki is the place, yes. This video is a great tutorial: https://www.youtube.com/watch?v=N6tZujOPnDw and this guide will help a lot (especially if you do not know lua language): https://github.com/FWolfe/Zomboid-Modding-Guide/blob/master/README.md

This tutorial video will show you how to make a simple drink in Project Zomboid. I will go into the steps involved from start to finish. Read more below.

0:00 intro
1:08 Start
1:44 Searching for images to use in game
2:30 Searching for the Sound Effect
3:06 Creating mod file directory
3:54 Creating mod.info
4:34 Creating a poster
7:14 Adding ne...

▶ Play video
GitHub

Guide to modding various aspects of Project Zomboid - FWolfe/Zomboid-Modding-Guide

#

Zoom, your spam is visible, I signaled and blocked you. Stop trying so hard to get the last request or others will do the same.

loud pasture
#

to anyone with problems setting up a second Zomboid folder like me, if your folder names have spaces, you need to put the path in quotes like:

-cachedir="E:\pz modding\ZomboidDev"

simple crow
#

Great thanks much, I'll start with those resources.

loud pasture
#

im a noob too and also found this video as well:

https://youtu.be/-yrmCAwzTbY?si=Sd9_9glgADtAcyZ2

1:11 Step 1 - Know your file locations
4:06 Step 2 - Storyboard your ideas out
9:03 Step 3 - Get your files from the game or other mods
11:47 Step 4 - Build your mod files
1:01:54 Step 5 - Create the textures (mislabeled in the video, oops)
1:19:45 Step 6 - Put your mod files in the right structure
1:30:37 Step 7 - Test your mod (please back up ...

▶ Play video
simple crow
loud pasture
#

Hey all, wondering if anyone can help me clear this up about item models:

Some items have both a 'StaticModel' attribute and a 'WorldStaticModel' attribute.

the bean bowl is an example of this

item BeanBowl
{
DisplayName = Bowl of Beans,
DisplayCategory = Food,
Type = Food,
Weight = 1.5,
Icon = BowlFull,
EvolvedRecipe = Omelette:8;Soup:24;Stew:24;RicePot:24;RicePan:24;Sandwich:8;Sandwich Baguette:8;Toast:8;Salad:8,
EvolvedRecipeName = Bean,
FoodType = Bean,
EatType = 2hand,
GoodHot = true,
IsCookable = TRUE,
RemoveNegativeEffectOnCooked = TRUE,
ReplaceOnUse = Bowl,
MinutesToCook = 20,
MinutesToBurn = 40,
DaysFresh = 2,
DaysTotallyRotten = 4,
HungerChange = -24,
UnhappyChange = 10,
Calories = 170,
Carbohydrates = 33,
Lipids = 1,
Proteins = 7,
StaticModel = Bowl,
WorldStaticModel = BowlSoup_Ground,
}

here are the Bowl and BowlSoup_Ground:

model Bowl
{
    mesh = Bowl,
}

model BowlSoup_Ground
{
mesh = WorldItems/BowlSoup,
texture = WorldItems/BowlSoup,
scale = 0.4,
}

what is different between the StaticModel attribute and the WorldStaticModel attribute?

bronze yoke
#

StaticModel is used in the player's hand, WorldStaticModel is used on the ground

loud pasture
#

so does static model need to reference a model with both a mesh and a texture?

bronze yoke
#

it doesn't matter, as long as it's a valid model

loud pasture
#

Ok, thank you!

#

one more question, why does the model Bowl not have a texture, when im eating it, where does that texture come from?

bronze yoke
#

the mesh must already point to it

loud pasture
#

so a mesh file can point to a texture file?

bronze yoke
#

yeah

loud pasture
#

ok, interesting, thanks a ton!

gilded hawk
#

So, Inspired by PD2's SuperBLT I developed a system to easily inject functions into the main game, what do you guys think is more tidy?

Left my mod using the new Injection system.
Or
Right using typical injection

#

And the best thing is that I can enable and disable the entire mod module by using

Hooks:toggleHooks(false)
-- Or
Hooks:toggleHooks(true)
outer crypt
#

Not sure if anyone has tried this... Thank you for reading: When you click on the inventory of an item like a counter or crate it shows the icon of that item in the inventory pane, is there a way to change or set that icon on a container item? Or maybe a way to create a whole new container type where that can be set?

gilded hawk
#

Cause the mod I'm working on right now, can allow changing the icon of a container, and it's capacity

outer crypt
# gilded hawk What are you trying to achieve?

I have a few sprites that I have converted into container items and it would be nice if they looked the part when the inventory was looked at. If I make them counter containers it shows counter icons, stove containers look like a stove, just trying to make them look better than generic crates.

gilded hawk
#

So, if I understood correctly, you made new sprite for the containers, and you want the different containers to stop using the generic icons, and use your instead, right?

outer crypt
gilded hawk
#

Okay, so you can try and add your icons to the media\lua\shared\Definitions\ContainerButtonIcons.lua

#

if you look inside of it, you can see how zomboid recycles the same icon for different container, all you have to do is add the correct texture

outer crypt
#

that's neat, thank you! looks like I could call it by a new name, then a file in the mod under the same tree that requires Base.ContainerButtonIcons and then add to t list with the new texture and drop that into my tree that matches as well.

gilded hawk
#

Yes, you should be able to keep it nice and tidy

outer crypt
#

That worked perfectly, Mx! Thank you very much!

gilded hawk
#

You are welcome!

split yoke
#

is there way to upload mod to workshop with steamcmd? or some other way beside the in-game UI with the workshop buttons?

loud pasture
#

so i have been developing a reese's puffs mod that retextures cereal and cereal bowls, and gives them unhappiness decreases, but i am struggling with the CerealBowl item. It is modified in a script as shown. The unhappiness change is commented out because adding it removes the 'place item' option from its context menu

#

any help is greatly appreciated 🙂 ❤️

bronze yoke
#

missing comma at the end of the unhappychange line

loud pasture
hallow hearth
#

Is there a logical place to listen for zombie-made sounds? I found WorldSoundManager.Worldsound.sourceIsZombie

#

And OnWorldSound event but I don't necessarily want to try to capture every sound and then decide if it comes from a zombie or not, I feel like it can be zoomed in a bit to capture less world and player sounds?

#

I'm basically trying to capture all zombie sounds and increase the priority other zombies give them

pulsar niche
#

Dismantling floors could give carpentry exp

loud pasture
#

I am making a mod to add Reese's puffs to the game. My problem is that the custom eat sound only applies after reloading the world.

test sequence:
load world with mods
find reese's puffs
try eating them, they do not make the sound
quit
load
try eating them, they do trigger the custom sound

tested with the Reese's puffs and bowl of reese's puffs

when they're spawned by the debug menu it also doesn't play the sound

it seems that the order that the modifications to the base module apply are that the custom sound is only applied after reloads? i dont fully understand, does someone know of a fix?

#

there are 3 images, you need to click the arrows to see them all

thanks in advance!

#

did some debugging:

edgy cosmos
#

howdy ho! i'm currently in the process of making a reskin for Filibuster Rhyme's Used Cars. So far, the working version I have is Filibuster's /entire/ mod, with textures swapped and a few edited script files. I've attempted to as such, make a version that is /just/ the files I've edited, as well as the script files - and found that, if using mod settings to load my reskin mod after Filibuster's, the added skins appear invisible, and the default skin slots appear "vanilla". If loading before filibuster's; nothing happens. Any tips?

loud pasture
#

i added this

and now the previous warning does not happen, it still behaves the same way though, only playing the sound after the second load

edgy cosmos
#

@winter thunder apologizing profusely for the ping but you had some good ideas that helped me figure out the issue last time

loud pasture
#

i will send a new message before i go to bed:

i am making a reese's puffs mod, it retextures Base.Cereal and Base.CerealBowl and gives them new display names. It also gives them a CustomEatSound which originally referenced a file, but now references a custom sound which i addedd (i think?). the result is the same either way, the custom sound will only play if i leave and then reload. However, after adding the custom sound, the warning shown in the screenshot of the debugger no longer appears. This behavior is also present in blackbeard's nukacola mod which is also a modding tutorial. https://steamcommunity.com/sharedfiles/filedetails/?id=2200810675.

please ping me if you have a response, thanks!

loud pasture
#

Tldr I made a custom sound and it only works if I load the world, leave it, and reload it.

mellow frigate
muted garnet
#

please explain how the increase in experience from the doctor profession works, at the end of the action, if the player is not a doctor, then he receives 25 experience, as it should, and if a doctor, then 166, although he should have less exp (no books)

next vine
#

so does someone know how to calculate all faction member zed kills and time spend online ?

tame mulch
sour island
#

Aren't zombie kills listened to on the server?

#

Could probably toss a function into the onzombiedeath event

#

I've been having some issues with networking and using commands

#

Seems like alot of mods are sending data back and forth either in bulk or too frequently

#

I was also sending too much data in my shops mod - had to rewrite the networking aspect. Seems like if the table you're sending is too large the server is prone to lose the packet and create a runtime where the error says the IsoPlayer the packet is meant for is null.

wide shuttle
sour island
#

I think the 10YearsLater server has their stats on a website

next vine
#

Sure First of all im pretty new to modding but i know how to get the hours survied ans the Kills from a Player but how do i geht them from a whole faction tho

#

So please be kind to me 😅

pseudo apex
#

Is it possible to add a parameter to a piece of clothing so that it doesn't fall when you die?

sour island
# next vine So please be kind to me 😅

You can grab faction information off the IsoPlayer using getFaction etc - you could calculate the kills that way - but this is a potentially dangerous way to go about data tracking as you'd need to account for the creation and destruction of factions. You could simply have a table of factionIDs - add the factionID to the table if it's there, otherwise add 1. But again, factions can be created or destroyed -people can leave factions, etc.

sour island
pseudo apex
sour island
#

Those don't fall when you die, unless I'm misunderstanding what you mean

pseudo apex
#

Sorry, I expressed myself poorly. What I'm trying to do is make the item disappear or break when you die, so that other players can't have it.

sour island
#

Ah, you would need to utilize the on death event to do something like that

#

You can add tags to the item's parameters to make it easier to expand on - or you could simply include a table of item types to check for.

pseudo apex
#

Thank you, I'll have to learn more to achieve these things.

sour island
#

No problem

loud pasture
autumn garnet
#

a small example, of a project on pause which I used to make this system for 10yl

sour island
#

Is this what you'd have in mind @next vine?

next vine
# sour island Is this what you'd have in mind <@1050027290987339846>?

Yeah kinda tho i only need the zed kill and survived time from the alived charakter

if u know the SSR Safehouse overhaul im a big fan. tho i dont like how to get the points for the safehouses and i want to make it possible that the whole faction could collect togheter the points for getting more and bigger savehouses instead of the version i have right now. bc only the faction Owner gets count to my point script ^^

sour island
#

Ah well, in that case the kills earned don't really need to be tracked that strictly

#

You can just use getFaction and reward the faction the player belongs to

next vine
#

`function calculatePointsForFaction(faction)
if faction == nil then
return 0
end

local points = 0
local members = faction:getPlayers():size()

-- Server erhält maximale Punkte
if isServer() then
    return 250
elseif isClient() then
    local factionMembers = faction:getPlayers()

    for _, member in ipairs(factionMembers) do
        local timer = member:getHoursSurvived()

        -- Punkte für überlebte Stunden
        if timer > 12.0 then
            points = points + math.floor((timer / 24) + 1)
        end

        -- Punkte für Zombie-Kills
        local zombieKills = member:getZombieKills()
        if zombieKills > 100 then
            points = points + math.floor((zombieKills / 100) + 1)
        end
    end
end

return points + members

end
`

i dont know ._.

ember roost
#

So how exactly can I take on texturing my own models? What type of style does PZ really have?

trim juniper
#

Hey all. Struggling to understand how to make mods multiplayer-safe... really just how to get a general idea of what is managed entirely server-side, client-side, or what needs to be synchronized (and how to do that).
For example
getPlayer():getBodyDamage():setInfected(false) getPlayer():getBodyDamage():getBodyPart(BodyPartType.FromIndex(i)):SetInfected(false)
- would that be handled entirely client-side? Would I need to sync any changes to the server?

bronze yoke
#

entirely client-side

#

a client is completely authoritative over its players' health

trim juniper
#

Ah cool, thanks. So there's no need to push those changes to the server at all?

bronze yoke
#

nope, anything health related will be synced automatically as long as you change it from the client the player belongs to

trim juniper
#

Great, thanks for the help!

#

On the opposite side - under a LoadGridsquare event, something like object:setWaterAmount(0) - would that happen entirely server-side and auto-update to clients? Finding it hard to visualise what exactly is happening during a LoadGridsquare

#

Also, for something that does run entirely server-side, do players need that mod installed/enabled, or is it enough to just have it added on the server config?

bronze yoke
#

usually you do have to use some methods to transmit changes like that, but if it happens on the server side LoadGridsquare is fired before the clients are actually sent the squares so in that specific case you don't need to

#

unfortunately there is no support for 'server only' mods, technically you can accomplish this with a mod that loads files in the server's cache directory but the game's mod system doesn't support it natively no

#

it always wants the clients to be using exactly the same mods as the server

trim juniper
#

Ah right, well that keeps it straightforward at least 🙂 Would I need any specific code to tell it to run something like that only on the server, to stop clients duplicating the same action, or does it sort that stuff out for itself?

bronze yoke
#

you can check if a file is running on the server with isServer() or the client with isClient(), generally i recommend using not isClient() since checking specifically for server will stop it from running in singleplayer

#

in singleplayer both will return false

#

if you want a file to only run on the server-side (and singleplayer) you can start the file with if isClient() then return end

#

unfortunately just putting it in the server folder doesn't do anything like that, even though the client folder *is* restricted to clients

trim juniper
#

Awesome, think that should be enough info to get me on track. Many thanks!

heady crystal
#

Anybody know if it's possible to force a player or zombonie to jog? Not sprint, jog.

#

Or like. Run I guess can be used in English. But I think run and sprint are the same

#

🤔

bronze yoke
#

setForceRun(true) on a player should do it, though iirc results vary with those methods

#

it won't work for zombies though, it's an isoplayer method

heady crystal
#

Hm can I make a timed action have the Player run

bronze yoke
#

yeah, there's one for walking so you just have to flip that flag most likely

heady crystal
#

Is there? I know there's stopOnWalk

#

and stopOnRun

#

I never found anything that specifically makes the player run

bronze yoke
#

i mean just setForceRun at the start of the action

prisma quest
#

hi, im new to modding and programing in general and I am trying to figure out what DisplayCategory I should put my modded item into

mellow frigate
mellow frigate
#

and In Jump I use ```lua
self.character:setRunning(false)--I use true too
self.character:setSprinting(false)--I use true too

gilded hawk
#

Is there a way to extract the variable name from a variable, or a table?

#

Like if I make a
local myVar = {}
How can I pull the name myVar from the variabe myVar?

bronze yoke
#

you can't really

#

if it's in a table you can loop pairs until you find the value, but if it isn't guaranteed to be unique that's no good

gilded hawk
#

Damn, alright too bad, thank you

stray willow
#

🤔 What would be needed to make it so when you complete a recipe it reduces your boredom or unhappiness?

#

I assume a lua function?

mellow frigate
drifting ore
#

I'm testing my mod on a local server. For some reason, OnZombieDead and OnPlayerDeath fire twice... why is this?

stray willow
#

I was consider it to be like...constantly reducing while the recipe is in progress

mellow frigate
stray willow
mellow frigate
stray willow
mellow frigate
stray willow
#

Still appreciate it - I'll probably just simplify it and do like you said for the time being

drifting ore
#

Would I need to listen to a client command on the server to detect deaths?

mellow frigate
drifting ore
stray willow
# mellow frigate None that I'm aware of.

So I guess what I'm trying to do is.... have it something like smoking, where after the smoking action, the item gets consumedand your stress/unhappiness goes down. Where would I look for that if you know ?

gilded hawk
#

Is it possible to set mod data in a specific tile container, and force this mod data to sync with all the other clients?

gilded hawk
#

Does anyone have an Idea why in the OnFillWorldObjectContextMenu inside the worldObjects argument, I keep getting the same object twice?

I had to resort to use a table with string to avoid the duplicate, but I'm not sure if this is a bug, or a feature

local function contextMenu(playerIndex, context, worldObjects)
  local player = getSpecificPlayer(playerIndex)

  ---@type table<string, IsoThumpable>
  local validObjects = {};
  local hasValidObjects = false;
  for _, object in ipairs(worldObjects) do
    local square = object:getSquare();
    if square then
      local moveProps = ISMoveableSpriteProps.fromObject(object);

      if moveProps and object:getContainerCount() == 1 then
        local getContainerCount = object:getContainerCount()
        Debug:print(tostring(object), getContainerCount)
        validObjects[tostring(object)] = object;
        hasValidObjects = true
      end
    end
  end

  if not hasValidObjects then
    return
  end
bronze yoke
#

i've never found the worldObjects table reliable at all

#

i had it returning a completely different list of objects in debug mode than in non-debug mode

wind geode
#

Anyone know how to dupe items on your server, say a bag full of stuff. Im trying to make server lore

reef cairn
#

anyone familiar with how to change foraging zones in debug mod?

#

trying to make an area "urban"

winter thunder
# reef cairn anyone familiar with how to change foraging zones in debug mod?

I dont think you can do this in debug? I beleive that zoning is handled with LUA, at least from what I can see. You set a location with the x and y, designate a height/width for it, as well as the type of zone. So you can do that sort of change more permanently through code like that. Hopefully someone else is more familiar with the debug side for you though

#

Anyone know if there is a way to additively merge tables? Like, if I have two tables like ->

Table1 = { Mustard = 10, Ketchup = 1,}
Table2 = {Mustard = 1, Ketchup = 5, Relish = 94}

Is there a way to turn that into a single table that combines any identical variables? That way the end table is ->

TableFinal = { Mustard = 11, Ketchup = 6, Relish = 94}
reef cairn
winter thunder
#

That is my best guess

reef cairn
#

Yea, ill do some more research

bronze yoke
#

keep in mind you'd have to add checks for the types of the variables if the table could have non-numbers in it

winter thunder
#

Thanks! I appreciate that :)

#

And uh- while I am here… How many if / elseif ‘s can I get away with before someone reads me code and tracks me down IRL to cause me harm? 😂

I need to check values, and the if structure is really appealing for how easy it is to set thresholds / bounds for it to go off.

However, I’ve realized that it will become quite easy to end up accidentally nesting quite a few if’s. Ideally I will plan it out so that it needs to take as few steps or checks as possible. But still 👀

#

This is also going into an OnCreate function, for reference. It shouldn’t be something used a lot in short succession

bronze yoke
#

you can have as many as you want, but long elseif trees like that (especially if you're checking a value as you say) can often be condensed into a couple lines of code using a table instead (and such a system would be easier to extend in the future)

#

i'd have to see exactly what you're doing to know if that solution is wise, but generally

winter thunder
#

The output is modulated by the inputs. I’m effectively brute forcing my way through an alloying system for proper smelting in game 😅

The types of metals used in the recipe is being tracked, but I need to know the amounts of each in relation to each other in order to properly modify the resulting items name, sprite, texture, etc.

I can already do all the individual pieces. But the issue I am running into rn is how to best check those values without using a lot of ifs haha
———
Idea rn is be to check the metal that has the largest quantity in the alloy, and run a function specific to that. That function would check the specifics, sorta like this:

function CopperCheck()
local copperOutput = {}
if copper >= 90 then
       xxxxx
elseif copper >= 75 then
     if tin == 25 then
         outputCopper = {true, ‘BronzeAlloy’, }
         return outputCopper
     elseif tin >= 15 then
            outputCopper = {false, ‘Impure Bronze Alloy’, ‘sprite.png, ‘texture.png’,}

elseif copper >= 50 then
      xxxx
end

The Boolean would be to tell it if it’s creating an ‘item’, or an ‘alloy’. So that specific alloys / pure metals could actually have their own item scripts

#

Issue is that when you have 2-3 metals that doesn’t look bad… when you have 5-10 possible pieces, that gets REALLY REALLY gross 😂

bronze yoke
#

hmm yeah using a table wouldn't be straightforward for this

winter thunder
#

Maybe slap on some booleans? 😂 that way I could specifically run functions that have the right pieces, and very quickly skip them if they don’t

#

Or just check for nil* depending

bronze yoke
#

using if statements isn't bad, though i recommend if you start getting more than a couple layers deep you should split off into a function, it gets pretty unreadable

#

you could do something like defining a bunch of alloys and looking for a best fit but, sounds like a massive headache no matter how you do this

winter thunder
#

That was my thought too. And yeah… that seems to be my MO 😂 I keep picking up really painful projects. The drug mod I made basically made me step away from modding for like 2 months

bronze yoke
#

i guess you could write a bunch of alloy 'recipes', create a function that finds the fitness of a set of materials to a recipe, then when you actually create the alloys you loop through all of them, take the highest fitness, and give it its purity based off of that

#

but i'm sure that'd lead to lots of weird edge cases

winter thunder
#

Yeah… biggest issue I had initially was prevented mega-alloys 😂 something that would purposely be a mix of every single possible thing no matter the quantity. Which will 100% still happen, but I realized that it’s kinda more important to figure out what you don’t care about than what you do

#

I’m my example, you can see that I’ve effectively ignored 10% of the input in that “impure” alloy. Just to make my life easier

still fossil
#

Hello.

I would like to make a simple recipe with different xp gain on certain skill levels (lvl 1 = 30xp; lvl 2 = 20xp; lvl 3 = 10xp, and everything above should give you no xp at all).
Unfortunatelly im a complete noob when it comes to scripting. I have already tried a few things, but without success. It's probably easy for someone who knows what he is doing, but i just can't get the function to work.
Can someone please help me there?

next vine
sand saddle
#

i has a coding question. i still try to get fish working with my adjustable weight script. it does work now for fish created in world (like kitchens etc) since i know how to add my part of script onto "Fishing.OnCreateFish" however how do i do that with "function ISFishingAction:createFish(fishType, fish)" do i just do the same despite it being joined with a ":" instead of a "." ?

median mantle
sand saddle
#

so i join it with a dot then. gotcha and thank you.

#

just a question why is there a "self," in the "old_" call?

median mantle
sand saddle
#

thanks 🙂

#

hmm that throws me a error. "ERROR: General , 1699612762555> ExceptionLogger.logException> Exception thrown se.krka.kahlua.vm.KahluaException: ItemWeightAdjustment.lua:65: function arguments expected near function at LexState.lexerror line:278." line 65 in question : "function ISFishingAction:createFish(fishType, fish)"

mellow frigate
sand saddle
#

local old_createFish = ISFishingAction:createFish function ISFishingAction:createFish(fishType, fish) local fishToCreate = old_createFish(self, fishType, fish); fishToCreate:setActualWeight(fishToCreate:getActualWeight()*SandboxVars.CustomizableWeightMultiplier.WeightMult); return fishToCreate; end

mellow frigate
#

local old_createFish = ISFishingAction:createFish is bad

#

local old_createFish = ISFishingAction.createFish is good

sand saddle
#

facepalms "why its always the small stuff that throws me of the loop. "." instead of ":" easily missable"

#

so.. sorry for me being a stupid.

mellow frigate
sand saddle
#

plan : get fishies to work properly with my weight mod. once that works i will look into furniture. currently my weight adjustment mod does not touch things like ovens,crates, freezers etc.

#

seems they are not stored in "getScriptManager():getAllItems();"

#

i replaced it and it throws me a new error.

#

function: ItemWeightAdjustment.lua -- file: ItemWeightAdjustment.lua line # 64 | MOD: Customizable Weight Multiplier
ERROR: General , 1699613307415> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: createFish of non-table: null at KahluaThread.tableget line:1689.

#

all i did was replacing that : with a .

median mantle
sand saddle
#

all i need is the returnvalue of ISFishingAction:createFish to adjust the weight of the created item. that function is a function by indiestone. and i put it at the end of the lua file. i dont think that that matters as the orginal is not in my lua.

median mantle
#

I mean, which folder your lua file is?

sand saddle
#

the orginal is in ProjectZomboid\media\lua\client\Fishing\TimedActions\ISFishingAction.lua

#

CustomizableWeightMultiplier\media\lua\shared\ItemWeightAdjustment.lua

livid badger
#

can someone tell me the code for spawning a base tree at x, y, z position? or where i can check refs

median mantle
#

I think you should place your code in client folder since the ISFishingAction.lua is also in client folder.

sand saddle
#

i will try that. if i understand the lua coorrectly i only need the returnvalue of ISFishingAction:createFish telling me what fish just got created so i can modify its weight with a function of my own. but i have no idea how to intercept that without doing the overwrite...

median mantle
#

The problem is where the code is

sand saddle
#

kk will make a new file with just that in it and place it at the other location.

median mantle
#

Oh, my mistake there's 1 problem local old_createFish = ISFishingAction:createFish -> local old_createFish = ISFishingAction.createFish

sand saddle
#

i fixed that.

median mantle
#

which is Tchernobill already mentioned above

sand saddle
#

leading to the second error.

median mantle
#

that's nice

#

then move your code into the client folder and it may work fine

sand saddle
#

moving that code works like a charm. thanks for the help! now i need to do extensive testing somehow. to make sure it dosnt messes up peoples saves when i update my mod on the workshop

sand saddle
#

how long does it usually take tll i see my mod being updated in the workshop?

sand saddle
#

ok something isnt working. it does update the description but my "submod" isnt showing up at all. i seen other mods doing it. delivering several separately activateable mods with one subscription. how do i do that?

#

also somehow the "last updated" info still says 4th. not today.

fast galleon
sand saddle
#

i did that. steam does not like.

fast galleon
sand saddle
#

strangely if i try to upload via the workshop ingame it does update the "description" part of the steam page. but does nothing else.

#

me stumped. i have no idea why i cant update my mod.

empty eagle
#

Does anyone know where the inventory images for items are stored?

sand saddle
#

ok i think i found the problem.... apparently the game does not recognize my submod as a mod. despite there being files inside. it detects the main mod and shows it in the modmanager. however the submod despite being there is not showing up.

gilded hawk
#

does your submod have the same ID as the main mod?

sand saddle
#

facepalms "ok found the issue. i was using "steamaps/zomboid/workshop" and not "users\username\zomboid\workshop" gosh damn ....

#

hey game. if you put a folder there. let me f*** use it -.-

gilded hawk
#

Is next available in zomboid's lua? It looks like it's not but I can't get a confirmation

#

mh, yeah looks like next() is not available in zomboid's lua

fast galleon
gilded hawk
#

Oh, really? That's new, thank you!

#

Nice, it works! Thank you!

sand saddle
#

ok now that i crossed off general items and fish off my list. now i need to do furniture. does anyone know where i can access the list with all tables/bed/fridges/ovens etc? apparently they are not included into "getScriptManager():getAllItems();"

gilded hawk
#

Oh yeah, I was trying to do that too, I never found it tbh

sand saddle
gilded hawk
#

What are you trying to achive?

fast galleon
sand saddle
gilded hawk
#

oh that's funny, I'm working on a similar mod lol, but for specific items

sand saddle
#

so i had to get creative.

gilded hawk
#

Oh damn

#

Also, have you looked into the Items List viewer?

#

You can set it to Movable and it gets a list of furniture

#

And if you try to edit an item, you can get the Item.Type 🤔

gilded hawk
sand saddle
#

the premise of my mod is that it works on "everything included modded" so i cant use a predefined list of items.

gilded hawk
#

Then the best approach would be of doing the multiplier thing once the item is picked up

sand saddle
#

i found the "zombie.inventory.types.Moveable" class. it inherits all functions from "zombie.inventory.InventoryItem" so i can edit the base value. all i need now is a list of all items of that class.

gilded hawk
#

I'm still smashing my head against a wall to improve my Storage/Container Upgrade mod

Keep finding small annoying issues with MP sync

sand saddle
#

to be honest i have no idea if my mod works in mp. never really tested it o.O

gilded hawk
#

Also, do item icons have to be 32x32px? Can't they be 64x64? 🤔

gilded hawk
sand saddle
#

for the items itself its editing the base weight of the items on the server side i think. just "weight*mysetting" fishes.. i not sure. i hijack the custom item weight after they are created and edit that.

hallow hearth
#

Are RV interiors created with "addInterior" when first entered or do they statically exist somewhere I can go poking around before entering the vehicle associated with them?

rich void
#

Massive thanks to this community, this channel has been such a useful resource to me and my friends while working on this, hope it's okay to drop in here Spiffo. 🫶

https://www.youtube.com/watch?v=jX7WndxDb_w

Description:

Welcome to the heart of the Zone! 🌐 In this exclusive dev-log, dive deep into the Stalker Roleplay Project, where survival meets the unknown. Join Indie, the project manager, and lead scripting developer, as we unveil the latest features, innovations, and future plans that will redefine your Stalker experience.

0:00 Introduction
1...

▶ Play video
rich void
hallow hearth
rich void
hallow hearth
#

I was thinking more like an alert over the player's head. Add something to the right click context menu to peek in the back and display it.

sand saddle
#

so after abit testing the "getAllItems()" only returns "Base.", "camping.","farming." and "Radio." items. and strangely one "Moveables.Moveable"... wtf?

sand saddle
#

do you know where they hare handled?

fast galleon
#

The weight is set from sprite, like this.

weight = (sprite:getProperties():Val("PickUpWeight") or 10) / 10

If it has a custom item property then it uses that script item's weight.

livid badger
#

Hey yo! how are u?

LootRarity = {}
LootRarity.Common = 15
LootRarity.Uncommon = 8
LootRarity.Rare = 3
LootRarity.Elite = 1
LootRarity.VeryRare = 0.5
LootRarity.ExtraRare = 0.01

local suburbsDistribution = {
    -- общее
    all = {
        -- Zombie female inventory
        inventoryfemale = {
            items = {
                -- "SHALCO.itemName", LootRarity.ExtraRare,
            }
        },
        -- Zombie male inventory
        inventorymale = {
            items = {
            }
        },
    },
    -- большая походная сумка
    Bag_BigHikingBag = {
        items = {
        },
    },
    -- обычная походная сумка
    Bag_NormalHikingBag = {
        items = {
        },
    },
    -- сумка выжившего
    Bag_SurvivorBag = {
        items = {
        },
    },
}

where i can find zombieSurvirors inventory restr. correct name?

sand saddle
#

im currently combinf trough zomboid/media

fast galleon
#

I'd say no

#

You can look at ReadFromWorldSprite to understand how the game transfers sprite properties to the item.

ISMoveableSpriteProps is the file that handles most lua function like pickup. Maybe weight is changed there too. You will need to patch the pickup and the properties for tooltip, etc...

Right, ISMoveableSpriteProps has setActualWeight there and it uses 50 default weight instead of 10 like ReadFromWorldSprite.

ISMoveableSpriteProps.new seems like good candidate for patching.

verbal yew
#

@placid pine hello bro, how about remove item tweaker from your better sorting mod?

verbal yew
sour island
#

You can create an issue, which reminded me to create one myself

#

Otherwise you can create a fork and submit a pull request - which is for them to pull your code into their code base

livid badger
livid badger
sour island
#

?

verbal yew
daring zealot
#

Does anyone here know if there is a sandbox option to enable zombies healing? Or an effect or something. I have seen a very weird behavior where zombies are healing constanly and I thought of maybe making a mod, but I first need to find if there is really an issue and which one is

safe sinew
#

I'm going to assume that there's no way for clothes to give carry capacity bonuses or something like that

tranquil kindle
sour island
#

Just a fair warning, manipulating weight that way can cause problems from what I understand.

#

Worn items can also be containers - i.e. have pockets. Shark's military gear does this.

#

Like the fanny pack in vanilla.

hallow hearth
vestal path
#

Hi! Can anyone help me with very simple Lua question?

So I do the test mod for myself (mb I'll publish some mods later... when I become more experienced)) )
I try to add experience to player with
OnGiveXP:Recipe.OnGiveXP.ADBandaging, in script section and I make a lua function:

function Recipe.OnGiveXP.ADBandaging(recipe, ingredients, result, player)
    player:getXp():AddXP(Perks.Doctor, (10 + ZombRand(10)));
end

But the game doesn't add exp to my player. Console says: "ERROR: General, LuaManager.getFunctionObject>no such function "Recipe.OnGiveXP.ADBandaging" "

What I am doing wrong?

sour island
#

Are you requiring the original recipe file?

bronze yoke
#

any recipe code should be in the server folder

vestal path
bronze yoke
#

/* */ isn't lua syntax, that'll stop the file from reading

vestal path
#

oww

bronze yoke
#

use --comment for line comments and --[[ comment ]] for block comments

vestal path
#

thanks!

pseudo apex
#

Are there ways to make an item of clothing usable only by an admin? without increasing the weight

frozen elm
wintry dune
#

does anyone know how to resolve IStooltipinv errors? Specifically that an item will not display its toolip, and attempting to edit the item will cause the game to break. The errors reference ISToolTipinv.lua lines 73(i think) to line 108. I think the game is attempting to generate a tool tip but it's stuck in a loop. I don't know where in my mod files the error is generated. Related, an item icon will not be generated though I'm sure i referenced the .png correctly in the .txt file of the item

#

--sorry for the word wall, trying to keep some documentation for myself

frozen elm
#

key rings are a complete enigma to me right now

#

how do they retrieve character names? how do they stay equipped?

#

i continue to ponder these mysteries

gilded hawk
#

Want to share a silly screnshot of my debug character current vibe

wintry dune
random finch
#

Is there a way to abruptly stop a hitreaction to allow an attack? Say OnPlayerUpdate when IsAimKeyDown() is true?

safe sinew
safe sinew
#

Thanks

trim juniper
#

Hey all. Anyone know if there's a simple way in Debug mode to force-kill all active zombies (as opposed to just clearing them)? I'd like to do some practical tests on zombie loot spawning, to check if my mod is working correctly, but I can't find any simple way to test without just running around shooting lots of zeds.

#

Either that, or I'm thinking perhaps some code to reduce any loaded zombies to zero health automatically... would that work?

fast galleon
vestal path
#

Hi! Is there a way to do recipe only once on same ingredients? In my recipe I want to keep zombie corpse, but I want that i cannot use this zombie in that recipe again. Also, I dont want to do 'fake zombie corpse' to replace one in recipe. Anyone has ideas?

#

Maybe I can add some tags? How do I do it?

drifting ore
#

hello. trying to find a simple way of adding custom cookware to advanced recipe lists without also conflicting with dozens of other mods and/or taking forever. anyone have any solutions?

idle hornet
#

Is it possible to mod music? Like is it possible to replace the soundtrack?

#

I've had the idea to re imagine the soundtrack for a while but if it's not possible I want to know before I get too deep.

blissful salmon
#

I try to change the item of a "IsoWorldInventoryObject". I use the following line to change (item is of type "IsoWorldInventoryObject" and newItem is of type "InventoryItem"):
item:swapItem(newItem)
This works on the client but isn't synct so the server. So other players won't get the change. Also when I logout and login again the change isn't there.
I tried the following methods to sync it to the server but it still doesn't work.

item:update()
item:transmitCompleteItemToServer()

Is there something else I have to do?

median mantle
#

Because, IsoWorldInventoryObject.swapItem calls IsoObject.sendObjectChange method when it's called on server side.

mellow elbow
#

hello! Can someone tell me how to make a poster mod? I tried with several tutorials and some other guides and I don't know if it didn't work because of something in the program or if I did something wrong.

mortal widget
daring zealot
#

Does the EveryHours have any way of happening every X ammount of hours, or it can only be in 1 hour intervals?

sour island
bronze yoke
#

you can also use the current hour to determine it

sour island
#

Oh yeah, if you need it to fire at noon rather than every 4 hours etc

bronze yoke
#

e.g. adding if getGameTime():getHour() % 2 == 0 then return end to the start would make it fire only on odd numbered hours, depends on what exactly you're trying to do

manic relic
#

anyone know how to stop this error "page" from appering?

#

cause it for some reason breaks my whole game when using debug mode

thorn brook
#

does anybody have a solution for this? i can't upload a mod

manic relic
#

and when I click on the skp botton it just happens this

#

the whole menu is just gone

thorn brook
manic relic
#

yeah but how do I stop it?

#

cause I cant test my mod

thorn brook
#

well remove the mod that's causing the problem probably

manic relic
#

huh?

fast galleon
manic relic
fast galleon
#

wrong msg

manic relic
#

sorry I cant follow you

thorn brook
#

so you might want to double check your code, i'm not sure

thorn brook
#

how do i solve it

fast galleon
#

maybe you're offline? try to relog.

thorn brook
#

weird

#

well, thanks

manic relic
#

I double checked the code for the 5th time now and it still doesnt work

#

does anyone have a soulution against it?

wintry dune
manic relic
#

nah just the same again

#

boots me to the main menu with nothing to press

#

and I did check the code

#

now my old test mod doesnt work either

#

im losing my mind

zealous bloom
thorn brook
#

hey, how do i remove the poster image from my workshop item?

#

like i want to have just a youtube video, but i can't seem to remove the image

#

@fast galleon do you know maybe?

sour island
#

Fairly certain you can't remove posters on the workshop.

blissful salmon
thorn brook
#

for example this one, 2 different images

bronze yoke
#

the icon is shown as a poster when you have no posters

#

it sounds like it won't count a video for that

thorn brook
#

alright i'll try a poster then

sour island
#

You can add images to the workshop, which is what shows on the left

covert carbon
#

What is the purpose of

{

}```
when creating items?
bronze yoke
#

it's to avoid name clashes

#

you're not really supposed to use module Base, you use one with your own module name (e.g. module MyMod)

#

if two mods add an item called apple, if they're in the same module it's a conflict, but if they're in different modules they can co-exist (resulting in ModA.Apple and ModB.Apple)

covert carbon
#

oh alright

#

thanks

sour island
#

Anyone know if its possible to add text to zombies using halo or say?

#

Got one that worked

#

addLineChatElement

#

As it turns out speedMod isn't the speed of the zombie afterall

#

Weird it was working then

wintry dune
bronze yoke
#

importing a module means you can reference things from that module by their type instead of their full type (e.g. Apple instead of Base.Apple)

#

there aren't a huge amount of reasons to do it for most script types, but it's very nice for recipes

covert carbon
#

Which file do you put items in?

wintry dune
#

👀 noted...maybe i should get rid of that in my item's text file since it doesn't need a recipe and therefore the import does literally nothing

sour island
#

Were zombie behaviors changed? setting tripping from sprint isn't working :\

#

Oh wait, I think I know what's going on

#

I left the my mod that stops sprinters from falling on

#

lmao

oblique estuary
#

Is there anyone here that possibly can help me figure out what's wrong with my mod when I upload it to workshop?
I'm very new at this and wanted to start with something simple, so I wanted to add some simple recipes to test the waters of my understanding of modding.
When I host the server It works fine when it's manually added in C:\Users\username\Zomboid\mods, but when I have it on workshop it doesn't seem to function anymore

I don't know if this is the wrong place to ask about this 😅

sour island
#

You need the staging folders for the mod - see Mod Template for an example

oblique estuary
bronze yoke
#

are you adding it to both the workshop tab and the mods tab?

oblique estuary
#

No, when I uploaded it, it was only at the workshop folder.. Should I have added it to mods as well?

bronze yoke
#

i mean in the server configuration

#

there's a workshop tab and a mods tab

#

the mods tab tells it which mod ids to enable, but if it hasn't been added to the workshop tab, the server won't download the mod in the first place

oblique estuary
#

Huh.. I did not know that, Usually I am not the one launching the servers, I'll try it out!

blissful salmon
#

Is it possible to get an instance of an existing item by its ID?

oblique estuary
#

When it happened last time, it was because I had made a misspelling in the script, although I can't seem to see any issues with the script this time

covert carbon
#

Which file do you put item files and icon pngs?

#

Folder*

oblique estuary
azure mauve
#

How do I access the workshop mod files for PZ? I want to see if I can make a few patches for compatibility

formal rain
#

is this lua bit written to ensure only cooked counterpart of the ingredients are used if there are any?

function Recipe.OnCanPerform.SliceCooked(recipe, playerObj, item)
if item and not instanceof(item, "Food") then return true end
return item and (item:isCooked() or item:isBurnt())
end

#

it's a part of vanilla recipes to split cooked pasta/rice into bowls

#

i keep getting this error when i try to craft the recipe, if it's related the recipe isn't becoming available in the crafting menu either

#

only available with right clicking item in the inventory

#

in case anyone's feeling like helping with what's going wrong

formal rain
#

^figured it out processed cheese is breaking it, can ignore the wall of text and images

verbal yew
#

ReplaceOnCooked = MyModule.LLSaucepanMilk2,

formal rain
#

ohh

#

OHHH IS THAT WHY the recipes dont show in the crafting menu

#

that's the only problem i have left right now

verbal yew
formal rain
#

im sorry SCGbigsad

verbal yew
#

I now want to rewatch it

#

xD

formal rain
#

and teach me what the problem is with it not showing on the menu

formal rain
#

in the video

#

i can craft them by right clicking the ingredients

#

but i cant over the crafting menu

#

it all started because i used this vanilla line in the recipes to pick out the cooked version instead of uncooked/burnt/cooked: OnCanPerform:Recipe.OnCanPerform.SliceCooked,

#

this is the lua definition of the line:

function Recipe.OnCanPerform.SliceCooked(recipe, playerObj, item)
if item and not instanceof(item, "Food") then return true end
return item and (item:isCooked() or item:isBurnt())
end

#

if i don't add this recipe picks out all kinds of cooked/uncooked/burnt

#

when i add this it doesn't show as craftable in the crafting menu

#

but works correctly in the right click options

verbal yew
#

As far as I remember, spoiled or burnt material cannot, in principle, be used for crafting from standart craftmenu recipes...

formal rain
#

it can

#

wait let me clip this

#

without the line

#

OH WAIT

#

spoiled or burnt

#

RIGHT

#

but it still uses uncooked

#

which is what im trying to dodge

verbal yew
#

OnCanPerform:Recipe.OnCanPerform.SliceCooked,
need change OnTest:,

#

and in lua check item state what you want

#

like, return false if uncooked

#

if i rightly understood u

formal rain
#

wait i have little to no coding knowledge so

#

let me try to write something to see if i understand it

verbal yew
#

min

formal rain
#

liiiike this on lua?

#

function Recipe.OnCanPerform.SliceCooked(recipe, playerObj, item)
if item and not instanceof(item, "Food") then return true end
return sourceItem:isCooked()
end

#

and the recipe would be like

#

recipe Make Cheese
{
LLSaucepanMilk,
keep Bowl,
keep Spoon,

Result:Cheese,
Time:80.0,
SkillRequired:Cooking=1,
Category:Cooking,
OnTest:Recipe.OnCanPerform.SliceCooked,
}
#

and i can change the "SliceCooked" to something else

#

so it doesn't clash with vanilla stuff yeah?

verbal yew
#
function Recipe.OnTest.MyTest(sourceItem, result)
    if instanceof(sourceItem, "Food") then
        if not sourceItem:isCooked() then
            return false
        end
    end
    return true
end
#

try it OnTest:, in recipe

formal rain
#

omg

#

i made it almost identical to yourse

verbal yew
#

hahaha

formal rain
#

ohh so

#

like this in recipe

#

OnTest:Recipe.OnTest.LLCheese,

#

because we change it to ontest on lua too

verbal yew
formal rain
#

OH MY GOD

verbal yew
#

work?

formal rain
#

YESSSS

#

ILYYYYYYY

#

im even a bigger fan now

formal rain
verbal yew
formal rain
# verbal yew

oh while you are here, did you get around checking crafting enhanced core btw?

#

i was gonna ask that day, i thought your vaccine mod used a similiar system

formal rain
verbal yew
#

last time i'm playing, not modding xD

formal rain
#

oh alright...

verbal yew
#

yay, finally, after 8 months

formal rain
#

enjoy praise_cat

verbal yew
formal rain
#

oh you dont remember sadyell

#

it is like a base thing to tie recipes to workstations

verbal yew
#

drunk emmm

formal rain
#

all good, i thought i'd ask since we talked about it before nehehe

#

ignore it then

#

thank you for the help again

verbal yew
#

i'm dont remember xD

formal rain
#

YES!

verbal yew
#

but Vaccine do it from lua func

#

standart recipes has string for check it

#

not sure about double near item

formal rain
#

oh i never thought of that

#

i'll try the double

verbal yew
#

ah, yep! i remember it xD

#

i get this tips from u

#

NearItem:Workbench,

formal rain
#

ohhhh

#

isee

#

this one looks much more customizeable

#

i like it a lot

formal rain
verbal yew
#

yep, maybe. But if NearItem:1item;2item;3item, work fine, then easy way use it.
But honestly, I don’t know if this is necessary at all.
It’s just that in the fashion for the vaccine there is one recipe with checking the location next to the computer and chromatograph

formal rain
#

so your system is 100% better for that

#

... i put a regular ass , instead of ;

verbal yew
formal rain
#

yeah no it doesn't work

verbal yew
#

sad)

formal rain
#

it shows in game but recipe isn't available

verbal yew
#

WOW

#

it's has string

#

xD

formal rain
#

yeah

#

it really shouldn't

verbal yew
#

how about double nearitem?

formal rain
#

it didn't work either

#

i tried it earlier

verbal yew
#

ehhh

formal rain
#

well

#

it is what it is

verbal yew
formal rain
#

almost sure CEC came after your mod pepeLurk

#

but it doesn't matter you guys use different systems

#

for the samesimiliar result

verbal yew
#

I don’t know at what point two tiles next to each other can be useful for crafting (except for a vaccine, where you need a computer and a chromatograph, but this is one case out of all the recipes)

formal rain
#

i made a recipe mod for our server using CEC as base

#

it includes everything people can need in a server

#

from tools to paints to clothes, medicine

#

never needed double

verbal yew
formal rain
#

slightly visually edited vanilla tiles

#

and yes

#

that's about it

verbal yew
#

ah, nope, they has autonomy tiles

#

Well, in fact it's not even a complicate mod, just TileSet...
You can just as easily use any tile like NearItem:,

formal rain
verbal yew
#

But this is not bad, for those who do not know how to make moveable objects and tiles xD (like me)

formal rain
#

(or me)

verbal yew
#

Listen on Spotify: https://spoti.fi/3SsugU0
Apple Music/iTunes: https://apple.co/41rIQPA

Thanks for listening to my cover of I Really Want to Stay At Your House, originally by Rosa Walton. CyberPunk Edgerunners is just such a moving anime that I had to cover this one. It's one of those songs that gives you a completely different vibe from the f...

▶ Play video
formal rain
#

im gonna listen to it on loop

frozen elm
#

How do you fix this when the mod is already deleted on the workshop?

verbal yew
#

found author of mod and kick them ass

frozen elm
#

I already deleted it from the server though

#

Do you recommend unsubscribing then subscribing again to all mods?

verbal yew
#

mod enabled in two table

#

Mods and Steam Workshop

#

should be deleted in two place

#

for example

frozen elm
#

I already deleted it in the two places

#

Now the server has normal termination

latent lance
#

I've created a miniature script for learning LUA in zomboid which works perfectly fine in singleplayer, but if I wanted to add multiplayer support how would I get the specific player which triggered the event?

near haven
#

Hey ya'll, is this a good place to ask for modding help/ideas?

#

For developers*

manic relic
#

yep

#

go ahead WindFish

near haven
#

Is there a way to replace an in-world item with another item at run time using just Lua? Say I have an ingot that is "hot" that I put it on the ground (that uses a 3D model). After a certain amount of time passes I would like to change it to a "cooled down" ingot item. How would I do that? Is there a way to replace the entire item with a cooled down version while preserving it's location and rotation in the world and making the transition seamless? It seems like the location/rotation functionality might be buried pretty deep in the Java so I'm not sure.

I have been able to spawn items in the world but the location and rotation is randomized, and it doesn't work properly in servers (duplicates ingots sometimes and doesn't show moving between containers for different players) even though I've tried it in both the 'shared' and 'server' folders. This is what I'm currently using that works on a solo world, but doesn't set the location or rotation:

    -- Add new item to world square
    square:AddWorldInventoryItem(newItem, 0.0, 0.0, 0.0);
    -- Remove old item from square
    square:transmitRemoveItemFromSquare(oldItem:getWorldItem());
rugged latch
#

havent tried it myself but a quick look at stuff gives me the guess that it might lol

#

dont take my word for it

near haven
#

Possibly?? I'll have a go with it. Also concerning though is the poor implementation I've managed so far with the spawning in servers. Do you have any ideas why items would be duplicating when moving them between containers? Is there a refreshAllPlayersInventories function I should be calling perhaps?

#

Or maybe pushing the item to the server so it saves it for everyone?

rugged latch
#

ill be frank i am likely more new than you are wiht zomboid modding lol, i havent fiddled around with in world items yet to know myself

#

my best guess issssssssssssss its some server shenanigans with some of your code being client side and some of it server side? not sure tho

#

because if it doesnt show transfering between containers for other players that tells me that its set to run that stuff client side but not server side

near haven
#

All of my code is in the shared folder at the moment, I'll try tossing it in the server folder again and test it more with my buddy tomorrow or Monday. Any other suggestions anyone can offer are greatly appreciated, but no rush, this sucker has been haunting me for weeks at this point : P

Thanks for trying, @rugged latch 🙏

livid badger
#

guys, tell me how can I change the character's running speed? (I have ready-made temporary events that will, under certain conditions, be triggered up to a certain period of time) I need links to examples where I can see examples of changing the characteristics (running speed) of a character.

local player = getSpecificPlayer(0);
    print(player.CurrentSpeed);

i dont think that this one is correct method

rugged latch
#

this here work for you?

#

wait sorry had to edit it, try using that

bronze yoke
#

it's some legacy stuff, the server folder runs on clients too and there isn't much of a difference between it and shared except load order

#

(not to mention nearly all of the vanilla lua in shared/server only actually runs on the client)

livid badger
near haven
# bronze yoke the server folder is also shared, you won't see any behaviour different

Interesting.. Can you think of a reason why an item might be doing different things for different players on a server? ie. player1 takes item out of oven but player2 still sees it in the oven. Once an item is spawned in the world, shouldn't it be included in all the updates and events that happen naturally? Or do I need to manually refresh all inventories?

bronze yoke
#

you shouldn't need to manually network things unless you're messing with them with custom code

latent lance
#

In a multiplayer scenario, how would I turn this from local player = getSpecificPlayer(0) to local player = getSpecificPlayer(playerIndex)?

bronze yoke
#

one thing to keep in mind is that the game is generally just kind of rife with those kinds of duplication bugs, so unless it's really persistent it might not be your fault

latent lance
#

the full function:

function checkForKeyPress()
    local player = getSpecificPlayer(0)
    local key = 25

    if isKeyDown(key) and not player:isDead() then
        player:setHealth(0)
    end
end```
bronze yoke
#

this code doesn't really need to be changed for multiplayer, it should work fine already

latent lance
#

So 0 is always the player who triggers the event?

bronze yoke
#

getSpecificPlayer only gets players from the client

near haven
#

Thanks, ya'll, I'll try some more stuff and get back : P

bronze yoke
#

(up to 4 because of splitscreen)

latent lance
#

Ahhh, thank you very much 😄

bronze yoke
#

if there's a keyboard player they're always player zero so this works fine in both splifscreen and online

rugged latch
#

Trying to check the light level of a grid square or something similar and led me to this https://projectzomboid.com/modding/zombie/iso/IsoGridSquare.Lighting.html
local playerSquare = getCell():getGridSquare(player:getX(), player:getY(), player:getZ());
print(playerSquare.lighting.resultLightCount());
however this line right above seems to just error no matter how i fiddle with it with zomboid only ever having this to tell me.
"java.lang.RuntimeException: attempted index: new of non-table: null"
which is confusing considering im not trying to access a table nor does the method im accessing return one
im pretty new to lua but not coding in general so this might just be some typing error or lua jumbo c# brain can't comprehend

bronze yoke
#

objects are tables

rugged latch
#

darn your totally right arent you

bronze yoke
#

i'm not really sure where it's getting the new from

#

also frustratingly you can't just access fields like this

#

there's a complex method to do it (or i wrote an api that does let you do it the way you're trying) but i think i remember a method to get light level anyway

#

playerSquare:getLightLevel(player:getPlayerNum())

rugged latch
#

wowza spent about an embarrasing 7 hours and its just that easy, seriously exactly what i was looking for
there was about a million functions and fields with light related names and i just sort of assumed what i was trying to get was the closest thing without really knowing how to get it
also of course im gonna have to learn some more bout lua but thanks lol

livid badger
#

guys, tell me how can I change the character's running speed? (I have ready-made temporary events that will, under certain conditions, be triggered up to a certain period of time) I need links to examples where I can see examples of changing the characteristics (running speed) of a character.

local player = getSpecificPlayer(0);
    print(player.CurrentSpeed);

i dont think that this one is correct method

trim juniper
#

Okay, another server/client question:
I'm doing a simple mod to give a semi-randomized starter kit to each player, using OnCreatePlayer and player:getInventory():AddItem(###) commands. Works perfectly singleplayer - I assumed it would be server-side, so I put the if isClient() then return end statement at the beginning... but then nothing happens when online. If I run it client-side instead, do I need to manually sync inventory changes somehow, or will it just work?

trim juniper
#

Out of interest, is there any resource out there I'm not finding, that actually gives more details about the API beyond just the function headers? How can I work this stuff out for myself without coming on here every time to ask the gurus? 🙂

wispy lark
#

Use a decompiler.

mellow frigate
mellow frigate
#

also if I remember correctly, "0,0,0" coordinate is handled as random position request. put any other value instead to set the position. (valid values are in the range [0,1])

latent lance
#

Are there any resources for creating custom UI panels?

gilded hawk
#

How can I check in lua if the player can craft a recipe?

Edit, found it.

local count = RecipeManager.getNumberOfTimesRecipeCanBeDone(selectedItem.recipe, self.character, self.containerList, nil)
near haven
covert carbon
#

Trying to understand how OnCreate works in recipes. For example, when a recipe says
OnCreate:Recipe.OnCreate.SliceHam,
What is it doing

heady crystal
#

Anybody know how to fetch if the player is the host user of a self host server?

neon bronze
gilded hawk
latent lance
#

Does anybody know how I can communicate with the server if something happens client-side? For example, the player clicks a button on the UI

neon bronze
#

Server commands

heady crystal
gilded hawk
heady crystal
gilded hawk
#

Oh damn, okay good to know. thank you!

latent lance
# neon bronze Server commands

SendCommandToServer("TestCommand")

function onClientCommandToServer(command)
    local player = getSpecificPlayer(0)
    if command == "TestCommand" then
        
        -- Make the player say something on the server
        player:Say("test")
    end
end

-- Hook the command handler to the server
Events.OnClientCommand.Add(onClientCommandToServer)```

Do you know what I am doing wrong?
median mantle
#

So you can't use getSpecificPlayer and there're not enough args for function

covert carbon
#

How do you find what square a player is in

gilded hawk
#

Is there a way to make it so that the toltip does not cover the option under it?

neon bronze
#

Player:getSquare() or get the x, y,z coords

mellow frigate
# near haven Okay, interesting.. So how would I get the old items xyz coordinates on the squa...

yeah, just test mate. below is an example of parsing all InventoryItem in IsoWorldInventoryObject instances of a grid square. ```lua
local square = getCell():getGridSquare(posX, posY, posZ)
if square then
local found = false
--if the square is loaded and the
local squareObjects = square:getObjects()
if squareObjects then
for i = 0, squareObjects:size() - 1 do
local object = squareObjects:get(i)
if instanceof(object, "IsoWorldInventoryObject") then
-- Get the item from the IsoWorldInventoryObject
local item = object:getItem()

median mantle
#

There's also IsoGridSquare.getWorldObjects method

gilded hawk
#

Is there a way to force Zomboid to reload an entire mod's lua while you are playing without having to load and re-load your save?

covert carbon
gilded hawk
#

Ah damn, I'm already doing the f11 and one by one thing 😦

covert carbon
#

Is a pain we must all go through

gilded hawk
#

Alright, I guess I wil implement the hard reloading myself

covert carbon
#

Would be a good idea to make a mod that lets you reload large sets of files

#

But would probably screw up your game depending on the file you reset

gilded hawk
#

Yep, I will add it to my upcoming MxUtils then

covert carbon
#

nice

mellow frigate
mellow frigate
#

Beware not wasting your time, you've got mods to do 😉

median mantle
#

So it may works as well IMO

mellow frigate
bronze yoke
mellow frigate
#

@near haven object:getX(), object:getY(), object:getZ() ..

covert carbon
#

does anybody know what this means

#

I spawn in, get the error. I press any numbers on my keyboard, get the error. I modded the game but I don't know what the issue is

bronze yoke
#

your recipe references an invalid item

#

i think this only happens when it's a result item

latent lance
#

maybe similiar

latent lance
#

Has anybody got an example of sendservercommands? I'm having an issue where nothing is happening when calling the function and I'm getting no errors

hot void
#

how do i add clothing on zombies?

thorn brook
#

i think i'm just gonna remove it and set it in the distributions file instead

trim juniper
wintry dune
# hot void how do i add clothing on zombies?

I think in the modeling channel there's a clothing mod tutorial that mentions how to get your clothes to appear on zombies
Though last time I checked, to make clothes appear in containers n stuff you needed to do something with lua distributions...someone please correct me if I'm wrong but I hope that offers a lead

#

To manually put something on a zombie and spawn it in, I'm not sure though. Sorry if that's what you needed!

hot void
#

i looked into the game code and got an idea

#

but i cant control the underware spwaning on zombies

trim juniper
hot void
#

i need to able to control all the clothing options

#

i have really spcific zombies in mind

#

@wintry dune

oblique estuary
#

Would there be anyone here who can tell me why this happens? (Server has stopped during launch (NormalTermination)
When I try to launch a multiplayer server with a mod I've created, it doesn't allow me to launch the server with the mod from the workshop, however it works perfectly fine when I try to launch a multiplayer server through local files.

At first I thought I must have made a silly mistake in the folder set ups, but after checking it over multiple times, I cannot see any issues, I am completely new at this, so I over simplified the mod to trouble shoot, yet it still doesn't allow me to create a multiplayer server with my mod attached to it when I use the mod from workshop.. What am I doing wrong here?

I have some plans for things I want to make, but if I can't make a simple mod like a single recipe work, it would seem silly to work on a bigger project

bronze yoke
#

the mod is private

#

the server downloads workshop items anonymously, so it can't download private mods

#

use unlisted instead

oblique estuary
#

Oh, does the same count for friendsonly?

bronze yoke
#

yeah, if someone not logged into steam can't see your mod, the server can't either

oblique estuary
#

Ooooooh, So all this time.. I've been knocking my head against a wall for 48 hours now, thank you so much Albion, this is my first time trying
When you explain it, it seems logical now 🤔
Big appreciation from here

gilded hawk
#

Do you guys think this UI is good enouhg?

oblique estuary
latent lance
#

Looks clean by the way

gilded hawk
winter thunder
#

decide to work on a blacksmithing mod

just now remember to check last months Thursdoid

see they are implementing a base game version of blacksmithing, with many similar characteristics of the mod being made

😔 suppose that means I just need to work fast enough to beat them to release

hot void
#

sadge

gilded hawk
#

What is the safest and most performant way to apply a default value to table?

tepid jewel
#

yo, sorry if its been asked billions of time, but I'm thinking of giving a try about modding the game, i would like to know if it is the right modeling file and what software should i use as a begginer ?

#

just want to edit the model/texture of the katana as a first goal

gilded hawk
#

it wooooooooooooooooooooooooooooooooorks!

#

5 generators 😄

wintry dune
# hot void <@825442656305020948>

Oh dam, not entirely sure how to do that. I know authentic Z has specific zombies that spawn (like a fully dressed clown for example). I think it's more like: have 1 zombie spawn with x, y, z clothes. You can try looking through authentic z's mod scripts but otherwise I'm not sure how to program such a thing. Good luck, hopefully someone can help a bit more!

bronze yoke
#

if you want to avoid repetition you can use a function that returns that, i haven't tested but i imagine that would be faster than the metatable approach

#

gonna test that actually, curious how metatables actually perform

#

in regular lua the metatable is much faster... can't test for pz now but maybe that is the right approach

gilded crescent
#

Anyone have an idea on how to add storage to tents? I know its planned for build 42 but I want to do a playthrough with no vehicles, travelling on foot and setting up a camp somewhere, I haven't been able to figure it out and I don't know much about modding this game and also still learning Lua

sleek heath
#

if i change names here will it make a completely new mod or update the current one i have uploaded?

#

cause im curious what i can change in the mods descriptions and such

fast galleon
sleek heath
#

a completely new folder?

#

aaaaah gotcha

fast galleon
#

changing the id can break saves, fyi

sleek heath
#

ah ok

#

gonna leave those alone then

#

they're a little innacurate but oh well

#

lol

#

rather not mess up peoples multiplayer servers lmao

fast galleon
#

you can usually upload a new submod with new id and gradually remove the old after some time has passed

sleek heath
#

making an expanded music add on for my current one as a separate mod of course

fast galleon
#

The issue with this right now is that all submods can be enabled automatically on servers or by people who skip reading instructions.

If you have mods that should not be used together (different mod versions) then it could cause issues. Big warning in description helps but not everybody reads it.

sleek heath
#

just thought i'd have a 1994 to 1999 music mod incase people wanted songs that just missed the 1993 mark lol

dull hornet
#

Hello,

Someone know how/where i can override/alter the zed story generation ? i'm working on this mod (zombie Legend) : https://steamcommunity.com/sharedfiles/filedetails/?id=2990731456 that spawn grey clothless Zed (Like the movie 'I am Legend'), it work for the random Zed, but those generated by the Story keep their clothes. I find nowhere where i can get rid of it

I searched by keyword on the discord, but i dont think the answer has already been given

sterile belfry
#

Hey guys, how are y'all doing?
I'm trying to change the walk and idle animation but without success 😦

Someone here knows how to change idle and walk animations?
I wanna use on my camouflage mod... When the player is camouflaged, player should act like a zombie

Thanks in advance

thorn brook
muted garnet
#

Please say me can I somehow view the entire list of global variables?

verbal yew
muted garnet
verbal yew
#

thats all

#

hvatit

#

go

muted garnet
verbal yew
muted garnet
verbal yew
#

xD

daring zealot
#

Does anyone know if there is amod that makes the can opener have priority when opening cans? RN, when u try to open one it will use knifes first, which is not optimal. Thnks

pulsar heath
#

heya, just to let everyone know ( whoever has any interest in it ) that im updating my integration mod, plus remaking ( almost done ) the App that stands in between the game and mod, so i'm taking suggestions and ideas of stuff anyone thinks would be something to add in the game integration with twitch.
Proof of concept https://www.youtube.com/watch?v=wdkwUSoycYc

so if anyone has any thoughts of a functionality to add, just let me know

Finished adding bot support ( fully customizable with rivescript ), worked a bit on the UI, ironed out a lot of bugs ( plenty still around i bet ), next step finish coding a more user friendly settings menu/form.

▶ Play video
#

also i'm making it so that anyone who wants to integrate their mod with twitch will be able to do so, using the app and adding a few lines of code in the original mod

muted garnet
# fast galleon Global Variables? Kak _G? https://www.lua.org/pil/14.html

like this, but please say me variables that are passed to a function without being used in code, like in this code:

function Function(player, perk, perklvl) 

if perk == Perks.Strength then
  if perklvl == 10 then
    player:learnRecipe("Recipe")
  end
end
end
Events.LevelPerk.Add(Function)

in this code the function will be executed without errors, although the code does not contain the variables player, perklvl, perk, I want to find out how many such variables there are or what it is that the function reproduces them itself without specifying the variables in the code, if these are global variables, then using for n in pairs(_G) do print(n) end I did not find any mention of these variables

fast galleon
# muted garnet like this, but please say me variables that are passed to a function without bei...

This snippet would not work, the events add is inside the function, you never call that function.

https://github.com/FWolfe/Zomboid-Modding-Guide/blob/master/api/README.md#the-event-system

This is a good guide about events.
https://github.com/demiurgeQuantified/PZEventDoc/blob/develop/docs/Events.md

Another list of events.
https://paste.sr.ht/~ckyb/99d2d134360d355f33ceecf255b971f6b1d03624

You can also test them in-game to check specific conditions...
#mod_development message

GitHub

Tool for generating Lua documentation for Project Zomboid events and hooks - demiurgeQuantified/PZEventDoc

GitHub

Guide to modding various aspects of Project Zomboid - FWolfe/Zomboid-Modding-Guide

fast galleon
muted garnet
muted garnet
#

the function works, but I don’t understand where it gets player, perk, perklvl from, since these values are not in the code

#

using ongamestart event function will not work and will send error

#

but using levelperk all works, but how?

verbal yew
latent lance
#

Anybody know why my mod UI doesn't appear for clients on the multiplayer server when downloaded through workshop?

#

but does when the mod is installed in the mods folder

#

it works on singleplayer

latent lance
wispy lark
#

sendClientCommand already infers the player. You dont need to include it.

latent lance
#

works now

gilded hawk
#

Does anyone know how the get a list of player given the coodinates of an object? nvm found it

timber yew
#

Hey guys, im full zero at modding, but i want to add custom sound for the cars in PZ. Is it possible to change default sounds to something more clean and real?

gilded hawk
#

Is there a common sendServerCommand to tell the player that OnContainerUpdate has been triggered?

slender stream
#

anyone knows how to make ingame visible map for modded map? I create a modded map, even though it is loaded into the game, the ingame player map does not reflect the modded map

muted garnet
bronze yoke
#

true if the perk level went up, false if it went down

#

in vanilla only strength/fitness will ever go down

muted garnet
#

thanks for answers

gilded hawk
#

@bronze yoke do you know if there is a way to trigger opening the debugger in pz via lua?
I noticed that I need to debug certain things before I can click F11

bronze yoke
#

i don't know if there's a better command for it, but error() will open it

gilded hawk
#

Ah great, thank you

hot void
#

why cant i use vanilla guid to make clothing sets for zombies

#

the first one is a guid from my mod

#

but the 2nd one is a guid from vanilla

#

mine shows but the vanilla one doesent

brave ruin
#

How long can you go on loot distributions ?

#

Like 0.1 or 0.0000001?

#

etc

hot void
#

0.1 is too low imo

#

1 out of 10 spots might have your item

brave ruin
#

Ohh okay

hot void
#

@brave ruin

brave ruin
#

Well some mods have multiple ones

#

Like britas armor

#

I find it to be to much loot everywhere

#

Of brita's armor

hot void
#

my guess is arsenal mod changes distributions for brita mods thats why its more common

brave ruin
#

I don't use arsenal mod

gilded hawk
#

I'm having a weird problem with my util, apparently { unpack(defaults) } does not work, and it always returns {}

---@param target table
---@param defaults table
function Utils:mergeWithDefaults(target, defaults)
  if not target then
    -- Return a new table to avoid modifying the input
    return { unpack(defaults) }
  end

  local result = {}
  for key, defaultValue in pairs(defaults) do
    result[key] = target[key] ~= nil and target[key] or defaultValue
  end

  return result
end
hot void
#

had to change them to something btween 1-4

#

but thats for cosmatic clothing tho

bronze yoke
#

0.1, on default loot settings, means a 0.0004% chance

hot void
#

i still cant find out why i cant add vanilla items to my mod zombie clothing sets and the guide in the modeling channal has the same thing i did

brave ruin
#

Do anyone know why the console spams

AnimationPlayer.play> Anim Clip not found: InvalidOnPurpose

and how to fix the issue?

gilded hawk
#

When I'm hosting via no-steam, using the host menu, do the server logs go in the console.txt?

bronze yoke
#

no, still coop-console

gilded hawk
#

Ah, okay thank you

reef cairn
#

I am trying to make sure this warns the server using /servermsg funtion

#

this is what I have so far

#

chatMsg.__index = chatMsg
if not isAlert then
msg = "[Server] "..msg
end
ISChat.addLineInChat(setmetatable({ msg = msg.."\t" }, chatMsg), 0)
end

#

however it isn't actually putting up the message before restarting, any assistance would be appreciated

reef cairn
#

I am assumeing the line msg = "[Server] "..msg should actually be msg = "[servermsg]"..msg?

idle marten
#

hello guys. i dont know if this is the right channel to write, but my mod that i made automatically disables itself when i try to enable it. lua doesn't refresh, and it just throws me back into the menu if i click on back. any way i could solve this?spiffo

undone crag
#

I do not know about this.

idle marten
#

do you want me to send a zip file of mod?

undone crag
#

I am not feeling that helpful, or something ;-;

idle marten
#

why not ?

#

i spend 4 days watching tutorial on youtube and make Beer mod

#

and i cannot enable it

#

It is outrageous

#

my honest reaction

undone crag
#

You could try debugging it <- wow advice so helpful

sleek heath
#

so uh, I'm trying to upload a separate mod but idk if i just overwrote my old one lol, they both have the same id? but different folders is that a problem?

#

it's still uploading rn

#

but im seeing this

#

update of existing item instead of creating new item

#

i could simply reupload the old one if it does overwirte but i was told simply separating folders makes a new mod itself on the workshop

#

but we'll find out soon

#

yep

#

replaced it

#

LOL

#

am i meant to leave the id section blank in order to create a new item?

#

ok yea thats what i did wrong

#

One on the right had the exact same ID as the left one when i first uploaded it

#

probably what caused it

deft skiff
#

Hello. I could use some help debugging a mod that I wrote. I made No Food Expiration (https://steamcommunity.com/sharedfiles/filedetails/?id=2695935241&tscn=1699911640) to prevent food from perishing. It searches the files "farming.txt", "items_food.txt" and "newitems.txt" and deletes every DaysTotallyRotten parameter that it finds. Works great for 99% of cases, except for the Uncooked Pots of Pasta and Pots of Soup that you find in houses. If you cook those, the cooked version rots. I can't find any recipe file that contains these items, so I'm not sure what controls them rotting. Any ideas? It's not a mod conflict, I'm able to replicate the issue on a new save that's only running No Food Expiration. Uncooked version has no expiration. Cooking it gives it a "fresh" parameter, and then it rots.

#

Also, if you've got any advice, @ me directly. I don't check Discord very often, I want to make sure I see it. Thank you in advance!

sleek heath
#

yep i feel like an idiot after trying to upload a new mod lmao

west hemlock
#

so i have created an animated horse in blender, anyone got ideas on how to make it so i can sit on it and ride it?

#

within the game?

sleek heath
#

enjoy

sour island
#

Did that get nuked already?

trim skiff
#

hello, guys, noobie question, what this "Events.EveryTenMinutes.remove(function)" do?

sleek heath
sour island
sleek heath
#

oh

#

idk works for me

#

could be under review though yea

#

i changed the description just like a minute ago

sour island
#

Link works now actually, so it's all good

sleek heath
#

lol

#

nice

#

i didn't thoroughly test it yet though in terms of spawns

#

still initializing a multiplayer server lol

#

wanna make sure it doesn't take god knows how long

#

ok so og mod is bugged lol

#

after uploading this one onto it

#

i need to reupload it

#

the expansion works though

#

hold up might be on me

#

gonna resubscribe to my own mod to see if it works

trim juniper
#

Hmm, thoughts anyone? Trying to tailor a hardcore co-op experience with a friend, and want to inject some additional sense of jeopardy by treating it as strictly "Ironman" - either of us dies, it's a world-wipe, no respawning.
Probably doesn't really need to be any more than an agreement between us really... but I was wondering if there was any elegant way to somehow auto-wipe the world OnPlayerDeath or something.

sleek heath
#

after some testing i cannot run 2 true music mods as 1 will delete all the songs from the other

#

so i will have to make a separate mod with all the original songs and the new ones in 1 mod instead

sleek heath
#

@sour island cant run both mods at the same time unfortunately so i just decided to add everything from the original mod to the expanded mod which makes it 1310 songs lol

sour island
#

True music can't operate with 2 at the same time?

#

That's ironic considering all the packs

gilded crescent
#

Unless I'm thinking of another radio mod, can't remember which one I used it's been a long time

sour island
#

Ah, that makes more sense

gilded crescent
#

Yeah, I was thinking survivor radio but I imagine true music works similarly

shadow leaf
coarse sinew
azure mauve
#

does anyone know the values that toughness, speed, and strength can go up to?