#mod_development

1 messages Β· Page 13 of 1

glad ridge
#

i did dl this other mod that adds items to inv on spawn though and its the same format inv:AddItem("Base.CAR15"); inv:AddItem("Base.Glock"); inv:AddItem("Base.9mmClip17"); inv:AddItem("Base.9mmClip17"); inv:AddItem("Base.Bullets9mmBox"); so maybe it has to do with the keypressed

cyan basalt
#

and just to be sure you've enabled it in the mods menu right?

#

when testing i think people generally put the mod in C:/Users/youruser/Zomboid/mods but idk if workshop works too it prob does

#

in debug mode see if you can locate your lua script too after pressing F11 to see the scripts/windows and stuff

glad ridge
glad ridge
cyan basalt
glad ridge
cyan basalt
#

no problem!

glad ridge
cyan basalt
#

on the right side of the debug window you can find all the lua scripts

#

and you can type in the name of the script and find it there

#

that's where you can also reload changes without restarting the game

glad ridge
#

okay yeah its not loaded in..

#

actually i see it here

drifting ore
#

hey there, i'm wondering how many layers deep i can store player moddata. seems like i can store variables by themselves just fine, but if i wanted to modify something within, for example, an array inside of an array, it doesn't save the next time i access it. is there a limitation with that at all or do you think it's user error?

thin hornet
#

only thing is you cannot save java object or they will be lost and instanciated lua object will lose their metadata

#

so really you can save tables and primitives

drifting ore
#

ah ok, so if I made an interface in typescript and was trying to call/modify an instance of that, I would run into problems?

#

if so that makes sense. i think i can work around that just need to ponder

thin hornet
#

no if you made an interface you can just cast it back as that interface

#
const someData = theTable.myData as IMyInterface
drifting ore
#

hmm okay, yeah it should be cast properly. i can print the length of the array i wanted to modify at the very end of my action, and it's correct. but the next time my action is called the array is empty again.

thin hornet
#

you still need to verify if that data is valid

drifting ore
#

got it ok. this gives me a bit to work with thanks! i'll report back if i'm still stumped.

cyan basalt
drifting ore
#

absolutely ^^

jagged ingot
#

I would like to see it too. Helps me see how people learn to use it.

hushed cloud
#

Looking to commission a modder who knows how to alter item stats/spawn tables for other mods. Would be a mod that overwrites some stuff.

hushed cloud
#

thats what commission means

jagged ingot
#

Some people really don't.

hushed cloud
#

lmao

#

yes ill pay

#

its a simple mod really

jagged ingot
#

Ok. Can you DM me?

drifting ore
cyan basalt
#

ahh i see thank you!

#

and you just created an interface and then casted a table to that interface?

drifting ore
#

yeah, so my moddata looks sort of like this:

takenDrugs: {
  "AntiInflammatory": DrugInstance[],
  "Morphine": DrugInstance[],
}

and then DrugInstance is another interface that has stuff like name, effectiveness, etc.

#

the reason i changed it to be like this is so i can keep track of how many of a certain kind of drug are in the player's system. i'm thinking diminishing returns rather than damage/overdose

cyan basalt
#

ooo that's pretty cool!

#

if you don't mind do you have a github? I'd love to take a look

#

also what do you guys do for testing multiplayer? do you just host a dedicated server from your local computer and use your own client? I want to take the easiest route since I'm lazy lol

thin hornet
#

host button is slow asf

#

you can also run a second client using nosteam

cyan basalt
#

ahhh good to know! and if it's just on the same computer i don't have to port forward right

thin hornet
#

if your computer can handle running two client and a server haha

cyan basalt
#

i think it should be able to

thin hornet
#

mine cant

#

and yeah its local so no port forwarding needed

#

you just add localhost in the join server menu

cyan basalt
#

32gb ram and an i9 + 3080ti should probably be fine haha

thin hornet
#

you can set your server config with the host menu

#

but you start it with your bat file

cyan basalt
#

yaaa i just edited the sandbox settings and added my mod

drifting ore
cyan basalt
drifting ore
#

hell yeah thanks! this is also my first so no worries lol

jagged ingot
#

I'd like to have that "first mod" experience again.

#

It's nice to see people getting that.

#

Feels amazing when you go through the effort to learn so much to try something like modding for the first time.

tight otter
#

can anyone tell me what the procedural=true tag does for modding item spawns?

#

i just want to know if i need to merge my items (weapon attachments) into the ProceduralDistribution table or use mymapdistributionTable

cyan basalt
jagged ingot
cyan basalt
#

a bit confusing but more comfortable for me since I have experience with javascript!

#

and using Konijima's pzpw tool made it quite easy

jagged ingot
#

Awesome.

cyan basalt
#

some parts are a little more complicated tho since you have to have everything typed unlike lua

jagged ingot
#

Do you feel lost?

#

Do you feel like you saved time writing in that typed environment?

cyan basalt
#

I definitely still feel a little lost, but overall I think it will be beneficial for when I write mods in the future

jagged ingot
#

It's a new environment for PZ to write mods in. Good to know how the first modders think about it.

cyan basalt
#

probably a bit more of a learning curve though

#

I think I'd feel lost either way though bc I'm new to this haha

jagged ingot
#

Awesome. The group that made the typings is useful if you have specific questions about it. If you want it I can DM you it.

cyan basalt
#

I feel like it will save more time in the future for sure and having all the methods and definitions with autocompletion was super nice

#

sure that would be great!

jagged ingot
#

@thin hornet Did great work with pzpw

wooden falcon
#

done. hopefully it didn't break anything :)

thin hornet
#

you rock

#

you actually fixed something πŸ˜›

#

now the settings should update without needing to restart

#

ill test very soon

wooden lodge
#
inventoryfemale = {
            rolls = 1,
            items = {
                "ZombieSample", 10,
                "ZombieBrainSample", 1,
                "5DollarBill", 3,
                "Money", 5,
                "KaeldorWallet", 3,
                "KaeldorCoin", 0.5,
                "LerasLuck", 0.01,
                "KaeldorTailoring1", 0.1,
                "KaeldorTailoring2", 0.1,
                "KaeldorTailoring3", 0.1,
                "KaeldorTailoring4", 0.1,
                "KaeldorTailoring5", 0.1,
                "KaeldorTailoring6", 0.1,
                "KaeldorTailoring7", 0.1,
                "KaeldorTailoring8", 0.1,
                "KaeldorTailoring9", 0.1,
                "KaeldorTailoring10", 0.1,
                "KaeldorTailoring11", 0.1,
                "KaeldorTailoring12", 0.1,
                "KaeldorFurniture1", 0.1,
                "KaeldorFurniture2", 0.1,
                "KaeldorFurniture3", 0.1,
                "KaeldorFurniture4", 0.1,
                "KaeldorFurniture5", 0.1,
                "KaeldorFurniture6", 0.1,
                "KaeldorFurniture7", 0.1,
                "KaeldorFurniture8", 0.1,
                "KaeldorBrewing1", 0.1,
            }
        },

I'm here with another question. I might be understanding the loot tables wrong, but doesn't 0.1 behind the items mean the rarity?
I have people reporting they're getting 30+ of those magazines when killing around 800 zombies. There's no waay that's 1/1000 of a chance to spawn at this point in time. Anything I'm missing?

#

Please @frail spire if you have a solution or tip πŸ‘πŸ½

jagged ingot
#

This poor 'me' account gets pinged so many times I bet.

thin hornet
#

i didnt think @frail spire was actually an account

wooden lodge
#

πŸ˜‚ Just realized

#

I think I foudn a solution

tight otter
wooden lodge
#

It's because everything is set around the same rarity it doesn't really have an option to spawn anything

#

I've adjusted it to spawn money 50%

#

5 dollar bills 20%

#

So the otehr stuff now actually is rare

#

I feel like because everything is rare, the game just pcks one thus making it not rare

#

If you know what I mean πŸ˜‚

tight otter
#

you know what that would technically work

#

otherwise if you lower the weight of the rare items to like 0.01 it should be closer to 1/1000

glad ridge
#

do you guys know where i can find the school bag icon and the green spiffo icon for your inventory?

willow estuary
#

The Zombie Heat Map in an area will affect loot rarity in a complicated fashion that makes rare items less rare, among other effects.
Junk tables are exempt from this effect however, but are not affected by the sandbox loot rarity levels, always defaulting to normal.
Junk tables used to be affected by zombie heatmap, but that was unintended and removed in the latest build.

wooden lodge
#

But it's zombie loot

#

That's not affected by any of this is it

#

I mean a lone zombie should have the same chances of spawning those things compared to a zombie in a horde of 500

willow estuary
#

