#mod_development

1 messages Β· Page 488 of 1

sour island
#

Ye

#

Lua OP

neon lintel
#

anyone got britas weapon mod?

bold cobalt
#

yep

neon lintel
#

in pz chat

exotic ember
#

anyone familiar with True Music mod?

#

Ran into an issue havnt come across yet

sour island
#

Just wanna say good bye friends, if I don't melt my cpu I'll see you soon

sour island
#

we have lift off

sour island
#

going to spawn 1500 cars to see what the range limitation on spawning cars is

#

cause it seems to be roughly the size of a chunk/cell

#

mistakes were made

rancid barn
#

Oh sweet Jesus

sour island
#

if i'm just adding x and y why did it encircle me....

proud fern
sour island
#

9 FPS

#

game is not very optimized /s

errant meteor
#

PZ was made at the start of 2010s lol

sour island
#

Twas a joke

#

I don't know of any game that can handle 1500 3D objects like that

errant meteor
#

NASA super computer

sour island
#

this save needs to be immediately deleted though

rancid barn
#

Why’s that?

sour island
#

cause it's got 1500 objects where I'm standing

#

also I see why that happened

#

didn't find a new square

#

whoops

#

dumb code did exactly what I told it to

#

trying to figure out why they can't be spawned on roofs but also how to load the cell/chunk to place them

#

are stories placed as the player explores?

grizzled grove
#

i know vehicles can't normally be spawned inside a building, I would imagine that goes for roofs as well. I'm not sure if it's that it's a lot or a roomdef that blocks spawning though. We have two 'special' roomdefs, empty and emptyoutside, in case that helps at all

proud fern
sour island
#

the car doesn't spawn in at all though

#

the engine can tell it's not on a ground floor and poofs it

proud fern
#

I mean, the same would probably go for water.
Roofs are just car innacesible I guess

#

Unless like, Louisville has roofs with cars

sour island
#

cars can spawn on water** afaik

nimble spoke
#

but you can spawn vehicles on water

proud fern
#

Oh

#

Well fuck my argument got destroyed

sour island
#

Yeah I think it's just a very particular limitation placed on the spawning of vehicles

#

the thing going on with the range though I think I just need to figure out a solution

#

either a list of locations that get loaded in when the player is near by

#

or load the chunk - place the car - unload it

fair frost
# sour island

Something i've been wondering
What are the non-crashed versions of the helis are used for ?
Like i assume they can, maybe be spotted during event including them when they don't crash but i'm unsure

sour island
#

They're just there mostly for future things

#

it's easier for shark to design an intact one then break it

willow estuary
#

Vehicles only "exist" on z-level 0/ground floor. They can look like they're above ground level, but that's just looks. I believe it's on account of how their 3d physics engine has been slotted into PZ's isometric game engine.

It's one of the reasons, IMO, why player-flyable helicopters etc are only feasible as janky novelties versus a serious emulation.
But yeah, as is, no vehicle ramps, multi story parking garages, overpasses, etc, are currently feasible on account of this.

rancid barn
#

