#mod_development
1 messages ยท Page 549 of 1
thanks, this is super helpful, and I am afraid that your second message is the case, but I am going to keep looking
also should have mentioned that i spotted this, but i do appreciate your help

i am trying to make some adjustments to the Please Don't Feed the Zombies mod that just hit the front page for my own use to make it a bit more like the walking dead. I have tried a couple times to mod PZ but couldnt get past scripts really, so you are a big help
np
I have next idea for mod to u
Fast enter to vehicle cos even by Z it's still annoying cos menu opens not always
need to aim to vehicle door xp
even in one of ur last gifs from ur last mod u entered in vehicle only after 5 times

tbh u professional
you dont really need to wait for the green to come up
Hey I made that!
I'm curious why you don't want zombies eating humans that were killed twice?
I haven't been able to test much in multiplayer, does it mess with the game in some horrible way I haven't considered or is it just preference?
lol i havent really tried it with multiplayer but i was trying to get it so that the zombs would only munch on npcs who died (until they would turn into zombies themselves) or zombies who spawned dead in the world already because i guess in The Walking Dead lore they dont eat other zombies after they died because of rotting flesh and whatnot. I think your mod is really cool, i was just trying to tailor it to my preferences a little more
Ahh, makes sense - hadn't thought about NPC mods. I'll make a note to add a config for only non-zomboid corpses to be eaten.
Thanks!
thanks for reaching out! if I can get it to work as I'm intending I will let you know how I did it. I'm not an expert or anything, so honestly you would probably beat me to it, but I'll try
Lol, sounds good
Ah ha, appreciate that.
My man. You made a mod that allows you to pull people out GTA style?
ye
When is this going up on the workshop? I wanna test it.
yehh yuhh
There a simple way to get rid of a players shadow without impacting any other shadows? Used masks on an item to hide the model.
Item EatType
doesn't seem to work properly when
ReplaceInSecondHand and/or ReplaceInPrimaryHand is set.
kind of prevent the EatType animation to works.
how to use bit lib in pz?
Bits returns nil 
utils same 
you can't, you can only access classes that are exposed
take a look here if you have decompiled the game