No, that is how it works. That's why there's so many empty junk tables in the distributions files, so modders can bypass this effect.

#

Zombie corpses in Louisville will have more loot than ones in a otherwise zombie free forest cell.

wooden lodge
#

That's interesting

#

It's even intended to work like that on zombies or is that going to be changed?

willow estuary
#

It's not a bug.

jagged ingot
drifting ore
#

to see an item's GUID do i HAVE to

#

use debug mode?

#

bleh

tight otter
#

Is there a clean way to override one file of a mod without copying all of the files? I want to override a ProceduralDistribution table to decrease spawn values, where the override works even if a mod is updated

agile coral
drifting ore
agile coral
#

You can find them all here

heady crystal
#

Does anybody know if it's possible to override the distribution table for a vanilla vehicle?

agile coral
#

that fileGuidTable.xml has them all in it

drifting ore
#

dope thanks

agile coral
#

no problem

heady crystal
#

Trying to add a custom item to the truck bed of police vehicles

#

Doesn't seem to do anything

#

I tried adding a regular item too but no luck

agile coral
#
if DistributeTo == nil then
    DistributeTo = function(_table, item, chance)
        local n = #_table+1;
        _table[n] = item;
        _table[n+1] = chance;
    end
end
DistributeTo(VehicleDistributions.PoliceTruckBed.items, "Base.Wallet", 5);
#

Replace Base.Wallet with the item you want to add

heady crystal
#

Currently trying to add sunglasses. I wrote this:

VehicleDistributions = VehicleDistributions or {}

VehicleDistributions.PoliceTruckBed = {
    rolls = 4,
    items = {
        "Glasses_Aviators", 999999,
        "The other regular items go here, I am shortening it for Discord.", 1,
    },
    junk = {
        rolls = 1,
        items = {
            "The junk items go here, I am shortening it for Discord.", 1,
        }
    }
}
agile coral
#

And change the number from 5 to whatever weight you want for the rolls

#

I'd suggest something like 100 when testing to be sure it spawns enough to find it

astral dune
#

quick question, is it possible to create a java object from the lua side? I would like to create a new Fixer object that I could pass to the FixingManager, but I can't tell if it's possible

drifting ore
#

@agile coral
table.insert(ZombiesZoneDefinition.Army, {name = "Brita_Crewman_2"})
this just removes the entire table right?

#

because im trying to achieve that lol

tight otter
#

is there a way to remove items from a table akin to how table.insert works?

tight otter
agile coral
#

table.remove()

drifting ore
agile coral
#

Which works like table.remove(tableName, index)

drifting ore
#

i dont neeed an index yea

#

i jsut want to remove the whole table

#

so i can just but table name

#

and leave the index empty?

heady crystal
#

Where would I put that function? Game start?

drifting ore
#

lua

#

Server

#

if you want to override

heady crystal
#

Oh

drifting ore
#

i think server is the highest

heady crystal
#

Omg I am dumb

drifting ore
#

might be mistaken

#

check with valrix

heady crystal
#

Oh no wait I had it in server already

drifting ore
#

shared means both server and client can access

heady crystal
#

God for a second I thought I was doing it client side lmao

drifting ore
#

lowest in the hierarchy

agile coral
#

media/lua/server/BitBraven_Dist.lua or whatever you want to name it

drifting ore
#

so it goes like

heady crystal
#

Oh ok thanks

drifting ore
#

server => client => shared

heady crystal
#

I was wondering if I could just throw it on a blank file

drifting ore
#

you can edit things in the client frm the server

#

but you cant do client => server

#

only server => server

#

and i think that causes headaches too

#

lol

agile coral
#

Yeah, stuff in Server is only run server-side, Client is client-only, and shared runs in both

heady crystal
#

It worked!

drifting ore
#

distributions are usually server side

heady crystal
#

Thank you so much

#

😁

agile coral
#

welcome!

heady crystal
#

Now my mod is complete

tight otter
# agile coral table.remove()

would this work to remove a modded item from this container?
table.remove(ProceduralDistributions["list"]["GunStoreShelf"].items, "moddeditem");

drifting ore
#

iirc

#

dont quote me on this

#