: (

marsh beacon
#

Even if they could exist on another plane, you still have the 45⁰ ramp/stair issue

fair frost
#

And looks pretty based

umbral raptor
#

Hey, I was wondering if there was a mod that adds better cabins, like logging cabins, ski resort, hunting cabins, etc. The ones currently in the game are just tiny af and the only proper lodge in the game is thrown down in the middle of nowhere and very hard to get to/out of.

viral crater
#

i dont think there are many ski resorts in kentucky
definitely none where the game is set

umbral raptor
#

anything that adds stuff like buildings to forests pretty much

#

or upgrades the cabins in the game

dawn shuttle
#

Been struggling to figure out why my Panel is causing the whole window to be draggable.. If I remove the listbox from the panel it responds to the mouse. Any idea wth is going on? Many thanks

rose notch
plucky nova
#

for the past month, i have been trying to get the mod "True Music" to work properly. for some reason, it seemingly conflicts with a different mod that i am having trouble pin-pointing out of my 114+ mods. I know this is partly my fault, for having so many mods, but i still want this mod to work somehow.

#

i have tried trouble-shooting it with several different mods, and i cant figure out which one it is that is causing the mod to not work

#

the mod works fine on its own, its just that some mod that i cant seem to pin-point is causing it to break

bold cobalt
#

I guess you can turn them all off except true music and turn them all on one by one

plucky nova
#

when i put down a boombox, it does not work. the menu opens, but nothing is there

plucky nova
bold cobalt
#

Yeah it does sound like a big hassle

plucky nova
#

i have 114 mods, that would take way too long lol

#

but i might have to...

#

anyway

royal ridge
#

is there an error log?

thin hornet
#

dang, loading in the game loads up to 36793 squares o.O

willow estuary
#

Well, I think the "reality bubble" around a character extends 75 squares?
So that would be a 150x150 chunk right there, which would be 22,500 squares if you only counted the ground floor squares? I believe only squares that are a building/feature or are adjacent to one "exist" above z-level 0. I guess I'd say buildings are "fuzzy" in this regard.
22k is close enough to 36k that I'm not surprised though,

thin hornet
#

im simply counting them from the load event

---@param square IsoGridSquare
Events.LoadGridsquare.Add(function(square)
    totalSquareLoaded = totalSquareLoaded + 1
end)

But its not always the same amount depending on where i load in i think.

#

I cant seem to find an event for what i wanna do

#

@iron salmon would be nice if we could have an event OnItemInstantiated to handle any item instantiated by the game. Not sure if there is way to suggest these kind of stuff to the dev. This way if an item is created manually it would still be intercepted and execute our code on it.

#

~~for example media CD and VHS are randomized when they are instantiated, if i make a custom item and want to assign them custom moddata for my mod, there not many way right now to actually edit that item other than scanning the surrounding and loop bunch of containers. A nice way would be to simply wait for an item to be instantiated and compare its type and moddata and randomize if the condition are good for me. I'm testing with OnFillContainer but doesn't seem to run all the time i could be wrong tho. ~~ Been doing it wrong apparently lol

willow estuary
#

@ nasko is the person who gets paid to get pestered re that sort of matter,

thorny vortex
#

Someone suggested that I make a mod that disables the ability to auto hop fences, I wanted to know if that's even possible or if it's hardcoded into the game?

thin hornet
#

@thorny vortex its hardcoded in IsoPlayer
isSafeToClimbOver
this.getCurrentSquare().Is(IsoFlagType.HoppableN)
the java code for IsoPlayer if you wanna look https://pastebin.com/67VPqH1E

thorny vortex
#

Alright, thanks for the help!

exotic ember
#

anyone use that TrueMusic mod?

#

Added a couple of tracks that just speed through with some horrible aquatic sounding filter.

#

Sounds like its accelerating through a cassette at an equipment damaging speed.

thorny vortex
#

I've had a problem with it where the boombox just doesn't work when placed

#

But then again my mod load is like 100+

kind basalt
#

I found an error with a mod I played and noticed the error come from here.

#

how can I find the table or list definition about SuburbsDistributions["gunstore"]["locker"]

thin hornet
#

@kind basalt
E:\SteamLibrary\steamapps\common\ProjectZomboid\media\lua\server\Items\Distributions.lua
E:\SteamLibrary\steamapps\common\ProjectZomboid\media\lua\server\Items\ProceduralDistributions.lua

thorny vortex
#

I keep finding like, 4 miniguns per location I go to, even on extremely rare

#

Nevermind I never looked at the distribution

weary matrix
#

@dawn shuttle hard to say without the code

cobalt kettle
#

Looking to get into some modding. Recently won a copy and started looking at the docs. Found something that piqued my interest and was lookin to get a jumping off idea.

While I have messed with Java years ago, and some JS,... Lua is new. I'm not real worried about that as much as I am naming, saving, what I can and cant do,...

Looking into the java. Specifically the IsoZombie class.

thin hornet
#

@cobalt kettle welcome in the modding world of pz πŸ‘

weary matrix
#

Any clue of a good Lua pretty printer that works for Zomboid to troubleshoot some issue?

#

I tried two different that I use for other Lua project, but they crash when trying to pretty print Zomboid objects

thin hornet
#

@weary matrix what class you need to pretty print ?

weary matrix
#

@thin hornet let's say IsoPlayer

#

I have some weird issue where player:getSquare() returns nil, can't figure out why

#

I want to print the player object to understand if there was a corruption, or if the object is not the one I expected etc

#

but it's weird cause it's the player object provided by OnPlayerUpdate(player) event

#

got this problem with some rooms sometimes also, like room:getSquare() also returns nil sometimes

thin hornet
#

you can check if the variable is an instanceof(player, "IsoPlayer") or instanceof(square, "IsoGridSquare")

#

otherwise try printing the object

for k, v in pairs(obj) do
    print(k, " ", type(v), " " , v)
end
#

but that wouldnt work with a java object :/

#

getSquare() return nil for me near stairs

#

or if the square is too far from the player

weary matrix
#

ah interesting

thin hornet
#

you can try type(obj) to check what type it is also if you get "userdata" then its a java object

weary matrix
#

yeah problem is stuff I want to debug is userdata :/

thin hornet
#

try error(obj) and might have the data shown in the debugger

weary matrix
#

let me try

#

@thin hornet perfect, thanks

thin hornet
#

@weary matrix also an utils if you just wanna see what it is

print(KahluaUtil.rawTostring2(getPlayer())) -- zombie.characters.IsoPlayer@1dabe2dd
print(KahluaUtil.rawTostring2(getPlayer():getSquare())) -- zombie.iso.IsoGridSquare@44229c14
weary matrix
#

@thin hornet πŸ‘

thin hornet
#

@weary matrix also if you want to check a java object field and function

-- Check a java object class fields
local player = getPlayer()
local fieldNum = getNumClassFields(player)
for i=1, fieldNum-1 do
    print(getClassField(player, i))
end

-- Check a java object class functions
local funcNum = getNumClassFunctions(player)
for i=1, funcNum-1 do
    print(getClassFunction(player, i))
end
#

will print something like

...
LOG  : General     , 1636028477102> protected void zombie.characters.IsoPlayer.updateStats_Sleeping()
LOG  : General     , 1636028477103> public zombie.characters.IsoGameCharacter zombie.characters.IsoPlayer.getClosestZombieDist()
LOG  : General     , 1636028477104> private boolean zombie.characters.IsoPlayer.IsUsingAimHandWeapon()
LOG  : General     , 1636028477105> public float zombie.characters.IsoPlayer.getPlayerClothingInsulation()
LOG  : General     , 1636028477106> public boolean zombie.characters.IsoPlayer.isTimedActionInstant()
LOG  : General     , 1636028477107> private void zombie.characters.IsoPlayer.onClothingOutfitPreviewChanged()
LOG  : General     , 1636028477108> private static void zombie.characters.IsoPlayer.onTrigger_ResetIsoPlayerModel(java.lang.String)
LOG  : General     , 1636028477109> public void zombie.characters.IsoPlayer.setVehicle4TestCollision(zombie.vehicles.BaseVehicle)
LOG  : General     , 1636028477110> public double zombie.characters.IsoPlayer.getLastSeenZomboidTime()
LOG  : General     , 1636028477111> public void zombie.characters.IsoPlayer.setPerformingAnAction(boolean)
LOG  : General     , 1636028477111> public float zombie.characters.IsoPlayer.getPlayerClothingTemperature()
...
weary matrix
#

@thin hornet ah interesting too, let me save that code in it's own file for later use

thin hornet
#

@weary matrix also if you wanna run stuff and dont want the error to stop the rest of the code after you can run it into a pcall

function causeErrorButDontStopExecution(param1, param2)
    error("Error!!!")
end

local hasError = pcall(causeErrorButDontStopExecution, "param1", "param2")
if hasError then
    print("There was an error running causeErrorButDontStopExecution() but this still got printed !")
end
weary matrix
#

@thin hornet true, but pcall is standard Lua, so I know about it! πŸ˜„

#

still thanks for pointing it out

thin hornet
#

cool might help other πŸ˜„

weary matrix
#

definitely

thin hornet
#

im taking a brake of coding so im just dropping some knowledge xD

#

stuff i recently learned anyway

weary matrix
#

@thin hornet awww how come you're taking a brake at coding?

thin hornet
#

cause ive been coding all day xD

weary matrix
#

ah just for today πŸ˜…

thin hornet
#

Yeah lool

weary matrix
#

@thin hornet may I ask what you've been working on?

thin hornet
#

Working on a computer mod

weary matrix
#

interesting

#

what can you do with the computers?

thin hornet
#

for now you can install hardwares, turn it on, access bios and toggle settings.

weary matrix
#

heh nice

thin hornet
weary matrix
#

@thin hornet I've been thinking for a while about making a cyber security game, similar to zomboid, but no zombie apocalypse

thin hornet
#

but basically it will allow to play games, read/write text files, and use/require software to do stuff

weary matrix
#

@thin hornet will you implement networking? πŸ˜„

thin hornet
#

allows to use vanilla CDs and im adding learning CD to gain skills

#

We are thinking about networking for the MP release

weary matrix
#

you'd have to pull a cable between the computers, zombie could get their feet in the cable, so you have to replace them πŸ˜‚

thin hornet
#

but might make some sort of networking for SP too

#

networking might be wireless tho since power is wireless too

#

but might need relay to make it go further

weary matrix
#

yeah

thin hornet
#

i also want a printer to print text file on paper sheet xD

weary matrix
#

or you have to dig grave all along the way to bury the cables πŸ˜‚

#

@thin hornet good idea, you could print maps, share maps with others etc

thin hornet
#

massive print bunch of copies of text file

#

or yeah maybe a scanner to copy maps

#

depend what existed in 1993

#

But the mod includes a way to create addons to extends the features of the mod

#

the main mod im trying to keep it as neutral so that the addons dont have to update all the time

craggy furnace
#

ive used this extensively

thin hornet
#

nice

exotic ember
#

any users of the TrueMusic mod out der?

quick maple
#

Hi, how can I edit the text shown when pressing Q?

abstract raptor
#
    IGUI_PlayerText_Callout2 = "Over here!",
    IGUI_PlayerText_Callout3 = "Hey you!",
    IGUI_PlayerText_Callout1New = "HEY!",
    IGUI_PlayerText_Callout2New = "OVER HERE!",
    IGUI_PlayerText_Callout3New = "HEY YOU!",
    IGUI_PlayerText_Callout1Sneak = "pssst!",
    IGUI_PlayerText_Callout2Sneak = "psst",
    IGUI_PlayerText_Callout3Sneak = "hey",```
quick maple
#

Gracias, bro!

thin hornet
quick maple
abstract raptor
#

Prolly yea

#

that's what I did with Irate User Interface

#

where I changed all the text in game to have swear words

quick maple
#

Do I delete all other lines except the callout lines? Or leave it as is?

abstract raptor
#

I think you leave it be?

#

Yeah I'm not sure, I just replaced the entire file last time

#

What are you changing the shouts too?

quick maple
#

Shouts from another language

#

I'd also like to add more than 3 shouts for variety if possible.

tame mulch
rugged parcel
#

why are my mags and attachments on the guns in britas weapon pack not showing up

bold cobalt
#

Mine works, did you try to unsubscribe and resubscribe from the mods then start a new game?

#

Also with new loot distribution fixes you might not always find the correct ammo or magazines right away.

rugged parcel
#

I am pretty sure I have unsubscribed and even deleted my game

#

it has to be some kind of mod or something

#

I will get rid of my loot distribution mod

bold cobalt
#

Which loot mod is it?

rugged parcel
#

90s distribution pack

bold cobalt
#

Yeah I have that one but I’m not using it so maybe that’s it

dawn shuttle
weary matrix
#

@dawn shuttle haha, great πŸ‘

thin hornet
#

Anyone has an idea how to add a mod requirement to the workshop.txt?

sour island
#

For the workshop you have to use the steam workshop page settings

thin hornet
#

oh

#

this

sour island
#

ye

thin hornet
#

thanks man

sour island
#

np

drifting ore
#

So, how would armed Vehicles work? like mounting a .50 on a Humvee?

rancid barn
#

would probably work like how you can shot out of windows with guns

pearl prism
sour island
#

Anyone familiar with the new globalobject moddata know if it is getServerModData ?

royal ridge
#

no, does it work the same as global mod data though?

#

you can transmit to the server with void ModData.transmit(String key)

#

and view it with void ModData.request(String key)

#

Maybe the new getServerModData gives you a list

#

local myGlobalModData = {} ModData.add("GlobalModData", myGlobalModData) ModData.transmit("GlobalModData")

dry chasm
# sour island Anyone familiar with the new globalobject moddata know if it is `getServerModDat...

I'd say a copy paste of changelog part regarding global mod data would be the clearest answer.

Registers moddata tables with a given String key.
When Global Moddata is initialised during world loading it triggers the event OnInitGlobalModData with parameter: boolean isNewGame.
LuaTable ModData.create(String key) creates and returns the table with given key, returns null if the table already exists.
String ModData.create() creates a table with a random UUID key, note: returns the string key.
LuaTable ModData.getOrCreate(String key) gets or creates the table with given key.
LuaTable ModData.get(String key) returns the table with given key or null.
boolean ModData.exists(String key) return true if table with given key exists.
LuaTable ModData.remove(String key) removes the table with given key if exists and returns it or null.
void ModData.add(String key, LuaTable table) store the table with given key (overrides any existing table).
ArrayList getTableNames() returns a list of all registered tables.

sour island
#

ah

dry chasm
#

for networking part:

Global ModData is not synced between server and client as depending on what the moddata is being used for this may not be required or even unwanted.
Syncing of data where needed is up to coder/author. There are however two methods for networking:
void ModData.transmit(String key)

  • this will attempt to transmit the table with given key, when called on server this is send to all clients, when called on client send to server. (see note on receiving moddata below)
    void ModData.request(String key)
  • client only, this sends a request to server to send back the table with given key to this client.
    When the server or the client receives a moddata packet it is not automatically added to the local register.
    Instead the packet is read and the event OnReceiveGlobalModData is triggered, the String key and LuaTable table are passed as arguments.
    NOTE: the table argument can be 'false' when moddata packet replied to a ModData.request.
    The coder/author can then decide to parse, register or keep it as temporary lua table only etc.
    Source: https://theindiestone.com/forums/index.php?/topic/38241-iwbums-4151-released/
autumn sierra
#

chuck is a man of few words lmao

royal ridge
#

I use global mod data for the immersive solar arrays mod but I don't send anything to server yet since no multiplayer

thin hornet
#
local GlobalModData = ModData.get("ComputerMod")

local function LoadGlobalModData()
    if not ModData.exists("ComputerMod") then
        ModData.create("ComputerMod")
    end

    GlobalModData = ModData.get("ComputerMod")
    if GlobalModData.computerLocations == nil then GlobalModData.computerLocations = {} end
    if GlobalModData.computerStateLocations == nil then GlobalModData.computerStateLocations = {} end
end

Events.OnGameStart.Add(LoadGlobalModData)

thats how i use for now

royal ridge
#

pretty much use it the same way

thin hornet
#

When MP comes out ill see what i do with it

drifting ore
#

Im not sure is this the right channel for this, but what are some good mods that you should have?

#

Actually a lot of people discuss about this on the reddit. Ill just search there

royal ridge
#

it depends on what you are looking for in your game, have you play it much in vanilla?

ruby urchin
#

T-pose

zealous glade
#

Can I ask a silly question? Is there a command like weapon:getType():setType("Axe") ?

weary matrix
#

@zealous glade what are you trying to achieve?

#

if you desperately want an axe you have an item spawner in debug mode

zealous glade
#

Sorry about this dumb attempt, I'm just trying to mess around, like giving a zombie a chance to revive if you kill it using a melee weapon but you don't kill it critically, so it might come back later

#

and sorry for my bad english πŸ’©

thin hornet
#
local playerObj = getPlayer()
local inventory = playerObj:getInventory()
local axe = inventory:addItem("Base.Axe")
zealous glade
#

That's not what I try to do, thanks anyway! I want to "check if the weapon I use to kill a zombie is a melee type or not"

#

I looked into item_weapon.txt, where I find a category, like Axe, so ..

thin hornet
#

maybe try SubCategory

zealous glade
thin hornet
#

item:getSubCategory() == "Swinging"

thin hornet
#

or that yeah haha

#
handWeapon:getCategories():contains("SmallBlunt")
handWeapon:getSubCategory() == "Swinging"
zealous glade
#

I know it's dumb, can anyone understand what I try to do?😫 I'm a total idiot on lua

thin hornet
#

why OnContainerUpdate?

zealous glade
#

because a dead zombie is a container?

thin hornet
#

oh

#

but then the first param would be

#

container

#

LuaEventManager.triggerEvent("OnContainerUpdate", this <-- its the container);

#

which can be a dead body

dry chasm
#

I think that'd fit more to what you plan on doing

thin hornet
#

OnZombieDead(isozombie)

dry chasm
thin hornet
#

it doesnt

dry chasm
#

aw

#

alternatively hook the hit for multiplayer compatibility? Unsure if the hit thing'd run before or after the death happens though

zealous glade
#

because, for what I understand, when you kill a zombie, and dont kill it by critical hit, you might not strike zombie's head, so the zombie might not be dead, you just knock him out. So he might revive

thin hornet
#
function FightStep:OnMomDead(zed)
    Events.OnZombieDead.Remove(FightStep.OnMomDead);
    FightStep.momDead = true;
end
Events.OnZombieDead.Add(FightStep.OnMomDead);
#

probably run before the death occure as you need to hit it to kill it

dry chasm
zealous glade
#

I cannot follow you guys now, it's far beyond my brain's capacity

dry chasm
#

sry

thin hornet
#

LuaEventManager.triggerEvent("OnHitZombie", this, var2, var7, var1);

zealous glade
#

I will study it hard now, I guess, hope one day I can make it possible

thin hornet
#
("OnHitZombie", IsoZombie, IsoGameCharacter, BodyPartType, HandWeapon);
("OnZombieDead", IsoZombie);
dry chasm
#

does the damage and change to corpse apply there too, do you know that? πŸ‘€

thin hornet
#

also the hit is triggered before the dead if that was a question

LuaEventManager.triggerEvent("OnHitZombie", this, var2, var7, var1);
         float var8 = super.Hit(var1, var2, var3, var4, var5, var6);
         if (this.Health <= 0.0F && !this.isOnDeathDone()) {
            this.DoZombieInventory();
            LuaEventManager.triggerEvent("OnZombieDead", this);
            this.setOnDeathDone(true);
         }
dry chasm
#

so prior to that D:

thin hornet
#

i guess that OnHitZombie if its not the body part of the head he could give health back

dry chasm
#

alternatively there's the option of comparing the delay of hit to death πŸ‘€

thin hornet
#
function onHitZombie(zombie, playerObj, bodyPartType, handWeapon)
  if not bodyPartType.Head then
     local health = zombie.Health
     zombie:setHealth(health + 1) --- idk just an example
  end
end
Events.OnHitZombie.Add(onHitZombie)
#

invincible zombie sound like a good idea

#

lol

zealous glade
#

why +1 health

#

oh i get it, yeah

thin hornet
#

i guess if its not the head you dont wanna kill it

zealous glade
#

yes, you can't kill it

#

unless you execute it

willow estuary
#

This should work

function OnlyCriticals(wielder, zombie, weapon, damage)
    if not (instanceof(zombie,"IsoZombie")) then return false end
     zombie:setHealth( zombie:getHealth() + damage )
end    
#

This below code needs to be after the above code in either the file, or the file directory structure.


Events.OnWeaponHitCharacter.Add(OnlyCriticals)
#

If a zombie has it's health restored, only criticals put them down.

thin hornet
#

interesting

willow estuary
#

Haven't tested so might just be a bunch of bullshit on my end here? But in theory I think it should work. 🀷

zealous glade
#

Still try to understand the code, sorry I'm an idiot cold I will try it later! Thanks!

willow estuary
#

Now, another step would be evaluating if the weapon is a melee weapon or not, as well.

zealous glade
#

can I just use weapon:isRanged() == false?

thin hornet
#
function onWeaponHitCharacter(playerObj, zombie, weapon, damage)
    if not zombie:isZombie() then return false end
    if weapon:isRanged() or not zombie:isCriticalHit() then
       print("Zombie old health:", zombie:getHealth())
       zombie:setHealth( zombie:getHealth() + damage ) -- give health instead of taking as its not critical 
       print("Zombie new health:", zombie:getHealth())    
    end
end
Events.OnWeaponHitCharacter.Add(onWeaponHitCharacter)

but doing that would make shooting zombie irrelevant

ruby urchin
#

Anyone know how replace a animation?

thin hornet
#

depend what you mean

ruby urchin
#

??

#

how "what you mean" lol

thin hornet
#

replacing a walking animation? an action animation?

#

what animation you wanna replace

ruby urchin
#

Wait me a sec

thin hornet
#

im not pro animation just asking for more context on what you want to achieve

ruby urchin
thin hornet
#

haha

#

funny

#

but in all honesty i dont know much about anim i wish i do, i need anims for my mod

gentle mountain
#

Is there a mod that allows me to listen to radios without having them equipped, e.g. listening to them while they're on the belt and I'm not holding them?

willow estuary
#

Got the "bag attachment code" for the quad bikes spiffed up to where you use a rope to attach bags to them, which you get back when you uninstall them.

#

No tool required to remove them.

drowsy merlin
#

What are good sources of up to date information about hydrocraft and the different mechanics it adds to the game?

weary matrix
#

but it might be incomplete

#

or read the source πŸ˜›

mental steeple
#

is there an up to date guide on adding models to build 41? everything on the forums seems outdated

scenic cradle
#

anyone available to help with a couple of should-be-simple questions regarding a mod I'm working on?

scenic cradle
#

Yeah, figured as much. I just need help getting inventory icons and 3d ground models to tint properly like clothes/bags that also use tint

#

the equipped models tint just fine

#

textures, rather

craggy furnace
#

are you talking about having multiple textures and then having the icons match up?

scenic cradle
#

either that or making them 'tint' like duffel bags and stuff, i.e. spawning in random colors

craggy furnace
#

yes

#

let me show you

scenic cradle
#

oh thank god

craggy furnace
#
<clothingItem>
    <m_MaleModel>skinned\hair\m_balaclavaface</m_MaleModel>
    <m_FemaleModel>skinned\hair\f_balaclavaface</m_FemaleModel>
    <m_GUID>a3a1ca7b-4ded-43fe-be01-dacfdfef68aa</m_GUID>
    <m_Static>false</m_Static>
    <m_AllowRandomHue>false</m_AllowRandomHue>
    <m_AllowRandomTint>true</m_AllowRandomTint>
    <m_AttachBone></m_AttachBone>
    <m_HatCategory>nohair</m_HatCategory>
    <m_MasksFolder>media/textures/Clothes/Hat/Masks</m_MasksFolder>
    <textureChoices>balaclava_full2</textureChoices>
</clothingItem>```
#

do you see AllowRandomHue and AllowRandomTint?

scenic cradle
#

yea

#

i used the Tint one, but only the equipped bag actually worked

#

not the icons or the ground models tho

craggy furnace
#

1 sec

#
    <textureChoices>clothes\hat\Hat_PoliceBaseballCap</textureChoices>
    <textureChoices>clothes\hat\Hat_PoliceBaseballCapBlack</textureChoices>
</clothingItem>```
#

you must set up the texture choices to path to the texture

#

use this too

#

IconsForTexture = PoliceBaseballCap;PoliceBaseballCapBlack,

#

this will switch between the named textures

scenic cradle
#

Is that for inventory icons?

craggy furnace
#

yep

scenic cradle
#

oh shit, I've been calling Base

craggy furnace
#

test it out and get back with me

scenic cradle
#

am I supposed to call my own mod in the item script?

craggy furnace
#

you mean in module?

scenic cradle
#

yea

craggy furnace
#

a lot of people use Base but i find that it causes issues with other mods and i use it to organize my own mods

#

you can create your module anywhere iirc with the exception of models

#

anything with the model loader requires Base?

scenic cradle
#

ah I see

#

let me work on this a bit and I'll hit you up again, thankyou so much

craggy furnace
#

np i am here

sour island
#

Does anyone know of a way to load a chunk/cell/square? For some reason my previous approach to spawning items/vehicles/zombies far away no longer works. (Possibly never has?)

#

Using getCell():getOrCreateSquare() creates a square but there isn't a chunk tied to it which throws up errors.

#

Looks like getCell() is only getting world's current cell - not sure if that's new behavior

#

time to dive into IsoWorld/IsoCell/IsoChunk I guess

sour island
#

@iron salmon What do you know about gridsquares/chunks/cells ?

#

I used to be able to spawn cars/items/zombies 200ish tiles away now I can only do it roughly 90ish

#

And I don't see a way to forcibly load a cell/chunk briefly

#

and I would have to refactor a good deal of code to create a spawn scheduler when ever a player goes near by.

undone heron
#

does anyone know if the bug with custom passive skills got fixed yet? wasn't a few months ago when they switched over to the new .txt file system for skills.

sour island
#

bug?

wraith dust
#

how can i find the default 0 0 0 offset point on attachment offsets

#

especially in Bip01_BackPack

undone heron
# sour island bug?

if you define a modded skill (in build 41.52) as passive, it wouldn't show up in the character creation screen and when you go in game, would start at 0 instead of 5

#

reported it, but haven't seen it listed anywhere in patch notes so just wondering.

sour island
#

Have you tried Passiv ?

undone heron
#

yes

sour island
#

Odd

undone heron
#
perk Reading
{
    parent = Passiv,
    translation = Reading,
    passive = true,
    xp1 = 1000,
    xp2 = 2000,
    xp3 = 4000,
    xp4 = 6000,
    xp5 = 12000,
    xp6 = 20000,
    xp7 = 40000,
    xp8 = 60000,
    xp9 = 80000,
    xp10 = 100000,
}
#

tho that was 41.52

I'll boot up in the latest to see

#

yeahhh

#

still not functional

#

sad

hot patrol
#

anyone know if it is possible to implement items that have more than 1 texture option? Right now I have it soo my dakimakuras are all idividual items but I feel like this could easily flood loot tables and I want them to be rare.

undone heron
#

@sour island maybe you can help since you're super knowledgeable with the game. do you know what file has the information for when a character is actually being created?

#

like I know ProjectZomboid\media\lua\shared\NPCs has MainCreationMethods which defines a lot of methods, but not the actual character creation

sour island
#

That may be done java side

undone heron
#

damn

sour island
#

What are you trying to do exactly?

#

Create a player or grab it's data?

undone heron
#

grab their data on creation

#

but after their perks and traits are added*

#

was trying to think of a work-around for the issues I'm having till indiestone fixes it

deep loom
#

hi friends, whenever I try to disassemble a device for electricity XP I get an error and I dont gain any XP

#

I assume it must be one of my mods, has anyone experienced something like this before?

undone heron
#

one of the workarounds I thought of was ...

on
Events.OnCreatePlayer.Add(addTraitToPlayerOnCreation);
reduce level to 0.
Count up how many traits they have related to the reading skill
re-add what proper level they should be at.

However it seems like the initial trait, profession, and exp adjustments happen AFTER the event I am using. So it does all that and then adds in the traits, which resets back to level 1/2/3

sour island
#

There's Lua functions for adding skills from professions there may be something in that file.

weary matrix
#

@undone heron you could probaly hook onPlayerUpdate() and do something like:

if not player:getModData().initialized then
    player:getModData().initialized = true
    -- Do your special stuff here
end```
thin hornet
#

I do something like this with custom Lamp Post and Custom Souns Emitter

#

because when i leave the area where a computer is the square unloads, so the light must be restored when i come back, or if i load in the game far and go to near that computer i need the light and the sound to be started as soon as its in the area. (Couldnt figure a better way to handle this)

dry chasm
#

For spawning items I'd rather choose the event LoadGridsquare and load moddata containing the items to spawn by location and string.
Then just compare the Griddsquare's X,Y,Z with the items to spawn and if not spawned yet, then spawn.
That way, while an event runs whenever a gridsquare loads, it won't run each and every tick - and when keeping it in a single function iterating a table and not one function for each item added to the event, it shouldn't cause lags (atleast on my tests) with a few hundred checks.

sour island
#

I've considered that - it's just I'd need to redo alot of stuff lol

thin hornet
#

@dry chasm ive tried using LoadGridsquare but its only called when i load in my save file and its load around 30,000 squares. Then when i teleport around its never called again so not sure how that works.

dry chasm
#

πŸ€·β€β™‚οΈ on my end it loads it fine and unloads squares i distance myself from

#

also loads when teleporting so ... not sure?

sour island
#

I've been using getorcreatesquare - and it does create a square - but as there is no chunk related the java side of things fall apart

dry chasm
thin hornet
#

@dry chasm do you have an example of how you use it?

#

ill test again but from my experience ive had trouble using it especially because it runs around 30k times so doing stuff in it kind of lag my game at loading time

dry chasm
#
local itemsToSpawn = { -- preferrably use moddata to save/load that so it's not respawned once quit/loading into it again
  {x=10000, y=6000, z=0, item="Base.Someitem", spawned = false},
  -- ...
};

function MyItemSpawning(square)
  -- store location once so we don't have to call the methods all the time while iterating
  local sqX, sqY, sqZ = square:getX(), square:getY(), square:getZ(); 
  for k, item in ipairs(itemsToSpawn) do -- iterate all items to spawn
    if not item.spawned and item.x == sqX and item.y == sqY and item.z == sqZ then -- check
      item.spawned = true; -- set spawned to true
      -- spawn item
      break; -- break out unless you potentially spawn more than one item at the same location.
    end
  end
end

Events.LoadGridsquare.Add(MyItemSpawning);
#

something like that?

#

alternatively, to remove "further" checks for each load with each item spawned, one could reverse-iterate the item table and upon spawning just remove the entry

thin hornet
#

okay ill try to spawn Axe on all square now lol

dry chasm
#

and for saving stuff, one could use
the event OnInitGlobalModData

function initItemSpawning(newGame)
  if newGame == true then
    itemsToSpawn = {
      -- the items here
    };
  end
end

Events.OnInitGlobalModData.Add(initItemSpawning);
#

and then just create it there, alternatively load it

dry chasm
thin hornet
#

yeah i remember your stream, it called as soon as you moved

#

but in my end it just call on game load and i never see that event ever again no matter how far i Teleport

dry chasm
thin hornet
#

ill try reuse after this test

#

oh

#
Events.OnGameStart.Add(function()

    Events.LoadGridsquare.Add(function(square)
        print("Load square -> ", square:getX(), square:getY(), square:getZ());
    end);

end);

By binding only after game start it seem to call whenever i move

dry chasm
#

welcome to anonymous function hell again. πŸ˜‚

thin hornet
#

We are anonymous, expect us

#
Events.ReuseGridsquare.Add(function(square)
        print("Reuse square -> ", square:getX(), square:getY(), square:getZ());
    end);
#

doesnt call

#

w/e we know when a square is loaded how do you know when its unloaded

dry chasm
#

when it's nil when trying to get it's location xD

thin hornet
#

yeah ok

weary matrix
#

it seems quite outdated

thin hornet
#

<!-- Generated by javadoc (1.8.0_45) on Mon Jul 13 17:47:43 ADT 2015 -->

weary matrix
#

@thin hornet that's the version of the Java virtual machine, not the version of Zomboid

thin hornet
#

its been generated in 2015

weary matrix
#

oh my, my spear traps mod has 3,298 Current Subscribers, never expected so many users

thin hornet
#

so its pretty outdated

weary matrix
#

@thin hornet oh my bad, I missed the important bit πŸ˜…

thin hornet
#

hehe

weary matrix
#

I guess I should generate my own Javadoc then πŸ˜…

thin hornet
#

my generator condition went to zero and burned my place down xD

weary matrix
#

aww geez

        if(watchkey == null) goto _L2; else goto _L1
#

getting this error when trying to generate Javadoc, cause decompilation is not perfect

thin hornet
#

do you know of capsid?

weary matrix
#

nope

#

but the invalid decompiled files I have, have been decompiled with Jad

#

cfr seems to be doing a better job, but is 1000% slower

#

@thin hornet what's capsid?

thin hornet
#

its decompile the game and allow for an intelisense and also annotate the whole source code for you

weary matrix
#

oh nice!

#

Had no idea

thin hornet
#

you just need to use IntelliJ community edition
start a project with gradle and groovy, select java15 and then you follow the instructions

#

If you have question regarding the installation i can send you detailed screenshot

weary matrix
#

@thin hornet this should get pinned I guess

#

@sour island do you have enough power to pin things in here?

thin hornet
#

I will probably make a tutorial on how to set it up soon

weary matrix
#

would be nice

autumn garnet
#

it's in French but it's easy to set up

thin hornet
#

nice

weary matrix
#

@thin hornet which OS are you working on?

thin hornet
#

im on win10

#

i also used it on ubuntu before

weary matrix
#

good to know

#

@thin hornet ok I have IntelliJ setup, started a new gradle project with groovy, but now I'm lost when I try to follow the setup from github

#

I found the gradle tools window, but then I can't find how to Run createRunConfigurations Gradle task.

thin hornet
#

then you wait it will update

#

it will ask you for your game directory in a terminal

#

lets me know when these parts are done

#

after createRunConfigurations is finished

weary matrix
#

@thin hornet which folder is it expecting exactly? Like steam/steamapps/common/ProjectZomboid?

thin hornet
#

yeah

weary matrix
#

or should I go deeper in the filesystem tree?

thin hornet
#

are you on windows?

weary matrix
#

no, ubuntu

thin hornet
#

ok then on ubuntu if i recall its on directory deeper

weary matrix
#

I get sick when I try to use windows πŸ˜‚

thin hornet
#

/home/work/.local/share/Steam/steamapps/common/ProjectZomboid/projectzomboid

weary matrix
#

yeah ok

thin hornet
#

if you need to edit manually the path

#

alright so for the steps after the createRunConfigurations

weary matrix
#

ok it's decompiling now

#

@thin hornet I should ask the Zomboid developers if they're ok with publishing up-to-date javadoc

#

I could host the Javadoc for all major version of Zomboid, guess it would be really helpful to many modders

thin hornet
#

you can try asking

weary matrix
#

@thin hornet I guess your tutorial is quite ready πŸ˜„

thin hornet
#

let me know when all the step are done ill lets you know the final steps

weary matrix
#
1 actionable task: 1 executed
03:59:34: Task execution finished.```
thin hornet
#

nice

#

lets me know if you have the jar file with IWBUMS

#

should be in lib

#

if you dont try running these three gradle tasks

weary matrix
#

No actually I just have zomboid.jar

thin hornet
#

okay check the tasks in the gradle panel

weary matrix
thin hornet
weary matrix
#

@thin hornet I have zomboid.jar but not zomboid-41.56-IWBUMS.jar

thin hornet
#

its should be okay

#

just need to add the source to the zomboid.jar

weary matrix
#

ok I did all that, now it's asking for my mod name etc

#

but I don't want to create a mod, just get the javadoc (and the source but for this it's ok now)