yo wheres that new ATM tile
now I have to create bit lib in game where one already exists but I haven't access to it
what a shit
atm machine ๐
Is there a mod out there where we can set a weather/season event to last for a specified period of time? Say I start the game in July but I want a winter event to kick off in 30 days, but it'll last for 6 months, so I need to prepare in that time and then work to survive the time after that. This is to simulate events such as an impact winter from asteroid impact, or a nuclear winter from a nuclear war (with subsequent mods added for effect).
How can I add a new type of zombie? I want to replace most if not all zombies with a certain few models that I made for enemies. I just want them to spawn like other zombies and maybe have a few special actions like lunging themselves at players. I'd be grateful just for a way to add a new zombie type though, really.
Anybody know why my solo world mods are all of a sudden using my steam workshop versions of my mods and not the local versions in my /Users/*/Zomboid/workshop folder? Any changes I make to those mods don't get picked up by game unless I unsubscribe from the steam workshop version of that mod.
Yeah I do have the same behavior for SP
Do you remember it always being like that? I'm pretty sure I used to be able to be subscribed to my mod, but still able to tweak it from my /Users/ folder and still get the change effects after a lua reload.
If I recall correctly it was not like that in the past
But its been a while since i test my mods in SP, usually use local server or host
Hey all. I'm fairly new to modding PZ and I'm trying to find a way to increase the base capacity of containers (such as crates). However, I was unable to find where the base capacity of furniture is defined.
Alternatively, I tried looking into modifying the "Organised" trait's multiplier (to effectively increase the capacity of all containers) but I was also unable to find where this variable is defined.
Any help on either of the above issues would be greatly appreciated!
I think youll have to use the tile software to check the tile definition
TileZed
@thin hornet Thanks! I'll set it up and see if it helps
Im not sure you can edit vanilla tiles tho
I could be wrong, but as far as I know mods that change the capacity of the contenders tend to cause problems in the game
@pearl prism That would definitely explain the lack of mods tweeking base capacity of containers. What about going down the route of modifying the value for the Organised trait?
Most of time traits are handled on the java side (so not really editable)
@pearl prism @thin hornet So if base traits are not editable, what about creating a new custom trait that would behave the same as "Organised" but with a higher multiplier? Or would that also involved adding something on the Java side?
So for example:
zomboid\zombie\inventory\ItemContainer.java
public int getEffectiveCapacity(IsoGameCharacter var1) {
if (var1 != null && !(this.parent instanceof IsoGameCharacter) && !(this.parent instanceof IsoDeadBody) && !"floor".equals(this.getType())) {
if (var1.Traits.Organized.isSet()) {
return (int)Math.max((float)this.Capacity * 1.3F, (float)(this.Capacity + 1));
}
if (var1.Traits.Disorganized.isSet()) {
return (int)Math.max((float)this.Capacity * 0.7F, 1.0F);
}
}
return this.Capacity;
}
you can create new traits but you cannot add the effect to that function getEffectiveCapacity
You will need to research there is maybe a function or something that would allow you to do something but not that I know personnaly
I believe the big problem is that the game first reads the original code and then reads the mods' codes, so any attempt to change any vanilla system tends to give an undesired result. The way it is possible to change contender storage capacity would be to simply create an entirely new furniture from scratch, that way the game would only read the mods codes.
Well basically the game engine is made of Java, it include a Lua interpreter that exposes a set of functionality that we can use in our Lua mods. So we are limited to what is exposed and cannot overwrite any thing of that java stuff.
hi, I am having an issue where any items I drop on the ground get deleted, any ideas?
@outer perch dropping like mouse dragging it down?
yeah
you are using mods?
yeah a lot
@thin hornet @pearl prism I see. Got it, thank you both!
you are on the unstable or stable beta?
it can
:(
So you are having that issue in SP or MP?
mp
anyone else having it?
yeh
my friend
I found this: The mod causing it is Arsenal/Brita's Weapon pack. Unsubscribe and resubscribe to it to fix the bug from the integrated Eris Nightvision mod.
but probably outdated eh?
no idea
meh
Paw Low and Britas are causing issues. Redownload Britas and download this unofficial patch for Paw Low to stop disappearing item issue.
I guess that might make some sense
will try this
got both oth them
okay, fix from reddit
This worked for me, thanks
Closed the game
Unsubscribed from both Brita's mods, Paw Low, etc.
Resubscribed, including the Paw Low patch
Watched the workshop content download in Steam
Launch the game, make sure they're all enabled (including the Paw Low patch)
Continue save - success!
https://steamcommunity.com/sharedfiles/filedetails/?id=2612639612 patch for paw low
Shameless bump
fix above helped^
can someone help me when i try to start my server with mods mods just dont load?
How is the guid for custom items produced?
Ah it appears I can use a generator. ItemZed also produces a guid but Ive never used it, not sure if its still updated.
ItemZed is horribly out of date; I'd suggets manually editing script files instead?
I use this to make GUIDs
https://guidgenerator.com/
Free Online GUID/UUID Generator
Very good. That's the one I came across.
Or use this extension if you're using VS Code https://github.com/heaths/vscode-guid
are there any mods that increase the storage size of containers?
A LOT
i havent found any that have been updated. can point me to one?
Hi, I have a question. Does anyone know how to make a mod pack? I did like to play with my friends with some mods but usually its like one of us have late version and we cant play
I'm not sure which one is good. I would make one if I want to use something like that
Do you mean, a mod collection that allow you to subscribe or literally a single mod that contains all mod that you want?
if you mean the first option then go here
when you have a problem just sub and unsub all mods in the collections
and delete all workshop in local folder
then resub again
rather something like "Snake's Mod Pack" or server packs. One mod contains multiple mods.
its like all in one
but remember modders dislike the idea because it takes all of their time and effort
ask for permission first
after thinking that it may be invasive for them, I will probably give up because I have literally LOTS OF mods i did like to play with bois but still thanks for help, I learned something new
better add those mods into your collection, good for everyone
also take a little effort
Hey, working on making a gun mod but run into a slight issue with the positioning of the rifle. Its kinda low down on the character and doesn't sit right in the hands. I tried adjusting the models position in blender but all that seemed to do was distort the model in game. I'm pretty sure it's a script I'm looking to edit in the firearm.txt file but I really have no idea.
Maybe you can search for an old post. I guess some people have encountered this issue.
Is there some replacement to the UseItem event?
Anybody know how to get the item or item name of a vehicle part?
Not sure what I am supposed to do with that information
Anyone know of a way to ensure your mod is loaded before someone elses? like an anti-require?
local vehicle = playerObj:getVehicle()
local vehiclePart = vehicle:getPartById("Part_name")
@heady crystal
Oh thought you meant just in the lua, should be able to spawn it in by the ID too
local playerObj = getPlayer()
local vehicle = playerObj:getVehicle()
local vehiclePart = vehicle:getPartById("Part_name")
I have the vehicle but I want to get it's parts and give it to the user as items
But inventory:AddItem(PARTHERE) won't work with anything I tried off the part
ID won't work, getfulltype only returns the part not the item, etc.
Oh yah than this should work, use vehiclePart and put the ID in getPartByid()
to do inventory:AddItem(vechiclePart)
That doesn't work
I already tried it
It expects the item name string
Say I want to add a vehicle's front left wheel
I'd have to do for instance inventory:AddItem("Base.NormalTire1")
Oh really and yah that should work to get it in item form if thats its name
Yes the problem is how to get it's name off the part?
How to get it's name at all
Nothing works
Oh you mean just the display name?
Yah thats its normal name, should be able to work with it as such, otherwise idk really
Yes but how do you get that property off the part?
can someone please explain to me what the heck MetalValue is? I keep seeing it in a bunch of unrelated mods but I can't figure out what it's used for.
Metalworking recipes
metalworking was/is a planned skill - there's alot of stuff referencing it in the files - alot of modders added it in/make use of it.
alright, so it's a useless item property until 2025?
alot of modders added use for it
if you want your item to be interactable/metled down/etc idk not really a big deal
fair enough. Thank ya for the quick response my dude! Working on an overwrite to integrate ISA into hydro right now to replace Hydro's bugged solar generators. Finally got around to testing the ISA patch and it actually fixes the cell unloading issues that Hydro still has.
For Events.OnKeyPressed, is there somewhere where we can see the mappings between keys and their corresponding numbers?
Added support for magazines to Named Literature
Was debating on whether or not to pull issues/volumes from some database but no real gain I guess
ISPaintMenu.onPaint = function(worldobjects, player, thumpable, painting)
local playerObj = getSpecificPlayer(player)
local playerInv = playerObj:getInventory()
if true or JoypadState.players[player+1] then
local bo = ISPaintCursor:new(playerObj, "paintThump", { paintType=painting })
getCell():setDrag(bo, bo.player)
return
end
local props = thumpable:getProperties()
thumpable:setIsThumpable(false);
local isWall = props:Is("WallN") or props:Is("WallW") or
props:Is("DoorWallN") or props:Is("DoorWallW")
if isWall then
local north = props:Is("WallN") or props:Is("DoorWallN")
if not luautils.walkAdjWall(playerObj, thumpable:getSquare(), north) then
return
end
else
if not luautils.walkAdj(playerObj, thumpable:getSquare()) then
return
end
end
local paintCan = nil
if not ISBuildMenu.cheat then
local paintBrush = playerInv:getFirstTypeRecurse("Paintbrush")
ISWorldObjectContextMenu.transferIfNeeded(playerObj, paintBrush)
paintCan = playerInv:getFirstTypeRecurse(painting)0
ISWorldObjectContextMenu.transferIfNeeded(playerObj, paintCan)
end
ISTimedActionQueue.add(ISPaintAction:new(playerObj, thumpable, paintCan, painting, 100));
end
ISPaintMenu.onPlaster = function(worldobjects, player, thumpable, square)
local playerObj = getSpecificPlayer(player)
local playerInv = playerObj:getInventory()
if true or JoypadState.players[player+1] then
local bo = ISPaintCursor:new(playerObj, "plaster")
getCell():setDrag(bo, bo.player)
return
end
if luautils.walkAdjWall(playerObj, thumpable:getSquare(), thumpable:getNorth()) then
local plaster = nil
if not ISBuildMenu.cheat then
plaster = playerInv:getFirstTypeRecurse("BucketPlasterFull")
ISWorldObjectContextMenu.transferIfNeeded(playerObj, plaster)
end
thumpable:setIsThumpable(false);
ISTimedActionQueue.add(ISPlasterAction:new(playerObj, thumpable, plaster, 100));
end
end
trying to make painted and plastered walls invincible and untouchable by zombies, but this code doesn't seem to work, do you guys know the issue?
Would it even be remotely possible to get blender shape keys to work in zomboid
Does anyone know the function for modifying the speed a zombie is able to walk through trees? I'm new to modding and not sure where to look
can i overwrite existing walls to not be thumpable via plastering/painting or both?
I guess it's the unicode character order. If you want them to load before any other mods, place these ASCII Punctuation & Symbols before your mod id, but avoid the one that will break the code.
https://en.wikipedia.org/wiki/List_of_Unicode_characters#Basic_Latin
those who want their mod to load later, can also apply this method
I saw someone recently asked here but deleted the text
should it be
getPlayer():getInventory():AddItem("Base.NormalTire1"); ?
That's not even remotely close to what I asked, but it's ok, I already found a way out. Thanks anyways.
post your solution here, in case anyone searching for the solution
... and what is your question exactly? I read many times and still don't understand what you really need
you are welcome to come and send the code to the hydrocraft discord or make a pull request in to the hydrocraft github and I can merge it in, crediting you ofc. would be nice to fix any compatability issues with the main mod rather than needing additional patch mods we might break in the future. that way if we make any changes in the future, we wont break your stuff.
I mean, I gave you the clay molds recipe naming fix, but it's less of a patch and more of an integration of ISA for our server, would prob not be everyone's cup of tea and would make ISA a dependency for Hydro.
unless you wanna hitup Radx5 and Neznajka and fully bring ISA into hydro, it's not something you want in the main mod
I'm having trouble sending ModData from client to server. Wiki says that OnReceiveGlobalModData is triggered only on client side whereas indiestone forum says that OnReceiveGlobalModData is triggered on both client and server side. I am suspecting that first option is true, because is seems that client is transmitting ModData but server isn't receiving it.
Code shared by client and server:
if key~= "MyModData" then
return;
end
if not modData then
print("modData table is missing");
else
ModData.add(key, modData);
end
end
Events.OnReceiveGlobalModData.Add(OnReceiveGlobalModData);```
When I send ModData from server to client using `ModData.request("MyModData")` it works just fine. But when try to send modData the other way around from client to server using `ModData.transmit("MyModData")` then modData table on server doesn't update and stays in same state as before `ModData.transmit("MyModData")`
So does transmitting ModData work differently depending on direction of transmission or it does work the same way and I am missing something else?
instead of transmitting the whole table you might want to use sendClientCommand to transmit just the changed values to the server.
Client:
-- if ModData.exist("MyModData") -> ModData.delete("MyModData")
-- ModData.create("MyModData")
-- ModData.request("MyModData") -> we get the most up to date
-- OnReceiveGlobalModData -> set moddata on this client
Server:
-- ModData.getOrCreate("MyModData") -> persistant moddata
-- OnClientCommand -> handle client command -> update MyModData fields
-- sendServerCommand -> tell everyone online about the changed field
only the server should be trusted, so if a client was sending a whole modata table, it would replace the server one with it and could potentially cause loss.
CLIENT/SERVER WITH GLOBAL MODDATA
Made to work in single-player, host or dedicated.
CLIENT
MyMod = MyMod or {};
MyMod.Data = MyMod.Data or {}; -- storing modData tables in here
MyMod.ServerCommands = MyMod.ServerCommands or {}; -- storing server commands handlers here
--- client function to send changes to the server
function MyMod.sendSomeChange(key, value)
local args = { key = key, value = value };
sendClientCommand("MyMod", "MyCommand", args);
end
--- Server Command Handler : UpdateSomeData
function MyMod.ServerCommands.UpdateSomeData(args)
MyMod.Data.InfoStorageExample[args.key] = args.value;
end
--- handle initializing moddata
local function initGlobalModData(isNewGame)
-- clear only if its a client, if it's single-player we dont need to clear
if isClient() and ModData.exists("InfoStorageExample") then
-- clear the current copy for a client cause it might be outdated
ModData.remove("InfoStorageExample");
end
MyMod.Data.InfoStorageExample = ModData.getOrCreate("InfoStorageExample");
end
Events.OnInitGlobalModData.Add(initGlobalModData);
--- handle receiving moddata
local function receiveGlobalModData(name, data)
if MyMod.Data[name] and type(data) == "table" then
if #data > 0 then
-- if the received data is an array table
for _, value in ipairs(data) do
table.insert(MyMod.Data[name], value);
end
else
-- if the received data is a key/value table
for key, value in pairs(data) do
MyMod.Data[name][key] = value;
end
end
end
end
Events.OnReceiveGlobalModData.Add(receiveGlobalModData);
--- handle receiving server commands
local function receiveServerCommand(module, command, args)
if module ~= "MyMod" then return; end
if MyMod.ServerCommands[command] then
MyMod.ServerCommands[command](args);
end
end
Events.OnServerCommand.Add(receiveServerCommand);
SERVER
MyServerMod = MyServerMod or {};
MyServerMod.Data = MyServerMod.Data or {}; -- storing moddata table here
MyServerMod.ClientCommands = MyServerMod.ClientCommands or {}; -- storing client command handlers here
-- Client Command Handler : MyCommand
MyServerMod.ClientCommands.MyCommand(player, args)
if isDebugEnabled() or player:getAccessLevel() == "Admin" then -- example of possible check to validate client commands
-- data will be changed on server, if its single-player it will be changed on the "client" too.
MyServerMod.Data.InfoStorageExample[args.key] = args.value;
-- send the change to all clients, will not send if single-player not needed anyway
sendServerCommand("MyMod", "UpdateSomeData", args);
-- if we want to simulate sending it to a client in singleplayer we can just triggerEvent OnServerCommand
-- triggerEvent("OnServerCommand", "MyMod", "UpdateSomeData", args);
end
end
--- handle initialization of moddata
local function initGlobalModData(isNewGame)
MyServerMod.Data.InfoStorageExample = ModData.getOrCreate("InfoStorageExample");
end
Events.OnInitGlobalModData.Add(initGlobalModData);
--- handle receiving client commands
local function receiveClientCommand(module, command, player, args)
if module ~= "MyMod" then return; end
if MyServerMod.ClientCommands[command] then
MyServerMod.ClientCommands[command](player, args);
end
end
Events.OnClientCommand.Add(receiveClientCommand);
Does anyone have any idea where I could find the Lua code that deals with weight loss and gain? I've scrounged around the code and came up empty. I really want to make some kind of "weight loss pills" mod for multiplayer specifically. ๐
Take a look at my mod https://steamcommunity.com/sharedfiles/filedetails/?id=2827714166 it might help you
Thank you! Great mods by the way, I use your server messages and death messages on our server. ๐
๐ ty
Working on this repo right now, will try to add as much stuff as i can think of.
https://github.com/Konijima/Project-Zomboid-Code-Concepts
Another one for the Aliens fans https://steamcommunity.com/sharedfiles/filedetails/?id=2833308520
I'm really don't like pz cos I need to create folder with my mod name in each realm folder instead just media/lua/mymodname/[cl/sv/sh]
yeah thats a bit anoying but can also help
cause inside lua/client and lua/server we often have other stuff like Translate Items etc
so submodname directory help separate your logic from all the rest of it
it also help with the require require 'ModName/file
yea, rn it's no way to remake cos will break everything xp
Hm, that could be helpful - I was trying to patch my mod for another person's mod but I ended up just using a if check for the other mod being active - forcing a require and rerunning part of their mod inside of my own.
Load order should really be handled with require
require force the required script to be loaded first, if using require on a already loaded script it wont run it again it will just return its cached value
reloading a script re-run that script and update its cached value
A mod depending on an other:
if getActivatedMods():contains("TheRequiredMod") then
require("TheRequiredMod/script"); -- ensure that mod script is loaded now before continuing
-- we gucci
else
-- we gucci without it
end
When making a mod a possible pattern to ensure files load order:
client/Main.lua
require 'Utils'; -- ensure utils has been loaded first, will be available in all other files then
Main = {};
shared/Utils.lua
Utils = {};
client/Module1.lua
require 'Module2'; -- ensure Module2 has been loaded first
if Main then print("Main exist"); end
if Utils then print("Utils exist"); end
if Module2 then print("Module2 exist"); end
client/Module2.lua
require 'Main'; -- ensure Main has been loaded first
Module2 = {};
if Main then print("Main exist"); end
if Utils then print("Utils exist"); end
that isnt a module
and stop using globals already
client/Main.lua
local Utils = require 'Utils'; -- ensure utils has been loaded first, will be available in all other files then
local Main = {};
return Main
shared/Utils.lua
local Utils = {};
return Utils
client/Module1.lua
local Module2 = require 'Module2'; -- ensure Module2 has been loaded first
-- if Main then print("Main exist"); end
-- if Utils then print("Utils exist"); end
-- if Module2 then print("Module2 exist"); end
-- these are not a good way of doing things, require is how you ensure something is loaded. Check instead if a mod is loaded to make sure the require can happen
client/Module2.lua
local Main = require 'Main'; -- ensure Main has been loaded first
local Utils = require 'Utils'
local Module2 = {};
if Main then print("Main exist"); end
if Utils then print("Utils exist"); end
return Module2
for a file to be a module it needs to return something
whatever is returned is given when requiring somewhere
when invokes event OnObjectAboutToBeRemoved? I'm using next part to delete obj but event doesn't invoke
square:transmitRemoveItemFromSquare(obj)
square:RemoveTileObject(obj)
square:DeleteTileObject(obj)
or mb there's other event when obj deletes
nothing else but OnObjectAboutToBeRemoved on wiki
ah, it's lua event
but then how to catch real remove of object? basically I need to catch event when object about to remove by sledgehammer so need to catch transmitRemoveItemFromSquare or RemoveTileObject
looking at the pz code, I think you want to use OnDestroyIsoThumpable. That is the sledge hammer action calls atleast. However it calls it in an unusual way by using sendClientCommand. But I think that should work for the sledgehammer case. However for the :transmitRemoveItemFromSquare(obj) and the rest. you can just call the function you would insert to the event handler instead, as they might not trigger the an appropriate event anyways
Hey all. Not new to programming / LUA / etc..., definitely new to Zomboid modding. How do I get the PZ Library jars?
you can decompile the PZ. there is a guide in this channel somewhere. just search decompile
thanks

ah, it's clientside event, fk, missed it
@willow estuary sorry for ping but mb u know how to catch when object is about to be remove?
So, why is CAPSID running some kind of "createDiscordIntegration" gradle job? 
Nvm, found it
For anyone curious
Sorry, I don't have an answer for you regarding this.

btw, can I ask u to add bit lib on lua side? or dev who doing stuff like this
I have one but it's done by lua. be better by java
the only thing I'll wait in future updates

I believe it's SP and server event

yea, u should do triggerevent here

oh right, I was thinking about remove event since I've had issues with that
how did u solve thses issues?
my issue is to remove object from cluster when it was broken by sledgehammer cos I don't want to check if object is valid in iteration of this cluster
So, what function should I override to prevent XP gain for certain skills?
Would I override the AddXP function?
Or is there an event that is raised when a player gains XP?
Could just reduce XP by the same amount when it happens 
Thought that feels like it'd be somewhat performance-problematic, potentially
Ah, found it
its just an example
nothing wrong using globals if done properly, i mean pz is made of globals lol
everything wrong with using globals
pz is 90% made of globals
and?
and because of that you can hook and mod it
and?
and the same apply to a mod
Right, but LUA's philosophy is keeping scope as small as possible
It's bad practice to use globals if you don't need to
^
Yeah that why i said if done properly
"Done properly" is a very vague statement
but using a global is always not done properly
basically use a single global that contains everything else
look

if you do
local var = {}
return var
local var = require "whatever that file is"
you have access to the same var
sure
why would you ever use a global instead of this
Deja vu
then why are you advocating for globals

So, question; I'm new to PZ modding. I'm working on a mod that caps your maximum skill level based on your traits / profession.
mhm
Where would I grab the list of skills, traits, and professions?
the global Perks
I'm currently just planning on hooking into the AddXP Event. Can you "cancel" an event somehow?
gonna write the localist manifesto
we localists now
Events.AddXP.Add
Events.LevelPerk.Add
Aye, but you can't cancel the event somehow, can you?
btw what was the issue with using OnObjectAboutToBeRemoved event? when looking in the java, it should be triggered when isoobjects are removed from a tile
no but you can remove xp and limit the perk level
How would I limit the perk level?
Or simply reduce back to my limit if they level up?
well if > limit = set it back to X
you could use the perk level event and bump it back down
I guess
Is there any unlocks that happen if you level up? 
/ any weirdness to take into account
i dont see where AddXP event is triggered but LevelPerk is triggered at the end of the functions so if something was added it will probably already be added when LevelPerk is triggered
i suggest you read zombie\characters\IsoGameCharacter.java
Not too hard to change it to AddXP, if necessary
And saves on a fair number of calls
LevelPerk is triggered when Losing a level and Gaining a level
@thin hornet hi wasn't sure what the best way to communicate with you, but I was having some problems while following your guide for decompiling. after executing the setupWorkspace it ran all task mostly the same stuff except it ran "compileZomboidLua" instead of "compileZomboid" (not sure if that matters)? but ultimately I dont see the build folder and therefore no sources directory. Is there some mistake that needs to be fixed? I dont have any previous experience with gradle so im not sure what information is relevant
That's fine @shadow geyser
Or, well, the name difference is fine
Refresh your directory?
Also, @thin hornet, is there some way to get the amount of "pips" a player has per skill?
Like, what do these represent data/code-wise?
i suggest you check theses files
youll find reference about how to set level etc
pz is 99% made of 
better don't use parts of code from there
idk, it doesn't call
did you try OnTileRemoved
Sometime when using Reload button
it just fuck it up
so you have to go back to menu and log again
I press this button 3-5 times each time 
ah
XD
press only once
xD
you should see in the console that it reloaded it
but even tho
Events dont like reload
especially when using anonymous function
in 90% reloads
Events.OnTick.Add(function() end);
idk how it even can work cos it haven't any id for event
๐ฎ
dont ๐
use globals
xD
nah but better store that function in a var before passing it
but anonymous func is better... 
local function onTick()
Events.OnTick.Remove(onTick);
print("run just once")
end
Events.OnTick.Add(onTick);
also when reloading your script with this, the old onTick reference become nil
anonymous i dont think it nullify it
Yea, Ik but for func that shouldn't be removed I want to use anonymous func :(
Just try to use local function instead from now on

why are u making me cry
Right, but can you somehow check what your starting level for them is?
For example iterating over traits + profession and checking what they add?
Or is it not that simple?
You mean from the character creation menu?
Aye
At any point during the game, being able to check "What was this character's starting level"
Well you could save a player moddata the first time the character has spawned
Hm, preferably a more dynamic solution
what do you mean
Like, one that works even if the mod is added mid-playthrough
By calculating what the starting skill level is.
cant im pretty sure
Couldn't you check what the traits add on character creation?
depend if traits are dynamic
Oh?
but again, what if he gained a technical trait midgame
i mean adding mods midgame you cant expect it to be perfect
People will die and start a new character, unless the server is set to easy
They're generally not gaining traits, afaik?
depend if dynamic traits mods is installed
Unless they're using dynamic traits; But I'd say that's a fair enough interaction.
its a pretty popular mod
and yeah depending what you want to do why not
traits stuff is set in lua\shared\NPCs\MainCreationMethods.lua
local function getTraitPerkLevels(traitName)
local traitLevels = {};
local trait = TraitFactory.getTrait(traitName);
local map = trait:getXPBoostMap();
if map then
local mapTable = transformIntoKahluaTable(map)
for perk, level in pairs(mapTable) do
traitLevels[perk] = (traitLevels[perk] or 0) + level:intValue()
end
end
return traitLevels;
end
yeah
i checked the \lua\client\OptionScreens\CharacterCreationProfession.lua for reference
get your text editor find tools ready
you gonna have lot of research to do ๐
@thin hornet setPerkLevelDebug just sets the perk level, right?
Also, how would I go about logging something to the console? How about a server's console?
print("my message");
Right, but does that log properly to a server's debug.log?
Or do I grab a Logger object from somewhere and write through that?
well it take a string
Right, I'm wondering what to call to log to the game's logfile, though.
ZLogger:write(...)?
Or writeLog? 

DebugLog:log(DebugType.Mod, "Debug message here")
Like this?
Apparently you can write TypeScript PZ mods now.
Oh?
This was recently posted to Steam guides: https://steamcommunity.com/sharedfiles/filedetails/?id=2832871498
not like method
?
DebugLog:log > DebugLog.log
Static function call, not an instanced method call.
Like this, you mean?
DebugLog.log(DebugType.Mod, "message goes here")
That seems to expect the first argument to be a self, though.
/**
* @noSelf
*
* Method Parameters:
* - (String arg0): void
* - (Object arg0): void
* - (DebugType arg0, String arg1): void
*/
static log(arg0: any, arg1?: string): void;
Pretty cool that I can look this up using the typings from that project I linked.
nope
right
IDE seems to imply it expects it to be