you can simply do this
table.remove(ProceduralDistributions["list"]["GunstoreShelf].items,1);

#

1 just means you are removing the first item on the table

heady crystal
#

Loot distros go from 1 to 100 right?

drifting ore
#

so you can do the manual way

#

and remove items one by one

heady crystal
#

lmao

drifting ore
#

10 - 9 -8 etc

#

or just clear the .item index and insert your own

#

that works too shrugR

agile coral
#

Do you only want to remove one item, or many?

drifting ore
#

lol

agile coral
#

you could run through the indexes as a loop

drifting ore
#

goddamit

#

so its literally just what i said but automated

#

removing each index 1 at a time

#

lol

tight otter
drifting ore
#

not sure if pz has this but

#

table.removekey is a function in lua

#

that allows you to remove indexes

drifting ore
#

ok nvm you can remove specific items

#

the table just shifts

#

so you just loop that

#

until table is empty

#

its a pain in the ass

#

i usually just delete the entire table and create my own

#

if there are a lot of entries

agile coral
#

Since the way the item tables work is by pairs of entries, you can't really remove items unless you know the index. So you could find it by looping through the items table until you find the one you want, and save that index (as well as index+1 for the roll weight). Then remove those indexes

drifting ore
#

or just uh

#

count it

agile coral
#

But if it changes, then you'll remove wrong items πŸ˜‰

drifting ore
#

oh ya

#

das right

#

or do it the lazy way

#

remove the index and put in your own

#

that works too

#

only issue would be you'd cause mod conflicts

#

for any mod that edits the same table

#

lol

agile coral
#

Yeah, that's why its often harder to remove old code than just adding more new code. Less breaks

#

Whelp, finally got my mod updated

#

That's a win for the night

drifting ore
#

i guess the simplest way is

#

to create a function to remove table indexes

#

lemme search

thin hornet
#

are you trying to remove item from distribution?

agile coral
#

Yeah, they want to remove some items from ProceduralDistributions["list"]["GunstoreShelf"].items

drifting ore
#

@agile coralbtw from <m_Guid>f033a656-d685-434b-9025-312b81bf7087</m_Guid>

#

do i just make my own

#

new GUID

#

is there a GUID generator somewhere

#

lol

thin hornet
#
local function postDistributionMerge()
  RemoveItemFromDistribution(ProceduralDistributions.list.GunstoreShelf, "Base.ItemName", nil, true)
end
Events.OnPostDistributionMerge.Add(postDistributionMerge)
agile coral
#

lol

drifting ore
#

ok

#

thanks

astral dune
#

just for visibility I'll ask again: Is it possible to create a java object from lua? Or can you only manipulate objects that already exist?

tight otter
drifting ore
#

uh

#

thats just overriding it

#

ok well look at how the mod edits the ProceduralDistributionTable

#

thats probably the latest

#

then you can manually remove items using table.remove

#

if there are many items you'd like to remove, you just have to remove them from the index one at a time

#

or count

thin hornet
#

Look into C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\server\Items\SuburbsDistributions.lua
Devs added global methods to remove or replace item in a distribution table

drifting ore
#

wait really/

#

wut

agile coral
drifting ore
#

they created functions

#
    local recursive = (_dorecursive==nil) or _dorecursive
    local doChance = type(_chance)=="number"

    for k,v in pairs(_dist) do
        if type(_dist[k])=="table" then
            if type(k)=="string" and k=="items" then
                local validItem = false
                local isChance = true
                for i=#_dist[k],1,-1 do
                    local val = _dist[k][i]
                    if isChance then
                        validItem = not doChance
                        if doChance and type(val)=="number" and val==_chance then
                            validItem = true
                        end
                    else
                        if validItem and type(val)=="string" and val==_item then
                            table.remove(_dist[k], i+1)
                            table.remove(_dist[k], i)
                        end
                    end


                    isChance = not isChance
                    if isChance then
                        validItem = false
                    end
                end
            else
                if recursive then
                    RemoveItemFromDistribution(_dist[k], _item, _chance, _dorecursive)
                end
            end
        end
    end
end```
#

pretty self explanatory

#

_dist is distrubution table Item is uh item

thin hornet
drifting ore
#

fuck me

astral dune
astral dune
drifting ore
#
table.remove(AttachedWeaponDefinitions["LongGunOnBack"].weapons,2); 
table.remove(AttachedWeaponDefinitions["LongGunOnBack"].weapons,1); 

i was removing indexes one at a time

thin hornet
#

you instanciate an object using the new after the class like so

local newIsoObjectInstance = IsoObject.new(cell, sprite, x, y, z)
drifting ore
#

Too lazy to create my own function

#

Are these global functions?@thin hornet

drifting ore
#

I can run RemoveItemFromDistribution from my own lua?

thin hornet
#

yeah for the java new its .new

tight otter
astral dune
#

I'll give it a try right now

thin hornet
#

Example creating a new square

local newSquare = IsoGridSquare.new(getCell(), nil, x, y, z);
getCell():ConnectNewSquare(newSquare, true);
thin hornet
drifting ore
#

Nice okay

thin hornet
#

keep in mind mods might run before or after yours

#

so you can require("the_other_mod_distribution_file")
to ensure its loaded before your script
also use if not getActivatedMods():contains("TheOtherModID") then return; end at the top of that file so that it doesnt run if the other mod is not activated

astral dune
#

crap, it doesn't look like Fixing has a constructor

#

oh, the implicit empty constructor does, so Fixing.new() works. Nice, thank you very much @thin hornet

#

Can anyone think of a way to tell if a melee weapon is made of wood or metal? I tried InventoryItem.getMetalValue() but its pretty unreliable

thin hornet
#

FixingManager, Fixing, Fixing.Fixer, Fixing.FixerSkill are exposed so technically any public method should work

astral dune
#

which is great. As long as I can instantiate Fixing and Fixing.Fixer I can use all the methods in FixingManager without having to port them to lua and having to maintain that

thin hornet
#

getMetalValue is probably your only option

astral dune
#

ya, its ok, for example a bat is 0 and a spiked bat is 5. But a katana is also 0

thin hornet
#

one way would be to add Tags

astral dune
#

wanted to procedurally choose a required tool to work on the weapons, since a blow torch doesn't make much sense for a baseball bat, but I may just be out of luck

#

Tags?

thin hornet
#

but you would have to add the tags to all the items

#

probably can do using DoParam

agile coral
#

what about getMeltingTime()?

astral dune
#

I could try that, in theory it makes sense

thin hornet
jagged ingot
#

Nuclear fallout mod when?

thin hornet
#

you can search items by tags and can add multiple tags per items

#

example HandAxe has tags Tags = ChopTree;CutPlant,

astral dune
#

hmmmmm

thin hornet
#

you could create a listing of item to add a custom tag like MetalItem WoodItem

astral dune
#

I don't like the idea of adding my own tags, thats a lot of manual data entry, and I'd have to add specific compat for other mods

thin hornet
#

but again that mean to list them all manually

mellow oyster
#

So im trying to make animations for my character for pz but if i export it in blender as fbx it seems to do nothing ingame

thin hornet
#

yeah

#

i dont like it either

#

would be good for something less specific as that

astral dune
#

I could possibly look at their repair recipes and assume items that have welding recipes are metal, now that I think of it

#

since I'm elbow deep in FixingManager as it is

thin hornet
#

repair recipe are fixing

#

and ducttape is the main item lol

#
    fixing Fix Banjo
    {
       Require : Banjo,

       Fixer : DuctTape=2,
       Fixer : Scotchtape=3,
    }
jagged ingot
#

Wait so all 3D models are now Direct X models?

#

Nice.

astral dune
#

where is this file located?

thin hornet
#
C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\scripts\fixing.txt
jagged ingot
#

Wow I feel old here just figuring this out.

#

I know the old old school stuff for modifying 3D models but not the newer setup.

drifting ore
#

use blendah

jagged ingot
#

Oh yeah. Old school model edits used a specific IO plugin for Blender written by third-party.

#

Was like Blender 2.6 -> 2.7

tight otter
#

@thin hornet @drifting ore thanks for your help guys got it all working now πŸ˜„

agile coral
#

awesome

dire flicker
#

is there a mod to increase the capacity of storage containers? not looking for a 0 weight cheat or anything, just find it odd that one crate has more storage then large metal shelving witch takes up 4 blocks instead of one...and i do not want to have a crate base just to store all my crap

thin hornet
#

but there might be mods that let you build new storages with more space into it

dire flicker
#

thats what worried me, thanks for the info

drifting ore
#

@agile coral this code isnt working

#

table.remove(ZombiesZoneDefinition.Army,"Brita_Crewman_2")

#

am i writing it wrongly

#

do i need a require "NPCs/ZombiesZoneDefinition"

agile coral
#
RemoveFromDistributions(ZombiesZoneDefinition.Army, "Brita_Crewman_2")
#

Try that

drifting ore
#

i just realized

#

the zombiezonedefinition is a table in of itself

agile coral
#

oop

drifting ore
#

i cant just put string there

#

lol

agile coral
#
RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Brita_Crewman_2")
thin hornet
#

you probably need to add Base.Brita_Crewman_2

agile coral
#
local function postDistributionMerge()
  RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_Crewman_2")
end
Events.OnPostDistributionMerge.Add(postDistributionMerge)
drifting ore
#

why do i need a new local function

thin hornet
#

what do you mean

drifting ore
#

local function postDistributionMerge

thin hornet
#

yeah this is a callback that we pass into Events.OnPostDistributionMerge.Add(postDistributionMerge)

#

that callback will run when Events.OnPostDistributionMerge is triggered

drifting ore
#

hmm

#

ill try it

thin hornet
#

so it will RemoveItemFromDistribution after all distribution is fully merged

agile coral
#

I suppose this could do

thin hornet
#

most likely after all mods added new item to the dist

drifting ore
#
RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_SPECOPS")
RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_SPECOPS_2")
drifting ore
#

got it

thin hornet
#

yeah

drifting ore
#

i suppose that makes sense

#

ill smack that in

thin hornet
#

also if the item is not in the distribution it will do nothing

agile coral
#
Events.OnPostDistributionMerge.Add(function()
  RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_Crewman_2")
  RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_SPECOPS")
end)
drifting ore
#

i prefer this code lollocal function postDistributionMerge() RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_Crewman_2") end Events.OnPostDistributionMerge.Add(postDistributionMerge)

thin hornet
#

using anonymous function is a bad habit in lua at least

drifting ore
#

makes it clearer

agile coral
#

True

drifting ore
#

local function postDistributionMerge()
  RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_Crewman_2")
  RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_SPECOPS")
  RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_SPECOPS_2")
end
Events.OnPostDistributionMerge.Add(postDistributionMerge)```
#

lets give it a whirl

thin hornet
#

especially when reloading script

#

require "NPCs/ZombiesZoneDefinition" is not necessary its garanteed that files is already loaded when your mod runs, cause vanilla scripts runs before everything

#

it would be usefull to require only if the thing in that file was not global and was returned at the end or if its an other mod that you want to run before yours

drifting ore
#

eh

#

ill just include it just in case

thin hornet
#

look at your console.txt

#

you will see the load order

drifting ore
#

ah okay yea

thin hornet
#

Proper require usage:

FileA

local myModule = {}
function myModule.test()
  print("test")
end
return myModule

FileB

local TheModule = require("FileA")
TheModule.test()
#

even if FileB was loading first, it would require and force FileA to be loaded first, anyway FileA return what is accessible.

#

Files can return just like a function

drifting ore
#

ah

#

so if you want to use the function of another module

#

you use the require function

#

got it

thin hornet
#

yeah and also stopping using globals everywhere (which is the main cause of load order issues)

#

the only pain i can see from not using globals is reloading scripts

#

cause if i want to reload FileA after changing something ill also have to reload FileB after so that it require the new FileA again and get its new values

astral dune
#

What is the exact syntax I would need to use to call IsoGameCharacter.Traits.Lucky.isSet() from lua? I'm a little unclear on when . and when : is needed

drifting ore
#

thanks for the help!

thin hornet
astral dune
#

whomp

thin hornet
#

if there is not a public method available forget it

#

lucky you there is one for traits

#
playerObj:getTraits()
agile coral
#
player:getTraits():contains("Lucky")
astral dune
#

ah, I see a getCharacterTraits(), is that something different?

agile coral
#

I think what they return is different

#

Yeah, you'd want to use getTraits() over getCharacterTraits()

thin hornet
#

its similar

#

but doesnt contains custom trait I think

#

it extends TraitCollection

#

use getTraits youll have more power freedom

#

especially for custom traits

astral dune
#

well thanks guys, I'm sure this will work. Right now I'm getting a weird casting exception that I think I'm too tired to debug, but progress is good

#

you're very helpful

agile coral
#

glad to be of help

steady herald
#

new mod works at least KEKW

#

gotta work on the audio tho

#

maybe decrease how long it lasts

#

planning to make a mod that changes the noise when you get hit by a zombie

#

which works better

slow graniteBOT
#
Riko Prushka#6686 has been warned

Reason: Bad word usage

cosmic condor
#

wut

steady herald
cosmic condor
#

bad bot, overly sensitive word filter

steady herald
#

also i broke pz yesterday with my script

#

i learnt you need to overwrite the event with the sound

#

otherwise if the mod is enabled it just constantly crashed

#

had to delete from my c: workshop

cosmic condor
#

a bracket missing and you can't boot the game up

steady herald
#

Possibly lol

steady herald
#

damn

#

i found a way to change the shouts when q is pressed

#

but no way to add a sound when its done

drifting ore
#

hey guys

#

anyone what script I should use to remove certain clothing items from mobs ?

#

or if I could even remove all profession items from them

shadow geyser
# steady herald but no way to add a sound when its done

you could make a function to make the sound play when the key for the shout button is pressed using the one of the key pressed events. There are a bunch, not sure which would be best, probably either OnkeyPressed or OnkeystartPressed

shadow geyser
drifting ore
shadow geyser
#

what item are you trying to remove?

drifting ore
#

all outfits, so they have no items or clothing

#

I've already got a mod to remove items

shadow geyser
#

oh so that they would all be naked?

drifting ore
#

yes, I use the shadow zombies so it doesnt really fit when they spawn as a fireman

#

but it only affects the civilian spawns I think

#

anything with a profession still spawns the same

#

I found the professions.lua file

#

if I turn it all to 0, would it just replace them with regulars or just remove the spawns entirely ?

shadow geyser
#

you could try something as simple as

local function remove_outfits()
    ZombiesZoneDefinition = {}
end

Events.OnGameStart.Add(remove_outfits)
drifting ore
#

would this work on respawns too ?

shadow geyser
#

idk, haven't done this before, you would have to try

steady herald
shadow geyser
#

yeah, also make sure that the function doesn't consume the Q press. I haven't looked super hard at code related to key presses, but i've seen that there is a consumption mechanism for the keys, but in this case you wouldn't want it to be consuming it, when not in some menu. also youd have to make it not trigger when typing q for example in the crafting UI

steady herald
#

just gotta try and find how it does that

shadow geyser
#

yeah, well, when I took a quick look, it was in the java side of things, but I might have missed it

steady herald
#

thats the thing. me not too skilled in java lmao

shadow geyser
#

its in isogamecharacter.java, the callout function. about line 3637

#

you can see there, it is doing the random selection of those shout texts, then generating the virtual sound to attract zombies

steady herald
#

huh

#

didnt think that would work KEKW

shadow geyser
#

have you decompiled the java?

steady herald
#

nyet

drifting ore
#

would this apply to respawns or should I look further into that ?

shadow geyser
drifting ore
#

@thin hornetim having an issue

#

@agile coralu free?

#

i have this line of code ```TweakItem("Base.Hat_Gentex_Helmet","BulletDefense","100");
TweakItem("Base.Hat_HGU56","BulletDefense","60");

TweakItem("Base.Hat_PSGT_Helmet","BulletDefense","100");
TweakItem("Base.Hat_PSGT_Helmet_Camo","BulletDefense","100");

TweakItem("Base.Hat_MX_Helmet","BulletDefense","100");
TweakItem("Base.Hat_MX_Helmet_Glass","BulletDefense","100");

TweakItem("Base.Hat_FAST_Opscore","BulletDefense","100");

TweakItem("Base.Hat_Maska","BulletDefense","100");
TweakItem("Base.Hat_Killa","BulletDefense","100");

#

it applies it just fine

#

but for some reason

#

when the item spawns naturally

#

it doesnt apply the bulletdefense line

#

only when i spawn it via console?

#

how do i retroactively apply these values

shadow geyser
#

are you sure the params are being applied before they spawned? tmk the tweakItem doesn't affect items that have already spawned in. Have you tried traveling to another city to make sure all the stuff is newly spawned after the items have been modified?

worldly stone
#

MAP-JAM is currently running with some great map ideas being thrown around atm! Its definitely not too late to get started, even if you have never made a map before we are around to help you figure it out

drifting ore
#

hey guys, back with two questions

#

how would I make a certain item(s) not spawn in the game ?

#

I just want to disable all spawns of it

#

and how would I disable all zombie injury textures

#

no exposed ribs, no bandages etc

drifting ore
#

btw i cant remove this for some eason

#
local function postDistributionMerge()
  RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_Crewman_2")
  RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_SPECOPS")
  RemoveItemFromDistribution(ZombiesZoneDefinition.Army, "Base.Brita_SPECOPS_2")
end
Events.OnPostDistributionMerge.Add(postDistributionMerge)```
#

trying to remove this

#
table.insert(ZombiesZoneDefinition.Army, {name = "Brita_SPECOPS", chance = 10})
table.insert(ZombiesZoneDefinition.Army, {name = "Brita_SPECOPS_2", chance = 10})```
shadow geyser
#

Those aren't items, they are outfits. The removeItemFromDistribution only works on item distributions tmk

drifting ore
#

so how do i remove those outfits

shadow geyser
#

Idk if there is a handy dandy function given by IS for doing it. you might have to make your own function to parse through the outfits to remove the correct one

drifting ore
#

can i just do table.remove

drifting ore
#

made it so that

#

it searches for the value

shadow geyser
#

you don't need a return, just performing the removal should be enough

drifting ore
#

wdym

#

im trying to create a function to look for a string within a table

#

the table is ZombiesZoneDefinition.Army

#

i dont know in what exact location it is so i cant just put 1 2 or 3

shadow geyser
#

table.remove modifies the ZombiesZoneDefinition.Army array in place, so you won't need a return there. just the function call should be enough I think.

drifting ore
#

so just remove the return

#

ok

#

im a lua noob how do i put multiple strings into 1 function

#

i got "Brita_Crewman_2" "Brita_SPECOPS" amd "Brita_SPECOPS2"

shadow geyser
#
local function RemoveOutfitFromZone(zone, outfitname)
  for i, v in ipairs(zone) do
    if v.name == outfitname then
      table.remove(zone, i)
    end
  end
end

RemoveOutfitFromZone(ZombiesZoneDefinition.Army, "Brita_Crewman_2")
drifting ore
#

oh

#

that works

shadow geyser
#

haven't checked it ingame, but this seems right to me

drifting ore
# shadow geyser haven't checked it ingame, but this seems right to me
  for i, v in ipairs(zone) do
    if v.name == outfitname then
      table.remove(zone, i)
    end
  end
end
local function postDistributionMerge()
RemoveOutfitFromZone(ZombiesZoneDefinition.Army, "Brita_Crewman_2")
RemoveOutfitFromZone(ZombiesZoneDefinition.Army, "Brita_SPECOPS")
RemoveOutfitFromZone(ZombiesZoneDefinition.Army, "Brita_SPECOPS_2")
end
Events.OnPostDistributionMerge.Add(postDistributionMerge)```
#

i just wanna make sure

#

i remove them after distribution is merged

#

do local functions even interact with each other

#

or do i have to make it a global function

shadow geyser
#

I would just require the file that is adding those outfits into the zones. The zombie zone definitions aren't related to the OnPostDistributionMerge tmk.

drifting ore
#

afaik, if its in the same file it shouldnt be an issue

#

hmm

#

okay

shadow geyser
#

so just use require("BritaZeds")

drifting ore
#

at the beggining, got it

#

cant i use

shadow geyser
#

or it might be "Npcs/BritaZeds" I can't remember when the path searching starts

drifting ore
#

paths.dirp

#

aight

quiet nebula
#

I'm trying to show a piece of text above a zombie through something like
zombie.addLineChatElement("B. I'm close to " .. target:getUsername() .. ": " .. distance, 0, 0, 255, UIFont.Dialogue, "default", false, false, false, false, false, false, true)

But this doesn't seem to do anything either... Does anyone have any experience with this?

drifting ore
#

ProceduralDistributions = {};

local function
RemoveItemFromDistribution("Earring_LoopLrg_Gold")

#

would this be good to remove items from spawnings ?

shadow geyser
drifting ore
#

ah thanks

shadow geyser
shadow geyser
quiet nebula
#

Aaagh, hahaha

#

Thank you

shadow geyser
#
public void addLineChatElement(String var1, float var2, float var3, float var4, UIFont var5, float var6, String var7,
                               boolean var8, boolean var9, boolean var10, boolean var11, boolean var12, boolean var13) {
      this.chatElement.addChatLine(var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12, var13);
   }
dim hill
#

Would anyone be willing to give me a quick step by step tutorial on how to do this? Reduce the amount of cigarettes spawn in the world.

thin hornet
# dim hill Would anyone be willing to give me a quick step by step tutorial on how to do th...

look at \media\lua\server\Items\SuburbsDistributions.lua

-- set 'chance' or 'replaceChance' to false if you want to ommit either or both of them.
function ReplaceItemInDistribution(_dist, _item, _chance, _replacement, _replaceChance, _dorecursive)
-- optionally set 'chance' to false if you want to ommit it but do want to set dorecursive
function RemoveItemFromDistribution(_dist, _item, _chance, _dorecursive)

using theses two globals you modify the distribution table and item and their chance of spawning.

cyan basalt
#

What's the overall difference between ProceduralDistributions and Suburbs?

bronze mulch
#

Aight lads current problem

#

i modify the actual game file>

#

it works

#

i turn it into a mod

#

it ain't working

#

thing being it worked fine like 3 months ago

#

alright time to wake up my only hope

#

@gaunt pendant

#

guess what

#

they somehow patched it

undone elbow
#

How to change the chance of katana in corpses?

bronze mulch
#

Aight time to ask other people for help

#

@winter bolt MY COMRADE YOU HAPPEN TO HAVE SPARE TIME FOR EDUCATING PEOPLE?

winter bolt
#

for what

dire flicker
#

i know there is a mod for rain washing YOU, but why is the ground still dirty after 3 storms?

weak sierra
#

does anyone know anything about attachments not visually showing up on custom guns

daring zinc
#

How can I open the texture .pack files?

dire flicker
#

side note, wearable medkits? or medi bag?

weak sierra
weak sierra
dire flicker
#

ohhh

#

should i post theses in mod support?

weak sierra
#

but either of those are better yes

thin hornet
thorny garnet
#

What is the largest number of uses an item can have/the smallest UseDelta? Anyone know that info offhand?

shadow geyser
# bronze mulch

will need more of a description of what you are trying to do, and why it isn't working if you want help

bronze mulch
#

aight lad

#

i fixed it somehow

#

thing being i aint no programmer

shadow geyser
thorny garnet
#

i.e. 0.000001 or 0.00000001

#

Thanks for the response btw

cyan basalt
#

or i guess from either one?

thin hornet
#

depend what you want to do

#

If you remove it from the procedural it will remove it from any location using that procedural

glad ridge
#

trying to make my own customcontextmenu is there anyway for me to get it without the ContextMenu_Swim and just get it to Swim?

thin hornet
#

lua/shared/Translate/

glad ridge
#

ahh ty i see i'll look at some others files to see how that works

cyan basalt
mellow oyster
#

im trying to export it to fbx again with my animation but it doesnt seem to do anything...

cyan basalt
#

are you using the animations are being exported? try importing it into a new blender project and see if they are there

dim hill
#

Is there a mod that lets you decide how many points each trait gives?

shadow geyser
#

well, it is already visible from zomboid-javadoc.com although idk if that is technically "official javadocs"

quiet nebula
#
      this.chatElement.addChatLine(sayLine, red, green, blue, font, scramble, tag, allowBBCode, allowImages, allowChatIcons, allowColors, allowFonts, equalizeLineHeights);
   }```
#

So many freaking args

pearl crest
#

my good friend made this cool pz bot to tell information on users info and stuff , don’t know where else to share it than here

cyan basalt
#

zomboi?

#

i contribute to that sometimes

smoky meadow
gilded hawk
#

Does anyone know how to make an invisible piece of clothing?

winter bolt
gilded hawk
#
module InvisibleArmorTransmog {
    imports    {
        Base
    }

    item Invisible_Armor
    {
        Type = Clothing,
        DisplayName = Invisible_Armor,
        ClothingItem = Invisible_Armor,
        BodyLocation = Tail,
        Icon = Rabbittail,
        BloodLocation = Jacket,
        RunSpeedModifier = 0.99,
        CombatSpeedModifier = 0.99,
        BiteDefense = 50,
        ScratchDefense = 50,
        Insulation = 0.85,
        WindResistance = 0.85,
        WaterResistance = 0.8,
        Weight = 3,
    }
}
#

And this error too

weak sierra
#

and use that

gilded hawk
#

Blank file πŸ€” That might work

weak sierra
#

mhm

#

or try just erasing the line that assigns it to a model

#

might also work

#

not sure how PZ behaves with that

gilded hawk
#

Good idea

wooden lodge
#

@willow estuary Now after the recent change I'm getting drops like this

#

Even though the roll is defined as '1', how the hell is it possible that so many items get spawned on one single dead zombie??

cyan basalt
#

very good luck

quiet nebula
#

Is there a reliable way to apply an outfit to a character? I'm currently trying:

    zombie:dressInNamedOutfit("Spiffo");
    zombie:resetModelNextFrame();```
But that only applies it after restarting or after interacting with the zombie.
gilded hawk
#

I forgot that I can use ClothingItem = Belt,!

shadow geyser
#

they just call the longer funct with default args

glad ridge
#

hey guys if i want something to dry in 30 min real time what would i set this to? WetCooldown = _______?

shadow geyser
#

probably easiest way to figure it out is to just try it

quiet nebula
quiet nebula
thorny garnet
#

Is it possible to make an item/tile visible and interactive for admins only? I.e. players with no permissions cannot see or interact with it

heady crystal
#

How do I get itemGUIDs?

heady crystal
#

Thanks

astral dune
#

if I make a little mod and put it on a game I'm hosting, does it automatically get sent to someone who connects or is that only for workshop'd mods?

cosmic condor
#

Workshop is required

astral dune
#

anything you put on the workshop is public, right?

cosmic condor
#

You can set visibility

#

Hidden just for you or share with your friends only

astral dune
#

oh that's handy

weak sierra
#

where are the icon pngs stored in the game's files

orchid wolf
#

hello friends, if someone can help me, how can I make this script all players can listen to it if they are online and additionally add the base module? sorry i am new and learning how to mod

local OnEveryHour(player, x, y)
local hour = getGameTime():getHour();
if hour = 24 then

    getSoundManager():PlaySound("music1", false, 10.0);        
end

end

Events.EveryHours.Add(OnEveryHour);

module Base {

sound music1
{
    category = music1, loop = false, is3D = true,
    clip { file = media/sound/music1.ogg, distanceMax = 1500, volume = 1, }
}

}

glad ridge
glad ridge
#

does anyone know how i can make the player add water to a recipe that is not cloth or food?

daring zinc
#

Hey so how would I go about making a fake game character?
I dont need it to move or anything, just to show up as a character and derive from the object base for mod data
maybe something derived from IsoLuaCharacter?

thin hornet
astral dune
#

I'm having a weird issue. I've retrieved a Fixer for an item, it has a FixerSkill with the name "MetalWelding". If I call PerkFactory.getPerkFromName("MetalWelding") I get nil

#

the actual repair in game uses Metalworking, and does work

weak sierra
#

why are so many random things in the vanilla ProceduralDistributions file listed twice

#

give it a chance to spawn more than one?

#

can't they just up the rolls?

#

most of the time the chance is the same

astral dune
#

What is the best way to get a player's skill level from a string containing the skills name? PerkFactory.getPerkFromName(name) and PerkFactory_Perks.FromString(name) are both not working for me.

#

which means I can't use player:getPerkLevel(perk)

small topaz
#

Does anyone knows whether it is possible to save data structures so that the save is persistent over quitting and reloading a game? I know that you can save some data via the getModData() command but afaik, this will only store strings and doubles (or am I wrong?). Specifically, what I need to save is (probably) an IsoGridSquare type of object.

#

Another question: Given some x, y and z coordinates on the game's map, can I make an IsoGridSquare type of object out of them?

astral dune
#

Perks.MetalWelding:getName() gives Metalworking, yet PerkFactory.java clearly says this:

#

very frustrating

#

I don't know what to do

cobalt arrow
#

5 days and a lot of help later from Youtube, steam and you guys here πŸ˜… , finally I can now start working properly on my first *-real- *mod which will add craftable fairy lights and other things for your cosy apocalypse interiors pillow β˜• --- *please don't mind the visuals yet. rat *
So, thanks a lot guys :]

