#mod_development

1 messages · Page 547 of 1

wooden falcon
#

It's my own custom weapon so I can do it however I'd like. Having my own context menu and logic sounds like a good solution.

#

Thanks for your help.

thin hornet
#

Yeah Events.OnFillInventoryObjectContextMenu.Add might be your best friend on that one

surreal brook
#

perhaps in a "beta" mode that allows

thin hornet
# surreal brook perhaps in a "beta" mode that allows

Java mods are possible but will never be allowed with workshop mods.
Java mods could be potentially dangerous and that's why mods are made with lua and interpreted by the game java. Also probably something to do with reloading mods.

#

To have audio streaming, the dev would need to add new functions that allow querying a stream url and encoding and playing it into fmod or something.

surreal brook
#

ok

thin hornet
# surreal brook ok

What you can do is save those music files and pack them into your mod and play them.
But that will make the mod heavy in weight and it's also not what you were planning to do.

sour island
#

Anyone here super familiar with MediaData / recorded media etc?

real totem
#

Hey what exactly is the Hoot car zone? Color #FF007F, Not sure if its just a British car thing like boot/trunk or bonnet/hood or what. (realized looking at other peoples maps that it means hood :))

sour island
#

trying to track player's listened to media per line and it doesn't seem to be able to access it

sour island
#

Not sure why but I can't seem to access mediaData.mediaLineData's methods

#

Any javaheads know why?

#

the classes and methods are public

thin hornet
#

oh nvm

sour island
#

Did try that and it comes back as a mediaData@mediaLineData with a bunch of references

thin hornet
#

i see

sour island
#

The only thing I can guess is the class.class structure is messing up the javalua?

thin hornet
#

but isnt it suposed to be :getTranslatedText() with the :

sour island
#

I understood doing .function with out () reads if the function exsists

#

I get the same error eitherway

thin hornet
#

oh right

sour island
#

I wonder if I could call MediaData.MediaLineData.getTextGuid(self) ?

#

but rather than self use the line object

#

Unfortunately the new knownmedialines aren't exposed from IsoGameCharacter

#

@thin hornet

LOG : General , 1656709730722> Watched - mediaData: (6bf936ee-53d7-47b7-b3a7-c3ea0b88d44b) 18
LOG : General , 1656709730722> ---type(): userdata - string: zombie.radio.media.MediaData$MediaLineData@10c66f8e
LOG : General , 1656709730722> -------------------------------------------------------------
attempted index: getTranslatedText of non-table: zombie.radio.media.MediaData$MediaLineData@10c66f8e

#

is getLine a commonly named method?

#
   public boolean hasListenedToAll(IsoPlayer var1, MediaData var2) {
      if (var1 == null) {
         var1 = IsoPlayer.players[0];
      }

      if (var1 != null && var2 != null) {
         for(int var3 = 0; var3 < var2.getLineCount(); ++var3) {
            MediaData.MediaLineData var4 = var2.getLine(var3);
            if (!var1.isKnownMediaLine(var4.getTextGuid())) {
               return false;
            }
         }

         return var2.getLineCount() > 0;
      } else {
         return false;
      }
   }
#

This is how the game does it on java's side

#

My guess is, again, the java translator

thin hornet
#

player:isKnownMediaLine(guid) is exposed tho

sour island
#

Yes but I can't get the guid

#

LOG : General , 1656710320609> Watched - mediaData: (6bf936ee-53d7-47b7-b3a7-c3ea0b88d44b) 18
LOG : General , 1656710320609> -------------------------------------------------------------
attempted index: getVariable of non-table: zombie.radio.media.MediaData$MediaLineData@3b2ff275

#

hmmmm

#

it has a reference but is considered null/non-table

#

ok

dusty oriole
#

working on something funny

jaunty marten
dusty oriole
#

look closer

jaunty marten
#

germany roulette*

dusty oriole
#

there's something silly going on here

viral flame
#

If you can throw pies at the zombies im sold

dusty oriole
#

this guy gets it

dusty oriole
#

working on fummy icons

#

for jobes

wooden falcon
#

Do files in media/lua/server/ get run on the client's PC if they aren't the server host?

#

I'm trying to prototype something where I have a Settings object created in a media/lua/shared/ file. It gets modified by a file in the media/lua/client folder. And then it gets read and used by a file in the media/lua/server. What I want is for anyone to be able to modify their personal object, but only the object on the server's PC actually has any effect on the game. Currently, a non-server client's changes to that object are having an effect on the server and I don't know if it's because I have an error in my code's logic or if my understanding of the client / shared / server folders is flawed and can't be relied upon.

(To be more specific if it's still not clear. I have a mod with a custom weapon. I want clients to be able to modify the weapon stats through in-game settings that my mod has setup. But for MP, I want ONLY the server's modifications to the weapon to have any effect on the weapon within that server. But I'm hosting and friend is joining and they see the weapon stats that they've set, while I see the weapon stats that I've set [when what should be happening is that their settings make no difference because I'm the server host so only my settings should be applied].)

spare burrow
#

Hey, i can't find how the adrenalinejunkie trait works, have tried to look on all the lua files at no avail, does anyone knows where its effects are located? ty!

viral flame
spare burrow
#

oh

#

i'll have to check how to reverse engineer it xD

#

thanks ^^

viral flame
thin hornet
spare burrow
#

Thanks too! i'll have to discard an idea because this overpass my coding knowledge, but i'll try to inform me about how possible would it be to be done!

last forge
#

If someone here has the game prior to 41.71, could you share me the code from client/OptionScreens/MainOptions.lua, function GameOptions:new, around line 128

midnight mica
#

anyone know if they removed trunks being able to be installed to vehicles? trying to increase the trunk capacity, but the script trunks don't seem to be used atm

sour island
#

Might be a mod but I can weld metal sheets onto trunks to repair it

#

Does car weight impact speed?

#

I was expecting to be a rocket but it was not all that much faster

midnight mica
#

nope repairing trunks is vanilla, but when i overwrite the script of the trunk items it does not have any effect, so either those trunks are old items or items for the future that are not in-game yet

drifting stump
#

and you should use sandbox options for that

wooden falcon
# drifting stump and you should use sandbox options for that

Do you by any chance know what the type should be for a dropdown menu in a sandbox option? For example:

option Susceptible.EveryoneIsSusceptible
{
    type = boolean, default = false,
    page = Susceptible,
    translation = Susceptible_EveryoneIsSusceptible,
}

boolean = tickbox
double = textbox
integer = textbox

I can't find the vanilla files where the sandbox settings are described, and Susceptible (the only mod that I have that uses sandbox settings) doesn't have a dropdown setting.

last forge
#

Hey there, @slow granite ; it seems that the player object lost the isShoving method ? Any new way to replicate previous behaviour ? any page for me to see interface changes through updates ?

drifting stump
#

here

#

@wooden falcon

strange sequoia
#

Hello hello, i've been looking through the game's recipes and i'm wondering if it's possible to make a recipe that gives multiple results ?

I have a craft in mind that requires to use hair dye, a pot of water and some fabric to dye. I want the result to be an empty pot and a dyed fabric but i can't seem to find a way to make it so there's two result to the craft

small topaz
#

is it possible to create an item which increases the run and combat speed?

thin hornet
#

In your case you just want to use the OnCreate function that you link with the recipe and in that function you add the extra items to the inventory

Basically create a media/lua/server/Yaki_Recipecode.lua
Then Add a global function with a unique name like

function MyRecipe_stuff_OnCreate(items, result, player, selectedItem)
  player:getInventory():AddItem("Base.MyItem");
end
strange sequoia
thin hornet
#

You can still easily make it so that the item need to be Warm

#

Look at how sterilize bandage does it

small topaz
#

moreover, how do those run- and combat speed modifiers exactly work? for example, if an item has RunSpeedModifier = 0.87, does this means that that the player has 87% of the default run speed when wearing it? and if i put RunSpeedModifier = 1.0, does this means that there is no decrease in run speed at all?

thin hornet
#

hum

thin hornet
small topaz
#

that's a possible way but still a bit difficult to get a clear picture of those things...

thin hornet
#

@strange sequoia

    recipe Disinfect Bandage
    {
        destroy Bandage,
        WaterPot;5,
        CanBeDoneFromFloor:true,
        Result:AlcoholBandage,
        Time:100.0,
        Heat:-0.22,
        Category:Health,
    }

can set Heat:-0.22, to your recipe to require a specific heat level

strange sequoia
#

I forgot to change the result

#

It's supposed to be red fabric

thin hornet
#

@strange sequoia
in your recipecode.lua

function MyRecipe_stuff_OnCreate(items, result, player, selectedItem)
  player:getInventory():AddItem("Base.MyItem");
end

in your recipe script

OnCreate:MyRecipe_stuff_OnCreate

and WaterPot is considered to have water in it.

#

if you want to specifiy the amount of unit of water do it like
WaterPot;5,

strange sequoia
#

Ok i'm completely lost

thin hornet
#

Okay so, the recipe take a list of ingredients right.
Stuff like a water pot contains units of water (drainable).
So you could for example, say

Fabric,
HairDyeRed,
WaterPot;5,

for every 5 unit of warm water in the pot
give me a dyed fabric

#

so it would consume the items and 5 unit only of the water pot

strange sequoia
#

Yep that i understand, but it's the RecipeCode.lua where you lost me i think

thin hornet
#

in your mod just create a file at
mods/mymod/media/lua/server/yaki_recipecode.lua

#

then you just make a global function with some unique prefix like

Yaki_Recipes = Yaki_Recipes or {};
function Yaki_Recipes.DyeFabric1(items, result, player, selectedItem)
  local inv = player:getInventory();
  inv:AddItem("Base.Item");
end

in the recipe script:

OnCreate:Yaki_Recipes.DyeFabric1,
strange sequoia
#

Holy shit i feel so dumb and lost stressed

thin hornet
#

Okay explain me what you have done

strange sequoia
#

I drank too much coffee my brain refuses to process that

thin hornet
#

lol

strange sequoia
#

It's, like, i'm stuck at that "Yaki_Recipes" i don't know what to replace that with

thin hornet
#

okay so you have your file created in the server directory

strange sequoia
#

RecipeCode ?

thin hornet
#

yeah

strange sequoia
#

Yep

thin hornet
#

okay good

#

now if i understand you wanted to transform a fabric into a dyed fabric right?

strange sequoia
#

I want to to give "Red Fabric" and an empty pot

#

I want it to use all the water in the pot

thin hornet
#

Yeah but the pot may be almost empty or full

#

So

#
    recipe Dye Fabric Red
    {
       Fabric,
       HairDyeRed;1,
       WaterPot;5,

       Result:RedFabric,
       Time:130.0,
       Heat:-0.22,
       Category:Tailoring,
    }
#

this would consume 1 fabric, 1 unit of the hair dye and 5 unit of water in the pot.

#

The pot will give an empty pot when empty

#

its automatic

strange sequoia
#

Damn... It was that easy ? stressed

thin hornet
#

yeah

#

no need of lua code either

open swallow
#