thin hornet
#

then you should see a build dir

#

with all the decompiled files

#

and a generated dir

#

with both lua and java source in it

weary matrix
#

yeah I found the lua and java source

thin hornet
#

if you ever choose to make mod with it install emmylua

#

will allow to use the annotations for lua

weary matrix
#

no I'm ok with git+vim on the command line, don't need an IDE for coding

#

I just want the javadoc up-to-date

thin hornet
#

πŸ‘

weary matrix
#

but where is it?

ruby urchin
#

What happens here? try get java source?

thin hornet
#

in the build directory

dawn lynx
#

Bless your soul for that tut @thin hornet I'll try it out here in a bit lol

#

I've been needing updated source

weary matrix
#

@thin hornet ```~/IdeaProjects/Zomboid/build$ find -type f | grep -v '.class$|.lua$|.java$'
./generated/sources/zomboid/stdlib.lbc
./libs/Zomboid-1.0-SNAPSHOT.jar
./classes/zomboid/stdlib.lbc
./tmp/jar/MANIFEST.MF
./tmp/zomboidSourcesJar/MANIFEST.MF
./tmp/zomboidLuaJar/MANIFEST.MF
./tmp/zomboidJar/MANIFEST.MF

#

no javadoc

thin hornet
#

no javadoc but all the java is there

weary matrix
#

@ruby urchin well mostly the javadoc but you can get the source too

dawn lynx
#

Yeah you have to sort through the java code, its not actually gonna generate javadocs

#

But everything you'd find in javadocs is there

weary matrix
#

I know

#

but javadoc is just a command you run on the source

#

in my case it's throwing errors

#

I like to have both

dawn lynx
#

Ahh yeah idk I've never generated javadocs

weary matrix
#

like for example when you search for a specific method, with the source you have to check all the class hierarchy, with javadoc you see all the inherited methods and fields

thin hornet
#

not sure why its throws an error but i usually just read the classes when i need to find something

weary matrix
#

I guess I just haveto figure out the proper parameters to javadoc command

ruby urchin
thin hornet
#

using find in files is very fast in intellij

weary matrix
#

but at least now I have clean sources!

dawn lynx
#

^ ikr!

thin hornet
#

if you hover var3 and stuff you can also see the types

#

and if you click stuff you directly go to that class

dawn lynx
#

On the topic - anyone know how I would detect transfer of items to/from a vehicle container?

thin hornet
#

might be able to check with OnContainerUpdate

dawn lynx
#

Yeah I'll give it a shot, thanks

thin hornet
#

first param should be a container i think actually no

#

it seem to be an IsoObject and extended classes of IsoObject

weary matrix
#

Damn


> Task :compileJava NO-SOURCE
> Task :compileGroovy NO-SOURCE
> Task :processMediaResources NO-SOURCE
> Task :processResources NO-SOURCE

> Task :zomboidVersion
zdoc version 3.1.0
game version 41.56-IWBUMS

> Task :updateZomboidLua SKIPPED
> Task :classes UP-TO-DATE
> Task :javadoc NO-SOURCE     <------- WHY NO SOURCE :(((

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 676ms
1 actionable task: 1 executed
04:32:24: Task execution finished 'javadoc'.
thin hornet
#

bahaha

#

so you used?

#

didnt even realise it was there

weary matrix
#

@thin hornet yeah, this is the first thing I tried, for which I pasted the log

#

I also tried Tools = > Generate JAvadoc, but it complains there's no class files

thin hornet
#

im trying it

weary matrix
#

@thin hornet any luck? Or are you getting same error as me?

#

in Tools -> Generate JavaDoc I tried nearly all combinations of options, but always same result:
Error running 'Javadoc': Selected scope contain no Java classes

#

mmm maybe I have to generate a new gradle project with the sources πŸ€”

#

I went a step further by creating a new project, copying all Zomboid java folders to src/main/, then generate JavaDoc, it starts the process, loads all source files one at a time, but then bail out due to syntax problems 😦

thin hornet
#

maybe we cant generate the javadoc from a decompiled version

#

not sure

dawn lynx
#

That's gotta be it

thin hornet
#

the developpers have the real source code so it may work better

#

maybe they will update the javadocs when MP release as there is probably alot of stuff work in progress right now

dawn lynx
#

I'm sure they'll update the javadocs once b41 is no longer in beta, or I would hope so anyway

#

Yeah xD

thin hornet
#

if they did right now all the MP stuff would have to be stripped

weary matrix
#

@thin hornet well there's no reason, if you have the sources you can generate javadoc, that's just how javadoc works

#

I tried to comment the lines with syntax errors, so it's going further, but now it complains because it can't find package org.lwjgl.opengl. I have to find a way to add it to the project

#

and I realize it's the same error I got when trying to run javadoc command from a terminal

thin hornet
#

not suire what version of lwjgl u need

#

you can get the source and compile it in intellij it has a gradle

weary matrix
#

I extracted the sources for org.lwgl.opengl in src/main/java and now these error are gone, I just have to add other missing libs πŸ˜„

thin hornet
#

nice

weary matrix
#

ok now I need org.lwjgl.system, which is not in the release I got for lwjgl 😩

thin hornet
#

you could maintain a git repo with the javadoc if you get it to work

weary matrix
#

that's what I want to do

#

assuming the devs are OK with it of course

#

aaah maybe I just have to add the main lwjgl library

#

ok found it πŸ˜„

#

let's try now

dawn lynx
#

Awesome, hope you get it working πŸ˜„

weary matrix
#

now I need javax.annotation πŸ˜‚

#

Ok I'm done with all the lwjgl errors, now getting errors for other missing libs etc, like gnu.trove.list.array

thin hornet
#

step by step drunk

#

but if you succeed youll be awarded the title of hero of the month πŸ˜‹

weary matrix
#

oh man so much pressure πŸ˜‚

#

but that sounds good, I hope I will manage to do it

#

now I'm struggling with versions of the different libs

weary matrix
#

what I can't figure out though, is that many dependencies are in Zomboid game folder, but not all of them (.jar/.class)

#

so I'm wondering how the game can run at all πŸ˜‚

#

any clue if Zomboid could store dependency files somewhere else than in .steam/steam/steamapp/common/ProjectZomboid?

wraith dust
#

i have a question

#

how can i add more than one slot in item tweaker with AttachmentsProvided

weary matrix
#

geez, struggling with native libraries it seems, missing all the lwjgl classes like GL11, GL12, GL13 etc 😩

last ferry
#

hey anyone know what mod adds cocaine

#

like is it apart of jiggas

dry chasm
ruby urchin
#

Oh shit

late hound
devout flint
proud fern
drifting ore
scenic cradle
#

Anyone know why the inventory icons and ground models wouldn't tint like the bags? The icons in the 'equipped bags' section of the inventory seem to work.

ruby urchin
#

check if item_ground have the same UV mapping

woven pecan
#

how do you unpack .pack files

scenic cradle
#

use a utility called UnPacker

hot patrol
#

Anyone know if it's possible to make items that have multiple texture options similar to the decal tshirts? I want to reduce the amount of items I have spawning in the world.

scenic cradle
#

yes it is

#

i dabbled in it some since I'm having trouble getting the tints to work

#

@ruby urchin hey man, could you point me toward item_ground? I can't seem to find it

#
woven pecan
#

Cheers man πŸ™‚

hot patrol
#

I also need to know if I can have those textures be transferred in crafting recipes. The item I am making will be able to be crafted into armor and I want to armor to retain the same texture

dark acorn
#

What code language does PZ run on?

scenic cradle
#

java/lua

#

i think are the only things it uses

dark acorn
#

Thanks

thin hornet
#

Who would be interested into a custom item tooltip API?

rancid barn
#

Oh?

#

Interesting.

thin hornet
#

Will publish a finished version when im done with the last part, adding any icons like the cooking ingrediants etc

#

Ive built this with the same logic behind the java code using ObjectTooltip.Layout

weary matrix
#

@scenic cradle hey man, I wouldn't recommend UnPacker, unless you just want to see if the tiles you're looking for at in there. Otherwise the result would not be usable if you want to modifiy/add etc

#

doesn't give you valid spritesheets

#

better use TileZed

scenic cradle
#

interesting, what makes them invalid?

weary matrix
#

@scenic cradle well it just puts the tiles as close as possible to each other, so you lose the relative position inside each cell

scenic cradle
#

aah, I see. I only use it to steal inventory icons from the spritesheets to photoshop for my mods lol

weary matrix
#

mmm for icons it should be ok then

scenic cradle
#

but I am thinking about making an actual map soon so that's good to know, I appreciate it

deep loom
#

Is there such a mod that helps with ripping zombies cloths and such?

#

such a hassle to do all the clicking everytime

scenic cradle
#

like...to auto rip clothing on death?

deep loom
#

aye

scenic cradle
#

I don't see any that look like they do at a glance, but I'm sure it wouldn't be too complicated to make one

ashen mist
#

Hey yall, I need some help with a potentially mod caused issue

#

Whenever I try to tear clothes and select "All" it tears one item, shows the error thing in the corner, and stops

#

Is there any type of mod in particular that may be causing this?

weary matrix
#

@ashen mist check console.txt on your Zomboid folder

ashen mist
#

Which folder is that?

#

because there's quite a few

weary matrix
#

@ashen mist the one in your home folder, not the one inside steam folder

#

it should be name "Zomboid", and have a mods subfolder, and a console.txt file assuming you started the game at least once

ashen mist
#

I'd hope its been started, I've clocked over 100 hours into it

weary matrix
#

check %UserProfile%\zomboid maybe

#

if using Windows

ashen mist
#

found it

weary matrix
#

@thin hornet oh man, struggling with lwjgl. It looks like they're using both lwjgl 2.X and 3.X but they're not supposed to be compatible to use them together

#

for example all the package like lwjgl.glfw, lwjgl.openal etc are only available in 3.X, but all the OpenGL classes like GL11, GL12, GL13 etc are only available in lwjgl 2.X

#

and the game seem to use both

#

the good news is usually javadoc commands bails out after 100 errors, so up until now, I always had at least 100 errors. But now I'm at a point where I only have 19 errors left

pearl prism
#

I just found a vanila Zomboid car model with door animations, very interesting to know that this was in the game archives all along. For anyone who wants to see it called Vehicles_ModernCar_Martin

weary matrix
#

@pearl prism door animation?

pearl prism
#

YES

weary matrix
#

what does it mean?

pearl prism
#

when you enter in the vehicle it shows an animation of the door opening

craggy furnace
#

very old news

#

its been in there for about a year now

#

go look at what the new car modders are doing

#

same premise

#

the car itself is rigged

pearl prism
# craggy furnace very old news

The funny thing is that I've been asking about this for months and people don't even answer or say they don't know if it's possible to do

#

πŸ‘

south brook
#

what is this mod

craggy furnace
#

this for now should be considered as the bible on how to do a modular vehicle with animated doors

pearl prism
craggy furnace
#

i am very happy that guy has just gotten better and better

#

ive wanted to make a modular car mod but honestly it seems like a waste of time when i have a ton of other projects to deal with

#

i think for the majority its smarter to wait for the indie stone to add in their own car animations properly

#

but honestly it seems like its totally do able to "properly" put in a synced character as of now but thats a lot of R&D for a small feature

weary matrix
#

@thin hornet

#

I cheated a bit πŸ˜…

#

since there was only 19 errors remaining, I changed the code to remove missing symbols, shouldn't change the output much πŸ˜„

pearl prism
craggy furnace
#

for all intents and purposes it seems "done" and i say that very loosely

#

the core stuff seems to be there and it just needs to be synced up and polished

pearl prism
#

I believe this will be done when they start to deal with military vehicles and such things

#

The crashed car models, I'm sure it will also be integrated with the driving vehicles

weary matrix
#

@sour island Hello mate, are you around? I was able to generate the javadoc for Zomboid version 41.56 IWBUMS. Who should I asked to if it's ok to host a version of it online?

ashen mist
weary matrix
#

@ashen mist Check console.txt for errors

#

or post it here

#

like when you see a red error at the bottom right corner while playing, you should get a stack trace (error) in your console.txt

ashen mist
sour island
#

Javadoc being a dump of all exposed functions/methods?

ashen mist
#

oh damn, it's chuckleberry finn, fancy seeing you here

sour island
#

Oh wait thought you said ZomboidDoc /ZDoc

#

if you're decompiling the java yourself I guess you can ask the devs if its ok

weary matrix
#

@sour island well I think only part of the code base is opensource. And yes, javadoc is a dump of exposed methods and fields

#

yes I'm decompiling, that's why I prefer to have their approval

#

so any clue which IndieStone member I should ask?

sour island
#

Is your process easy to do / integrate into InteliJ? What I'm using now is somewhat out of date

craggy furnace
#

you can do two things

sour island
#

The only one that's pingable is Nasko iirc

craggy furnace
#

either ask nasko or email them

craggy furnace
weary matrix
#

@sour island it's using IntelliJ yes, but it's not simple, I had to make some code edits to remove problematic symbols from external dependencies, otherwise it was not generating the javadoc due to error

ashen mist
#

I forgot which mod it was, but I remember seeing your PFP with it while I was unsubscribing from a ton of stuff to try fixing a bug I've encountered

weary matrix
#

but I might document the process if people are interested

#

and maybe make it smoother/easier

sour island
#

That would be helpful

weary matrix
#

@sour island thanks, I'll try to ask Nasko when he's online

sour island
#

ZDoc/pzMod as tools are depreciating and I was going to look into seeing about an alternative

#

But I'm not well versed in java or the other stuff used to make zdoc, so I wasn't sure where to start

weary matrix
#

well the bare minimum is valid sources + the javadoc command line tool

sour island
#

Does it create a LuaLibrary usable in IntelliJ?

weary matrix
#

but I did it with IntelliJ so it should be OK to document the process

#

@sour island I really just create an IntelliJ project, add the sources in there, and call the javadoc command, which only generates the HTML, so I guess no

sour island
#

ah

weary matrix
#

I'm not even sure what is the LuaLibrary you're talking about

sour island
#

What zdoc creates are lua files of the information which you can refer to as a library and when you type this happens:

weary matrix
#

unless you mean the javadoc for kahlua?

#

aaah so you get completion for your Lua code

sour island
#

Yeah it's called a Lua Zip Library but they're just lua files

weary matrix
#

no that's really another topic than what I've been trying to achieve, sorry πŸ˜…

sour island
#

no worries

#

More automated tools for modding the better

weary matrix
#

I was just tired of reading Lua source code from Zomboid and mods which call methods that are not documented in the official Javadoc

sour island
#

The official one is for b40 right?

weary matrix
#

I'm not sure, but it's very old (from 2015 IIRC)

#

might even be b39 or something, but really not sure

#

I've only been playing Zomboid since July 2021 or something, so I don't know the history of modding API very well yet πŸ˜…

ashen mist
#

I cannot figure this out

weary matrix
#

@sour island any clue about Nasko timezone?

ashen mist
#

I have no idea why the hell tearing clothes just broke all of a sudden

sour island
weary matrix
#

@ashen mist are you getting errors in console.txt?

#

Ok then

ashen mist
#

Maybe???

#

I can’t even tell

weary matrix
#

@ashen mist post it here, I'll have a look

ashen mist
#

Does it update on the spot?

weary matrix
#

yes

ashen mist
#

Or do I have to close the game

weary matrix
#

well I'm running Linux, on Linux it updates straight away, not sure about Windows but it should be the same hopefully

#

@ashen mist you'd have to start a game and trigger the error you're having though

sour island
#

It updates the file - you'd have to reopen the file. However, the log in the main directory gets reset when the game launches.

ashen mist
#

I’ve done it a bunch already

weary matrix
#

what you psoted looks like this is just the initial loading of the game

ashen mist
#

I don't know what to do then

#

That's console.txt, I found it where you said to find it

weary matrix
#

@iron salmon Hey man, I was able to generate the Javadoc for Zomboid v41.56 IWBMS. I was wondering if the Indie Stone team would be OK with me hosting a version of it online, same as https://projectzomboid.com/modding/ but up-to-date. I'm sure it would be really helpful for modders etc

ashen mist
#

I’m just gonna restart my pc and see if that might fix it

weary matrix
#

@ashen mist try to trigger an error in game (red square with number at lower right corner of the game screen), then hit escape to pause the game, then open the console.txt files and upload it here

#

is that what you did already?

ashen mist
#

Yeah

weary matrix
#

seems weird cause when you have the red square you always get an error in console.txt AFAIK

#

for me the problem is when you don't get the red square, then you have to dig further into the code

scenic cradle
#

I always find my errors in the log file in c:users/user/Zomboid/

#

there is a Logs folder in the Zomboid folder

twilit socket
#

I wish this game had more modding tutorials

#

at least on Youtube. the only semi recent one is the one that Blackbeard did basically

weary matrix
#

@ashen mist hey I'm sorry dude, I just realized when you expand a file on Discord it might still be incomplete. I opened your console.txt in a text editor and I can see errors!!!

solid jewel
#

I have been thinking of creating a vehicle mod for Project Zomboid. Yet, I do not have any kind of experience In creating mods and what so ever.
Are there any tips or pages where I can look stuff up?

weary matrix
#

I found 30 errors total

#

@solid jewel check the pinned message in here, but documentation is scarce and often outdated

#

@ashen mist here is a new version of your console.txt where I removed everything non relevant

#

download the whole file and not just expand in discord πŸ˜…

#

@ashen mist I guess these are the most interesting part:

function: insertTable -- file: ScrapArmor_Distributions.lua line # 14
function: OnCraftComplete -- file: ISInventoryPaneContextMenu.lua line # 2790
function: OnCraft -- file: ISInventoryPaneContextMenu.lua line # 2762
function: onMouseUp -- file: ISContextMenu.lua line # 90
function: perform -- file: ISCraftAction.lua line # 126
function: perform -- file: OverloadForAchievementISAction.lua line # 17
function: ReturnItemsToOriginalContainer -- file: ISCraftingUI.lua line # 1597
function: ScrapArmor_Distributions.lua -- file: ScrapArmor_Distributions.lua line # 80
function: TailoringDistro.lua -- file: TailoringDistro.lua line # 9
#

so if you disable BooksDistributions, TailoringDistro and ScrapArmor_Distributions most of these errors should go away

#

guess we should pin this to the channel, if someone has the power to do it

solid jewel
#

I've gone through the pinned messages and I have not found anything that could be of use for me, either way, thanks for the help, I might just try to go on It with ease by making a simple clothing mod or something.

pearl prism
#

Nuub question here, what is the command to Lua ignore the fractions of a number in a math count ?

dry chasm
weary matrix
#

yup math.floor() is the way to go

dry chasm
#

atleast i believe ceil is a thing as well

#

never had a use for it (yet)

weary matrix
#

it is, but I'm pretty sure he needs floor() and not ceil()

cobalt steeple
#

Sorry to interrupt

#

But is there any extra steps to take when changing a specific file from in-game

#

Like a translate file

solid jewel
#

quick "starter" question, when creating a mod, do I just create a new file for my mod Inside the mods folder?

#

also, are those important?

pearl prism
dry chasm
# cobalt steeple Like a translate file

for custom translations of a mod to take effect, the file name'll have to be the same as the original IIRC.
As for lua, if you call it the same, it will replace the original completely. Instead of doing that however I'd advise not to do that and instead something similar as to

local original_Function = functionInQuestion;
function functionInQuestion(...)
  -- your things
  return original_Function(...); -- return original if applicable.
end

as a quick and rough example πŸ‘€

cobalt steeple
#

But it still shows the original even if i activate it

dry chasm
# solid jewel quick "starter" question, when creating a mod, do I just create a new file for m...

IIRC if from steam and on windows, it'll take the mods folder in %UserProfile%\Zomboid\mods\ for local custom mods
For a new mod, create a new folder in that mods folder, create a mod.info file with (minimum) the id field (for more info refer to pinned message)
from there you can then make a media folder and follow the base folder structure, example:

media
|___lua
|    |___client
|___scripts

Ideally (aside of translations IIRC) do not name the files exactly like the base files.

cobalt steeple
#

Thank you very much for the help

dry chasm
cobalt steeple
#

Yes

pearl prism
#

Other nuub question,
Is there another way to do this in Lua

  print("X is a number between 2 and 9")
end ```
sour island
#