astral dune
#

Perks.FromString("MetalWelding") works where PerkFactory.getPerkFromName("MetalWelding") did not. I don't know why but I'm not going to look a gift horse in the mouth

glad ridge
cyan basalt
cyan basalt
cobalt arrow
# cyan basalt any yt recommendations that would help for beginner modders?

Depends what you are after :] ?
For the whole tile import/setup thing i followed this 3parts series https://youtu.be/Fbvb6LeX0Sw
Haven't done anything 3d-related yet though

Quick video on getting custom tiles in the project zomboid editors (buildinged, tiled and worlded)

If you like what im doing please consider donating to my Patreon.
https://www.patreon.com/DaddyDirkieDirk

β–Ά Play video
glad ridge
#

for anyone who created their own mod, did you ever get an error that a workshop item 2590924071 is missing and it won't load the world

cyan basalt
astral dune
#

Another modder has a function firing on Events.OnFillInventoryObjectContextMenu, how do I make sure my function fires after his?

zenith agate
random finch
quasi geode
dark finch
#

I would like to commission someone to create a mod that changes the way stun lock in pvp works

random finch
cosmic condor
#

use tilezed to extract

weak sierra
prisma mantle
#

Does anyone know the name of the mod that you can leave your learning in a book if you die?

shadow geyser
shadow geyser
shadow geyser
astral dune
#