Hello. Question to the mod community. Is there a mod that provides players with some form of skill progress retention after death. Either full retention or even partial? That works for a dedicated MP server.

I do know of the mod that allows you to retrain skills back up (as in level up through books, as opposed to the xp applied bonus).

strange sequoia
# thin hornet yeah

Damn, thanks a lot for the help then, because i was starting to make something def way too complicated for my poor skill in coding ahah

open swallow
thin hornet
#

Check the sandbox options in your server, you can customize the setting for the journal. Lots of options.

open swallow
#

While I get it (especially in the early learning curve) I can see his view point on it not having any fun to it. I like the tactical sneaking survival. Thanks for the info again

thin hornet
#

Yeah when you focus too much on skill its suck to lose em. But after a few months playing you understand that death is inevitable.

open swallow
#

yes.. I mean.. it's literally the words you read/listen to at the beginning of the game, death is inevitable (a lot)

#

the foreshadowing is real 😄

thin hornet
#

In my journey i'm at the point where I like the skill progression to be ultra slow, otherwise you max it too quick.
Also not everyone should be pro at everything, thats the point of having a medic, a mechanic etc that focus on its profession.

open swallow
#

Agreed. Unfortunately he's the type of survival crafting player that wants to "do it all" 7days type 😆

thin hornet
#

To each its gameplay preference hehe, when easy gets boring he'll ask for harder. Slowly understanding the game better and accepting more challenges.

open swallow
#

Yeah, that's sort of where the group of us started. One set up the dedicated private server.. an we slightly lowered some settings (0.8 zombie pop to reduce early numbers / slower shamblers/medium rear bites).. an bumped up a few multi-hit swings (10-20% more traits adjustments) just to give us a better chance to learn without just being brutalized over an over. At least until the basic move/combat forage/survival etcetera

wooden falcon
#

I have a custom item dropping from zombies. To pick the loot rarity, I have in lua\server\Items\MyItem_Distributions.lua:

    table.insert(SuburbsDistributions["all"]["inventorymale"].items, "MyItemName");
    table.insert(SuburbsDistributions["all"]["inventorymale"].items, 4);
    table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, "MyItemName");
    table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, 4);

This works appropriately (if I set the number really high, it drops a ton, if I set it really low, it hardly ever drops).
I want to be able to make the drop rate a sandbox option so I wrote this function:

function ModifyDropRate(item_name, new_drop_rate)
    local found = false
    for k,v in pairs(SuburbsDistributions["all"]["inventorymale"].items) do
        if found then
            SuburbsDistributions["all"]["inventorymale"].items[k] = new_drop_rate
            break
        end
        if v == item_name then
            found = true
        end
    end
    if not found then
        table.insert(SuburbsDistributions["all"]["inventorymale"].items, item_name);
        table.insert(SuburbsDistributions["all"]["inventorymale"].items, new_drop_rate);
    end
    found = false
    for k,v in pairs(SuburbsDistributions["all"]["inventoryfemale"].items) do
        if found then
            SuburbsDistributions["all"]["inventoryfemale"].items[k] = new_drop_rate
            break
        end
        if v == item_name then
            found = true
        end
    end
    if not found then
        table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, item_name);
        table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, new_drop_rate);
    end
end

I have tried adding this function to so many different Events including:

Events.OnInitWorld.Add(ApplyDropRates)
Events.OnGameStart.Add(ApplyDropRates)
Events.OnKeyPressed.Add(ApplyDropRates)
#

Print statements are showing the values being changed when I refer back to them later however, the drop rates aren't changing at all. If I modify one item's drop rates manually in the lua\server\Items\MyItem_Distributions.lua, it drops all the time, but if I modify another item's drop rate with that function on any of those events, it hardly ever drops.

Is there something I need to know about changing drop rates once PZ is already open?

thin hornet
#

I think you might try to make it too much "customizable"

#

you can have like 3 mods 3 flavoir, like rare, normal, abundant, at least thats what im used to see.

#

I do agree it would be nice to have settings to make mods more customizable, loot table wise etc but the way it work i thinks it just make it more complicated

#

distribution must probably match on clients and server. Sandbox settings and any other custom mod settings can be adjusted while the game is running so that wouldnt really change stuff like a distribution table

wooden falcon
#

Yeah you might be right.

#

Is it possible to print to console and read it from the main menu somehow? Even reading it from the debug menu would be fine. All I know about is the console box that shows up in a world, but sometimes I want to print from main menu.

jaunty marten
#

@wooden falcon

carmine portal
#

another mod request: the ability to add room lights, like how existing buildings are with a light switch

open swallow
carmine portal
#

yeah like the vanilla game where there is a light switch

jaunty marten
open swallow
#

Oh the possibilities that something of that nature could layer into PZ

jaunty marten
#

I'm already had same idea with farming pipes for configurable auto-water plants and it's fine but with electricity I think will problem to setup wires (and create system for it) cos pz is 2.5d game and it will really pain in da ass okey

open swallow
#

conduits an housing boxes

#

craft insulated/protected conduits

#

an place

#

but yes I could see it being tricky

carmine portal
#

thats why I put the suggestion here, same with the electric register radiator heater, both systems already exist in the base game but in different forms

#

the light switches exist and the heater in vehicles exist

#

AND timers exist on microwaves and oven/stoves

jaunty marten
#

minecraft...

carmine portal
#

officially add in immersive solar array mod into the main game

jaunty marten
carmine portal
jaunty marten
#

nah

#

hate rains

carmine portal
#

rain good

#

become damp

#

its also cozy

shell sleet
#

fr

jaunty marten
#
  • when rain ends and after it I want to plant seeds there's no chance to start rain x)
#

just a dance with tambourine

#

for me wires system is awesome cos then I can move generator out of my house for 999km

#

I recently rip my save by big boom from gen stressed

wooden falcon
# thin hornet distribution must probably match on clients and server. Sandbox settings and any...

I was able to get it working by having it be a main menu setting instead of sandbox. When the user saves their settings, it gets saved to a file. And then at the top of lua\server\Items\MyItem_Distributions.lua, I load from the file and use those loaded values for the initial distribution inserts.
Tested it where 2 of us used different settings, but the server host's settings were the only ones applied to the server.

thin hornet
#

neat

jaunty marten
#

menu settings only for visual ones

#

drop this idea plz

smoky meadow
#

guys can someone explain it to me what's the meaning of this "KnockBackOnNoDeath"

jaunty marten
#

I'm not sure but I think it means if player do attack zombie and this one didn't die then knock back him

strange sequoia
#

@thin hornet Hey, i'm sorry i have a problem with the recipes again ;_; It works nice but it applies the heat requirement to the hair dye too, so i have to put it in the oven too to complete the craft.

How can i make it so the dye doesn't need to be heated ?

smoky meadow
thin hornet
#

mhm

jaunty marten
smoky meadow
jaunty marten
thin hornet
#

the recipe would look like

recipe Dyed Fabric Red
{
    destroy Fabric,
    WaterPot;5,
    Result:RedFabric,
    Time:100.0,
    Heat:-0.22,
    Category:Trailoring,
    OnTest:Yaki_Recipes_OnTest_DyeRedFabric,
}
#

hum...

#

actually i dont know

strange sequoia
#

I haven't seen that kind of things in the game's code so i'm not sure it's possible 😮

thin hornet
#

Maybe make a Cooking Pot item filled with water and red dye

#

like a 2 step recipe

strange sequoia
#

Yeah ! I had that idea too

thin hornet
#

first mix dye into a cooking pot, then heat and dye fabric

strange sequoia
#

I'd have to make it work like a regular water pot just not drinkable

#

Definitely yeah, i'll try that

thin hornet
#

Yeah it has to be a fake water pot item

#

basically a simple drainable item with the appearance of a cooking pot with red water

strange sequoia
#

Yep, i took the lines of the Bucket full of water in the game's code

thin hornet
#
item WaterPotRedDye
{
    DisplayName = Cooking Pot with Red Dye,
    DisplayCategory = Water,
    Type = Drainable,
    Weight = 3,
    Icon = Pot_Water_Red_Dye,
    ReplaceOnDeplete = Pot,
    UseDelta = 0.04,
    UseWhileEquipped = FALSE,
    StaticModel = CookingPotRedDye,
    WorldStaticModel = CookingPotRedDye_Ground,
}
#

something like that

strange sequoia
#

Ok nice ! Thanks a lot, again 🥺

thin hornet
#

No problem so after this you would have 2 recipes.
The one to mix red dye in a cooking pot and the one to dye fabric with a red dye cooking pot.

#

Will need a lua code to keep the drainable quantity when converting a water pot to a red dye water pot

#

But just hit me up ill try and write it with you

strange sequoia
#

Yep, this is going to be a lot of copy and paste + replace with the color name to have them all

thin hornet
#

oof right

strange sequoia
#

What's the name of the required LUA file ? I can try to look it up to see if i understand what i need to do

thin hornet
#

how about just mixing red dye with frabric without water pot?

#

😛

strange sequoia
thin hornet
#

xD

#

im lazy

#

when it get super complicated

strange sequoia
#

Yeah same, and frustrated too x)))

#

Or i can just remove the heat requirement and bam

thin hornet
#

oh

strange sequoia
#

You know what, i think i'll do that xddd

thin hornet
#

good idea

strange sequoia
#

That'll save me a lot of troubles

thin hornet
#

i didnt even think about this

strange sequoia
#

I'll try again once i get better with coding, but for now this'll do

thin hornet
#

im trying to code birthday

#

but im getting tired and all these dates stuff getting me confused

strange sequoia
#

Oh wow yeah, that sounds like a lot of work just thinking about it 😮

thin hornet
carmine portal
#

what would be the use of a birthdate and age system?

thin hornet
#

Aging

carmine portal
#

academic and criminal record?

#

gonna cosplay as a drug dealer?

thin hornet
#

Im making a real life roleplay server

carmine portal
#

do the dealing of the smash

#

and the smack

thin hornet
#

ill start with legal jobs system lol

carmine portal
#

good man

#

tax evasion

#

#1

thin hornet
#

lool

carmine portal
#

and then, corporate sabotage

#

followed by public exposure

#

in that order

#

your character led an interesting life

thin hornet
#

well now i know who to keep on the watch list 👀 xd

#

||KahliAvali||

#

Your phone will be tapped if you ever logon my server

jaunty marten
thin hornet
drifting ore
#

Hello, does anyone here do mod commissions?

jaunty marten
# thin hornet

on ur server will be system like "Person description"? or it'll lite-rp

thin hornet
jaunty marten
thin hornet
#

computer based shop, with variable economy

#

Well in real life you dont have your life description written on your forehead

#

Roleplay should be about what you say and do

jaunty marten
#

in real life u can customize ur char as u want but pz isn't

#

but maybe it's fine

#

never played rp exactly in pz

thin hornet
#

Well everything will be character name based, any username will be hidden.

#

And ill make interaction between player like showing ID card to someone.

#

Im also planning on making the game start on Kingsmouth island and eventually if too many players opens up more of the map.

jaunty marten
#

sounds cool

tranquil reef
#

How do I give the player multiple of the same item