What would be the benefit?

#

If you're worried about OOP you can use () to control values

pearl prism
#

Just optimization

dry chasm
# cobalt steeple Yes

did a quick test, it did change on my end. Please ensure your mod is active for the save and alternatively check for typos in path/file name as well as in the file. Aside of that I'm probably clueless as well.

sour island
#

@thin hornet @dry chasm πŸ‘

dry chasm
sour island
#

Handles vehicles, items, zombies, and even other functions. May clean it up and post it here for others.

thin hornet
weary matrix
#

@thin hornet yay πŸ˜„

zealous wing
#

Do any of yall think a Holtzman Shield from Dune is possible in Project Zomboid?

weary matrix
#

@zealous wing everything is possible, but would that make sense for a Zombie game?

weary matrix
#

@iron salmon awesome! πŸ˜„

rancid barn
#

sick

ashen mist
weary matrix
#

@ashen mist share the console.txt

#

if someone could pin the message to this channel

sour island
#

Nice

agile coral
#

Niiiice, this will save some time going forward

ashen mist
#

I hope this is the right one, I used the one I found in the quick access thing in the file explorer

weary matrix
#

@ashen mist I can see some errors related to BooksDistribution, so it's probably a copy of a previous run

ashen mist
#

I'm not even sure what mod could cause it anymore