sure, but the perk wasn't hardcoded, it was being retrieved from a FixerSkill

#

I did manage to solve it, Perks.FromString(fixerSkill.getSkillName()) did the trick

shadow geyser
# small topaz Does anyone knows whether it is possible to save data structures so that the sav...

might be better to get some more details about what you are trying to acheive. You can't store isogridsquares in a moddata somewhere, but you can store the coordinates in a moddata table. so you could have a table, that contains tables. Each one of the sub table, just has the 3 coordinates, so you are able to grab the isogridsquare later. Also I say that storing the isogridsquare might not be what you want, because they are only accessible while the player is close to them, and the grid square, and their moddata table are not loaded in, so you won't be able to manipulate distant isogridsquares if that is what you are trying to do

#

there is a -nosteam flag that lets you run multiple instances of PZ

astral dune
#

Here's a fun math problem I can't quite figure out: Is there a reasonable way to calculate exponential decay when the decay amount per time interval is always rounded to the nearest integer? Tempted to just write a recursive function to brute force it, but I feel like it can be math'd

#

its called exponential decay, but yes its logarithmic

astral dune
#

whelp, I didn't realize going into this that the average weapon has a condition of 10, I assumed it would be something like 100. The minimum amount a successful repair can do is one whole condition point, which is 10% of the total condition, even when the tooltip says it'll only repair 2% of the damage