thin hornet
jaunty marten
tranquil reef
#

Thank you

jaunty marten
tranquil reef
#

I've never gotten answers so quick, so that surprised me lol

jaunty marten
#

service

open swallow
#

Where would I find the server settings for a solo local save game? For some reason it's not letting me pick a safe house in the building I've started stockpiling at. Found it, not sure what listed parameter controls safehouse claims (if there is in the server setting file)

flint bone
#

where can I find the debug log?

latent orchid
#

Anyone know how to link the switched on overlays to stoves (ie light interior)?

tranquil reef
#

Is there a way to check if I'm within like 2 tiles of a corpse on the ground

thin hornet
#
function getAllCorpseOnGround(squareToCheck, distance)
    local result = {}
    for x=squareToCheck:getX()-distance,squareToCheck:getX()+distance do
        for y=squareToCheck:getY()-distance,squareToCheck:getY()+distance do
            local square = getCell():getGridSquare(x,y,squareToCheck:getZ())
            local objects = square and square:getWorldObjects() or nil
            if objects ~= nil then
                for i = 1, objects:size() do
                    local obj = objects:get(i-1)
                    local item = obj:getItem()
                    if item:getType() == "CorpseMale" or item:getType() == "CorpseFemale" then
                        table.insert(result, item)
                    end
                end
            end
        end
    end
    return result
end

local lastSquare
local function checkIfCorpseInRange(player)
  local square = player:getSquare()
  if square ~= lastSquare then
    local corpses = getAllCorpseOnGround(square, 2);
    
    if #corpses > 0 then
      -- i found corpses
    end

    lastSquare = square
  end
end
Events.OnPlayerMove.Add(checkIfCorpseInRange);

@tranquil reef

#

something like this

tranquil reef
#

Thank you

undone crescent
#

hey guys! is there an guide for making animations in blender for zomboid? i coudnt find one 🙂

thin hornet
#

@undone crescent might wanna try to ask into #modeling that's where the 3D guys are.

teal mural
#

how hard is it to add new items to the game

#

like drinks or something

tranquil reef
#

Really easy lol

thin hornet
#

Well the hardest (or time consuming) part would be the 3D modeling of the items

dawn sparrow
#

anyone got a mod that helps removing these?

dawn sparrow
#

i got that mod but it seems to not work in singleplayer

#

or im to stupid xD

thin hornet
#

right click youll have a submenu with a list of object on the square to remove

#

in single player you need to have debug enabled

dawn sparrow
#

i do have debug enabled

thin hornet
#

mhm

dawn sparrow
#

i can show you ? xD

thin hornet
#

nah im going to update it in a moment

#

i made the mistake of just checking for admin

#

testing real quick and ill update it

dawn sparrow
#

thats lovely

#

<3

thin hornet
#

@dawn sparrow updated!

dawn sparrow
#

gonna test it

#

god i love you and you saved the game for me

thin hornet
#

i love god too and im glad it saved the game for you

dawn sparrow
#

that was so annoying xD

#

gave you a heart on steam :)

tranquil reef
#

apparently the game does not like this

#

WaterBottleFull=1/MayonnaiseWaterFull=1/RemouladeWaterFull=1/WaterPopBottle=1/GardeningSprayFull=1/WaterBleachBottle=1/WhiskeyWaterFull=1/WaterPot=1/WaterSaucepan=1/FullKettle=1/BucketWaterFull=1/WateredCanFull=1/WaterMug=1/WaterMugRed=1/WaterMugWhite=1/WaterMugSpiffo=1/WaterBowl=1,

#

is there a way to be able to use a little bit of one type of water container in a recipe

#

WaterBattleFull=1, by itself removes a bit of water from it, but doing the slashes gives a ton of errors

#

still not sure about doing more than one bit of water but apparently just having it do WaterBottleFull/WaterPot/etc. still works the way I need it to

thin hornet
#

dont use a =

#

use a ;