---@public
---@param str String
---@return void
---@overload fun(o:Object)
---@overload fun(type:DebugType, str:String)
function DebugLog:log(str) end
---@public
---@param o Object
---@return void
function DebugLog:log(o) end
---@public
---@param type DebugType
---@param str String
---@return void
function DebugLog:log(type, str) end
This is what I'm getting from DebugLog.lua
Heh. That sortof looks like typings for Lua.
Its annotation
So, some of this feels a bit wack
What do you want to do?
DebugLog:log(DebugType:Mod, "SkillLimiter.LimitSkill: " .. character.getFullName() .. " | " .. perk.getName() .. " | " .. level .. " / " .. max_skill)
Really just log to the debug log
I'm just not quite sure whether or not I'm calling the log function correctly
And whether or not the DebugType is passed properly
I'm not 100% on the whole . vs : thing in LUA
Like, I've used C++ / C#, so I'm assuming it's comparable to :: there
Like a static call of some kind rather than to an instantiated object?
ัะตะป ัั.. (maaaan..)
I said DebugLog.log
why are u using method
btw how do u even compile the file with DebugType:Mod
Because my IDE, and the doc, seem to imply that would cause the first argument to expect an instantiated object.
wtf is this
Also, mind just replying in English? 
will try
forgot to change lang on keyboard

