#mod_development
1 messages Β· Page 488 of 1
anyone got britas weapon mod?
yep
was gonna ask about that change magazine type but you helped me haha
in pz chat
Whats up?
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
Oh sweet Jesus
if i'm just adding x and y why did it encircle me....
That looks like Chinese Traffic
PZ was made at the start of 2010s lol
NASA super computer
this save needs to be immediately deleted though
Whyβs that?
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?
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
I think the roof thingy is because the first floor is one of the only ones for vehicles
Like, sometime a car can glitch into the house yet floors above don't seem to really react to the car, same does the car
the car doesn't spawn in at all though
the engine can tell it's not on a ground floor and poofs it
I mean, the same would probably go for water.
Roofs are just car innacesible I guess
Unless like, Louisville has roofs with cars
cars can spawn on water** afaik
but you can spawn vehicles on water
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
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
They're just there mostly for future things
it's easier for shark to design an intact one then break it
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.
: (
Even if they could exist on another plane, you still have the 45β° ramp/stair issue
Oh okay
I like to spawn them around by my base
Simply because how well it blends in
And looks pretty based
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.
i dont think there are many ski resorts in kentucky
definitely none where the game is set
anything that adds stuff like buildings to forests pretty much
or upgrades the cabins in the game
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
Probably, canβt think of any though, you could make one
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
I guess you can turn them all off except true music and turn them all on one by one
when i put down a boombox, it does not work. the menu opens, but nothing is there
i know, but i am saving that as a last resort
Yeah it does sound like a big hassle
is there an error log?
dang, loading in the game loads up to 36793 squares o.O
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,
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
@ nasko is the person who gets paid to get pestered re that sort of matter,
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?
@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
Alright, thanks for the help!
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.
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+
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"]
@kind basalt
E:\SteamLibrary\steamapps\common\ProjectZomboid\media\lua\server\Items\Distributions.lua
E:\SteamLibrary\steamapps\common\ProjectZomboid\media\lua\server\Items\ProceduralDistributions.lua
Thx
I keep finding like, 4 miniguns per location I go to, even on extremely rare
Nevermind I never looked at the distribution
@dawn shuttle hard to say without the code
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.
@cobalt kettle welcome in the modding world of pz π
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
@weary matrix what class you need to pretty print ?
@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
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
ah interesting
you can try type(obj) to check what type it is also if you get "userdata" then its a java object
yeah problem is stuff I want to debug is userdata :/
try error(obj) and might have the data shown in the debugger
@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
@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()
...
@thin hornet ah interesting too, let me save that code in it's own file for later use
@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
@thin hornet true, but pcall is standard Lua, so I know about it! π
still thanks for pointing it out
cool might help other π
definitely
im taking a brake of coding so im just dropping some knowledge xD
stuff i recently learned anyway
@thin hornet awww how come you're taking a brake at coding?
cause ive been coding all day xD
ah just for today π
Yeah lool
@thin hornet may I ask what you've been working on?
for now you can install hardwares, turn it on, access bios and toggle settings.
heh nice
@thin hornet I've been thinking for a while about making a cyber security game, similar to zomboid, but no zombie apocalypse
but basically it will allow to play games, read/write text files, and use/require software to do stuff
@thin hornet will you implement networking? π
allows to use vanilla CDs and im adding learning CD to gain skills
We are thinking about networking for the MP release
you'd have to pull a cable between the computers, zombie could get their feet in the cable, so you have to replace them π
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
yeah
i also want a printer to print text file on paper sheet xD
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
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
xerox machine
Free tool to convert image to xerox copy like effect. Drop image in tool, click convert to xerox button to apply the effect. Now Preview and download image in your desired format (both png and jpg option available)
ive used this extensively
nice
any users of the TrueMusic mod out der?
Hi, how can I edit the text shown when pressing Q?
found in lua/shared/translate/EN/IG_UI_EN.txt
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",```
Gracias, bro!
https://steamcommunity.com/sharedfiles/filedetails/?id=2645634376
This mod is an utility mod for mod developpers.
Make it safe and easy to add item to the distribution tables.
Do I just copy the file to my mod in the same directory and edit it?
Prolly yea
that's what I did with Irate User Interface
where I changed all the text in game to have swear words
Do I delete all other lines except the callout lines? Or leave it as is?
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?
Shouts from another language
I'd also like to add more than 3 shouts for variety if possible.
I released last version of my NPC mod! Link on my NPC mod Discord: https://discord.gg/z74HkvT6
why are my mags and attachments on the guns in britas weapon pack not showing up
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.
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
Which loot mod is it?
90s distribution pack
Yeah I have that one but Iβm not using it so maybe thatβs it
turns out the issue was the panel's height was 0 which governs the box size to detect clicks but most def. not what is shown in the UI! Fixed 
@dawn shuttle haha, great π
Anyone has an idea how to add a mod requirement to the workshop.txt?
You don't put it in workshop.txt, you put it in mod.info
For the workshop you have to use the steam workshop page settings
ye
thanks man
np
So, how would armed Vehicles work? like mounting a .50 on a Humvee?
would probably work like how you can shot out of windows with guns
yes that's how i would do
Anyone familiar with the new globalobject moddata know if it is getServerModData ?
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")
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 eventOnInitGlobalModDatawith parameter: boolean isNewGame.
LuaTableModData.create(String key)creates and returns the table with given key, returns null if the table already exists.
StringModData.create()creates a table with a random UUID key, note: returns the string key.
LuaTableModData.getOrCreate(String key)gets or creates the table with given key.
LuaTableModData.get(String key)returns the table with given key or null.
booleanModData.exists(String key)return true if table with given key exists.
LuaTableModData.remove(String key)removes the table with given key if exists and returns it or null.
voidModData.add(String key, LuaTable table)store the table with given key (overrides any existing table).
ArrayListgetTableNames()returns a list of all registered tables.
ah
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:
voidModData.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)
voidModData.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 eventOnReceiveGlobalModDatais 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/
chuck is a man of few words lmao
I use global mod data for the immersive solar arrays mod but I don't send anything to server yet since no multiplayer
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
pretty much use it the same way
When MP comes out ill see what i do with it
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
it depends on what you are looking for in your game, have you play it much in vanilla?
T-pose
Can I ask a silly question? Is there a command like weapon:getType():setType("Axe") ?
@zealous glade what are you trying to achieve?
if you desperately want an axe you have an item spawner in debug mode
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 π©
weapon:getType() would return a string so not sure what you trying to accomplish.
if you want to add an axe it would be inventory:addItem("Base.Axe")
local playerObj = getPlayer()
local inventory = playerObj:getInventory()
local axe = inventory:addItem("Base.Axe")
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 ..
maybe try SubCategory
item:getSubCategory() == "Swinging"
weapon:isRanged() == false?
or that yeah haha
handWeapon:getCategories():contains("SmallBlunt")
handWeapon:getSubCategory() == "Swinging"
I know it's dumb, can anyone understand what I try to do?π« I'm a total idiot on lua
I will try it, thanks!
why OnContainerUpdate?
because a dead zombie is a container?
oh
but then the first param would be
container
LuaEventManager.triggerEvent("OnContainerUpdate", this <-- its the container);
which can be a dead body
IIRC you can use the OnZombieDeath event (or whatever it was called) which includes the player param and check for current equipped weapon (if any) and decide on there wether to reanimate him or not?
I think that'd fit more to what you plan on doing
yes
OnZombieDead(isozombie)
does it not include the player?
it doesnt
aw
alternatively hook the hit for multiplayer compatibility? Unsure if the hit thing'd run before or after the death happens though
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
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
even on the event? so it's not like it only triggers when the hit has gone through already? (IIRC that includes all 3, weapon, player and zombie, not sure of order though)
I cannot follow you guys now, it's far beyond my brain's capacity
sry
LuaEventManager.triggerEvent("OnHitZombie", this, var2, var7, var1);
I will study it hard now, I guess, hope one day I can make it possible
("OnHitZombie", IsoZombie, IsoGameCharacter, BodyPartType, HandWeapon);
("OnZombieDead", IsoZombie);
does the damage and change to corpse apply there too, do you know that? π
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);
}
so prior to that D:
i guess that OnHitZombie if its not the body part of the head he could give health back
alternatively there's the option of comparing the delay of hit to death π
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
i guess if its not the head you dont wanna kill it
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.
interesting
Haven't tested so might just be a bunch of bullshit on my end here? But in theory I think it should work. π€·
Theory is half the work!
Still try to understand the code, sorry I'm an idiot
I will try it later! Thanks!
Now, another step would be evaluating if the weapon is a melee weapon or not, as well.
can I just use weapon:isRanged() == false?
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
Anyone know how replace a animation?
depend what you mean
replacing a walking animation? an action animation?
what animation you wanna replace
Wait me a sec
im not pro animation just asking for more context on what you want to achieve
I already "replace" (I think, because I'm still working with anims), but I get a "little twist" at the beginning, that shouldn't happen
https://streamable.com/v3s2f8#
haha
funny
but in all honesty i dont know much about anim i wish i do, i need anims for my mod
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?
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.
What are good sources of up to date information about hydrocraft and the different mechanics it adds to the game?
@drowsy merlin only place I know is http://undeniable.info/pz/wiki/itemlist.php?kind=Classic
but it might be incomplete
or read the source π
is there an up to date guide on adding models to build 41? everything on the forums seems outdated
anyone available to help with a couple of should-be-simple questions regarding a mod I'm working on?
Might as well just ask
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
elaborate a bit more?
are you talking about having multiple textures and then having the icons match up?
either that or making them 'tint' like duffel bags and stuff, i.e. spawning in random colors
oh thank god
<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?
yea
i used the Tint one, but only the equipped bag actually worked
not the icons or the ground models tho
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
Is that for inventory icons?
oh shit, I've been calling Base
test it out and get back with me
am I supposed to call my own mod in the item script?
you mean in module?
yea
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?
np i am here
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
@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.
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.
bug?
how can i find the default 0 0 0 offset point on attachment offsets
especially in Bip01_BackPack
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.
Have you tried Passiv ?
yes
Odd
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
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.
@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
That may be done java side
damn
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
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?
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
There's Lua functions for adding skills from professions there may be something in that file.
@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```
My approach to doing stuff far aways is to create a custom class that hold the info that i want to spawn and the coordinates.
I store all those object in a key table and in a single OnTick, every 100 ticks or w/e I check for each entry check if there square exist and spawn the thing then i remove it from the key table.
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)
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.
I've considered that - it's just I'd need to redo alot of stuff lol
@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.
π€·ββοΈ on my end it loads it fine and unloads squares i distance myself from
also loads when teleporting so ... not sure?
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
it does create one but it doesn't really "load" whats there. IIRC it's used for doors somehow
@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
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
okay ill try to spawn Axe on all square now lol
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
and idk why it behaves like that on your end - but you did see last time that it loads on my end π
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
unsure but could it be that you did not try in a new save? For that you may need the ReuseGridsquare event, but im not certain, most/all my tests are usually in a new save π€
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
welcome to anonymous function hell again. π
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
when it's nil when trying to get it's location xD
yeah ok
any clue which version of Zomboid is this Javadoc for? https://projectzomboid.com/modding/
it seems quite outdated
<!-- Generated by javadoc (1.8.0_45) on Mon Jul 13 17:47:43 ADT 2015 -->
@thin hornet that's the version of the Java virtual machine, not the version of Zomboid
its been generated in 2015
oh my, my spear traps mod has 3,298 Current Subscribers, never expected so many users
so its pretty outdated
@thin hornet oh my bad, I missed the important bit π
hehe
I guess I should generate my own Javadoc then π
my generator condition went to zero and burned my place down xD
aww geez
if(watchkey == null) goto _L2; else goto _L1
getting this error when trying to generate Javadoc, cause decompilation is not perfect
do you know of capsid?
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?
its decompile the game and allow for an intelisense and also annotate the whole source code for you
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
@thin hornet this should get pinned I guess
@sour island do you have enough power to pin things in here?
I will probably make a tutorial on how to set it up soon
would be nice
Faire ses dΓ©buts dans la crΓ©ation d'un mod sur Project Zomboid : Mise en place de l'environnement.
Plus d'informations dans la description (lien, ressources...).
Le framework (CAPSID) vous permettra de jongler plus facilement entre les classes, methods utilisΓ©es par Project Zomboid.
Il automatise aussi la crΓ©ation de la structure de votre mo...
it's in French but it's easy to set up
nice
@thin hornet which OS are you working on?
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.
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
@thin hornet which folder is it expecting exactly? Like steam/steamapps/common/ProjectZomboid?
yeah
or should I go deeper in the filesystem tree?
are you on windows?
no, ubuntu
ok then on ubuntu if i recall its on directory deeper
I get sick when I try to use windows π
/home/work/.local/share/Steam/steamapps/common/ProjectZomboid/projectzomboid
yeah ok
if you need to edit manually the path
alright so for the steps after the createRunConfigurations
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
you can try asking
@thin hornet I guess your tutorial is quite ready π
let me know when all the step are done ill lets you know the final steps
1 actionable task: 1 executed
03:59:34: Task execution finished.```
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
No actually I just have zomboid.jar
okay check the tasks in the gradle panel
@thin hornet I have zomboid.jar but not zomboid-41.56-IWBUMS.jar
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)
then you should see a build dir
with all the decompiled files
and a generated dir
with both lua and java source in it
yeah I found the lua and java source
if you ever choose to make mod with it install emmylua
will allow to use the annotations for lua
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
π
but where is it?
What happens here? try get java source?
in the build directory
Bless your soul for that tut @thin hornet I'll try it out here in a bit lol
I've been needing updated source
@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
no javadoc but all the java is there
@ruby urchin well mostly the javadoc but you can get the source too
Yeah you have to sort through the java code, its not actually gonna generate javadocs
But everything you'd find in javadocs is there
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
Ahh yeah idk I've never generated javadocs
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
not sure why its throws an error but i usually just read the classes when i need to find something
I guess I just haveto figure out the proper parameters to javadoc command
currently, Visual studio have a search option for that, at least that's how I do it
using find in files is very fast in intellij
but at least now I have clean sources!
^ ikr!
if you hover var3 and stuff you can also see the types
and if you click stuff you directly go to that class
On the topic - anyone know how I would detect transfer of items to/from a vehicle container?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
might be able to check with OnContainerUpdate
Yeah I'll give it a shot, thanks
first param should be a container i think actually no
it seem to be an IsoObject and extended classes of IsoObject
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 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
im trying it
@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 π¦
That's gotta be it
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
I'm sure they'll update the javadocs once b41 is no longer in beta, or I would hope so anyway
Yeah xD
if they did right now all the MP stuff would have to be stripped
@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
not suire what version of lwjgl u need
you can get the source and compile it in intellij it has a gradle
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 π
nice
ok now I need org.lwjgl.system, which is not in the release I got for lwjgl π©
you could maintain a git repo with the javadoc if you get it to work
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
Awesome, hope you get it working π
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
step by step 
but if you succeed youll be awarded the title of hero of the month π
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
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?
i have a question
how can i add more than one slot in item tweaker with AttachmentsProvided
geez, struggling with native libraries it seems, missing all the lwjgl classes like GL11, GL12, GL13 etc π©
seperating with a semicolon ; I'd assume
scarier than mine!
wide slenderman walk intensifies
Fucking flagpole son of a zombie
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.
check if item_ground have the same UV mapping
how do you unpack .pack files
use a utility called UnPacker
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.
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 https://theindiestone.com/forums/index.php?/topic/3511-pz-unpacker/ this is the one I use
I wrote a tiny tool, for Un/Packing .pack files. .pack FormatThe .pack files contain all used textures in PZ.The structure is the following: Features:1. Unpack: .pack files into seperated .png files (extra info is saved in a .xml file)2. Pack: .pack file is (re)pack with the .xml file and all .pn...
Cheers man π
Could you possibly DM me how it is done?
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
I mean, the WorldItems
What code language does PZ run on?
Thanks
Who would be interested into a custom item tooltip API?
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
@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
interesting, what makes them invalid?
@scenic cradle well it just puts the tiles as close as possible to each other, so you lose the relative position inside each cell
aah, I see. I only use it to steal inventory icons from the spritesheets to photoshop for my mods lol
mmm for icons it should be ok then
but I am thinking about making an actual map soon so that's good to know, I appreciate it
Is there such a mod that helps with ripping zombies cloths and such?
such a hassle to do all the clicking everytime
like...to auto rip clothing on death?
aye
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
Sure 100%
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?
@ashen mist check console.txt on your Zomboid folder
@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
I'd hope its been started, I've clocked over 100 hours into it
found it
@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
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
@pearl prism door animation?
YES
what does it mean?
when you enter in the vehicle it shows an animation of the door opening
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
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
π
yeah, its totally possible to do right now
what is this mod
this for now should be considered as the bible on how to do a modular vehicle with animated doors
Yeah, its it's a really well done mod
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
@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 π
I'm sure in 5 years they will do it
its actually not that far off
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
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
@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?
@weary matrix so what do I do with it now?
@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
That's all open source as far as I know
Javadoc being a dump of all exposed functions/methods?
oh damn, it's chuckleberry finn, fancy seeing you here
Oh wait thought you said ZomboidDoc /ZDoc
if you're decompiling the java yourself I guess you can ask the devs if its ok
@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?
Is your process easy to do / integrate into InteliJ? What I'm using now is somewhat out of date
you can do two things
The only one that's pingable is Nasko iirc
either ask nasko or email them
Hello
@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
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
but I might document the process if people are interested
and maybe make it smoother/easier
That would be helpful
@sour island thanks, I'll try to ask Nasko when he's online
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
well the bare minimum is valid sources + the javadoc command line tool
Does it create a LuaLibrary usable in IntelliJ?
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
ah
I'm not even sure what is the LuaLibrary you're talking about
What zdoc creates are lua files of the information which you can refer to as a library and when you type this happens:
unless you mean the javadoc for kahlua?
aaah so you get completion for your Lua code
no that's really another topic than what I've been trying to achieve, sorry π
I was just tired of reading Lua source code from Zomboid and mods which call methods that are not documented in the official Javadoc
The official one is for b40 right?
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 π
I cannot figure this out
@sour island any clue about Nasko timezone?
I have no idea why the hell tearing clothes just broke all of a sudden
Just ping him, he'll get to it.
@ashen mist post it here, I'll have a look
Does it update on the spot?
yes
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
It updates the file - you'd have to reopen the file. However, the log in the main directory gets reset when the game launches.
Iβve done it a bunch already
what you psoted looks like this is just the initial loading of the game
I don't know what to do then
That's console.txt, I found it where you said to find it
@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
Iβm just gonna restart my pc and see if that might fix it
@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?
Yeah
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
I always find my errors in the log file in c:users/user/Zomboid/
there is a Logs folder in the Zomboid folder
I wish this game had more modding tutorials
at least on Youtube. the only semi recent one is the one that Blackbeard did basically
@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!!!
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?
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
Really useful stuff: https://steamcommunity.com/sharedfiles/filedetails/?id=2644480496
it was posted in #pzwiki_editing
guess we should pin this to the channel, if someone has the power to do it
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.
Nuub question here, what is the command to Lua ignore the fractions of a number in a math count ?
as in rounding down for a clear number instead of decimals? math.floor(1.525) will return 1, if you wish to round up math.ceil(number)
yup math.floor() is the way to go
it is, but I'm pretty sure he needs floor() and not ceil()
Sorry to interrupt
But is there any extra steps to take when changing a specific file from in-game
Like a translate file
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?
Thanks guys that's exactly what I need
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 π
I made it the same like it is in the media file
But it still shows the original even if i activate it
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.
Thank you very much for the help
Never tried actually overwriting an existing translation, I'd assume it'd work though.
Do you have the same folder structure as well? media\lua\shared\Translate\XX\file_XX.txt ? (yes, the language "code" as well)
Yes
Other nuub question,
Is there another way to do this in Lua
print("X is a number between 2 and 9")
end ```
What would be the benefit?
If you're worried about OOP you can use () to control values
Thank you
Just optimization
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.
@thin hornet @dry chasm π
alternatively you could do
local msg = (x > 1 and x < 10) and "X is a number between 2 and 9" or "X is either smaller than 2 or bigger than 9";
print(msg);
Not sure if you'd call that more optimized though π€
Handles vehicles, items, zombies, and even other functions. May clean it up and post it here for others.
Nice man you made it π
@thin hornet yay π
Do any of yall think a Holtzman Shield from Dune is possible in Project Zomboid?
@zealous wing everything is possible, but would that make sense for a Zombie game?
sure, go ahead
@iron salmon awesome! π
sick
I disabled my tailor book mod and scrap armor and it still won't work
@ashen mist share the console.txt
Javadoc for all versions of the game
Version 41.65
https://zomboid-javadoc.com/41.65/
Version 40.43
https://zomboid-javadoc.com/40.43/
Version 39.67
https://zomboid-javadoc.com/39.67/
Version 38.30
https://zomboid-javadoc.com/38.30/
if someone could pin the message to this channel
Nice
Niiiice, this will save some time going forward
I hope this is the right one, I used the one I found in the quick access thing in the file explorer
Actually, use this one instead, just to be sure
@ashen mist I can see some errors related to BooksDistribution, so it's probably a copy of a previous run
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
@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
I don't think I even have a mod called BooksDistribution
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?
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:
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?
Yeah
That's creating the stack traces
Achievements for B41 I think it is
Ah damn, and I liked that one
It used the noises from The Last Stand: Union City
Also LOG : Lua , 1636240614020> Loading: C:/Program Files (x86)/Steam/steamapps/workshop/content/108600/2209099061/mods/AdditionalSkillBooks_2/media/lua/server/Items/BooksDistribution.lua
Glad you got it working π
What was going on in your game - what errors?
Cant tear more than 1 clothing item at a time
Ah that's the achievement one then - it's breaking in crafting
Also can't unbox multiple boxes of ammo unless its inside my inventory
@dawn lynx π

nice
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
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'
I deleted every old save I had
Every time I made a change to the list I made a new file
If there's no obvious errors
you'll have to do the half method
disable half your mods - test
Deeply Closeted can't be causing this, can it?
?
Anything that tweaks crafting or even timed actions could cause this
You're better off just doing the half method
If there's no errors to look at you can't just guess
maybe the new errors are in here?
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
i disabled most of my modlist and it still wont work
achievements are gone
maybe its superb/subpar survivors
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?
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?
oh k
I'm just gonna assume Superb/Subpar survivors is why my character forgot how to tear clothes
New release ItemTooltipAPI
https://steamcommunity.com/sharedfiles/filedetails/?id=2648006337
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.
thanks man ill try to contact the owner of that mod
Yeah thatβs what would be causing it, however, he said he fixed that bug already, so not sure what thatβs about unless this world was running the mod before it was fixed and that stuff spawned already
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?
you think that will remove the items from my save?
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?
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
You can always add one of the vehicle mods that use those parts. Would just need to travel a new part of the map for one of them to spawn.
does the item belong with the jeep mod?
It looks like it, yes, but I don't know for sure personally.
I created a Collection of API mods
if anyone have more suggestion let me know so that i can add it
https://steamcommunity.com/sharedfiles/filedetails/?id=2648023377
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.
@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)
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 π
@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.
This is a good idea
π
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
I'm not a wiki guy myself, so I can't speak for the nuts and bolts of editing the wiki, but the particulars seem to be laid out here
https://pzwiki.net/wiki/Help:Contents
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.
@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
@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.
I did some research on using github to upload automatically to the workshop -- it is doable but would require a steam account without 2FA.
shouldn't be a problem
or do you need a valid credit card/phone number etc? I can't remember
Not sure if it would be viable or worth doing, but would be fun to have an actual community project anyone can contribute to.
indeed
You need to own the game in order to upload to workshop.
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.
With out 2FA I would not advise having personal info on that account.
for sure
Maybe we can use a prepaid credit card
and just have that account named PZ Community or something
Assuming Steam allows for prepaid credit card that could work
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.
Perhaps @iron salmon could smooth the process out?
I'm sure he could
Define "isn't stable"? The game's been in b41 for at least a year by now. 10+ years for the whole project.
@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
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.
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 ?
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.
indeed
Anyone know the key to bring up the console?
think its f6
Wait nvm -debug didn't go through
yea thats the name
Double checking a code snippet
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.
i just care abt tutorials be updated
i have bad memories of outdated tutorials for minecraft modding
tl;dr: People are making mods and guides, the game is changing, people should be aware. ?
they should
Yeah, but an argument could be made that game won't eve be "done"...
So worrying about that stuff is moot.
Well guides should include the game version it was made for
I think he's just overthinking things.
luckily one cannot break something by overthinking about it π
-snip-
Would appreciate any look throughs.
My concern/idea for optimization is some how chunking the list depending on distance.
can you post it on pastebin with lua language enabled?
Sure
will take a look
Whipping up an example use
also i updated the community repo with more ideas
https://github.com/Konijima/PZ-Community-API
Just realized I could make it friendlier to use if it just spawns in the item be default
SpawnerAPI: Allows for pending the spawns of vehicles, items, zombies (with added functions supported) in order to spawn things anywhere in the world. Upon loading the cell in question the item becomes spawned in.
Found here as a part of CommunityAPI: https://github.com/Konijima/PZ-Community-API/tree/master/Contents/mods/CommunityAPI/media/lua/client/SpawnerAPI
Nicely done
ModData.getOrCreate("farSquarePendingSpawns")
does this make it equal to an empty table by default?
interesting