#
WaterBottleFull;1/MayonnaiseWaterFull;1/RemouladeWaterFull;1/WaterPopBottle;1/GardeningSprayFull;1/WaterBleachBottle;1/WhiskeyWaterFull;1/WaterPot;1/WaterSaucepan;1/FullKettle;1/BucketWaterFull;1/WateredCanFull;1/WaterMug;1/WaterMugRed;1/WaterMugWhite;1/WaterMugSpiffo;1/WaterBowl;1,```
#

you can also make it cleaner by making a GetItemTypes in lua

tranquil reef
tranquil reef
thin hornet
#
MonkeyShark_Recipes = MonkeyShark_Recipes or {};
function MonkeyShark_Recipes.GetItemTypes_WaterContainers(scriptItems)
   -- scriptItems:addAll(getScriptManager():getItemsTag("FishMeat"))
end
#

yeah cool

thin hornet
#

youll have to edit the recipe if TIS release new water containers

tranquil reef
#

Probably won't be too bad but I've also worked on this from like 3 AM to 9 AM so I can set it up with something like that tomorrow

#

for now I can sit back and enjoy the fact that I've wasted 6 hours of my life on a mod for plucking and cleaning corpse teeth

thin hornet
#

xD

#

yeah same for me i havent sleep and will probably go do that now

vapid wind
#

does anyone know how to read error logs??? server im on has so many errors but nobody knows how to fix them

trail plover
#

is there a good gettign started resource to use?

smoky meadow
#

need help how to disable the knockback when you get fired by a firearm?

jade musk
#

ive been thinking about a mod, similar to the Save Our Station, but instead of the radio, its power and water. i wish i knew lua

shadow geyser
thin hornet
#

no idea if it will be publicly released tho

last forge
#

But no need for the thing I asked anymore; found a fix 🙌

smoky meadow
#

guys how to disable the knockback when you get fired by a firearm.

sharp dawn
#

hi some friends and I are trying to search mods to add realistic animations. I find the "True Actions. Act 2" and "AuthenticAnimations" but neither work in multi

wooden lodge
#

Hello my lovely modders, I'm here with yet another question.
What would be the OnEat-Function to make an item on consumption lose you weight?

For example a mixture of herbs that makes you lose 1kg instantly. Is that even possible?
Please tag me here or DM me as I usually miss a lot of messages on this Discord. Thanks in advance.

frosty falcon
#

possible to hook onto item spawning? i.e when item is spawned, change one property of that particular spawn

spare burrow
#

Hey people, if i want to add a function to ISHealthPanel.lua, is it necessary to overwrite the entire file, or just adding the local-function would work? same for editing functions inside

#

(or any contextual interface file, like adding new types of tailoring patches and etc, for easing compatibility and etc)

spare burrow
#

(checked the wiki and in theory its possible to just add my part/overwrite with load order what needs to be overwritten, but wanted to be sure so if anyone has info @ me without remorse xD)

wooden falcon
# spare burrow (checked the wiki and in theory its possible to just add my part/overwrite with ...

I'm not sure if you can overwrite a local function, but you can certainly overwrite non-local functions. If it's from a vanilla file, it doesn't matter what you name your file (mod files are always loaded after vanilla ones). If it's another mod you are overwriting, you need to name yours (your actual file's name, not the mod's name) lower alphabetically.

If you want to still keep the original functionality of the function, but just inject some of your own code, the pattern you want is something like

myObj = myObj or {}
myObj.originalFunction = myObj.originalFunction or VanillaModule.originalFunction

function VanillaModule:originalFunction()
  -- your code to run before original

  -- call the vanilla function
  local originalResult = myObj.originalFunction(self)

  -- your code to run after original
  

  -- make sure you keep the vanilla return value unless you know you want to return something else
  return originalResult
end
#

If you want to overwrite it without keeping the original functionality, you don't need to bother saving the original function and you don't need to make that call in the middle.

#

Is it possible to have print statements show up somewhere in the main menu? If I'm debugging something while I'm in a world, it's easy enough to see what's printed in that little console box. But if I'm debugging something in the main menu, I have no idea how to see any prints? Would I have to write to a file and then read from the file or something? Or is there an easier way?

spare burrow
wild heath
#

Is there anyone who takes requests or does mods im trying to get some characters in a rp discord server

sour island
#

Console.txt for SP, Coop-Console and Server Console for MP

unborn raft
#

Is the RV interior broken in MP?

#

I have a new save and have the mp version enabled but I keep getting black screened

wise vector
unborn raft
#

Ah

#

Does the adding map to existing save work if I want to add the mod back?

wise vector
#

I was able to add it to my server without having to make a new save, but it depends I would think

unborn raft
#

I'll try it

#

Thanks for the help

wise vector
#

np!

wooden falcon
#

Weapons in the /media/scripts/items_weapons.txt file have the following attributes:

MinimumSwingTime
SwingTime
BaseSpeed

Anybody know how these differ?

Also, it seems like if I have a weapon with SwingAnim = Stab, it never knocks enemies down. Anyone know if there's a way to keep that animation, but still have it possible to get knocks? I tried setting the KnockdownMod to higher numbers, but that doesn't seem to make any difference. The swing animation suits my custom weapon much better than any of the other animations, but the no knock is not ideal.

carmine portal
#

got another mod request

#

the ability to have a shop light, like the ones you see in garages that hold two long skinny bulbs, they function just light lamps and mountable lamps where you click on them to operate them

#

also adds a new item, incandescent light tube

wooden falcon
#
            player:setAttachedItem(weap:getAttachedSlotType(), weap)
            player:setAttachedItem(weap:getAttachedToModel(), weap)
            player:setAttachedItem(weap:getAttachmentType(), weap)

None of these are working. Anybody know how to attach a weapon (e.g. to the back)?

viral flame
#

wonderful programmer art included

small topaz
#

hi! i want to store some additional data associated to the player which may change during game. is it safe to store those data in global variables if i define and put them into the client folder? definitely works for single player but i don't know how this behaves in multiplayer. (since i am not a multiplayer, i cannot play-test it.)

wooden falcon
small topaz
#

Ok, thanks! I just name them like "MyModNameMyVariable". So there shouldn't be conflicts with globals from the vanilla game or other mods.

jaunty marten
#

where I can store global moddata? getWorld have no getModData function so I have no idea (no I don't need moddata linked to character)

#

I tried to find something in pz or mods but there's 2233 matches okey
I checked some of it but found nothing

jaunty marten
#

finally found it if anyone will need this one:

GameTime.getInstance():getModData()
small topaz
#

is there way to find out whether the time is fast forwarded?

#

maybe something like "TimeFastForward(3)=true" means time is speed up 3 times?

jaunty marten
#

try to check code of timespeed panel from single player

#

lul

drifting stump
#

this is the actual global modData

jaunty marten
drifting stump
drifting stump
small topaz
#

@drifting stump thanks

#

@drifting stump in fact there is

drifting stump
#

there isnt

small topaz
#

@drifting stump in case you introduce new types of data for the player, where would you store them when you need to access them in different .lua files? moreover, note that specifically in lua, every function can also be seen as as a variable. so every mod which uses global functions uses global variables im this sense...

jaunty marten
drifting stump
#

and function are variables just declare them local

drifting stump
jaunty marten
#

thanks again

drifting stump
#

@small topaz

small topaz
drifting stump
#

and? theyre just not well coded

jaunty marten
jaunty marten
#

or maybe I just don't check good mods yet xp

small topaz
#

wow. really didn't knew this. and what about tis themselves? the vanilla code is full of globals...

trail plover
#

its more about code design and pattens but most of this stuff is ignored in a world where everyone has massive ram and hard drives. Back in the 80s you needed to recover as much memory as possible to make advanced anything. Now its more of a bug creation/hack thing

jaunty marten
trail plover
#

if vanilla has globals it would explain why it uses gigs when it just opens

#

but in open world generation it would be hard to control the amount of globals

drifting stump
drifting stump
trail plover
#

its basic code design. If you only need it for a few make it local as possible. If you need it later 1 time then make something return it via a function or property its not even difficult

#

its easier to understand once you write something with a global and you got 50 things all manipulating that global without ur knowledge and your trying to trouble shoot it

#

ill be honest if i was modding i prolly wouldnt care

jaunty marten
drifting stump
#

i have planned a rewrite of the crafting menu and server browser

#

ill get to it when i have time

jaunty marten
#

with mark "Serach everywhere"*

jaunty marten
#

but if don't change variables name then it's almost fine

#

but my code style won't let me do this

#

so I drop this idea xp

#

my mental health is more important

trail plover
#

i just want to make a chop n flip hydroponics mod

#

and im too lazy

#

is there a way to test your mod your building when you have 40 mods installed for some mp server? can i just single player with just a test mod installed or something?

#

i havent tried modding since like

#

2015

jaunty marten
#

just create preset via mod manager

trail plover
#

hmm

#

maybe ill just try it and see

frosty falcon
#

can you get a building name without cycling through roomDef?

jaunty marten
#

any way to catch moment when placing build object switch from one square to another one?

#

without caching prev pos and check it with current

trail plover
#

where can i find the placement info for a rain collector? i cant seem to find any info on that one

jaunty marten
trail plover
#

tried

#

i cant figure out the file

#

ill find it

#

just weird how that one seems to be hidden and i can find everything else under the sun

unborn scaffold
#

Are there any tutorials on adding new a GUI to the game (or is it even possible?)

#

I want to make something similar to the radio UI

jaunty marten
#

check the original radio code

#

lul

unborn scaffold
#

I started doing that, gotta figure out what everything does now

brave cloak
#

hi guys. how are you doing? i tried finding a tutorial, but couldn't find something that helped me.

how do I create a fix recipe for use in vehicle mechanic ui?

violet shell
#
function Commands.fixPart(player, args)
    local vehicle = getVehicleById(args.vehicle)
    if vehicle then
        local part = vehicle:getPartById(args.part)
        if not part then
            noise('no such part '..tostring(args.part))
            return
        end
        local item = part:getInventoryItem()
        if item then
            part:setCondition(args.condition)
            item:setCondition(args.condition)
            item:setHaveBeenRepaired(args.haveBeenRepaired)
            part:doInventoryItemStats(item, part:getMechanicSkillInstaller())
            if part:isContainer() and not part:getItemContainer() then
                -- Changing condition might change capacity.
                -- This limits content amount to max capacity.
                part:setContainerContentAmount(part:getContainerContentAmount())
            end
            vehicle:updatePartStats()
            vehicle:updateBulletStats()
            vehicle:transmitPartCondition(part)
            vehicle:transmitPartItem(part)
            vehicle:transmitPartModData(part)
        else
            noise('part item is missing'..args.part)
        end
    else
        noise('no such vehicle id='..tostring(args.vehicle))
    end
end
#
function Commands.repairEngine(player, args)
    local vehicle = getVehicleById(args.vehicle)
    if vehicle then
        local part = vehicle:getPartById("Engine")
        if not part then
            noise('no such part Engine')
            return
        end
        local condPerPart = 1 + (args.skillLevel / 2)
        if condPerPart > 5 then condPerPart = 5 end
        local done = 0
        for i=1,args.numberOfParts do
            part:setCondition(part:getCondition() + condPerPart)
            done = done + 1
            if part:getCondition() >= 100 then
                part:setCondition(100)
                break
            end
        end
        if done > 0 then
            if args.giveXP then
                player:sendObjectChange('addXp', { perk = Perks.Mechanics:index(), xp = done, noMultiplier = false })
            end
            player:sendObjectChange('removeItemType', { type = 'Base.EngineParts', count = done })
            vehicle:transmitPartCondition(part)
        end
        player:sendObjectChange('mechanicActionDone', { success = (done > 0), vehicleId = vehicle:getId(), partId = part:getId(), itemId = -1, installing = true })
    else
        noise('no such vehicle id='..tostring(args.vehicle))
    end
end
#
function Commands.takeEngineParts(player, args)
    local vehicle = getVehicleById(args.vehicle)
    if vehicle then
        local part = vehicle:getPartById("Engine")
        if not part then
            noise('no such part Engine')
            return
        end
        local cond = part:getCondition()
        local condForPart = math.max(20 - args.skillLevel, 5)
        condForPart = ZombRand(condForPart / 3, condForPart)
        local numParts = math.floor(cond / condForPart)
        if numParts > 0 then
            player:sendObjectChange('addItemOfType', { type = 'Base.EngineParts', count = numParts })
        end
        part:setCondition(0)
        vehicle:transmitPartCondition(part)
        player:sendObjectChange('mechanicActionDone', { success = (numParts > 0), vehicleId = vehicle:getId(), partId = part:getId(), itemId = -1, installing = true })
    else
        noise('no such vehicle id='..tostring(args.vehicle))
    end
end
trail plover
#

so a really dumb question i guess. on Steam workshop mods for like mp and such where are the mods located for me to just rip them open and look at code

#

it really seems thats going to be easier then asking random questions

violet shell
trail plover
#

thanks

brave cloak
#

thanks @violet shell

trail plover
#

i think its elsewhere tbh

#

no ur right

#

jesus

#

the folder naming is throwing me off

#

i keep going into project zomboid

violet shell
#

the name of the folders are just the workshop IDs

trail plover
#

yeh

violet shell
#

not so hard 🙂

trail plover
#

SteamLibrary\steamapps\common\ProjectZomboid\Workshop

#

i keep going in there

#

looking

drifting ore
#

its there a mod for view behind ur character even if u don t look?
i would like one

lost slate
humble junco
#

Hi everyone. Follow up question on my question before regarding the permanent night mod. Turbo ultimately ended up helping me figure that out, and over the past few days I've managed to make a couple of other tweaks so that the lighting remains consistent both through the game's natural weather system as well as weather altering mods like Eternal Snow, Infinite Weather, etc.. However, one problem I seem to be running into involves the AMBIENT value of climate. The basis of the mod remaining almost entirely pitch black depends heavily on AMBIENT, however, whenever weather kicks in, the AMBIENT value seems to be overwritten by some sort of settings exclusive to those particular weather events. I can't seem to find anywhere in the files that would plainly define the lighting settings behind things like storms, tropical storms, and blizzards. Does anyone have any idea where they might be?

shadow geyser
humble junco
#

because in the .class file i did find the value names for AMBIENT, VIEW_DISTANCE, etc. but can't figure out a way to potentially change any values since i'm not sure what program to run the file in

shadow geyser
#

its the same i think? im not so used to java but from my understanding .class is just the compiled file, whereas .java is source. im looking an the decompiled code.

humble junco
#

i guess my dilemma is i already have code that overwrites the base game's AMBIENT, so when you run the mod and there is no weather going on, the AMBIENT value in the code works

#

the issue then becomes when weather starts up, something overrides the AMBIENT value in the mod's code

heady crystal
#

How do you rotate in the vehicle editor, anybody know?

humble junco
thin hornet
#

did anyone face issue when trying to query the player modData from the server?
i tried to player:transmitModData() to kind of force it to send it to the server but not getting the modData from the server side

#

but since IsoPlayer is also an IsoObject i would have guess that it worked. Maybe im just missing something here

#

well after many test it seem player mod data is not transmitted at all and even when trying to force it. I wonder why.

#

also that would mean that if i delete my local save and join a server again, it would reset my moddata since its seem to be local only

drifting stump
#

transmit only works for objects not characters

#

therefore always remains local

thin hornet
#

yeah thats what it seems when reading the source

#

but again that mean player modData is unreliable

#

saving thing in player mod data would be lost if we deleted the save file and loaded back in the server

drifting stump
#

the kind of things youd store on player modData make sense in global modData as an alternative

thin hornet
#

i supose ill start using global moddata instead yeah

#

ill check how it work with the server

drifting stump
#

you can look at some of my mods if you need an example i use that to store server side player data

thin hornet
#

neat do you have a url real quick ?

drifting stump
thin hornet
#

or is it just a config file

drifting stump
#

its a config yeah you can ingore that for what you want

thin hornet
#

cool 😄

drifting stump
#

what matters is basically just ModData.getOrCreate("serverPointsData")

#

and the commands to query from a client

thin hornet
drifting stump
#

why would i

thin hornet
#

you send the info from a command but couldnt mod data be sync between server and all clients?

drifting stump
#

the clients dont need the whole data in that case

thin hornet
#

depend of the situation

drifting stump
#

like in a banking system do you need to receive the info from everyones bank account?

thin hornet
#

if you want to check everyone score with a leaderboard for example you would already have all the data on each client to check it right?

#

yeah banking info i do understand

#

so basically i could create different modData and some be public info and other server only

drifting stump
#

yeah in that case it makes sense to have everyone have the data and use the server to sync it

thin hornet
#

for example Bio

#

instead of requesting a bio everytime you want to check everyone could have the bio of anyone

drifting stump
thin hornet
#

kind of

drifting stump
#

json isnt needed anymore since they fixed global modData saving on the server

thin hornet
#

so setting the value is instantly saved

#

no need to call anything

drifting stump
#

yeah any modData is supposed to save with the game

thin hornet
#

thats dope ill play around with the transmit and see how that work

#

wouldnt want to overwrite stuff cause of unsync data

drifting stump
#

reason i dont use transmit is simply because transmit sends the whole table and thats unnecessary for these uses

thin hornet
#

yeah i could see why

#

might have to optimize the structure of table

#

to separate and store smaller stuff in tables

drifting stump
#

or use a query system like i do

thin hornet
#

yeah

drifting stump
#

making a new global modData entry for each player wouldnt make sense so only way of sending smaller and only necessary data is with those queries

thin hornet
#

Do we have a list of events that explains if the event is ran on both server or just client?

atomic kiln
#

Hi, I'm looking to make a mod and am trying to learn how electricity works in game. I'm trying to find the code for the car battery charger and how it works, but am very lost.

strange sequoia
#

@thin hornet Hey hey, it's me again. Hope i'm not bothering you with my questions, but, if i wanted to make multiple crafts for one object that has multiple textures and each craft gives a different texture. How should i do that ?

thin hornet
#

Like a single item with different color ?

#

I think the only limitation about this is the 3D model of the object cannot be changed but the icon can.

strange sequoia
thin hornet
#

Clothing items are the only items that can have different color easily

#

okay so what you want is to set the clothing item color to a specific color based on the recipe right?

strange sequoia
#

Yep, i want the recipes to be like "Make red dress with red fabric", "Green dress with green fabric" and so on

#

Because right now i have a single craft for those dresses and it gives a random texture each time

thin hornet
#

yeah just a moment i used to have a code for that made for someone else but ill find a refence again

strange sequoia
#

Yep no problem ^^

thin hornet
#

@strange sequoia so you have set multiple texture choice in the xml if i remember right?

strange sequoia
thin hornet
#

alright

#

do you have the recipecode.lua that we talked about the other day or did you remove that?

strange sequoia
#

No i removed it since i didn't use it

thin hornet
#

okay we will probably need it this time to change the result item

#

wait a moment ill write it for you

#

😛

strange sequoia
#

Oh, ok 😄 i was trying to find another recipecode.lua file in other mods folder, to see if i could start with an example

thin hornet
#

now on the recipe script you want to plug those function like so:

OnCreate:Yaki_Recipes.OnCreate.DyeClothingRed,
strange sequoia
thin hornet
#

No problem 😄

#

let me know if it worked

#

I think you could have done the clothing with tint too, so you would be able to actually set the color with RGB

strange sequoia
#

Ok, so on this recipe for example, i have to write it like that ? :

    {
        FabricRollRed=2,
        Thread=2,
        keep Needle,
        Result         : Dress_LacedRed,
        OnCreate:Yaki_Recipes.OnCreate.DyeClothingRed,
        Sound         : ClothesRipping,
        Time         : 50.0,
        Category    :  Tailoring,
        AnimNode         : RipSheets,
    }```