do you obey to computer?
This is what I'm referring to
If the IDE generally catches mistakes a lot sooner than humans do, I'm inclined to at least give its suggestions thought.

Alrighty then
if ur ide says DebugType:Mod variable is correct then I'm done
It doesn't seem to accept either DebugLog.Log nor :Log tbh
So PZ has a DebugLog in their Lua too?
I'm interested in this (just read it the latest comment). So is it possible to debug and print things to the console without using the print? ๐
Weird to have two.
It is. I showed the typings earlier.
right but what's sense of it?
Or if it's just some wacky definition hinting
I didn't think that someone would've made LuaDocs for Java API of the game.
Is this the syntax then?
Not the faintest clue
I'm new to Lua
Not new to programming, though.
But I haven't really touched Lua, nor interacted with Java with it before.
So some of the syntax is still a bit peculiar to me.
I think Lua complicates invocations more than it should honestly.
Like, is DebugLog in this case an instance we're accessing? Or just a class definition?
This is why I write in OOP languages.
Same ๐
Yeap, same
Monkey's labor (ั) Sisyphus
No clue why my IDE is hinting at the first arg being self in that case though.
If it's not an instance, calling it through ":" might make sense?
Headscratcher for sure
Thanks. I guess there's two docs / typings now in the PZ universe.
metatables is enough in lua
Metatables look like pure pain, thank you
Sorry but instance literally means an object instance which means non-static calls use :.
metatables are awesome
I still don't fully grasp what : is in Lua tbh
I was confused initially because of the fact that there're two DebugLogs? Or those docs aren't correctly mapping static calls.
The docs might just not be mapping things correctly, is what might be going on
but if u can't get to use function not like method but just static then yea it's will be really pain
: is literally object.call(self, ..)