#

I've basically neutered my mod list

#

I've gotten to the closest I've been to Vanilla since I first downloaded the game

weary matrix
#

@ashen mist well, if you have errors from BooksDistribution, it means either it's still enabled, or you send an old console.txt

#

your file explorer quick access gave you the old file basically

ashen mist
#

I don't think I even have a mod called BooksDistribution

weary matrix
#

oh

#

mmm

#

nothing related to books?

#

or just send a screenshot of your mod list

sour island
#

Those are the names of files - unless the author names their stuff clearly it's going to be pretty hard

#

Didn't someone write something to extract stack traces from a log?

ashen mist
sour island
#
STACK TRACE
-----------------------------------------
function: ReturnItemsToOriginalContainer -- file: ISCraftingUI.lua line # 1597
function: OnCraftComplete -- file: ISInventoryPaneContextMenu.lua line # 2790
function: perform -- file: ISCraftAction.lua line # 126
function: perform -- file: OverloadForAchievementISAction.lua line # 17
ERROR: General     , 1636240734819> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in ReturnItemsToOriginalContainer at KahluaUtil.fail line:82.
ERROR: General     , 1636240734819> DebugLogStream.printException> Stack trace:
ashen mist
sour island
#
STACK TRACE
-----------------------------------------
function: ReturnItemsToOriginalContainer -- file: ISCraftingUI.lua line # 1597
function: OnCraftComplete -- file: ISInventoryPaneContextMenu.lua line # 2790
function: perform -- file: ISCraftAction.lua line # 126
function: perform -- file: OverloadForAchievementISAction.lua line # 17