thin hornet
#

yess

strange sequoia
thin hornet
#

usually from what i remember they use from 0.0 to 1.0

strange sequoia
#

Yeah i can't remember but i gave up after a while xd

thin hornet
#

but for hair and clothing i could be wrong

#

by the way i love your mods

strange sequoia
#

Thank youuuu ❤️ ❤️ I was scared it would be too much of a niche mod, since it was made for RP purposes xd

I'll see if the file you gave me word, thanks a lot again ❤️

thin hornet
#

yes let me know!

strange sequoia
#

Btw, how does the game know which model and texture to give from your code ? So i can recreate it for other recipes

thin hornet
#
function Yaki_Recipes.OnCreate.DyeClothingGreen(items, result, player)
    if result:getClothingItem():hasModel() then
        result:getVisual():setTextureChoice(1);
    end
end

result variable will be the result item of the recipe you plugged the function to
setTextureChoice(1) the number here will be the texturechoice you set in the xml starting from 0 for the first one

#

if im not mistaking of course

strange sequoia
#

Oohhh right, ok i see. I doesn't directly pull the texture it just tells the recipe to use the first, second or third texture choice

thin hornet
#

yeah it all depend of the result item set in the recipe script itself

#

plug that on a recipe for a cooking item it would probably create an error

strange sequoia
#

No wait nevermind, i got it wrong

#

I can just use the 3 different oncreate for any recipes

thin hornet
#

well if all your object have the same color choices, in the same order in the xml, then that function would work for any of your clothing item

strange sequoia
#

Yeah, ok ! Wow i understand something from a code, it's a miracle 🙏

#

Ahahah

thin hornet
#

and technically we could make it a single function if you want to add a new field to the recipe, we would just fetch that value in the item modData

#

oh no nevermind

strange sequoia
#

Ah damn, you lost me again

thin hornet
#

i just confused myself lol

strange sequoia
#

Ahahahah

thin hornet
#

yeah i confused recipe with item

#

nvm

#

lol

strange sequoia
#

No problem :p Thanks again, you're really helpful, i'll make sure to credit you in my mods page for your help 😄

thin hornet
#

cool cant wait to see the mod 😄

strange sequoia
thin hornet
#

ohh

strange sequoia
#

It's for the different dresses on the medieval set 🙂

thin hornet
#

neat man, makeshift clothes Dye able!

strange sequoia
#

I wanted to make them dye able in all the colors available with the hair dye, but oh boy would it take forever to make

#

So right now i'll stay with Red Blue Green xd

thin hornet
#

I think if you did it with Tint it would be doable

#

you would just need the base texture to be white

strange sequoia
#

Would it be easier to make ? 😮

thin hornet
#

well it would be less textures to make

#

if you look at how a tint able vanilla clothing item is made

#

you could do similar

#

then code wise, we would just use setTint instead of textureChoice

strange sequoia
#

In the XML ?

thin hornet
#

with a rgb color

#
<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
    <m_MaleModel></m_MaleModel>
    <m_FemaleModel></m_FemaleModel>
    <m_GUID>093e8f6f-7cd9-4e9e-9cfb-c4d9f0e02ff4</m_GUID>
    <m_Static>false</m_Static>
    <m_AllowRandomHue>false</m_AllowRandomHue>
    <m_AllowRandomTint>true</m_AllowRandomTint>
    <m_AttachBone></m_AttachBone>
    <m_BaseTextures>clothes\shorts_textures\bikini_white</m_BaseTextures>
</clothingItem>

example this bikini use <m_AllowRandomTint>true</m_AllowRandomTint>

#

and the base texture is a white version

strange sequoia
#

Yep

#

And the way you set the tint is in the recipe code then ?

thin hornet
#

then

-- Written this way so that you can re-use in different mods of yours
Yaki_Recipes = Yaki_Recipes or {}
Yaki_Recipes.OnCreate = Yaki_Recipes.OnCreate or {}

-- DyeClothingBlue 
function Yaki_Recipes.OnCreate.DyeClothingBlue(items, result, player)
    if result:getClothingItem():hasModel() then
        local color = Color.new(0, 0, 1, 1);
        self.item:setColor(color);
        self.item:getVisual():setTint(ImmutableColor.new(color));
    end
end

-- DyeClothingGreen
function Yaki_Recipes.OnCreate.DyeClothingGreen(items, result, player)
    if result:getClothingItem():hasModel() then
        local color = Color.new(0, 1, 0, 1);
        self.item:setColor(color);
        self.item:getVisual():setTint(ImmutableColor.new(color));
    end
end

-- DyeClothingRed
function Yaki_Recipes.OnCreate.DyeClothingRed(items, result, player)
    if result:getClothingItem():hasModel() then
        local color = Color.new(1, 0, 0, 1);
        self.item:setColor(color);
        self.item:getVisual():setTint(ImmutableColor.new(color));
    end
end

#

it set the color of the item for the inventory icon then it set the model color tint

#

So still need to create a function and recipe for all color you need but at least you can fine tune the color with rgb

strange sequoia
#

Oooh, man i should have done that from the start 😮 It looks so much easier

thin hornet
#

actually

#

it could probably be done with a single recipe if you allows all Dye object as an ingrediant

#

in that function we can get which dye was used

#

actually that would be the correct way of doing it

#

show me the script for the FabricRollRed item

strange sequoia
#

If I made the recipe from a single item, right? Because right now it uses two items, If you don’t count the fabric, water and dye

thin hornet
#

well the recipe itself could be a single recipe if you allow multiple fabric and clothing item

#

then in the lua function we will check what fabric was used and change the color

strange sequoia
#

That sound complicated o_o

thin hornet
#

if you can just copy/paste the script for a single colored fabric

#

your item xml would look like this

<?xml version="1.0" encoding="utf-8"?>
<clothingItem>
    <m_MaleModel>media\models_X\skinned\Clothes\M_Dress_LacedRedV2.fbx</m_MaleModel>
    <m_FemaleModel>media\models_X\skinned\Clothes\F_Dress_LacedRedV2.fbx</m_FemaleModel>
    <m_GUID>af20cac1-583e-43da-8678-5caf85ecc68d</m_GUID>
    <m_Static>false</m_Static>
    <m_AllowRandomHue>false</m_AllowRandomHue>
    <m_AllowRandomTint>true</m_AllowRandomTint>
    <m_AttachBone></m_AttachBone>
    <m_Masks>3</m_Masks>
    <m_Masks>5</m_Masks>
    <m_Masks>13</m_Masks>
    <m_Masks>14</m_Masks>
    <m_Masks>15</m_Masks>
    <m_Masks>9</m_Masks>
    <m_Masks>7</m_Masks>
    <m_BaseTextures>clothes\dress\Dress_LacedWhite</m_BaseTextures>
</clothingItem>

you would create a white version of the texture Dress_LacedWhite

#

then in each fabric we will set the RGB color that we want (very simple)

strange sequoia
#

ok ok, I think I already have a white texture in my files somewhere

#

But how is the RGB color set for the fabric though ?

thin hornet
#

lets go in step by step

#

so the lua code would be something like this

-- Written this way so that you can re-use in different mods of yours
Yaki_Recipes = Yaki_Recipes or {}
Yaki_Recipes.GetItemTypes = Yaki_Recipes.GetItemTypes or {}
Yaki_Recipes.OnCreate = Yaki_Recipes.OnCreate or {}

-- All YakiDyeFabric
function Yaki_Recipes.GetItemTypes.YakiDyeFabric(scriptItems)
    scriptItems:addAll(getScriptManager():getItemsTag("YakiDyeFabric"));
end

-- All YakiDyeableClothing
function Yaki_Recipes.GetItemTypes.YakiDyeableClothing(scriptItems)
    scriptItems:addAll(getScriptManager():getItemsTag("YakiDyeableClothing"));
end

-- DyeClothing 
function Yaki_Recipes.OnCreate.DyeClothing(items, result, player)
    local found, r,g,b
    for i = 0, items:size() -1 do
        local item = items:get(i);
        if item:hasTag("YakiDyeFabric") then
            local itemModData = item:getModData();
            r,g,b = itemModData.r, itemModData.g, itemModData.b;
            found = true;
            break;
        end
    end
    if found and result:getClothingItem():hasModel() then
        local color = Color.new(r, g, b, 1);
        self.item:setColor(color);
        self.item:getVisual():setTint(ImmutableColor.new(color));
    end
end
strange sequoia
#

Oh but wait

#

there's a problem though

#

The dress uses two different colors

#

Blue and white

thin hornet
#

oh

#

well yeah that might be a problem then

#

this would tint the blue part a different color

#

only the white part would be the correct color

strange sequoia
#

Yeah, and i'm not sure there is a way to mask colors 😮

thin hornet
#

i dont think i remember any tintable clothing item to be made of two color

#

if so one of the color will be changed

strange sequoia
#

Arff, then yeah i think i'll need to use the first technique you sent me, because most of my clothes use twi different colors

#

There's only one that uses tint

thin hornet
#

yeah we can still improve the code if you want tho

strange sequoia
#

Sure, how so ?

thin hornet
#

we can assign the textureChoice index to the dye fabric item script

#

then recover that value in the function

#

so it makes 1 function for all

strange sequoia
#

Ok i see yeah

thin hornet
#

you just need to make all texture choice the same order

#

we can probably make it a single recipe too

#

for all the clothing recipe

strange sequoia
#

Ok, but what about clothes that don't share the same order ? For example there's a tunic that has Grey, Brown and Blue colors instead of RGB should i change it ?