#

breaks some assumptions I built a mathematical model around, lol. Now I'm gonna have to rebalance everything

undone elbow
#

How to get the hunger value below zero, i.e. with positive (green) hunger effects?

#

I'd like to know green hunger moodle level. But not just 2 or 3, but 2.5 for example.

frosty falcon
#

the only way to know what type of building you're in (hospital, pd, bank, spiffos, etc) is to check every room name and look specifically for "bankroom" or "hospitalroom" etc right?

gilded hawk
#

TIL OnFillInventoryObjectContextMenu is a thing πŸ˜• I never realized that

rancid barn
#

do the autotsar mods overwrite the "ISVehicleMechanics:doPartContextmenu();"?

drifting ore
#

guys I'm having trouble with the simple mod I made

#

I tried to edit zombiezonedefinition and proceduraldefinition files

#

to remove costumes from zombies and remove certain items from the game respectively

#

but none of it works

#

I will post an example of what I used

#

ProceduralDistributions = {};

local function postDistributionMerge()
RemoveItemFromDistribution("Earring_LoopLrg_Gold") end
Events.OnPostDistributionMerge.Add(postDistributionMerge)

#

there are more items on the list, but as far as I can see stuff is still spawning

#

ZombiesZoneDefinition = ZombiesZoneDefinition or {};

-- total chance can be over 100% we don't care as we'll roll on the totalChance and not a 100 (unlike the specific outfits on top of this)
ZombiesZoneDefinition.Default = {};

table.insert(ZombiesZoneDefinition.Default,{name = "Naked", chance=100, maleHairStyles="Bald:100", femaleHairStyles="Bald:100"});

local function remove_outfits()
ZombiesZoneDefinition = {}
end

Events.OnGameStart.Add(remove_outfits)

#

I even managed to add it as a mod to the game and activate it, but I find items I've included in the mod and zombies with clothing still spawning, how to fix this ?

shadow geyser
#

did you remove all the other outfits from the zombie zone definitions?

drifting ore
#

nope, this is all I posted on the file and used it as a mod

#

how should I have done that ?

gilded hawk
#

Did anyone ever use ScriptItemInterface.newItemType or ScriptItemInterface.cloneItemType ?

#

@willow estuary Sorry to ping you, but, do ScriptItemInterface.newItemType and ScriptItemInterface.cloneItemType work?

If yes, when should I use them? I'm trying to generate new itemTypes on the fly. But I'm strugling

gilded hawk
#

Also, for fellow modders

Regex to look for search Events in the zomboid lua files [E]vents\.[a-zA-Z]+

And dump file of the events

gilded hawk
#

I don't get it why this does not work?

function TransmogCloner()
    local items = getAllItems();
    -- Must cache lenght or it will keep growing the more I add stuff
    local lenght = items:size() - 1
    for i = 0, lenght do
        local item = items:get(i);
        local fabricType = item:getFabricType();
        local NbrOfCoveredParts = BloodClothingType.getCoveredPartCount(item:getBloodClothingType())
        if fabricType == nil and NbrOfCoveredParts > 0 then
            -- I have to use the global version apparently
            cloneItemType('Transmog'..item:getFullName(), item:getFullName())
            print('Transmog'..item:getFullName())
        end
    end
end

Events.OnGameBoot.Add(TransmogCloner)

I'm not even getting an error, I'm getting notthing

cyan basalt
#

do you want the if to have this? if fabricType == nil? or is it supposed to be !=

#

and is there a reasoning for this being ongameboot rather than start?

gilded hawk
#

fabricType == nil is good enough, and no specific reason to not use ongamestart

cyan basalt
#

bc i thought boot was when you launched the game rather than when when you join a game

gilded hawk
#

This is pain

#

I just decided to log the result of cloneItemType

LOG  : General     , 1660925126458> TransmogBase.Hat_GasMask
LOG  : General     , 1660925126458> Item{Module: Base, Name:null, Type:Normal}
LOG  : General     , 1660925126459> TransmogBase.Hat_BalaclavaFull
LOG  : General     , 1660925126459> Item{Module: Base, Name:null, Type:Normal}
LOG  : General     , 1660925126459> TransmogBase.Vest_Hunting_Orange
LOG  : General     , 1660925126459> Item{Module: Base, Name:null, Type:Normal}
LOG  : General     , 1660925126460> TransmogBase.PonchoYellowDOWN
LOG  : General     , 1660925126460> Item{Module: Base, Name:null, Type:Normal}
LOG  : General     , 1660925126460> TransmogBase.PonchoGreen
LOG  : General     , 1660925126460> Item{Module: Base, Name:null, Type:Normal}
LOG  : General     , 1660925126461> TransmogBase.Hat_SummerHat
LOG  : General     , 1660925126461> Item{Module: Base, Name:null, Type:Normal}
steady herald
#

im gonna do something terrible

jagged ingot
#

You already did not using dark theme.

steady herald
jagged ingot
#

Hahaha

#

It's all good brother.

steady herald
#

i hope to god this works

jagged ingot
#

Get the one that does the melody.

#

The European fancy horn.

steady herald
jagged ingot
#

Don't know the name of the horn but it's Italian.

steady herald
jagged ingot
#

Hahahaha

#

Those horns! :D. When my hubby and I were staff at a YMCA youth camp in Italy, we experienced this vintage car parade. :) When these oldschool vintage cars passed, we all cued up at the roadside and cheered those fancy old cars on. :D Well ok, the Ferrari was not that oldschool. ;) No I’m not skinny because I move so much ;) Follow me on Strava:...

β–Ά Play video
jagged ingot
gilded hawk
#

This makes absolutely no sense

This function throws no errors, and it logs properly too

function TransmogCloner()
    local module = "Base"
    local name = "MxDebug"
    local displayname = "MxDebugName"
    local type = "Clothing"
    local inventoryIcon = 'WatermelonSmashed'
    local item = createNewScriptItem(module, name, displayname, 'Weapon', inventoryIcon);
    print(tostring(item))
    print(tostring(item:isHidden()))
    print(tostring(item:getObsolete()))
    local belt = ScriptManager.instance:getItem("Base.MxDebug")
    print(belt)
    print(tostring(belt:isHidden()))
    print(tostring(belt:getObsolete()))
end

Events.OnGameBoot.Add(TransmogCloner)
Events.OnGameStart.Add(TransmogCloner)

TransmogCloner()
LOG  : General     , 1660926847103> Item{Module: Base, Name:MxDebug, Type:Weapon}
LOG  : General     , 1660926847104> false
LOG  : General     , 1660926847104> false
LOG  : General     , 1660926847104> Item{Module: Base, Name:MxDebug, Type:Weapon}
LOG  : General     , 1660926847104> false
LOG  : General     , 1660926847104> false

Why the hell then the items does not appear in the list painpainpainpainpainpainpainpainpainpainpainpainpainpainpainpainpainpainpainpainpain