LOG  : General     , 1636240734828> bugged action, cleared queue    zombie.characters.CharacterTimedActions.LuaTimedActionNew@1658b862
#

OverloadForAchievementISAction

#

You have an achievement mod?

ashen mist
#

Yeah

sour island
#

That's creating the stack traces

ashen mist
#

Achievements for B41 I think it is

#

Ah damn, and I liked that one

#

It used the noises from The Last Stand: Union City

sour island
#

Also LOG : Lua , 1636240614020> Loading: C:/Program Files (x86)/Steam/steamapps/workshop/content/108600/2209099061/mods/AdditionalSkillBooks_2/media/lua/server/Items/BooksDistribution.lua

dawn lynx
sour island
#

AdditionalSkillBooks_2

#

that's the mod creating issues with the bookdistro

ashen mist
#

disabled it

#

Im gonna try again now

#

See if I can tear two things

sour island
#

What was going on in your game - what errors?

ashen mist
#

Cant tear more than 1 clothing item at a time

sour island
#

Ah that's the achievement one then - it's breaking in crafting

ashen mist
#

Also can't unbox multiple boxes of ammo unless its inside my inventory

weary matrix
#

@dawn lynx πŸ‘

sour island
thin hornet
#

nice

ashen mist
#

Hm

#

I got an error loading in