thin hornet
#

oh so not all dyable clothing has the same colors?

jaunty marten
thin hornet
#

like if you have 5 dye fabric color shouldnt all your clothes be dye from those fabrics?

strange sequoia
#

Some of them have another order, but it's, like, only two of them

#

I dye the fabric not the clothes

thin hornet
#

you craft the clothes from the dyed fabric

strange sequoia
#

Yep

thin hornet
#

so i supose all makeshift clothes can be crafted in all of those fabric color right?

strange sequoia
#

Well that's the problem, not all of them requires the "fabric" item to be crafted

#

And some not in the same color scheme

#

Right now only the clothes from the medieval set are dye able. They all use the Fabric material to be crafted, but both the "Peaseant Tunic" and "Peaseant Dress/Skirt" are in a different color scheme than the rest of the clothes

thin hornet
#

by the way not sure what OnCreate:Recipe.OnCreate.Pot, is for but i doubt its needed

strange sequoia
#

Isn't it to give back the empty pot once the craft is done ?

thin hornet
#

it shouldnt remove the cooking pot cause its a drainable item

#

it should use the the amount of water unit and when depleted it will already return an empty pot

strange sequoia
#

Oh, right, and it uses only a portion of it's water. I forgot sorry. I guess it's just leftover lines i'll remove them

thin hornet
#

anyway Recipe.OnCreate.Pot is no where to be found in vanilla recipecode

strange sequoia
#

I think it was left from when you wanted me to create one in my RecipeCode

thin hornet
#

so how many clothing item use the same color scheme?

#

if all clothing had the same colors then i say we could make a function to handle all

#

but if you have bunch of exception for different object then might be better to do it like this

strange sequoia
#

The other clothes either use a single texture or tint

thin hornet
#

oh

strange sequoia
#

Nope, made a mistake, the last one "Nice Tunic" is RGB

thin hornet
#

so only two color schemes

#

so the long belt dress cannot be brown and grey

#

cause you dont want to or there is a reason?

strange sequoia
#

it's because i wanted fancy clothes like the dresses to have more vibrant color scheme. The other clothes that uses Brown, Grey, Green are like clothes worn by peasants and they're in a colder color scheme

thin hornet
#

cool

#

so then

#
-- Written this way so that you can re-use in different mods of yours
Yaki_Recipes = Yaki_Recipes or {}
Yaki_Recipes.OnCreate = Yaki_Recipes.OnCreate or {}

-- DyeClothingBlue 
function Yaki_Recipes.OnCreate.DyeClothingBlue(items, result, player)
    if result:getClothingItem():hasModel() then
        result:getVisual():setTextureChoice(0);
    end
end

-- DyeClothingGreen
function Yaki_Recipes.OnCreate.DyeClothingGreen(items, result, player)
    if result:getClothingItem():hasModel() then
        result:getVisual():setTextureChoice(1);
    end
end

-- DyeClothingRed
function Yaki_Recipes.OnCreate.DyeClothingRed(items, result, player)
    if result:getClothingItem():hasModel() then
        result:getVisual():setTextureChoice(2);
    end
end

-- DyeClothingBrown
function Yaki_Recipes.OnCreate.DyeClothingBrown(items, result, player)
    if result:getClothingItem():hasModel() then
        result:getVisual():setTextureChoice(0);
    end
end

-- DyeClothingGrey
function Yaki_Recipes.OnCreate.DyeClothingGrey(items, result, player)
    if result:getClothingItem():hasModel() then
        result:getVisual():setTextureChoice(1);
    end
end
#

considering that green is always set to be third aka 2

#

So you just assign those function to the correct recipe for the correct item

strange sequoia
#

Green is the third ?

thin hornet
#

ah its not

#

but if you put it third instead of second that would fit

strange sequoia
#

I mean, i can change order it is in the XMLs so green is always the second choice ?

#

It would make it easier, no ?

thin hornet
#

make it last yeah

#

since the two first are different

#

or make it first

#

as long as it fit the other scheme

strange sequoia
#

Ok so, Brown Grey Green, and Red Blue Green

thin hornet
#

yeah

strange sequoia
#

And that would make the oncreate lines Blue and Grey = 1, Red and Brown = 0 and Green = 2

thin hornet
#

exactly 😄

#

cause you would assign them to the correct recipe for that item scheme

strange sequoia
#

Ok, gotcha, i'm sorry if i sound so lost btw 🥲

thin hornet
#

if i have grey fabric i might be confused as to why i cannot craft a laced dress with it (as a player)

#

but i understand the reason why not as you explained it to me

strange sequoia
#

Yeah but it's assigned to the clothes recipes, not to the fabric's color, right ?

#

So you wont have to make a grey dress out of blue fabric, since the fabric's color won't matter

thin hornet
#

i just mean that if i have 5 dyed frabric choices i would expect to be able to craft any makeshift clothing with any of those

strange sequoia
#

Ooooh, right, sorry

#

It's true, it's a bit dumb now that i think about it

thin hornet
#

i do understand the style idea behind it, just that lets say all i have is gray fabric cause i couldnt find any other dye

#

lol

#

but still want that laced dress cause its sexy

strange sequoia
#

Oh no, now i realise, and i have to change the whole thing stressed

thin hornet
#

might just have to make the texture for those dress 😛

#

two more texture color for them 😄

#

yay!

#

😛

strange sequoia
#

And more colors for the peasants clothes too

thin hornet
#

me i like grey, my whole life is grey

strange sequoia
#

lesgo

thin hornet
#

yess!

#

haha

#

i convinced you im heppy

strange sequoia
#

Well, i'll go do that, it won't take long x) brb

thin hornet
strange sequoia
#

Also i just realised that i've been writing "Peaseant" in all my files when it's "Peasant"

drifting ore
#

question about the npcs mod.

#

I dont ever see people around anyone know why?

thin hornet
strange sequoia
#

OK, the textures are done, and the recipe is made, but it still gives random textures. Did i do something wrong in the recipe ? @thin hornet

subtle sapphire
#

Hello modders 👋
I am playing around the zombie:makeInactive and my intent is to set a zombie inactive. So, I call the zombie:makeInactive(true) and I see that the zombie become Shambler. Unfortunately, I am noticing that is not working perfectly for all the zombies. Sometimes I can still see some zombies moving at their default speed setting Fast Shamblers. Looks like the zombie:makeInactive sometimes doesn't work. Do you have the same experience? Any known workaround to effectively inactive a zombie?

thin hornet
strange sequoia
worn sierra
#

Is there a "The last of us" Mod?

thin hornet
#

might have to set it every frame im not sure

worn sierra
#

I need Walker, which looks like being infected by the Cordicepts

worn sierra
strange sequoia
#

No it's only for the world to look overrun by nature unfortunately

thin hornet
#

let me check @strange sequoia

subtle sapphire
strange sequoia
thin hornet
# strange sequoia Yep, no problem 🙂 I'm going to go out for a moment to get groceries, i'll be ba...

im not sure but maybe this would work

-- Written this way so that you can re-use in different mods of yours
Yaki_Recipes = Yaki_Recipes or {}
Yaki_Recipes.OnCreate = Yaki_Recipes.OnCreate or {}

-- DyeClothingRed
function Yaki_Recipes.OnCreate.DyeClothingRed(items, result, player)
    result:getVisual():setTextureChoice(1);
    result:synchWithVisual();
end

-- DyeClothingGreen
function Yaki_Recipes.OnCreate.DyeClothingGreen(items, result, player)
    result:getVisual():setTextureChoice(2);
    result:synchWithVisual();
end

-- DyeClothingBlue
function Yaki_Recipes.OnCreate.DyeClothingBlue(items, result, player)
    result:getVisual():setTextureChoice(3);
    result:synchWithVisual();
end

-- DyeClothingBrown
function Yaki_Recipes.OnCreate.DyeClothingBrown(items, result, player)
    result:getVisual():setTextureChoice(4);
    result:synchWithVisual();
end

-- DyeClothingGrey
function Yaki_Recipes.OnCreate.DyeClothingGrey(items, result, player)
    result:getVisual():setTextureChoice(5);
    result:synchWithVisual();
end

really just a guess cause im not testing in live

strange sequoia
#

I'll tell you that when i come back home ^^ Thanks again for all the help ! I can never say that enough eheh

thin hornet
#

not quite sure how to handle that, but maybe check any zombie mod that would handle zombies in an update loop

subtle sapphire
#

I did 😢

#

I started to think that the zombie:makeInactive can cause desync issue between client and server.

thin hornet
# subtle sapphire I started to think that the `zombie:makeInactive` can cause desync issue between...

just in case you didnt see the source for that function, if it help in anyway

   public void makeInactive(boolean var1) {
      if (var1 != this.inactive) {
         if (var1) {
            this.walkType = Integer.toString(Rand.Next(3) + 1);
            this.walkType = "slow" + this.walkType;
            this.bRunning = false;
            this.inactive = true;
            this.speedType = 3;
         } else {
            this.speedType = -1;
            this.inactive = false;
            this.DoZombieStats();
         }

      }
   }
#

one of the reason we need to call this function on every tick is that its being reset by the internal zombie update function every frame

#

OnZombieUpdate is called after the internal makeInactive call so technically using makeInactive in your own OnZombieUpdate should work

#

i dont know how to help you so im technically just doing some observation in the source

subtle sapphire
#

Yes, I've see both these methods, makeInactive and updateInternal (which is called by the update).
I see your point, and I believe you are right. I think what is happening is that the updateInternal will try to call the makeInactive(false) if zombie should be active (the active only sandbox setting), and this can "collide" with the one we call with the mod. Maybe? 🤔

thin hornet
#

You are testing without any other mod on?

subtle sapphire
subtle sapphire
#

It's even difficult to reproduce.

thin hornet
#

If OnZombieUpdate is not called, that mean the client didnt detect a zombie to update

valid escarp
thin hornet
#

yes Antoneeee

valid escarp
#

nice

#

im thinking about modding the game, and making my own cars

thin hornet
#

What kind of car?

valid escarp
thin hornet
#

Actually mods are made with Lua

#

the java you see there is just us looking at the decompiled files for reference

#

to learn about the behind the hood

#

the game is made of java but it has its own lua interpretor so it loads mods in lua and only allow a range of exposed methods and objects to be used.

valid escarp
# thin hornet What kind of car?

well im really a car guy, and i simply feel like the cars havent had as much detail or simulation put into them.
theres lots of audio and game mechanics around them, yet the models seem simple. too simple. and i wish the mechanics and models were more accurately represented.
also, ive recently seen a post on reddut about the cybetpunk city in zomboid, and thats given me in inspiration to make my own cars based on cyberpunk, and implement them into zomboid

thin hornet
#

i think cars you can set their driving stats but i doubt you can change the core physic of driving

valid escarp
thin hornet
#

Well pz is a good place to learn lua, cause you have so many example code to look at.

#

it might not be the best way of writting lua, there is old and new code so some stuff is better then other but still

#

the only java mod that would work would be server side java mods. Cause clients wont have to download em

valid escarp
#