is there anyway to know which mod is this ? Can't launch server because of this
I see
it's not only lua but most of langs
I've used :: and the likes before
no words about c plus plus plz
I'm crying
All var.func(..) calls are static. Using : is a simplification of passing the object's instance to the function.
I see, thanks. That explains things a fair bit.
It's sort of like what I recall python did with self parameters for pseudo-classes, however my Python days were back in Python 2.
Everything that's in the Lua codebase for PZ are pseudo-classes btw.
Sounds a lot like class methods in Python
Lua literally doesn't know what a class is.
Which is why I'm hyped about writing mods in TypeScript now.
I can imagine
metatables is fair close
It's useful but will not provide things like what OOP standards provide in most modern languages.
^
Is it even possible?
Apparently
for example?
Absolutely. Someone just released a full typescript environment for it and even wrote a guide.
You should give Python 3 a try sometime. It's really quite fun to work in these days.
I have. I just don't need to use Python anymore. ๐
Fair fair
Well... gotta give it a try ๐
/** @noSelfInFile */
import * as Events from 'ZomboidEvents';
import { getPlayer } from 'Zomboid';
Events.onGameStart.addListener(() => {
print(`Hello, ${getPlayer().getFullName()}!`);
});
But just to get back to my issue:
Simply doing DebugLog.log should work, then? Regardless of the IDE assuming it needs a self argument?
I said twice the final answer to u wtf
You should be fine using DebugLog.log. It's exposed as a public static method.
Mhm, might be an issue with the docs then