#

number doesn't matter though

#

so I'll see if its anything to worry about later

#

Still can't tear more than 1 clothing item

brittle jewel
#

If you're not starting a new save file, make sure it isn't just re-loading disabled mods. You can disable them by clicking 'More' and then on the next screen you can 'Choose mods'

ashen mist
#

I deleted every old save I had

#

Every time I made a change to the list I made a new file

sour island
#

If there's no obvious errors

#

you'll have to do the half method

#

disable half your mods - test

ashen mist
#

Deeply Closeted can't be causing this, can it?

sour island
#

?

ashen mist
#

clothing mod

#

adds new colors

#

supposedly adds new varsity jackets too

sour island
#

Anything that tweaks crafting or even timed actions could cause this

#

You're better off just doing the half method

ashen mist
#

wait, damnit

#

that was sposed to be a link to the let me think mod

sour island
#

If there's no errors to look at you can't just guess

ashen mist
sour island
#

One of the errors happens inbetween someone called 'Jordan' doing first aide?

#
function: ReturnItemsToOriginalContainer -- file: ISCraftingUI.lua line # 1597
function: OnCraftComplete -- file: ISInventoryPaneContextMenu.lua line # 2790
function: perform -- file: ISCraftAction.lua line # 126
function: perform -- file: OverloadForAchievementISAction.lua line # 17
#