is there a way to make mods somehow edit the core to how cars work? so that im able to make more detailed cars?

#

i mean, ive seen aiterons npc mod, and its just a regular mod that you can install

#

a

thin hornet
#

You would have to research the codes to learn whats doable and whats not

valid escarp
#

hm

#

if im able to add bodygroups to cars kinda like how gmod works, and then just have the code switch between the bodygroups depending on the state, i theretically should be able to achieve what i want on a baseline level.

#

id like to also add a torque curve, and more realistic engine stats too cuz honestly 360 hp is for performance engines, yet its on a budget car

#

360 torque however is more realistic, but its not a good way to compare how good an engine is

valid escarp
#

idk if any of this is possible, i dont have any experience in modding zomboid, honestly.

#

id like some info on how to get started on modding

thin hornet
#

Id say check the forum and the pinned section here

#

also check other mods that do similar stuff than what you want to do.

valid escarp
#

what mods?

thin hornet
#

idk i mean to learn how to make your new car check other car mods.

valid escarp
#

oh

subtle sapphire
# valid escarp what mods?

Yes, I think is the best way to learn. I think @thin hornet wanted to say to check the workshop for all the existing mods that deal with vehicles, and try to see how they are made.

valid escarp
#

yea

#

this all seems really intimidating tbh

thin hornet
#

and it is 😛

#

It really depend how much you want it tho

valid escarp
#

man idk

thin hornet
#

make flying car bro 😛

valid escarp
#

setting up the map editor was one thing
getting it to work was another thing entirely
but even then it still didnt work

thin hornet
#

yeah mapping is hard as f if you ask me

valid escarp
#

yra

valid escarp
thin hornet
#

those who make successful maps have spent a ton of time figuring it out probably.

valid escarp
#

jesus

#

ill see if my motivation persists tomorrow

thin hornet
#

do small things, you wont get what you want in one day thats for sure

#

@valid escarp best little mods you can learn from is making items and recipes. Thats a start if youve done no other modding in pz yet.

valid escarp
#

alright ill see about doing that

frosty falcon
#

a police station building isn't actually called a police station in lua anywhere is it? looks like buildings are defined by their rooms?

#

so a police station building might have a room called "policestation" right

thin hornet
#

yeah they are defined by their set of rooms at least safehouse are

frosty falcon
#

or it might not

thin hornet
#

but their might be defined by zone

frosty falcon
#

like if I want to know if something is a house, I have to check all rooms for "bedroom" and "bathroom" perhaps

valid escarp
#

well i know that theres lots in the game

thin hornet
#

i know bank have a bank zone

frosty falcon
#

oh zone, ok I'll check that out

thin hornet
#

😉

frosty falcon
#

thought it meant like foraging zone

thin hornet
#

yeah its mostly used for the foraging

#

getting zones will give you an array so if you know what you are looking for like Police or FireDept you can loop and break as soon you find it

#

the zone seem to be much bigger and extend outside the building so if you need to be inside the building just check if player is in interior too

#

safehouse are considered kitchen + bathroom + (bedroom or livingroom)

strange sequoia
#

@thin hornet Hey, i'm back, sorry 🙂

I tried the other code you sent me, now it kind of works but the colors are all over the place. the Red recipe only gives Green, Blue gives Brown, Green gives Blue, Brown gives Grey and Grey gives random colors xdd

thin hornet
#

mhm

#

are all xml ordered correctly?

strange sequoia
#

They are all ordered like this : Red, Green, Blue, Brown, Grey

thin hornet
#

wait

strange sequoia
thin hornet
#

the index was starting at 1

#
-- Written this way so that you can re-use in different mods of yours
Yaki_Recipes = Yaki_Recipes or {}
Yaki_Recipes.OnCreate = Yaki_Recipes.OnCreate or {}

-- DyeClothingRed
function Yaki_Recipes.OnCreate.DyeClothingRed(items, result, player)
    result:getVisual():setTextureChoice(0);
    result:synchWithVisual();
end

-- DyeClothingGreen
function Yaki_Recipes.OnCreate.DyeClothingGreen(items, result, player)
    result:getVisual():setTextureChoice(1);
    result:synchWithVisual();
end

-- DyeClothingBlue
function Yaki_Recipes.OnCreate.DyeClothingBlue(items, result, player)
    result:getVisual():setTextureChoice(2);
    result:synchWithVisual();
end

-- DyeClothingBrown
function Yaki_Recipes.OnCreate.DyeClothingBrown(items, result, player)
    result:getVisual():setTextureChoice(3);
    result:synchWithVisual();
end

-- DyeClothingGrey
function Yaki_Recipes.OnCreate.DyeClothingGrey(items, result, player)
    result:getVisual():setTextureChoice(4);
    result:synchWithVisual();
end
#

has to start at 0

strange sequoia
#

Ooohh, my mistake then

thin hornet
#

maybe not who knows

#

xD

strange sequoia
#

No i remember i changed them after making the new textures because i thought it had to begin at 1

#

🥲

thin hornet
#

yeah but for your defense, java start at 0 lua start at 1

#

and setTextureChoice is a java function called with lua

#

😆 angry

strange sequoia
#

It works !

thin hornet
#

😄

thin hornet
#

the icon is also the correct one right?

strange sequoia
#

They are yes, i changed the order too

strange sequoia
#

Made a mistake with the new textures though, but it's easily fixed x)

#

Phew, now that this is done, i have to recreate all the other recipes lol

thin hornet
#

oh no did you removed them?

strange sequoia
#

No but i need to make the new recipes for the different colors

edgy locust
#

Good morning everyone.

Is there any way to create your own clothes?

thin hornet
#

haha he might have asked the right question at the right time

strange sequoia
#

Completely yes ahah

#

@edgy locust Yep you can, the screenshot just above is from one of my clothing mod

edgy locust
strange sequoia
thin hornet
#

@iron salmon May I suggest to add an event that is called before the server shutdown, so that we can do some stuff and save some data before shutting down.

Events.OnServerShutdown.Add(doThisThenSaveMyStuffRealQuickServerIsAboutToGoDark);
carmine portal
#

is pepsi man in the game as a mod?

strange sequoia
worn sierra
#

OOOOOO

#

@thorn cipher combined with 10 Years later...
Omg! THANKS

#

I just need scrap-weapons, and lets go

carmine portal
#

Metro 2033 weapons when?

thorn cipher
#

literally just search 'last of us'

#

😄 enjoy

thin hornet
#

i do not know what black magic this is, but after deleting the local savefile, it seem that the player modData was still available O.o

#

it might not be available on the serverside when requesting it but clearly it has to be transmitted somehow

#

in any case im happy about it

random finch
#

Tweaking an items stats in an existing mod. However, results in duping the item. How do I prevent this while keeping the items behavior in the original mod intact?

drifting stump
#

through lua

getScriptManager():getItem(""):whicheverFunctionYouNeedToUse()
thin hornet
#

the directory in save

random finch
#

This is where I added the item with custom stats.
media\scripts\Swatpack_items.txt

module swatpack
{
    imports
    {
        Base
    }

/************************Helmets************************/
    item Hat_SwatHelmet
    {
      Type = Clothing,
      DisplayName = SWAT Helmet,
      ClothingItem = Hat_SwatHelmet,
      BodyLocation = Hat,
      Icon = Hat_SwatHelmet,
      CanHaveHoles = false,
      BloodLocation = Head,
      BiteDefense = 100,
      ScratchDefense = 100,
      BulletDefense = 100,
      ChanceToFall = 5,
      Insulation = 0.45,
      WaterResistance = 0.40,
        Weight = 1.5,
    }
}

Then something like this?
media/lua/tweaks.lua

if getActivatedMods():contains("Swatpack") then
getScriptManager():getItem("Swatpack.Hat_SwatHelmet"):OnObjectAboutToBeRemoved()
drifting stump
#

?

#

delete the script

#

what are you editing on the item

random finch
#

I just added bullet protection. Deleting tweaks.lua

willow estuary
drifting stump
#

make a file in media/lua/shared

willow estuary
random finch
#

Oh wow, thanks. Kept looking at how other mods do it. Most used Item Tweaker API but it seems to be too dated. Much appreciated.

willow estuary
# random finch Oh wow, thanks. Kept looking at how other mods do it. Most used Item Tweaker API...

Tweaker API is a good newbie resource, but has issues with operating in Client and not Shared/Server last time I looked.

But it's really training wheels in that once someone learns a bit of lua it's unnecessary? There's nothing you can do with it that you can't do with DoParam using the format of the above example.

The less intermediaries/dependencies the better IMO. Especially with how there's so many issues with people using mods with dependencies in MP.

#

Item Tweaker also has issues in that some people have uploaded their own modified versions on Item Tweaker to the workshop, with the same modID, which then causes lua checksum "file does not match" issues when someone with one of the modified version of Item Tweaker downloaded tries connecting to a server that running a different version of Item Tweaker.