@jagged ingot
?
I'm going off of what I know as I've seen the decompiled source code for DebugLog.
for example?
Oh that. Interfaces, Abstract classes, etc.
Lua is as weak with OOP as JavaScript ES5.
Which is why I don't like using Lua ultimately.
It's a fun language.
It's great for scripting and works well in a lot of ways. This one is the one I like to focus on for my personal work though so that's why I have a less than stellar opinion of it.
right
funny though when you clearly didnt read how that typescript modding framework works
Reinventing those concepts only creates more trouble. With scaling, possible issues only grows.
it uses typescript to lua
which inherently means anything that can be done in ts can be done in lua
I had same question
I know it does. I don't think you are reading what I'm actually trying to say.
XD
its literally just an abstraction to hold peoples hands
ััะดะฐ ะตะณะพ
You're forgetting the compilation process which gives actual errors for support for development.
Selling the idea short.
and tbh fine by me if it will improve the quality of mods code
That's the point. ๐
u need to compile file to get errors instead just press Reload button?
hmmm
yea
it's faster
u even can install lua-linter to catch errors in real time
wtf
Well if you use something like Visual Studio Code, those errors are provided in a panel and auto-refreshed.
Wouldn't that be syntax only?
Yes. You see type errors. You see problems when accidently referring to a wrong type or a class declaration doesn't have a method.
i am however a firm believer in what a wise man once said
safety checks are useful to prevent crashes but if you just program well you don't need to prevent crashes
You see a lot more.
I think it's a personal decision but foolish to tell to new programmers.
if it runs unit-test on each of my funcs then I going to use typescript
I'm not sure but think linters can do same thing
I'm used linter only once just to test it
Unless you have a very smart linter for Lua that analyzes more than tokens then I don't expect it to look that deep into my Lua code.
just don't code with closed eyes
it really doesnt matter most of the issues will be prevented by not letting you do something wrong in the first place or having way better code than most mods
anyway it's not really useful
I think it can be when you import a lot of Lua code you don't know for sure will be syntactically correct.
I use JSON linters when writing my own quick export code.
syntax errors shows in console as I said so useless
Type safety is good for what it needs to be. If you write something small, you likely won't need it.
I'm content to know I have more options now.
btw I want to see how u will create mods on typescripts without auto-refresh in pz
I mean
it's really pain in da ass
XD
Lua files are exported so it would just pick up the file change?
so I need to compile the file each time?
The project I read has a compiler watcher built in.
reloading files is a lie it shouldnt be done
it's yes or no
It's a yes if you want to be techincal. It's a no if you're asking if you have to run a command everytime you change your code.
File watchers are a common thing to use for NodeJS environments.
?
so if I change the line in ts file it will pull changes in lua file without compile? wut?
detects source changed > compiles to lua
This.
If you want to be a dick, feel free. I'm not going to reply to you anymore though.
@jaunty marten do you have your mods on a repo or can link me one
have but restricted
server addons
what's u want?
can i look at the source?
there're used global table not modules so better to u don't look XD
yeah so point i wanted to make is valid youd benefit from that typescript thingy simply because it would produce better quality code
delta really has a point in this
I'm not sure exactly for me cos doing code on lua already for 5-6 years
using globals tho
it's not so reduce performance and it's a bit annoying (I mean doing modules) so 
the most important to optimise the calls of it
I have it so it's fine
I think