also achievements are still on

ashen mist
#

i disabled most of my modlist and it still wont work

#

achievements are gone

#

maybe its superb/subpar survivors

willow estuary
# weary matrix Javadoc for all versions of the game **Version 41.65** <https://zomboid-javadoc...

Could you do me a favour with this post and edit the text so it clearly explains what the pinned link is for? Otherwise it won't really be apparent what the pinned post is regarding when someone looks at, in the context of the pinned post interface? πŸ™‚

edit: Additionally, I'd encourage you to see about adding a page on the PZ wiki, #pzwiki_editing , regarding this? Pinned messages are a terrible solution organization wise, whereas the wiki provides the perfect format for organized links to this sort of resource?

neon lintel
#

hey guys i never installed the jeep mod but for some reason im finding roof racks, rooft lights, and other car accessories that look like they belong to the jeep mod.

#

i cant find where these items are coming from

#

I've never installed any type of vehicle mods in this game

#

any know where this is coming from?

#

@willow estuary hey did you add any type of vehicle roof accessories to your Advance G.E.A.R mod?

willow estuary
#

This ain't anything to do with me?

neon lintel
#

oh k

ashen mist
#

I'm just gonna assume Superb/Subpar survivors is why my character forgot how to tear clothes

kind surge
# neon lintel I've never installed any type of vehicle mods in this game

You have Tsar's Common Library in that list. That's a vehicle mod. Looks like the items you're mentioning are part of that mod. Their distribution looks like it shouldn't spawn those items without another vehicle mod activated, but maybe something is wrong with that check or something else is interfering with the check.

neon lintel
dawn lynx
willow estuary
#

Steam workshop seems to be updating mods sluggishly lately for some users? Only suggestion I have is unsubscribing and resubscribing if that seems to be the case.
Manually deleting the mod folder before resubbing if that doesn't seem to fix it?

neon lintel
#

you think that will remove the items from my save?

willow estuary
#

Nah, the items themselves probably exist in that common library itself. You could just use garbage cans to delete them though if that's what you want?

neon lintel
#

well would like to see if maybe theres vehicles i can attach those to

#

but if its just the accessories than i dont see why i should have them in my save haha

kind surge
kind surge
neon lintel
#

alright ill double check

#

thanks for the help yall

thin hornet
#

Let's make pzmodding great again πŸ˜†

#

I was thinking maybe we make a Community API that add bunch of stuff and we make sure its optimized or we make multiple API to standard thing up so that mods stop repeating the same code all the time. Would be nice if everything were running smooth and compatibility wasn't an issue. And we collaborate to keep it up-to-date all the time.

weary matrix
#

@willow estuary of course. Text has been updated as per your request. I'll edit the wiki later (But I do agree pinned messages are terrible for organizing things)

willow estuary
# weary matrix <@!456547581439377419> of course. Text has been updated as per your request. I'l...

Thanks!
We're actually discussing a better organizational solution for the modding guides, so fingers crossed that bears fruit?
And it's appreciated that you'll take it to the wiki as well. It know it's more work after putting something like that together, but hopefully that could serve as a means for streamlining all this modding guide business for everybody, so thanks again for that too πŸ™‚

weary matrix
#

@willow estuary Don't worry about the extra work, I don't mind. I'm just glad if what I did is helpful to other people πŸ™‚
Will try to update the wiki tomorrow.

willow estuary
#

πŸ‘

#

Actually, on the subject of guides and resources, it looks like the pz wiki page for modding itself is really out of date and threadbare.
I know a lot of people have providing great guides for modding project zomboid, and I hate how they get lost in the pinned posts.
Maybe if some of the people who have been contributing modding guides wanted to take a crack at spiffing up the modding page that would help?
https://pzwiki.net/wiki/Modding

#

There's a channel for editing the wiki as well, #pzwiki_editing , I'm not that familiar with it but I believe there's people that that can provide guidance for any issues with it.

weary matrix
#

@willow estuary I might also try to update the modding page with what I learn from the few months I started modding Zomboid + the content of the pinned messages. Also organize some kind of structure with placeholder for sections I'd like to see in there, so that other people with the appropriate knowledge can fill up the gaps. One important thing I think, is to add the version of Zomboid for which a given guide is valid.

#

like: Only for Zomboid 39.X, This is for Zomboid 41.50+ etc

#

But I guess that would be hard to achieve without making mistakes, unless the dev can spare a bit of time to answer a few questions there and there

thin hornet
#

@sour island just as an example of structure i made this repo. https://github.com/Konijima/PZ-Community-API
So instead of having bunch of API mods serious mods could switch to single, optimized and maintained mod.
Each developer added as contributors and workshop updates regularly if needed.

GitHub

Contribute to Konijima/PZ-Community-API development by creating an account on GitHub.

sour island
#

I did some research on using github to upload automatically to the workshop -- it is doable but would require a steam account without 2FA.

weary matrix
#

shouldn't be a problem

#

or do you need a valid credit card/phone number etc? I can't remember

sour island
#

Not sure if it would be viable or worth doing, but would be fun to have an actual community project anyone can contribute to.

weary matrix
#

indeed

sour island
#

You need to own the game in order to upload to workshop.

thin hornet
#

This way we can all discuss and help each other make any code very good and optimized and if one of the modder disapear the other can take over and update things up.

sour island
#

With out 2FA I would not advise having personal info on that account.

weary matrix
#

for sure

thin hornet
#

Maybe we can use a prepaid credit card

#

and just have that account named PZ Community or something

weary matrix
#

Assuming Steam allows for prepaid credit card that could work

willow estuary
# weary matrix like: Only for Zomboid 39.X, This is for Zomboid 41.50+ etc

I mean, to be honest, I think it's premature for people to put a lot of effort into modding guides while PZ itself isn't stable?

But people want modding guides, and people are making modding guides, so something needs to be done with all this energy while the game is finishing. And pinned posts are hilariously bad for the task.

sour island
#

Perhaps @iron salmon could smooth the process out?

weary matrix
#

I'm sure he could

sour island
#

Define "isn't stable"? The game's been in b41 for at least a year by now. 10+ years for the whole project.

weary matrix
#

@willow estuary well, from what I see, a lot of people are still playing with old release of the game, for various reasons, so documenting the past wouldn't be for nothing

#

also it would drastically help with developing mods that are compatible across version

#

@sour island I don't think he meant the game is unstable, but rather that the API is changing over time, breaking old code

sour island
#

Yeah but he brings up how it's "constantly changing" as a concern to making guides or dig into large projects.

#

I was just curious if he were to give an arbitrary % of unstableness if his concern would still sound rational.

#

i.e: The game is 2% unstable, it's not worth writing guides.

weary matrix
#

true, I'm not sure exactly how much change occur between minor version for example, but it seems to be different API for at least version 39, 40, and 41+

#

and one year is not much compared to the history of the game

#

what about in 3 years ? 5 years etc ?

sour island
#

The MP code will require the largest changes only because of the change in networking

#

One could probably browse the code rn to prepare for that though -- and that information would make for an excellent guide.

weary matrix
#

indeed

sour island
#

Anyone know the key to bring up the console?

rancid barn
#

think its f6

sour island
#

Wait nvm -debug didn't go through

rancid barn
#

f6 or f8

#

i know f11 is the one to bring up the error screen thing

sour island
#

f11 is the error readout

#

yeah

rancid barn
#

yea thats the name

sour island
#

Double checking a code snippet

willow estuary
#

That's just a personal misgiving? If people want to make guides or work on projects, go for it.
I just see how stuff with modding works change significantly over the past two years with how b41 itself has been changing.
The distribution changes, world object models, the changes with noiseworks, multiple new recipe features, new object parameters, etc.
I just don't think it's a case that someone could make an "ultimate pz weapon modding" tutorial today, and that would be the end of it? They'd still have to update it etc.
I think a lot of game systems are up in the air for being fundamentally reworked with stuff like the firearms rework, fire rework, visible passengers/animated vehicles, etc.

So do I think that should people not make modding guides on account of this? Well, given that people are making and using them, that's a moot point.
Should people be aware that PZ is in flux when deciding to make modding guides, or use them, yes, it would be good for people to be aware of this fact.

rancid barn
#

i just care abt tutorials be updated

#

i have bad memories of outdated tutorials for minecraft modding

sour island
#

tl;dr: People are making mods and guides, the game is changing, people should be aware. ?

rancid barn
#

they should

sour island
#

Yeah, but an argument could be made that game won't eve be "done"...

#

So worrying about that stuff is moot.

thin hornet
#

Well guides should include the game version it was made for

sour island
#

I think he's just overthinking things.

weary matrix
#

luckily one cannot break something by overthinking about it πŸ˜…

sour island
#

-snip-

#

Would appreciate any look throughs.

#

My concern/idea for optimization is some how chunking the list depending on distance.

thin hornet
sour island
#

Sure

thin hornet
#

will take a look

sour island
#

Whipping up an example use

thin hornet
sour island
#

Just realized I could make it friendlier to use if it just spawns in the item be default

thin hornet
#

Nicely done

#
ModData.getOrCreate("farSquarePendingSpawns")

does this make it equal to an empty table by default?

sour island
#

Oh I forgot I use isorange

#

yes

#

tested it to be sure

thin hornet
#

interesting

sour island
#

may have to snip and just leave a warning regarding cars and roofs

#

Updated the pastebin