steady herald
#

it didnt work

#

i dont understand

#

that should work

cyan basalt
#

for some reason i thought the sounds had to be ogg but i could be wrong

steady herald
#

i shall try that

small topaz
# shadow geyser might be better to get some more details about what you are trying to acheive. Y...

then the IsoGridSquare might indeed not be the thing I am looking for. thanks for explaining.

what I want to do is storing, having access to and manipulating the crops which the player has planted. What I can do is storing the x,y and z coordinates of the crop's location via getModData(). problem is that I don't know how to access the actual plant object by using the coordinates. there is a vanilla command which returns the plant and looks like this:

local plant = CFarmingSystem.instance:getLuaObjectOnSquare(self.sq)

problem is that I do not really know what the argument "self.sq" is. possible that it is an IsoGridSquare object but also possible that it is another "location/square" object....

cyan basalt
#

nah they've got .wav and .ogg in the game files so I don't think that's it

steady herald
#

oof

#

im pretty sure the script is right

#

thats how it looks in the original vehicle script

cyan basalt
#

yeah i just took a look at it too

#

try changing the path?

#

like i dunno if you need the media/sound/ part

steady herald
#

i did for replacing other sounds

cyan basalt
#

weirdddd

#

change it from file = to event =?

#

the original has event

steady herald
#

again. the other sound mods i modded did too

cyan basalt
#

danggg idk then

jagged ingot
cyan basalt
#

ahhh gotcha

steady herald
#

i really want this to work

jagged ingot
#

So you give the relative path

steady herald
#

cause if it does its gonna me hilarious

cyan basalt
#

i just saw that the paths in the items are in the sound folder, but they don't write that part of the path

jagged ingot
#

Exactly.

cyan basalt
#

yeah the relative path was what i was thinking

jagged ingot
#

The code fills it in.

cyan basalt
#

so instead of media/sound/clown_horn.wav it would just be clown_horn.wav

jagged ingot
#

I know this because of music player code I'm converting to Typescript.

#
                        String var4 = null;
                        if (ZomboidFileSystem.instance.getAbsolutePath("media/sound/" + var0 + ".ogg") != null) {
                            var4 = "media/sound/" + var0 + ".ogg";
                        } else if (ZomboidFileSystem.instance.getAbsolutePath("media/sound/" + var0 + ".wav") != null) {
                            var4 = "media/sound/" + var0 + ".wav";
                        }

                        if (var4 != null) {
                            long var5 = FMODManager.instance.loadSound(var4);
                            if (var5 != 0L) {
                                var2.file = var4;
                            }
                        }
#

var0 is your thing.

#

That's called in code.

shadow geyser
jagged ingot
#

I don't use script text files for my work so I wouldn't know from experience.

drifting ore
# shadow geyser ah also you need to move that table.insert to after clearing the zombies zone de...

ZombiesZoneDefinition = ZombiesZoneDefinition or {};

-- total chance can be over 100% we don't care as we'll roll on the totalChance and not a 100 (unlike the specific outfits on top of this)
ZombiesZoneDefinition.Default = {};

table.insert(ZombiesZoneDefinition.Default,{name = "Naked", chance=100, maleHairStyles="Bald:100", femaleHairStyles="Bald:100"});

local function remove_outfits()
ZombiesZoneDefinition = {}
end

Events.OnGameStart.Add(remove_outfits)

#

it is like this now, where should the table.insert go ?

#

im surprised no one has made this mod yet
so here is an idea

PZ but Plants vs Zombies soundtrack
with working "intense wave song" if you got spotted by more than 2 zombies

shadow geyser
gilded hawk
jagged ingot
shadow geyser
# small topaz then the IsoGridSquare might indeed not be the thing I am looking for. thanks fo...

all the plants are already stored in the SFarmingSystem. its a bit complex, as there are somethings that are accessible to the client, and some which are not. depending on what you want to do, if it is serverside only its fairly easy, if you want client to trigger actions its a bit harder. You can do the following.

for i=1,SFarmingSystem:instance:getLuaObjectCount() do
  blah blah blah to effect each plant
end
gilded hawk
jagged ingot
#

I wonder where it's drawing the list of items.

#

Might need to populate it.

shadow geyser
random finch
#

java.lang.ArrayIndexOutOfBoundsException: Index 200 out of bounds for length 200 at org.luaj.kahluafork.compiler.LexState.new_localvar(LexState.java:768)
Does this mean Kahlua has limitation on array size?

jagged ingot
#

You shouldn't need to have 200 vars in one file.

#

This is how Lua is in general.

random finch
#

They are all in on table

#

But, I can run the script fine. When running in game this error.

jagged ingot
#

Well I have a Lua file where I assign around 2 thousand items to a table. It runs.

random finch
#

There is no way I have that many vars

jagged ingot
#

I believe it's top-level assignments.

random finch
#

From what i read LUA can have infinite array sizes.

jagged ingot
#

It's nothing to do with array or table sizes.

#

local x = ..

random finch
#

or almost infinite depending on memory limitations.

shadow geyser
random finch
#

Thought so

jagged ingot
#
You can do at most 200 variables, because by empirical testing, Lua only allows you to have 200 local variables to any piece of code. Outputs all the numbers from 1 through 200. Lua's local limit is 256, not 200, because the lua interpreter uses bytes as IDs for locals.
#

No. This is Lua.

random finch
#

Concerning vars in general, got yuh

jagged ingot
random finch
#

Aint no way I have that many but I could...

fleet beacon
#

I apologize if this is the wrong channel. However there isn't much chat going on in mod support. I just had two quick questions. Does mod load order matter? I am hosting a server for coop and have a few dependancies. I assume the dependancies just go below other mods? Is there a mod load order sorting tool I can download to auto-manage the mod load order like Rimpy for Rimworld?

cyan basalt
#

afaik mod load order does matter, but the mod creators should account for that rather than the user (I could be wrong). mods load in alphabetical order i believe

#

unsure about a mod load order tool

fleet beacon
#

I see. Thank you for the response. The game has been stable despite a few LUA errors concerning the UI and some items. However I Feel that's mostly in due part to using the controller on the Steam Deck.

small topaz
shadow geyser
# small topaz many thanks! that's probably what I need! but I have still a question: within t...

ah yeah, thats the one. sorry, accidentally cut that out of my example. If you want it to do stuff for all plants, you want it on the server folder. and also, if you want it to be something that regularly happens, or checks to do something, you want to do that stuff inside a function, then add that function to a relevant event, such as OnEveryHours. You can find alot of examples using this mechanism in vanilla code.

shadow geyser
heady crystal
#

Does anyone know how does one send the command to create a vehicle as a client?

small topaz
small topaz
shadow geyser
#

sorry I was wrong, the following is from vanilla example of a function doing this


function SFarmingSystem:checkPlant()
    for i=1,self:getLuaObjectCount() do
        local luaObject = self:getLuaObjectByIndex(i)
blahblah
drifting ore
#

sorry if I am bothering you, I literally have no idea how to mod lol

cyan basalt
shadow geyser
drifting ore
#

or does it have to come after end ?

cyan basalt
#

as per your request ^^

shadow geyser
#

ah actually between those two lines, you need to recreate the Default table.

ZombiesZoneDefinition.Default = {}
drifting ore
#

local function remove_outfits()
ZombiesZoneDefinition = {}
ZombiesZoneDefinition.Default = {}
table.insert(ZombiesZoneDefinition.Default,{name = "Naked", chance=100, maleHairStyles="Bald:100", femaleHairStyles="Bald:100"});
end

#

like this ?

lavish linden
#

Anybody commision mods? Willing to pay

jagged ingot
#

I have a market space that's for posting commissions. If you're interested, DM me.

shadow geyser
drifting ore
#

Can anyone help me to add a new satchel to the game? the model is now i just need to code it

cyan basalt
#

Like a backpack?

#

As long as you’ve got the model set up correctly I believe all you’ve gotta do is make a new item in the scripts folder and add to the distribution table with a lua script

drifting ore
#

I don't know how to add them

#

It's my first time coding something so idk

cyan basalt
queen leaf
fleet beacon
#

Is there a mod that increases the size of the moodles? They are waaaaay too small for 4k resolution.

cyan basalt
#

thanks!

sour island
#

Other than the tint does it close the vision cone?

#

I was trying something similar (although opposite) with NVGs

cyan basalt
#

You can choose the different settings for it bc what it's actually doing is enabling search mode

sour island
#

ah

#

so not something I can make use of

cyan basalt
#

I believe it's using the gradientwidth for that? I could be wrong

#

how are you implementing it out of curiosity?

sour island
#