I can send my current mod after I finish it to u check the code if u want
hello guys
do you know any tutorials that could help me implement beards into the game?
i mean
add hairstyles
Hey guys,
if you are looking to make a mod and don't fancy dealing with Lua, maybe consider giving a try to do it in Typescript instead.
There is this project that provides all the Pros of Typescript with all the compatibility of Lua.
https://steamcommunity.com/sharedfiles/filedetails/?id=2832871498
btw I just got that if u can't do good code on lua then u will won't do good code on ts then how it can help? xd
I can write solid code in C/++/# and Python. I'm new to Lua and my code most definitely isn't the best it can be. Some people might have more experience with TS.
Seems reasonable to assume they'll have a much better time (and better quality code) working in TS.
In any case, more options is always a good thing.
I mean if u beginner
yea
You don't have to be an ass about everything, you know.
And aye! We saw / discussed that earlier. It's pretty cool.
he-he
Is there an OnReplace function when you eat an item?
if I remember correcty, ReplaceOnUse is the one you want.
Could anyone help me with getting started modding? I'm aiming to add a powered appliance but I can't find anything relating to power use in the game files
yeah if you look at the cannedCarrotsOpen, it has replaceOneUse = TinCanEmpty
I've looked through the wiki modding page and through similar mod files. Do I need to be working in LUA or Java to make a powered item?
forces parameter types and abstracts a lot of stuff
How does one get a character's profession? 
Found it
Typescript is a strictly typed language, will tell you are are screwing up before you even test it in game.
Hm, how do you iterate over a TraitCollection?
Doing a pairs/ipairs doesn't seem to work?
anyone know where i can find all vehicle and vehicle part functions? there doesn't seem to be a vehicle class on https://projectzomboid.com/modding/allclasses-noframe.html
If that's the official JavaDocs, those are as old as 2015.
TIS hasn't updated the JavaDocs in ages
thanks, i'll check it out
@jagged ingot You got a clue as to why this piece of code would throw a MethodArguments.assertValid?
local trait = TraitFactory:getTrait(trait_str)
trait_str is the correct string
I'll look.
Not sure if I'm once again misusing :
/**
* @noSelf
*
* Method Parameters:
* - (String arg0): zombie.characters.traits.TraitFactory$Trait
*/
static getTrait(arg0: string): zombie.characters.traits.TraitFactory$Trait;
/**
* @noSelf
*
* Method Parameters:
* - (Empty): java.util.ArrayList<zombie.characters.traits.TraitFactory$Trait>
*/
static getTraits(): java.util.ArrayList<zombie.characters.traits.TraitFactory$Trait>;
Aye, it takes a string
Glad I can help. You can use a folder-search tool in say an IDE with the typings in that project. That might help.
I'm still low key confused as to why local vars and whatnot use : to invoke their methods, and . seems to be used for static things
It's a combination of two things: The Lua engine being used and Lua code itself.
Believe it or not, the Lua engine used by PZ isn't actually Lua. It's a reverse-engineered copy.
Kahlua, right?
Kahlua2.
So, calling new is different from Java objects and Lua objects. You have to use .new(..) with Java and :new(..) for PZ's Lua objects.
: is calling to an instanced object. . is calling to a property.
Anything you know that has to involve calling . or :new(..) needs to use : for methods that aren't static.
I agree, however this is how that works.
Thanks for the info
The problem with Java objects is that you don't get to know what is or isn't static by default.
No problem.
I'm working on a mod that involves modding the core of the game to add support for manipulating music and shaders.
Oh?
Yeah. I'm able to manipulate the GLSL shaders with uniform variables. I also push PCM data from music of my own to them causing some cool effects.
Also some stuff with moodles visually affecting the screen.
That mod uses images via Lua drawn as UI textures.
Same general goal, though?
I'm actually modding and sending info the frag shaders.
Just nicer
Nice!
Okay, I feel like this shouldn't be causing issues; But apparently it is.
__add not defined for operands
for trait_perk, level in pairs(mapTable) do
if trait_perk:getName() == perk:getName() then
trait_perk_level = trait_perk_level + level
end
end
The trait_perk_level + level is throwing that error
I print the level and it looks like an integer type
Like
It prints 3
Unless that's a string as integer?
Or am I missing some weird arithmetic / integer wackyness in Lua?
You have a clue? @jagged ingot
local trait_perk_level = 0
This is where that var is created
Let's see..
I'm curious if it's a string, or one of the values is nil.
If it prints a numeric character, it can still be a string.
If you're more curious about type identities in Lua, try using type(var), which puts out a string of the type name itself.
The odd thing is that it was refusing to be concatenated to another string
Ah, Lua has a type()?
Nice
Oh wait
print(type("Hello world")) --> string
print(type(10.4*3)) --> number
print(type(print)) --> function
print(type(type)) --> function
print(type(true)) --> boolean
print(type(nil)) --> nil
print(type(type(X))) --> string
btw
So Max, you use .. to concat.
yes, but I mean if there is a function that is called when an item is replaced by another
It's like PHP.
Aye, that I know
Ok cool just making sure.
So this typescript thing, you all seem to be raving about it. Should I be focusing on that over the traditional way?
Time to print a type()
Whenever you see an error like that, assume first a variable is invalid at this point in the code. Work from the spot that errors going backwards.
I miss debugging in other languages, ngl
I might just switch over to TS for future mods
My bias is clear in the chat history however having type safety and exposed API when writing code will help you so much either being new to coding or not.
And yeah, I do have a formal education and work experience with programming / software engineering. Just... not Lua
It's ultimately an option and yours to make. Not negative either way.
Thanks for clarifying. I do too. I try to make things make sense for those who don't.
Thanks. Glad to hear.
BTW the typings alone in that TypeScript environment can act as an additional JavaDocs.
Take a search tool to it when you have questions. It exposes all public functions that the game does for Lua users.
I'm using IntelliJ atm
It's doing a nice job in general of showcasing that stuff
Just apparently not for the static things
So just due to it being easily searchable it'll be easier to learn?
I could go into detail if you'd like. I also don't want to overload the channel about it haha
Could do a quick thread?
Though the information seems universally useful for anyone interested in modding
ยฏ_(ใ)_/ยฏ
Sure.
It'll show you errors in many more ways than you can with most Lua writing software. You will see what you're working with and not assume it is a number or a string, object, etc. You have instant access to TypeScript tools like interfaces and abstract classes.
You can see what objects contain.
And here I was just planning to write my lua in notepad
Visual Studio Code is free.
There's also rich text editors like Sublime Text and Notepad++.
I genuinely do not understand people that proclaim writing code in generic text editors is somehow a better experience than IDEs
Don't expect me to know about that. I'm a spaghetti coder, pure and simple.
And yeah, ++ was what I meant
It's mental gymnastics applied to elitism over un-tech-savy people.
I genuinely hate people who punch down.
It just feels like people trying to prove something or gatekeep IDEs as something bad
Like, holy crap
We made IDEs and other tools to make programming more enjoyable and productive :')
Incompetence, Insecurity, unable to move, explore, learn, compromise, give.
I've just never had a need to learn IDEs because the caveman method works well enough
Oh
More power to you if you personally enjoy / are okay with using regular text editors
You using it doesn't mean I hate you btw.
We're just talking about the kind of people that feel the need to hate on IDEs / people that use IDEs / people that don't want to use regular text editors
On a side note
I found the issue
It's for people who try to act as if IDEs are a sin against their God.
The number is apparently Userdata
That's Java data, right?
Now, how do I convert that 
Yes. How do you get it?
You're free to despise my uncultured existence
I can make it easy for you to get it.
From a hashmap, from a trait's XP map
I have the userdata in a variable
Just gotta convert it
Show me the line.
local mapTable = transformIntoKahluaTable(profession_xp_boost_map)
for prof_perk, level in pairs(mapTable) do
if prof_perk:getName() == perk:getName() then
print("SkillLimiter - Types of level & trait_perk_level below:")
print(type(level))
print(type(trait_perk_level))
trait_perk_level = trait_perk_level + level
I tried out IntelliJ for a bit and was totally lost on how to set up the environment
TypeScript any simpler?#
TypeScript is a language. Visual Studio Code however is way simpler.
(Jetbrains IDE's are fabulous once you get used to them, though)
They have fernflower, which makes me giddy everytime remember that.
So trait_perk_level
I'm aware
Hahah sorry again.
Just figured 0 wasn't necessary :P
Typed a lot of md lately so brain is in that place.
I feel ya
I do a fair bit of Discord server management stuff, with a good amount of markdown text blocks to spice things up ๐
But yeah
level
From userdata to a generic number / integer
I don't know where this comes from: ```lua
local mapTable = transformIntoKahluaTable(profession_xp_boost_map)
Looking for the Java API call.
Someone tossed me a code snippet & source file to check out
The method they referred me to used that
function dump(o)
if type(o) == 'table' then
local s = '{ '
for k,v in pairs(o) do
if type(k) ~= 'number' then k = '"'..k..'"' end
s = s .. '['..k..'] = ' .. dump(v) .. ','
end
return s .. '} '
else
return tostring(o)
end
end
Dumps a table and prints it.
Could investigate the table
\lua\client\OptionScreens\CharacterCreationProfession.lua
I have that file open now.
Taken from there
Ah ok
Epic.
Let's see if the mod works now
This IDE confuses me. I just wanna bash rocks together and make code.
Do I need to install the JS/TS Nightly?
Wait what?
Say, does Lua have something akin to default values for parameters?
Visual Studio Code is a self-updating text editor.
No since types aren't required.
Ah, hm
It'll be nil by default.
You can write tuples btw
I don't think implicit nil checks as booleans works in Lua but I think it might.
write it in the debug console in-game if open.
Let's see if the mod works now
Good to know. Thanks. Been writing == nil.
I think a small project I might work on next is a self-documentation tool so I can write documentation for things like the Java API for PZ and have it insert into say those typings or decompiled Java code.
Another idea is to write a simple UI program that templates and has GUI to build custom ISUI Lua classes.
@jagged ingot Mod is alive ๐
Now, anyone know how to upload a mod to the Workshop? 
Yes. Check out ModTemplate in ../Zomboid/Workshop/.
Will do
You toss your mod into the ../mods/ folder in that.
Launch steam-enabled PZ, go to workshop tab, and follow what it says.
BTW you should copy the ModTemplate folder and customize it ofc.
more clear
local strrepeat, pairs, type, format, tostring, print = string.rep, pairs, type, string.format, tostring, print
local function toPlain(tbl, indent, out)
local isend = not out
out = out or "{\n"
indent = indent or 1
for k, v in pairs(tbl) do
local tabs = strrepeat(" ", indent)
formatting = tabs .. tostring(k) .." = "
if type(v) == "table" then
out = out .. formatting .."{\n"
out = out .. toPlain(v, indent + 1, "")
out = out .. tabs .."},\n"
else
out = out .. formatting .. (type(v) == "string" and format("%q", v) or tostring(v)) ..",\n"
end
end
if isend then out = out .."}\n" end
return out
end
function PrintTable(t)
print(toPlain(t))
end
@midnight mica
https://zomboid-javadoc.com/41.65/zombie/vehicles/BaseVehicle.html
https://zomboid-javadoc.com/41.65/zombie/vehicles/VehiclePart.html
Javadoc Project Zomboid Modding API declaration: package: zombie.vehicles, class: BaseVehicle
Javadoc Project Zomboid Modding API declaration: package: zombie.vehicles, class: VehiclePart
@willow estuary How would I just have a single outfit for every zombie?
anyone know where i can find the file to make a custom spawnpoint for single player
Hello im starting into moding. What i shuld know or have as begginer?
So when TS for PZ says to install NPM in main folder, does it mean the VSCode folder? Or my project folder?
npm install is a command to run.
So in the project's folder, run it.
It sets up all the dependencies and plugins in the environment that run when compiling the code.
It's a NodeJs environment and npm is the "Node Package Manager".
This is a console command. Forgot to clarify.
anyone have any idea why setContainerCapacity does not seem to work server side?
it works whenever i use it when the vehicle is created, but once its created i can't change the container size anymore, seems weird
anyone knows the line of code that tells if the zombie can see the player or not ?
So I have reworked the base mod repo im working on.
https://github.com/Konijima/Project-Zomboid-BaseMod-Concept
It can be used as a template for lua mods and or just for maybe learning something
Ill try to make a tutorial how it can be extended and used
but basically i might be using this for all my future mods so I ll keep it up to date too but also minimalistic
If i dont use item tweaker
hey can someone help me figure out how to make a VHS + book mod
im a complete beginner in JS
and iโve never done any modding
JavaScript?
yeah
break it down to smaller tasks and work on those
I'm sure that the mod would be simple enough to use Lua by itself, however if you know anything about TypeScript and feel more familiar with JavaScript, you have the option to use TypeScript.
I think the majority of your mod would be item scripts.
Absolutely good general advice.
lots of small victories > one large project challenge for newer ppl imo
Isn't there a guide somewhere that's generally used for types of mods for items for PZ?
I remember some website that had a lot of tutorials.
so depending on what you're doing with the book for example, you could finish that part first make sure it's all working and try the next bit
I say this because you can lose motivation if you get stuck on a big project, that said yours seems fairly straightforwad, good to begin with
i know that part from developing stuff
decide what you're gonna do first, try it, come back if you get stuck
alright iโll do that
sounds good, lots of helpful people in here :)
If you have any issues with Lua and can't find answers after looking it up on Google, it isn't a sin to ask here.
I mainly learned from picking apart other peoples basic mods when I started
didn't quite find any solid tutorials if I'm honest
I learn from breaking and reverse engineering hahaha
I haven't actually checked whats exactly exposed to kahlua, but seems a good majority or all of the public java classes are availabl
JavaDocs are good (The 3rd party ones). I would recommend this to people who want basic, traditional documentation. I also use an alternative typings set for TypeScript interpretations. ๐
The latest JavaDocs rendering is 41.65 though. With 42 on the horizon, this could be problematic.
I don't know the TOS here however decompiled code is a gray zone so just a heads up.
ye its fine
Those items are recursively exposed.
The typings I'm referring to only shows what Kahlua2 exposes through PZ.
JavaDocs like the ones I know shows more than what's exposed. This could be confusing to someone who tries to invoke unexposed content.
thats what I'm trying to understand, which parts of the javadoc is unexposed
not exposed
Javadoc Project Zomboid Modding API declaration: package: zombie.network, class: GameServer
I can see this being confusing for people who don't understand.
My experience helps me know what is and isn't.
or did this javadoc come from a generated subset of classes
only answer I suppose is to try
This one specifically comes from third-party. It means that the code from the game was ran through a JavaDocs tool.
yea dw
Same with the official one from 2015.
was just confusing myself a lil
If you want to see what 41.71 exposes, check this out: https://github.com/asledgehammer/PipeWrenchTemplate/tree/master/typings/ProjectZomboid/41.71
Items that are type are exposed but not directly.
oh this is quite nice and organised
From what I can see, the typings were generated where classes in the zombie package are recursively unzipped and compiled so I can still see some classes here that might show things that aren't accessible. It is based on that codeblock you see in LuaManager.
It'll be closer to what you'd expect to see exposed.
Even then you'll see where that call ends up.
gotcha
Seeing the actual types for parameters, return types, and static fields helps though.
JavaDocs has that too.
yea haven't used much of java so far but theres a lot of useful things in there
often you don't need a lot of it tbh
unless you're going real deep with your mods
This is why I'd need this mapping more than JavaDocs.
๐
its pretty nice being able to make an entire bicycle mod without even referring to javadocs
The biggest thing missing from all documentation is.. documentation. ๐
none of my mods is java lol
I'm curious why its different to the decompiled code, what exactly is the typings you have
The comment on the bottom is for the next one below it.
ohh ok I misread it
It's TypeScript so method signatures differ from say Java where multiple methods with non-erasure parameters can be a thing.
They have to be combined to follow the TS syntax.
It's actual typescript.
yeye
That GitHub project is actually a TypeScript environment to mod PZ using it.
I thought you were telling me you used it instead of java, but without the context of typescript xd
was like, wat the
but it makes sense, this is just directly matching the java... can't think of the right words rn ugh
binding them
now the question is
will this project be maintained
but in the dev world, I guess that's always the question
Yes. This project was said to have taken 6 months to make. I don't think it'll be abandoned soon.
could be
Well I know the author.
curious if someone else would take the mantle