(uploading mods to the workshop with the same modID as existing workshop items, even if it's an authorized modification is a very very not good thing to do).

random finch
#

Makes sense. Haven't messed with lua in 5+ years, but I completely understand wanting to minimalize dependencies for sure.

willow estuary
#

This is just my personal opinion, but I don't think dependencies are necessarily "viable" with b41 MP?

Firstly we have the issue with multiple modIDs for stuff like Item Tweaker, which right there, IMO, "breaks" those mods for MP.
Secondly dependencies can get broken by updates or become obsolete; which can be compounded if the author is no longer updating the dependency.
Thirdly it looks like a significant portion of people trying to set up servers have issues with setting up dependencies; a huge amount of the posts in mod_support are people trying to set up mods to work on their servers with dependencies. More can be done with how the server hosting interface handles mods + dependencies, but I can still see issues where people set up the mod lists using a text editor and the ini files?

trail plover
#

where do we find the list of items like for instance

#

base.seeds

trail plover
#

nm the wiki has the info if i look hard enough

kind fossil
#

Hello! has anyone have found a way to mod the camera in PZ?
For example zoom more, or have edit the sensibility of camera pan, make your own character invisible, move the camera permanently, even a free camera...
I started to try cinematics in PZ, and the actual camera is a real pain to manage

I know that the game is basically a 2D map with isometric assets where 3D models are moving, so there is no point to change the camera angle, but i'm curious about "what if" someone did that, what would it looked like (example for green screen)

undone crag
#

You can set the player object's alpha to 0. It changes back to 1 quickly gradually, but you can set it to 0 in each player update.

kind fossil
#

that's still a workaround to keep the character invisible, would the shadow still be there?

jaunty marten
violet shell
#

@drifting stump I red what you said about player modData. So if I understood well the thread, this code will not do what expected right ?

Events.OnGameStart.Add(function()
local player = getPlayer()
local pData = player:getModData()

    if not pData.FirstTimeItem then
        player:getInventory():AddItem(MyMod.MyStartingItem)
        pData.FirstTimeItem = 1
    end
end)

So I would need to use your trick to store datas in a global modData table with player IDs as index and true/1 as value ? And run my check in this table rather than directly in player modData ?

trail plover
#

is there a way to manipulate the farming growth time

lavish pine
#

hi, can I somehow change the price of vanilla profession

thin hornet
#

once you find the profession object that you want to edit you can setCost()

lavish pine
drifting ore
#

does anyone know of a zomboid mod which makes these maps actually readable? This Muldraugh map is sideways and I can't read it

#

I need it to be upright so I can read it, because in this playthrough I made all loot extremely rare and disabled the world map, because I get off to suffering etc, but I at least want to be able to read a map properly

#

so mods which make sensible realistic things possible are all fair game

native bramble
#

that's the orientation of Muldraugh though, the map is displayed in a top down view and the top of that map is north. the only part about it that's odd is the name placement, but that's just down to space constraints

#

but I don't think there's any mods that map the in-game map items isometric

#

there is also an option on the bottom right of the in-game map and mini map to switch to a Top down view of the map if that helps you at all with navigating with the maps

thin hornet
keen frost
subtle sapphire
#

Hello modders! Does anyone knows if there is a way to get all zombies that are near the player? Not using the player:getCell()

drifting stump
rich yacht
#

I'm trying to edit the Only Cure mod to make it take less time to pick up items while missing an arm but I can't find the file that modifies that transfer time, any help please?

thin hornet
# violet shell <@162202173856415744> I red what you said about player modData. So if I understo...
--- Handle initialization (network available from here)
local function initialize()
    Events.OnTick.Remove(initialize);

    local function givePlayerFirstTimeItem(player)
        local playerModData = player:getModData();
        if not playerModData.FirstTimeItem then
            player:getInventory():AddItem(MyMod.MyStartingItem);
            playerModData.FirstTimeItem = true;
        end
    end

    --- Store local players reference
    local lastPlayerObject = {};

    --- Check character spawn and respawn
    local function playerUpdate(player)
        if not player:isLocalPlayer() then return; end
        local playerNum = player:getPlayerNum();
    
        if lastPlayerObject[playerNum] and lastPlayerObject[playerNum] ~= player then
            print("Player respawned after dieing in game.");
            givePlayerFirstTimeItem(player);

        elseif not lastPlayerObject[playerNum] then
            print("Player spawned after click to play.");
            givePlayerFirstTimeItem(player);
        end

        lastPlayerObject[playerNum] = player;
    end
    Events.OnPlayerUpdate.Add(playerUpdate);

end
Events.OnTick.Add(initialize);

On the first tick of OnTick network is available in MP.
We check inside OnPlayerUpdate so that we get all local player (splitscreen friendly).
We also make sure to give that starting item again if the player die and make a new character midgame.

viral notch
willow estuary
viral notch
#

there is way to simple add something to vehicles without overwrite with whole files of it ?

viral notch
willow estuary
#

I don't know of a means to do that?

viral notch
sour island
#

Oh, vehiclescripts don't have a doparam, so you'd have to use setvariable - but that doesn't work on all kinds of variable types. So it depends on what you want to change.

sour island
green sparrow
#

Hey guys

#

Anybody else having issues with weapons spawning from britas weapon pack?

wooden lodge
#

Hello my lovely modders, I'm here with yet another question.
What would be the OnEat-Function to make an item on consumption lose you weight?

For example a mixture of herbs that makes you lose 1kg instantly. Is that even possible?
Please tag me here or DM me as I usually miss a lot of messages on this Discord. Thanks in advance.

thin hornet
#

@wooden lodge it is possible

#
local nutrition = player:getNutrition();
local currentWeight = nutrition:getWeight();
nutrition:setWeight(currentWeight - 1);

that is for lowering the weight

#
local original_ISEatFoodAction_perform = ISEatFoodAction.perform;
function ISEatFoodAction:perform()
  local itemModData = self.item:getModData();
  
  if itemModData.eatInstantWeightChange then
    local nutrition = self.character:getNutrition();
    local currentWeight = nutrition:getWeight();
    nutrition:setWeight(currentWeight + tonumber(itemModData.eatInstantWeightChange));
  end
  
  original_ISEatFoodAction_perform(self);
end

We hook into the EatFoodAction and if the item has a custom field named eatInstantWeightChange (for example)
We will apply the weight change and then we call the original EatFoodAction.

#

and for the script item you can add eatInstantWeightChange = X, to

item DogfoodOpen
{
    DisplayName = Opened Dog Food,
    DisplayCategory = Food,
    Type = Food,
    Weight = 0.8,
    Icon = DogfoodOpen,
    CannedFood = TRUE,
    EatType = can,
    Packaged = TRUE,
    ReplaceOnUse = TinCanEmpty,
    DaysFresh = 5,
    DaysTotallyRotten = 7,
    HungerChange = -30,
    UnhappyChange = 50,
    Calories = 498,
    Carbohydrates = 77.56,
    Lipids = 12.58,
    Proteins = 16.04,
    StaticModel = CanOpen,
    WorldStaticModel = CanOpenDogFood,

        eatInstantWeightChange = 2, -- if you want to gain
        eatInstantWeightChange = -2, -- if you want to lose
}
jaunty marten
#

@thin hornet maybe u know difference between these functions? especially the last two

square:RemoveTileObject(obj)
square:DeleteTileObject(obj)
square:getObjects():remove(obj)
square:getSpecialObjects():remove(obj)
thin hornet
jaunty marten
#

I found different ones in same functions but different files and want to know if these're same

thin hornet
#
   public IsoObject getDoorOrWindow(boolean var1) {
      for(int var2 = this.SpecialObjects.size() - 1; var2 >= 0; --var2) {
         IsoObject var3 = (IsoObject)this.SpecialObjects.get(var2);
         if (var3 instanceof IsoDoor && ((IsoDoor)var3).north == var1) {
            return var3;
         }

         if (var3 instanceof IsoThumpable && ((IsoThumpable)var3).north == var1 && (((IsoThumpable)var3).isDoor() || ((IsoThumpable)var3).isWindow())) {
            return var3;
         }

         if (var3 instanceof IsoWindow && ((IsoWindow)var3).north == var1) {
            return var3;
         }
      }

      return null;
   }
jaunty marten
#

kk, thanks

#

just want to know if there're some specifically features

#

will test anyway

thin hornet
#

and thats just what i found there is probably more i dont know much

jaunty marten
#

all objects but character/item/vehicle

thin hornet
#

from what i can see its all object that can be destroyed/damaged by zombies

jaunty marten
#

yeah

latent orchid
#

I tend to refer to them as World Objects as they are typically represented by the static tile sprites as opposed to 3D items. A few more that come to mind include IsoStove & IsoFireplace.

old wyvern
#

Throwing this in here because I forgot who made the bike mod, but I found an item called "Regular bike suspension type sport" in a random garage and it has a question mark icon. Placed it down and it started racking up errors. Not sure what this means

#

Also still can't find a bike anywhere lol

late hound
tight blade
old wyvern
tight blade
narrow urchin
#

Question about sandbox-options.txt - is there some way to invalidate sandbox options and return them to defaults on mod update. Or this happens automatically?

drifting stump
#

@willow estuary could you rename the channel to mod_making?

plucky junco
thin hornet
narrow urchin
thin hornet
#

its possible but it might require an admin account for MP, a normal account wouldnt sync with the server

narrow urchin
#

Should be possible - as part of the server script?

thin hornet
#

Might be worth trying to change it from the server and see if the change reflect on your client

#

might want to check getSandboxOptions()

narrow urchin
#

Worst case it is possible to send update config command from server to clients - I'm doing it already, however I use custom ini config

#

Perhaps you remember, which API I should look at for modifying sandbox options?

sour island
#

It's my true calling

brave cloak
#

is there a way to turn food items into drainables? wanted to change bleach into drainable, using itemtweak api, but whenever i try to clean blood, it just returns me

"bugged action, cleared queue"

keen frost
wise sinew
#

I'm trying to make a custom WeaponReloadType, but i don't know how to tie my IS<weapon>Weapon.lua file to a type word, like ISShotgunWeapon to the type shotgun, could anyone tell me what the proper way to go here is? Thanks!

trail plover
#

so i have a question on farming. So i added a new plot to grow and i have textures for like empty..seeded...then ready to harvest but i dont see how to make it go from 1 texture to another when its ready? does anyone know where i would link this up?

#

or have something that i can look at to figure it out

hearty magnet
#

what's this error mean?

atomic kiln
#

Can someone point me to where code for electricity and car batteries is in the file structure? Thanks

willow estuary
#

Got a message from on-high for anyone who makes models for PZ mods.

Small request from Spiffo-on-high for those who make models for PZ mods.

Oversized textures for weapons/clothing/vehicles etc within mods are currently becoming more of an issue with mod users - sometimes causing memory leaks and performance issues when mods stack up.

Please try to avoid using model textures that are larger than the ones used in Vanilla PZ for equivalent items.
    Generally speaking vehicles are 512x512.
    Body and clothing textures are 256x256.
    Weapons are generally 128x128 - but vary due to  the variation in sizes.
    Hats are 128x128.

Also in the same ballpark: using tricounts higher than vanilla can also have negative effects on performance too.

We will endeavour to help this situation along code-side, but in the meantime if people could try to keep within these limits we would be super-grateful.
strange sequoia
#

@thin hornet I ended up making the different pots of dye like the first idea you had. And i managed to make them work, It's a miracle ahahah ! 😄

sour island
strange sequoia
#

I left them as the "drainable" type

sour island
#

Ah, I'm trying to recolor/retexture the same model in multiple variants - but hit a road block

strange sequoia
# sour island Ah, I'm trying to recolor/retexture the same model in multiple variants - but hi...

I personally did that via the model_item.txt file. For example :

    {
        mesh = WorldItems/CookingPotFull,
        texture = WorldItems/DyePotRed,
        scale = 0.4,
    }
        model DyePotGreen
    {
        mesh = WorldItems/CookingPotFull,
        texture = WorldItems/DyePotGreen,
        scale = 0.4,
    }
        model DyePotBlue
    {
        mesh = WorldItems/CookingPotFull,
        texture = WorldItems/DyePotBlue,
        scale = 0.4,
    }
        model DyePotBrown
    {
        mesh = WorldItems/CookingPotFull,
        texture = WorldItems/DyePotBrown,
        scale = 0.4,
    }
        model DyePotGrey
    {
        mesh = WorldItems/CookingPotFull,
        texture = WorldItems/DyePotGrey,
        scale = 0.4,
    }```

They all have the same model but different textures
sour island
#

I need them to have the same module.type though - my project tweaks how books behave and I'd like to keep Base.Book as the only type to not deal with other's mod compat issues or loot tables.

gilded crescent
grim rose
#

hello i have very specyfic problem

#

you see whenever user has different language than English, crafting tab vanishes

random finch
#

I updated some code in my mod, uploaded to workshop, got a success message - no error. However, it never actually updated.

debug log: https://pastebin.com/5VYxyPHg

sour island
#

you don't have to block the ID number, it's public

#

How do you know it hasn't updated?

random finch
#

Id rather not until it finished

#

Its private

#

I re-downloaded from workshop and refreshed workshop page

sour island
#

And the workshop page doesn't say changes made reflecting today?