the game has a native NVG mode - but there's no way to adjust the intensity

cyan basalt
#

ahhh I see

sour island
#

internally it just adjust's darksight and applies a filter of green

#

I tried looking into adjusting the darksight to match the same values but I didn't see it

cyan basalt
#

can search mode and the nvg mode be activated at the same time?

sour island
#

I guess I could look into cat's eyes

cyan basalt
#

ooo yeah cat's eyes would probably be a good place to look

cyan basalt
#

could try to layer them then too idk

weak sierra
#

if i do a script override of an item

#

from another mod

#

i expect it to list my mod replacing the other mod's item like it normally does

#

but it doesn't..?

#

what triggers that listing or not

#

e.g.

wind abyss
#

why

willow blade
#

Can someone recommend a good newbie tutorial for making a food mod?

alpine rune
#

Hey guys, new to the modding scene, I have made a mod for Zangetsu from bleach, the weapon stats and Icon work however the audio and model isnt showing up in game (no noise when swinging, holding invisible sword) would anyone have any tips or know what the issue is? I used a blender file (fbx) I (I think I scaled properly) and mp3 sound files

alpine rune
glad ridge
# willow blade Can someone recommend a good newbie tutorial for making a food mod?

Dl a mod that just adds a new food to the game and study the txt files, Lua files and folder structure. If you're just making a recipe and new food item that gets created it's pretty straight forward just follow the txt files. If you want it to load into the map and be able to find it while looting you'll have to edit the luas. Also https://github.com/FWolfe/Zomboid-Modding-Guide

GitHub

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

alpine rune
glad ridge
alpine rune
#

Im afraid its the mesh as everything else is working fine :/ I'll take a look again tomorrow

mystic storm
#

hey is there a mod that removes the option to choose one of the 4 maps?
I want to get the map I choose randomized each time, I don't want the option to be manually chosen
I did a search for mods with the search "random start" but found nothing so idk

willow blade
thin hornet
glad ridge
#

i created a "fun time" mod that decreases sadness, boredom, and stress but idk if it should be released into the world.. not my proudest moment but it was necessary for spending long periods of time alone without human contact

undone elbow
#

How to enable fatigue in debug mode?

thin hornet
#

wont work in god mode

undone elbow
#

Singpleplayer option SleepNeeded is false by default for some reason...

thin hornet
#

O.o

glad ridge
#

is there a way to choose what color duffel bag i spawn in?

glad ridge
#

nvm got it

radiant venture
#

i have absolutely no clue how doParam works, i'm trying to add an item to an evolved recipe and it just won't work

#

can anyone help

toxic walrus
#

Can item tweaker insert new variables ?

drifting ore
#

I need help using the debug mode, how i can use reload lua? since i want to edit the capacity and weight reduction from a bag of stalker armor pack

glad ridge
#

isn't that in the txt file...

drifting ore
glad ridge
drifting ore
#

I can save much time on it

glad ridge
#

you can push f11 i think to bring up the menu and search for your lua in the bottom right square text box

drifting ore
#

My PZ loading is so bad i can't even to main menu when i started a game lmao

glad ridge
drifting ore
#

From what i seen, i don't find the script clothing file

glad ridge
#

?

alpine rune
#

Has anyone ever ran into an issue where their 3d model was invisible and if they fixed it?

lavish linden
#

Any modders willing to get commisioned to make a semi simple mod?

untold junco
#

commissioned πŸ™‚ . I spend the last week to try and understand PZ moding but would pay someone to get me introduced as the process is painfull

alpine rune
#

So I kinda got the model to spawn in however Im still lost but this might be more of a blender issue

glad ridge
alpine rune
#

the .txt files I used to make the mod?

glad ridge
alpine rune
glad ridge
#

have you seen this yet?

alpine rune
#

Okay so.....
Might have had the texture set as jpeg and not png

#

however ran into another issue lmao

glad ridge
#

oh yeah they should be pngs

alpine rune
glad ridge
#

sorry i can't help more i'm working on my first model as well

#

lol cool

#

just got to fix the offset

alpine rune
#

would that be in blender?

#

also fixed the textures

drifting ore
#

Is it supposed to be twice the size of her body

alpine rune
#

yeah

alpine rune
#

is there a tool for offsetting or is it just playing around in blender or with the template

late hound
alpine rune
#

like this?

opal stag
# alpine rune

Looking at the anime I think the blade should be smaller in diameter

#

The cutting part should also be larger

#

It's looks like a big knife

alpine rune
#

It is kinda just a big knife

#

I made the handle thinner to make the rest of the knife look bigger

#

fits in the hand better too

opal stag
#

Is it only a perspective problem in case of anime pic?

alpine rune
#

tbh the sword changes size many times in both the anime and manga it wasnt consistent

opal stag
#

K, now I understand

rocky sluice
#

what would happen if i had an existing game with no mods but then after a couple days of playing it i add mods to it? would it be corrupted

bronze mulch
#

depends what mods

#

elaborate what you want to add

rocky sluice
#

well i dont excatly have a list but i would add a lot of mods like new guns, pass out, basements

#

new cloths

bronze mulch
#

basements should be fine as they are technically not on the same map

#

clothes too

#

guns should work too

rocky sluice
#

ah i see

#

ok then

bronze mulch
#

with maps its diff

#

the map won't spawn on the chunks you aleardy visited

#

but you can restart these chunks

#

and it will work

#

Also

#

Loot generates when you open something

#

So you should see new items innit etc

rocky sluice
#

alr

#

btw i know this isnt a mod question but can you change settings of your game? like zombie lore, nature etc

#

if you already have a game

#

or a run that exists

bronze mulch
#

somewhere in the settings i guess

#

like the actual save settings

#

Also if ur new to the game check this collection out and choose somethings that you might like

#

I would suggest 100% adding these two lol

shadow geyser
bronze mulch
shadow geyser
# wind abyss

alot of the time, this can be caused by having another mod that also uses the same modid subscribed. And I mean subscribed in steam. It causes issues even if it is not activated in the game. Because PZ will search all the mod folders you have, and activate the ones with that mod id, so even though the conflict is coming from a different workshop mod, they will still be loaded, but then the server won't have that mod, causing the file does not exist. Double check that you don't have 2 versions of the same mod subscribed.

shadow geyser
# rocky sluice well i dont excatly have a list but i would add a lot of mods like new guns, pas...

most mods are fine without a new save, only issue is that they won't spawn in new items into places you already visited, unless you have loot respawn on. So for example, a new mod that adds items, or vehicles. Any area you have already been into, has had their "round" spawning stuff in. so you won't find any of the new stuff. Although that isn't usually that much of a problem. Whenever I add anything big, I move to a new city, so it will spawn all the new stuff there. Also unfortunately basements will not work on an existing save. idk about the tech details on why, but on their mod page they say it doesn't work.

shadow geyser
rocky sluice
#

Thank you all so much

thin hornet
weak sierra
weak sierra
#

didn't try changing anything vanilla

dark finch
#

Ill give 35$ to anybody who can make a working bear trap mod

#

I can prolly up the price if its that hard

#

Just want one thats gonna stick people in one spot and break their legs. And they have to open it at their feet

#

Im ignorant on coding in this game tbh but it dont sound like too much coding needs to be done

worldly olive
#

For those that uses Intellij to decompile PZ code did it happen that the find is no longer showing results in the Java classes? πŸ€” Tried to find any config or something but nope lol

charred hemlock
#

idea for a mod: the ability to use computers as notebook storage, so you can keep track of as many things as you would like

worldly olive
#

Yeah I mean, I've done that but is searching inside the lua files, the scripts etc but not in the Java classes

worldly olive
#

You're searching the class there, I want the content inside the class

cosmic condor
#

well I don't know then πŸ˜…

worldly olive
#

Like I know "Outdoorsman" word exist inside IsoGameCharacter, but now it is only finding it in the lua file πŸ€” weird

thin hornet
cosmic condor
#

VS Code FTW ❀️

worldly olive
#

I use Vscode for modding and Intellij to see the PZ Code, will check if I can using vscode

#

In vscode you have an extension for decompile right? Intellij does it all alone but vscode as I know doesn't

thin hornet
#

i dont use intelij at all other than maybe decompiling

#

i know you have Emmylua plugin for vscode but it doesnt give as much as emmylua in intelij with the modules plugged in

#

otherwise PipeWrench has everything java and lua auto-complete and allows to write your mod in typescript.

worldly olive
#

For vscode I use this but I need something to decompile Java I think because I can't see the code

flat cipher
#

You can use IntelliJ to decompile jars into .java files that you then open in VSCode or your editor of choice

worldly olive
#

Probably the best option πŸ€” weird anyway why I can't search inside the java files