#mod_development
1 messages ยท Page 295 of 1
I'm basing mine off the death angels from a quiet place
Someone found something the other day
Zombies, take on the effects of VisionModifier
So if you put glasses on a zombie, they have a worse vision
However you can't set the value to 0
It needs to be at least 0.01 I believe, but that's still really low vision
Is there a way to disable it instead?
Tho I really don't know how that actually affects zombies
No
Currently
not
I asked for access to the values that affect stealth for zombies
But that'll probably have to wait ...
Dang
Not with modding java, and it wouldn't be a simple mod.
I'd be happy to take on the challenge
The java accepts a list of possible alues for vision/hearing, which are the ones you see in the sandbox options - so no "blind" or "deaf"
I see
I hope someone can maybe help me figure out why my game crashes when doing that... the debug log doesn't seem to log the error that's happening.
EDIT: runs in OnRefreshInventoryWindowContainers(inventoryPage, reason)
if inventoryPage.onCharacter == true and reason == "buttonsAdded" then
local playerObj = getSpecificPlayer(inventoryPage.player)
local backpacks = inventoryPage.backpacks
for key, backpack in ipairs(backpacks) do
local items = backpack.inventory:getItems()
for i = 0, items:size()-1 do
local item = items:get(i)
if item:getCategory() == "Container" and item:getType() ~= "KeyRing" and not playerObj:isEquipped(item) then
containerButton = inventoryPage:addContainerButton(item:getInventory(), item:getTex(), item:getName(), item:getName())
end
end
end
end
How do you mess with zombie values to begin with?
Like I said I'm new to modding
In this case, it's just sandbox options that the java makes use of
One important aspect to Zomboid is the game is spilt into the java engine and the lua scripts & data files. Mods affect the lua code, but to affect java you need people to manually replace files in the game installation; a few mods like better car physics do this but it's rare and undesirable.
Sometimes you can find a crazy workaround, like changing tooltips by swapping ina fake item, letting java populate and render the tooltop, then swapping the item back. Other times you just give up on a mod idea because it hits the Great Wall of Java.
uuuh no idea sorry
I hope the B42 modding tools rectify this issue
sadly probably not
They said that they would be improving it
I do hope they give us access to stealth parameters
Especially specific zombies stealth parameters
They wont, it's a fundemental game design thing - but what will help a lot is when modders make a focused request in the Modding Request channel, because then speciifc java things can get exposed to change.
it's a thread under this channel.
Not really
If we get access to these
That's really good
Or something in this way
That'd be great for us
So these values change the viewcone of a zombie
I meant the general "we can't change java other than through exposed API calls/oublic fields"
But you can't access shit
Yea
But if they expose this kind of stuff to us, that could be very useful to make blind zombies
I think so yeah, they weren't there in B41
Every zombie spawns with Groucho Marx glasses that have a .0001 vision modifier?
hey guys i need help with a lua script
The answer is "tables"
im not familiar with lua scripts but how do i make a new action related to an item appear
That's a supposition yeah that it could work
Because everything is a table.
A Timed Action that makes an item appear you mean ?
And I'm not talking about a recipe either lol
i want to add a book that allows the player to read and gain XP instead of XP multiplier
so im trying to implement an action called "ReadGuide" that adds the XP
Maybe: 1) make invisible turns-you-blind glasses 2) set all zombie outfits to include these 3) on zombie death they are removed from the zombie inventory
Welp idk how books work in the game tbf, but I suppose it's a read book timed action or some shit
yeah its a timedaction
If you don't have a display name, the item doesn't spawn in the zombie inventory (technically it does but it's invisible/doesn't exist for the player)
there's already a mod out there that does something similiar in B41, you could take a peek at how they did it
Blind zombies ? Hell nah
Nah, I mean the "skill literature" that gives XP on reading, sorry should have clarified that
might exist, but not get dispalyed when InventoryPane renders objects... I wouldn;t be suprised if that skips things with a nil DisplayName
Either intentionally or because the code aborts
Yea actually I'm stupid I thought just XP boost but no XP directly, I'd suggest you learn how reading books giving XP boost works and you'll be mostly set for the rest
Yeah it skips it, but technically it still exists yeah
I use it for my zombie models
My Clickers have a custom full outfit model
Look at the skill journal mod
And it doesn't have a display name so it can never spawn in the inventory
lemme show u what i made but i used GPT which obviously made mistakes
It gives XP & recipes via a timed action when read, up to the limit of the character that wrote the journal
Nah I'm not reading that shit mate sorry
its prolly all wrong right haha ik im not gonna use it
I'm not debugging a full on file when the first lines aren't even a timed action
Did you read the timed action for book reading ?
What ?
Skill Journal.
in the scripts folder
??
has a context menu entry that triggers a timed action that reads a book that gives XP.
Check the mod skill journal
Look how they did it - might not be the best way, but it works.
yeah im still new to modding haha
Scripts folder ?
Timed Actions are not in the scripts folder
They are in the lua/shared/TimedActions folder
media>scripts>timedactions, there is a list for alot of timed actions
yeah 'timed action' now refers to two different things at the same time for no reason
They are all over the place, but always under media/lua
wtf is this shit
they define sounds, animations, etc for recipes
thats what im talking bout
what ?
And that's absolutely not what the classical timed action are but now I understand the confusion
I mean
those are a bunch of parameters used by vanilla timed actions, not the actual times actions code
i've been complaining about this
ight ha i get it now
In general, every timed action is in a seperate file in a folder names TimedActions
I mean, those are just straight up a different form of timed action ๐
but could be client/server/shared, could be a directory like "farming/timedactions" or "vehicles/timedactions"
Are they aware of the complaint? Seems like a no-brainer to not have a name collision of concepts for no reason
yeaaaaa idfk, they love to make their life miserable
i haven't raised it since i don't think it's something they did by accident
i can't imagine the motives for it but they did choose to do this
That's a hard mistake to make yea
I think for my mental health I'm just going to pretend it was an accident anyway
--reading glasses are a little faster
local eyeItem = self.character:getWornItems():getItem("Eyes");
if(eyeItem and eyeItem:getType() == "Glasses_Reading") then
time = time * 0.9;
end
Found this while reading through the ISReadABook file in the vanilla timed actions files
does it mean u read faster with eye glasses? haha. if so i didnt know this before
Hello folks! I am new to modding PZ and new to Lua in general; I have a question to try to understand the code a little better. Is the :create method called automatically when an object is instantiated? I am not seeing the :create method called explicitly, so I am curious if that is the case or if I am just missing things.
Lua objects are... well they are tables with an object-shaped disguise on.
Oh, sounds like I am further from dipping my toes in than I thought ๐
there's no special relevance to a :create() function in lua itself but a lot of the base classes the game uses will implement something like that
i think you're probably looking at ui which does do that
Java objects that are accessed through the various API calls... I'm not sure if they all have a create() that is the constructor, I've typically only created inventory items from scratch and I do that with instanceItem("Base.SomeItem")
Made this becuase I play in Debug mode but got sick of having to turn cheats off every time I started the game: https://steamcommunity.com/sharedfiles/filedetails/?id=3411534066
I am specifically looking at the ISFarmingCursor.lua ; I can see it is derived from ISBuildingObject which in turn is derived from ISBaseObject, but I have no idea how the ISFarmingCursor:create gets called.
that would be in ISBuildingObject, create() is called when clicking
the cursor stuff, to be completely honest, is an absolute nightmare
Just put it in the corner with all the other nightmares.
they're all built on top of the build cursor instead of having a generic cursor class to build on so most of them have to have a bunch of extra code to disable all the building stuff ๐ญ
i think the object's isValid() has to have returned true as well
oh my, I see my mistake now; I saw the self:create line, but didn't read the whole clause right that led to it. I saw the ISBuildMenu.cheat and completely wrote it off before noticing the big fat 'or' there 
Thank you!
Guys i still couldn't figure out a bypass method or another method that could make my "spreading trash" code
the code runs with Event.LoadGridsquare.Add()
but as you can see on 5 o'clock and 6
depends on the direction where the character is coming from. some chunks/grids are not loaded so the trash gets stuck within the chunk and does not spread
is there any method to solve this problem?
spreading trash function looks as follow ```
function SpreadTrash(Square)
local RecievedSqInfo = Square;
local PosX = RecievedSqInfo:getX();
local PosY = RecievedSqInfo:getY();
local PosZ = 0;
local SpreadChance = ZombRand(0,10)
-- print(SpreadChance)
if SpreadChance <= 3 then
local posSQ = CalculateAdjacentFloor(RecievedSqInfo)
local isoObject = IsoObject.new(getCell(),posSQ, "d_trash_1_20")
isoObject:transmitCompleteItemToClients()
isoObject:transmitCompleteItemToServer()
posSQ:AddTileObject(isoObject);
end
end
For future info, because I can't do b42 Multiplayer to test it.
If player A's client adds to the mod data for an item (in my specific case, it adds an entry called "CurrentAmmo" to the mod data)
if player B grabs that same item, is the moddata passed?
yeah
there's some bugs with it in b41 multiplayer (generally it works like this as expected though) but i imagine in b42 that probably won't be the case
it maybe could be necessary to add item mod data on the server side in b42
Ok, that won't be too hard I don't think. Thank you for the info.
ugh i must admit Event. OnLoadGrid isn't good idea to use
Any other Event I could use to make my code flow better?
wish there was a onchunkload or something
Damn didn't knew that
Hi guys, anyone has a sort of resource/guide or content where I can look up to learn how to add new traits into the game.
I don't want to do anything too complex, but I'm developing a mod that basically I want to add traits to the items when you equip them, I already kinda coded the trait on item equip functions but now I wonder how can I create new traits...
depends on what you want the traits to do
Sorry not having any help but like.
Why is this something you want?
I'm confused on the purpose
just for fun purpose
I want to make the trash tiles radio active
The best purpose is for fun
so when then spread, the radioactive zones spread
agreed
i mean i managed to get everything to work Except the unloaded chunk spreading part
as you can see from the image, the 12,1 o'clock northern side chunks are not loaded
if the character walks from the south
so they never get spreaded over there
tried to run Events.LoadChunk.Add(LoadChunkforsq) to run before the Events.LoadGridsquare.Add(LoadingSq)
guess it wasn't enough
tried putting Events.LoadGridsquare.Add(LoadingSq) inside the LoadChunkforsq function
and that gave massive lag
here's something I've been working on that i finally released, thanks all that give help here
The TM 31-210 Improvised Munitions Handbook is a 256-page United States Army technical manual intended for the United States Army Special Forces. It was first published in 1969 by the Department of the Army. Like many other U.S. military manuals dealing with improvised explosive devices (IEDs) and unconventional warfare, it was declassified and ...
hits that year requirement for immersion
Someone made a build 41 mod using this exact booklet for the same purpose I'm wanting.
Gonna seek out permission from them for using their assets in my mod, and if not then I'll just try to recreate it using imagery and graphics online about the booklet
I asked but I made a basic one anyway under the assumption they don't respond
so i've run into a weird problem with this, after adding that Icon = line to the crafting script, then making custom icons, now when i craft lets say the red version of the item it doesn't have any icon at all in the inventory. After crafting a tinted version of an item i get an error: ```function: InheritColorFromMaterial -- file: recipecode.lua line # 275 | Vanilla
Callframe at: performCurrentRecipe
function: perform -- file: ISHandcraftAction.lua line # 158 | Vanilla
ERROR: General f:12045, t:1737431924108> ExceptionLogger.logException> Exception thrown
java.lang.RuntimeException: attempted index: getColor of non-table: null at KahluaThread.tableget(KahluaThread.java:1667).```
maybe try doing Icon = Item_line
but after restarting the game the icons are back to normal lol
interesting
do the icons have to be in the same folder as the textures for the item?
then maybe that's the problem here, gonna move them heh
right so now there's the ? sign everywhere
Does DoorDamage on firearms (which is on all vanilla firearms) just, do nothing? lol
i have this in my crafting script Icon = Item_FaceMask_Red,
and this in the clothing script IconsForTexture = FaceMask_Red;FaceMask_Black;FaceMask_White,
it must have something to do with the icons being in a different folder than the textures, but in the base game they have them bundled in .package files and they work just fine anyway
idk how all that stuff works, but for different items i have textures and icons in 1 folder and those work just fine
Remove Item_ from the Icon Line.
Icon = FaceMask_Red,
But don't remove it from the png.
i have it like that in the other stuff that works tho
even the ones that only have 1 color choice work fine
it's just those that have more than 1 color
Oh, weird. I guess I have just been doing it the other way for so long, I thought it was supposed to be like that. lol
I'm not sure, but the icons MIGHT have to be in the base texture folder
sounds like something that would be required lol.
like, the icons work just fine no matter if i leave the Item_ there or not, they appear for the crafting menu both ways
another weird thing is i get an error when crafting the tinted version of that item, but the icon appears for it in the bag
Whats the error from console.txt?
^ this
is there some form of limit for backpack capcity?
i keep trying to make a new backpack 60 but it reverts back to 48 for some reason
you just have to put Capacity = 60, in the clothing script
backpacks cannot have a higher capacity than 50 in b42
is there a way to bypass this?
already did that
i think there's a mod on the workshop that changes a bunch of the lua to bypass it
do u know its name?
i don't
do u mean clothingitem or scripts?
42\media\scripts\clothing and the script that adds the item, but like Albion said you can only make it up to 50
item Infantry_Backpack_Ground
{
DisplayName = Tactical Infantry Backpack,
DisplayCategory = Bag,
Type = Container,
Weight = 2,
Capacity = 65,
Icon = InfantryBackpack,
AttachmentReplacement = Bag,
BloodLocation = Bag,
CanBeEquipped = Back,
CanHaveHoles = false,
IconsForTexture = Infantry_Backpack_Green,
CloseSound = CloseBag,
ClothingItem = Infantry_Backpack_Ground,
EquipSound = EquipBackpackLarge,
OpenSound = OpenBag,
PutInSound = PutItemInBag,
ReplaceInPrimaryHand = Infantry_Backpack_RHand holdingbagright,
ReplaceInSecondHand = Infantry_Backpack_LHand holdingbagleft,
RunSpeedModifier = 0.95,
WeightReduction = 90,
WorldStaticModel = Infantry_Backpack_Ground,
Tags = IgnoreZombieDensity,
}
Did I make any mistakes here?
Funny enough, this has the same issue as vanilla engineer. I forgot to captialize Bomb so it doesn't work
does sending a server command end the function? cause for some reason it's not carrying on with the function
yea you can't have capacity 65, it needs to be 50
so how is it that the base game has icons in the base textures folder, but the textures for the items are in separate folders inside that textures folder, but when i try doing that i get this issue
Ok, anyone have any thoughts on the following, not from a code perspective, but a how fun would this mod be to use perspective?
I've got my ammo type swapping system mostly finished, but I'm taking a break from it and for the moment I'm doing the fun part and adding all the special types of ammo.
I'm working on "Breaching Rounds". It appears that only melee weapons can hit thumpables.
Which would be more fun:
- A timed action via context menu that had the character walk up, put a round into the door and bust it up
- Some sort of collision system that travels out the best it can and trys to find a door to hit within range when you fire a shotgun loaded with breaching rounds?
just make it so you shoot at the door from melee range
no
Like, change Ranged to false?
I am not sure that will behave, but I am INSTANTLY amused by the idea ๐
no idea, i just mean a right click on the doors and select breach from there, and then it plays an animation
Are you giving the models.txt a proper reference to the texture location?
model blahblah
mesh = blahnlah,
texture = foldername/itemname,
oh i'm not, good find xd
thanks
i wish someone would make a battering ram
i didn't have that file at all cuz before i made the custom icons it was just using the base game ones
like the one used by SWAT
would be better than B42's 100 axe swings to take down the police station armory door lol
I'm pretty sure I just saw a mod with that
isn't there a c4 or smh in the game? ๐
Fair enough, honestly all my code is a hodge podge of every other mod ive looked at because I don't really know anything I just see what other people did and try do that too xD
Oh, nm it just has you break doors lol
same lmao
Its good tho, thinking about it for a second made more sense of it for myself, now i can go back and move some models i had seperated for no reason and delete some duplicates. xD
yea if you're using base game models/textures you don't need to have those in your mod folder
well that did nothing unfortunatelly
I AM ABSOLUTELY A FUKING DUMBASS, We are talking about the OnCreate funciton defined on in the CraftRecipe.txt files not for generic any crafting done
Thanks @bronze yoke @winter bolt , aight gunna find a new workaround now 
actually i'm now getting errors when i try using the static model for glasses with that script heh
can someone explain to me what does the "models_clothes" file even do
java.lang.RuntimeException: attempted index: getWorldItem of non-table: null at KahluaThread.tableget(KahluaThread.java:1667).```
i guess it's because glasses don't have a world item? i tried looking for any reference to them but couldn't
If all else fails, import base? xD
@quartz kindle moving here to not flood the gen chat, but if you have the mod downloaded you can find the sprites in the mod files, they are all 16x16
not home currently so I can't check it either haha
Ah okay
my mod doesn't have a lot of files so it shouldn't be too hard to find
if you can't find them I'll just send you a zip later or something
Gotcha. I sent a friend request if you're able to accept a little later. I checked my Zomboid folder in mods and only saw default.txt and reset-mods-41_51.txt but nothing with yours
Still haven't figured out why this refuses to work
have you tried referencing it as HCustoms.Bag_EliteCombatMaxGraffiti ?
you don't usually need to specify module for script objects in the same module but i've noticed vanilla does anyway
I was about to say that
I wouldn't be surprised if you can skip "Base" but not other modules.
Assuming I'd need to change this in both ECB_ITems as well as craft scripts?
no, just the craft recipes
And if that fails... try just putting the new items in Base.
gonna test
ECV_Items already has it - the items are inside module HCustoms { }
originally tried putting them as base with module HCustoms {
imports {
Base
}
thoough prolly didnt do that right ๐
same error
this is being a real pain in the ass
I have an issue where an item's icon won't load no matter what I do
huh. new error this time
Cannot override existing registry id (5639) to new id (323), item: Base.Bag_EliteCombatMaxSunrise
modding for this game has been.. much more annoying than I expected it to be
can someone help me with this? do i need to take all my clothing textures from subfolders and put them in the base textures folder for icons to appear when crafting stuff? i tried placing icons in that folder but that made everything turn into ?
okay im fucking done with this shit
i fix the icon, the model breaks, i fix the mod, the icon breaks
what's your problem, maybe i can help, i have some experience with stuff breaking lmao
okay so for some reason
i change the clothingitem's name from infantry_backpack to infantry_backpack_ground and suddenly the icon works but wearing it shows no model
i make it infantry_backpack again and the model is fine and dandy but the icon is broken
i can dm u my files if u want
maybe u can take a look at tell me whats wrong
sure
Heya all! I'm interested in doing some mod development for Zomboid for fun. I know Lua pretty well and I'm grateful for all the great resources provided in the wiki, pinned messages, and this channel. I'm curious about the particular workflow you'd suggest for developing/testing mods: What's your set up in terms of quickly iterating over changes/debugging mods/testing mods. I know how to set up mods, but how do you quickly test them ingame? What does your setup look like for doing the actual development? Thank you!
has anyone seen this when making vest im new and do not see why my upper torso would disappear when puting on my vest i just made
it's probably using some masks that hide it
face palm
<m_Masks>12</m_Masks>
<m_MasksFolder>media/textures/Clothes/BulletVest/Masks_BulletVest</m_MasksFolder>
<m_UnderlayMasksFolder>media/textures/Clothes/BulletVest/Masks_BulletVest</m_UnderlayMasksFolder>
i removed this lol
yup mystery solved heh
Made Escape From Tarcov
Airframe
Tv110
BlackJack50
ok i solved my own issue, forgot to add "Item_" before the texture name in the texture selector lua ๐คฆ
if ISMusicVehicleMenu == nil then ISMusicVehicleMenu = {} end
if not ISMusicVehicleMenu.oldShowRadialMenu then
ISMusicVehicleMenu.oldShowRadialMenu = ISVehicleMenu.showRadialMenu
end
function ISVehicleMenu.showRadialMenu(playerObj)
ISMusicVehicleMenu.oldShowRadialMenu(playerObj)
ISMusicVehicleMenu.showRadialMenu(playerObj)
end
function ISMusicVehicleMenu.showRadialMenu(playerObj)
local isPaused = UIManager.getSpeedControls() and UIManager.getSpeedControls():getCurrentGameSpeed() == 0
if isPaused then return end
local vehicle = playerObj:getVehicle()
if vehicle then
local menu = getPlayerRadialMenu(playerObj:getPlayerNum())
local seat = vehicle:getSeat(playerObj)
if seat <= 1 then -- only front seats can access the radio
-- print("ISMusicVehicleMenu")
for partIndex=1,vehicle:getPartCount() do
local part = vehicle:getPartByIndex(partIndex-1)
if part:getDeviceData() and part:getInventoryItem() and TCMusic.VehicleMusicPlayer[part:getInventoryItem():getFullType()]then
menu:addSlice(getText("IGUI_MusicOptionsCar"), getTexture("media/ui/vehicle_tape.png"), ISMusicVehicleMenu.onSignalDevice, playerObj, part)
end
end
end
end
end
function ISMusicVehicleMenu.onSignalDevice(playerObj, part)
if not part:getModData().tcmusic then
part:getModData().tcmusic = {}
part:getModData().tcmusic.mediaItem = nil
part:getModData().tcmusic.needSpeaker = nil
end
ISTCBoomboxWindow.activate(playerObj, part)
end```
This script worked in Build 41, but doesn't in Build 42. No errors, just doesn't show
Anyone know any API changes that could be the reason this doesn't work?
self.character:Say(getText("UI_ElectricWeapon_BatteryRemoved_WithCharge", math.floor(currentCharge)))
how to change the word color
What is needed to be added while implementing a new moveable?
i made a .pack and a script file for the items
as well as translations
what else is needed?
the items uses vanilla functions such as cooking
i editted that in using tilez
the objects currently appear ig but cannot be placed
@tranquil reef You can add colors:
```lua
[your code]
```
It will be more comfortable to read.
Ah, you're right. I used to only post code in the Unity discord so I forgot it had support for more than C#
can i still upload b41 even if ive updated to b42 unstable
Yea, it's literally the same files
ISMusicVehicleMenu = ISMusicVehicleMenu or {}
I need help with a moveable. I made the tiles and pack, script and more files, one of the furniture works, but the other does not and cannot be placed
if anyone knows bout adding tiles and such plz dm me
does anyone knows why the size = is not making the worlditem bigger?
Sorry, I did added as Scale =
Can you paste whole model script?
item TheBagofPortella_Back
{
WeightReduction = 95,
ClothingItemExtra = BagOfHolding_Front,
ClothingItemExtraOption = FannyPack_WearFront,
clothingExtraSubmenu = FannyPack_WearBack,
Weight = 1.5,
Type = Container,
Capacity = 80,
DisplayName = The Bag of Portella,
Icon = BagOfHolding,
WorldStaticModel = BagOfPortella_WorldItem,
Scale = 0.2,
PutInSound = PutItemInBag,
BodyLocation = FannyPackFront,
ClothingItem = Bag_FannyPackFront,
CanBeEquipped = FannyPackFront,
ToolTip = Portella,
}
That's not how it works
Everything works, like icon, item, worldstatic etc, just can resize haha
would that be
Model TheBagofPortella_Back
{
No, I created a new texture 2d
it needs to be in BagOfPortella_WorldItem
The texture works, I just can make it bigger, it seems small compared to the vanilla backpacks
So that means you need new model script with model and texture assigned, and then use scale
Did you override texture?
I didn't, this is the only script i have
Because from what I can see you did not made model script.
Wait it's clothing item...
WorldStaticModel = BagOfPortella_WorldItem, is pointing to a model script called BagOfPortella_WorldItem
thats where you need to put the scale
I am not trying to have the texture when I wear it, is just when I drop in the ground looks too small, even the texture being 128x128
So I just need to create a new script with model and then add the scale?
yeah
if you look in the vanilla game media/scripts/models_items.txt you can see what it should look like
you wont need to put a texture in the model though because clothing items have that set automatically
He did mention that he doesn't need new texture on clothing, so he needs to specify texture in model script
Hm, so I understand until the part that I have to create a model script, but didn't get it about the texture cloathing etc
the Model should be the name of my item or the texture file?
module Base
{
Model
Can someone confirm this is a bug or something??
function CF_RemoveCache(character, item)
print(item)
--item:setWeight(item:getWeight())
end
Events.OnEquipPrimary.Add(CF_RemoveCache)
LOG : Lua f:161, t:1737473158362> nil
LOG : Lua f:161, t:1737473158363> Base.KitchenKnifeForged:zombie.inventory.types.HandWeapon@11e44d4
LOG : Lua f:293, t:1737473160563> nil
LOG : Lua f:293, t:1737473160564> Base.BaseballBat:zombie.inventory.types.HandWeapon@5833ac9e
I tried twice (Bare Hand -> Kitchen Knife -> Baseball Bat)
and 4 lines were printed, i have no idea why nil is there.
should be whatever WorldStaticModel is set to
barehands is nil i think
Bare hands seem to be nil. So it is Bare Hand -> Kitchen Knife -> Bare Hand -> Baseball Bat
I mean, KitchenKnife -> BaseballBat also printed
LOG : Lua f:293, t:1737473160563> nil
LOG : Lua f:293, t:1737473160564> Base.BaseballBat:zombie.inventory.types.HandWeapon@5833ac9e
so do they basically do this
knife -> hand -> bat
oh
it makes sense..
yeah the character puts away the weapon and then equips the new one
but still i don't understand because event is OnEquipPrimary so bare hand is not something that can be equipped i think??
Thanks a lot
dropHandItems() for example does setPrimaryHandItem((InventoryItem)null) (setPrimaryHandItem() triggers OnEquipPrimary)
If I wanted to add a metalworking recipe where could I do that?
Hey @spiral egret by any chance are you able to get those PNGs to me?
yep nice timing lmao, I tried to message you just now but your DMS are closed
oh shoot sorry
I have it set to friends only
ill change it
Try now?
@spiral egret
How do you update a mod without overriding the workshop description?
what even is that handbook
The TM 31-210 Department of the Army Technicial Manual, Improvised Munitions Handbook

It's a official us military handbook regarding manufacturing explosive material & propellents, along with improvised grenades and bombs.
Written in 1969
yea I checked it out
Declassified as part of the freedom of information act
guessed so yea
I have a pdf of the handbook if you want, I'm looking through it as reference for possible weapons to add in a mod ๐
I already found it lol
as neat as it would be to have a directional bomb that you set down and ignite to kill zombies in front of you, I'm not sure of a way to have the damage be a cone instead of a full circle
To easily check in a cone
yeah but I wouldn't know how to attach that to the grenade's damage in any way
Just don't use the typical explosives from the game
How can one play a sound withot a regard if player is in-save (aka has character). I know you can play a sound with
player:playSoundLocal("name"); but how does one play it without player?
playSoundImpl
Some shit like that
Give me a sec, I'll find a better example
local emitter = getWorld():getFreeEmitter()
local square = door:getSquare()
emitter:playSoundImpl("DoorCreek"..tostring(ZombRand(1,16)),square)
With the string, your sound script
i dont think that would work in main menu, no?
Nop
ye that's what im saying
For that, check the main menu music framework
getSoundManager():PlaySound()

In case you need a working example
https://steamcommunity.com/sharedfiles/filedetails/?id=3173081439
Do you know what happens to emitters of zombies that die ?
nothing i think
Bcs I set custom emitters for my zombies, however when they die, sometimes the emitter continues to play
Yet
When zombie dies
I stopAll its emitter
I think I just fixed it by checking OnTick if the zombie is dead and forcing it to stopAll
nah nvm
so I'm using this as template, anyone knows why it crashes my modOptions?
local ETW_config = {
...
SoundNotificationSoundSelectComboBox = nil
}
local function ETWConfig()
local options = PZAPI.ModOptions:create("ETWModOptions", "ETW - Evolving Traits World")
options:addTitle("Evolving Traits World")
ETW_config.SoundNotificationSoundSelectComboBox = options:addComboBox("SoundNotificationSoundSelect", getText("UI_ETW_Options_SoundNotificationSoundSelect"),"")
ETW_config.SoundNotificationSoundSelectComboBox:addItem(getText("UI_ETW_Options_Sound_B42"), true)
end
ETWConfig()
Intelisense not picking up addItem as existing thing
Check the wiki page
You'll find better explanation of mod options
OOoh
nah nvm
Usually a crash of mod options tend to be linked to an empty string box
But you're not using these here anyway
what do you mean by 'crashes my mod options'
๐
mainb menu UI won't load because it throws error when generating mod options UI
java.lang.RuntimeException: No implementation found at MultiLuaJavaInvoker.call(MultiLuaJavaInvoker.java:112).
Stack trace:
se.krka.kahlua.integration.expose.MultiLuaJavaInvoker.call(MultiLuaJavaInvoker.java:112)
se.krka.kahlua.vm.KahluaThread.callJava(KahluaThread.java:192)
se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:988)
se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:173)
se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1963)
se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1790)
se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
zombie.Lua.Event.trigger(Event.java:81)
zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:281)
zombie.gameStates.MainScreenState.enter(MainScreenState.java:359)
zombie.gameStates.GameStateMachine.update(GameStateMachine.java:135)
zombie.GameWindow.logic(GameWindow.java:372)
zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:76)
zombie.GameWindow.frameStep(GameWindow.java:917)
zombie.GameWindow.run_ez(GameWindow.java:810)
zombie.GameWindow.mainThread(GameWindow.java:610)
java.base/java.lang.Thread.run(Unknown Source)
LOG : General f:0, t:1737487789063> -----------------------------------------
-----------------------------------------
Callframe at: se.krka.kahlua.integration.expose.MultiLuaJavaInvoker@793dbd07
function: addModOptionsPanel -- file: MainOptions.lua line # 3582 | Vanilla
function: create -- file: MainOptions.lua line # 645 | Vanilla
function: instantiate -- file: MainScreen.lua line # 718 | Vanilla
function: addToUIManager -- file: ISUIElement.lua line # 1138 | Vanilla
function: LoadMainScreenPanelInt -- file: MainScreen.lua line # 2149 | Vanilla
function: LoadMainScreenPanel -- file: MainScreen.lua line # 2058 | Vanilla```
That error looks like a classic error I had, tho I don't remember the exact reason
WAit I have to add to ID
i don't know if this would cause it but why do you have a combo box with only one option?
idfk, dhert was first one to figure new options so I jsut followed his stuff 
yea checking it now
It's the result of all the researches others did, and my own on the subject
It should detail everything you need to know
Tho don't hesitate if you think something could be added
Can I make this like.... not 1 ugly line?
item 1 [Base.Basil;Base.BlackSage;Base.Plantain;Base.Broccoli;Base.Cabbage;Base.Carrots;Base.Cauliflower;Base.Chamomile;Base.Chives;Base.Cilantro;Base.Corn;Base.Comfrey;Base.CommonMallow;Base.Garlic;Base.Greenpeas;Base.Hops;Base.Kale;Base.Lavender;Base.Leek;Base.Lettuce;Base.Marigold;Base.Onion;Base.Oregano;Base.Parsley;Base.RedRadish;Base.Rosemary;Base.Roses;Base.Sage;Base.Soybeans;Base.Spinach;Base.SweetPotato;Base.SugarBeet;Base.Thyme;Base.Tobacco;Base.Turnip] flags[AllowRottenItem] mappers[map1] mode:destroy,
its only for items that aren't in the basegame collect seeds recipe, so if i dont think theres a tag that would capture all this stuff but not double up the base recipe. Oh well, guess ill just have to deal with it.
Yeah they aren't, its not ment to make sense but getting seeds from everything was popular enough in 41 so I redid it for 42 stuff.
you can't use functions for these anymore
๐
in vanilla it was only used for tags anyway so they don't need it anymore
They must be working for the ultra wide screen companys ๐ญ
in vanilla sure, in mods you can most definitely find more uses tho
Any documents for modding ui?
Just pain and suffering
If I do something to add a tag to all the base veggies etc i want to include will that conflict with other mods that touch the same items, like will we just overwrite each other in the load order?
There is a guide actually
Idk how good it is tho
I plan on making that damn wiki page but that requires a lot of time for me to test stuff out, learn how to make UI and make a proper wiki page
But that looks like a decent guide from a quick glance
Anyone know if there is a flag or option or whatever in the Recipe syntax to require a magazine to be empty?
I don't think anything in vanilla requires this... but I can hope.
Oh, just thought about Recipe.OnTest. I might be able to do it there.
so the update killed all mods with recipes? anyone knows what changed?
java.lang.Exception: unknown recipe param: itemcount at InputScript.Load(InputScript.java:545).
ok without -debug i can atleast get in but its throwing errors like hell.
The Exhausted moodle now looks LESS like an anime wifu in heat.
Hey guys me and my buddy were trying to retexture some cars for fun and realized that somewhere there is a script randomizing the color instead of using a texture for the body any ideas where i should look to make it just use the texture we create
in vehicle
{
texture = Vehicles/texturename,
}```
will this just overide the random colors
if you have one declared it will only use this
this is way better actually
my biggest complaint is how desaturated all of the new moodles are so im glad they made them more colourful
i love this one lol
How do I configure the distribution for an item spawns in large quantities?
function IsoAnimal:checkForChickenpocalypse() end
LOL
module MoreBags
{
item Blackjack50
{
WeightReduction = 75,
Weight = 1.5,
Type = Container,
Capacity = 80,
DisplayName = Blackjack50,
DisplayCategory = Bag,
CanBeEquipped = Back,
IconsForTexture = penetratoricon,
OpenSound = BackpackOpen,
CloseSound = BackpackOpen,
PutInSound = PutItemInBag,
ClothingItem = Blackjack50,
BloodLocation = Bag,
RunSpeedModifier = 0.94,
AttachmentReplacement = Bag,
CanHaveHoles = false,
ReplaceInSecondHand = Blackjack50_LHand holdingbagleft,
ReplaceInPrimaryHand = Blackjack50_RHand holdingbagright,
WorldStaticModel = Blackjack50_Ground,
}
{
texture = Vehicles/texturename,
}
}
would this be how i would add multiple textures to my item
yeah i know i wanted to add multiple to my item lol
as well
{
texture = textures/texturename,
}
so change vehicles to this??
texture= is already accessing the textures folder
{
texture = 90sBlackjack50_Diffuse,
}
{
texture = DPMBlackjack50_Diffuse,
}
{
texture = FecktarnBlackjack50_Diffuse,
}
{
texture = MTPBlackjack50_Diffuse,
}
last time i ask soo this is good thank you for your help
?
yea
trying this method because my other one did not work for the bags but it did for vest
where i duplicated the texturechoices on my vest and it worked
well added multiple lines
yea but you wrote at first about car textures, so i thought it was about that. for clothes i dont know if that works, sry.
right np testing now
you need to change "AutoLearn" to "AutoLearnAny" on your recipes
thank you @tacit plover
guys, did they change something with itemcount ?
yeah, you need to add it inside a flags parameter now, so it should look something like this flags[ItemCount]
unknown recipe param: itemcount
my game is crashing and i've removed them one by one
oh
thank you ๐
For anyone wanting a list of changes, and if anyone has other changes for modding that happened, please share them to be put in the wiki
btw so, unless I unsubcribe them manually, my game will keep crashing right?
why didn't they improve this ๐ญ
So what was the writing before exactly ?
So I can add that in the wiki too
item 1 [Base.KATTAJ1_TacticalFlashlight] mode:keep flags[NotEmpty] itemcount,
oh, it used to be just "itemcount", without any parameters
yeah, like that
you can open your game without -debug mode
so instead of itemcount it's now flags[ItemCount] ?
your game wont crash instantly, then you can just update your mod
yeah!
done
how,, i mean i didn't know it's an issue of debug mode. because i always play my game with debug mode is enabled.
thank you again anyway โค๏ธ
can not seem to get multiple textures
thank god
if you right click on project zomboid on steam, you can go into "Properties", then you should see "-debug" as a launch option, just delete that and it should work
but, you'll lose your debug tools
Yep i knew xD but i was quite surprised it's only happening on debug mode, i didn't even imagine.
ohhh okay, maybe its easier to check crash logs i guess? 
wish there was a way to disable it tho
This might interest you, I think that's the flags for the crafting
Changes to the crafting flags
oh, CanBeDoneFromFloor is back, that's nice
ooof, that explains why I can't start the game...
hope dev doesn't think this is easier way... i believe this is a small issue from unstable version, that will be fixed soon.
anyone have any ideas why this method of adding multiple textures to my bag would work for my vest mod but not my bags
added it to each xml too
really trying to make multiple bags just for the texture
Failed to load asset: AssetPath("CanadeModel)
How is it failing? It's the same model that you see on the ground in the screenshot?
{
DisplayName = Can Bomb,
DisplayCategory = Explosives,
Type = Weapon,
Weight = 1.5,
Icon = Canade,
ExplosionPower = 90,
ExplosionRange = 7,
ExplosionSound = PipeBombExplode,
MaxDamage = 0,
MaxHitCount = 0,
MaxRange = 10,
MinDamage = 0,
MinimumSwingTime = 1.5,
PhysicsObject = CanadeModel,
PlacedSprite = constructedobjects_01_32,
SwingAmountBeforeImpact = 0.1,
SwingAnim = Throw,
SwingSound = PipeBombThrow,
SwingTime = 1.5,
Tooltip = Tooltip_Trap,
UseSelf = TRUE,
WorldStaticModel = CanadeModel,
WeaponSprite = CanadeModel,
}```
model CanadeModel
{
mesh = weapons/Canade,
texture = weapons/Canade,
scale = 0.35,
}```
don't understand why it's registering the model for worldstaticmodel but not WeaponSprite?
haven't had this issue with weapons before
if a java variable is declared as public, do I still 100% need a setter function to affect it in lua
A field ?
If the field is exposed, you can access it
You can't do that
kahlua doesn't expose fields
You need a setter for that
I figured
TIS exposing every value needed for custom animals besides the one that makes hostile animals possible
i think its searching for an actual model file called CanadeModel
There's a function that you can call to have the animal fight something, but it moves to you and then doesn't do the attack since it still depends on that attack timer lol. There's also an "attack time" variable in the animal definitions but that does nothing
Hoping they just forgot to make those two affect the same function rather than, the animal definitions one does something mundane and they have no plans to expose anything else
im assuming PhysicsObject is the one that needs a model path but ive never touched weapons so i have no clue
isn't physicsobject just a texture
oh yeah i guess its looking for a texture path then
how would I go about ensuring a gas can is empty before use in a recipe? or - better still - is there a way to get the fluid mixing system to produce a new item?
oh - found something that does similar. Looking in
no because it's not showing in my hand, and changing the weapon sprite makes it show the different weapon model
also it's displaying the model when throwing it, which is what PhysicsObject seems to handle
Also it shouldn't be, as I have had weapons referencing the model txt, with a different name from the model
oh wtf
that's what that error indicates either way
something is looking for a file called CanadeModel
might just have to change each one until you narrow it down
It's weaponsprite, I know because if I change it then it doesn't spit out the error
also cuz it's loading the ground and projectile model, but not in hand
Maybe it's because it's a throwable weapon specifically?
Lemme try something
Lil warning to modders, to anyone whom as a recipe mod in B42, last update broke compatibilities with mods with recipes
It'll cause a script loading error that makes the games unlaunchable
they changed the property "AutoLearn" to "AutoLearnAny", if that can help
thus making a parsing script error
There is also a change to the way they do itemcount
and for some reason you can load in normal mode (with errors) but teh game will crash in debug mode.
So load in normal mode, disable mods that have recipies, then you can start in debug mode.
the item count?
did they intentionally make all crafting recipes the same color in that b42.1 update, no matter if you have the required materials or not?
You don't even have to load in, you can just delete any "mod = xyz" line in default.txt in your user/xyz/zomboid/mods folder.
*falls to my knees in despair* oh god but i have so many recipe mods
To put a positive spin on things: we now have a good example of why the new folder structure exists when people ask about it! Separate recipe files for B42.0.2 and B42.1.0 are possible.
i'm sorry x)
Not all of them will be broken, just 90 to 98%.
*gives a thumbs up, through tears*
it's alright... just like B41 to B42
I am glad they are still working on the core recipe stuff, just would have been nice to not crash the game when parsing a recipe from yesterday.
yeah only 2 mods ive got used itemcount anyway so simple fix for me until they fix themselves.
or a mention of it in the changelogs, for modders
Changes to recipies in B42.1.0: https://pzwiki.net/wiki/Modding#Modding_changes
Recipe Scripts
AutoLearn to AutoLearnAny
itemcount to flags[ItemCount]
hey all how can I move really fast in debug mode?
Oh, it's on the wiki ! never thought of looking about it there, i meant the actual changelog of the update
thanks
okay, so. theoretically, if i go into the script files of any mods that have AutoLearn or itemcount, and change them to the new scripts, would it fix it?
i did that for itemcount and got 2 working so yeah, not sure of autolearn but probably.
If your recipes are totally custom i'd say it's a good start
can someone pin that link? I feel it is ging to get asked about a lot
it'd be a simple find and replace, right? okay let's see how this goes 
mine are fixing the actual game recipes, so i'm currently going through every fixed recipes and looking line by line what changed
did TIS modified the wiki, or is it one y'all?
to me, to know for future updates
yep, just do a replace in every recipe script then run the game to see if you missed any. run from bat or chexk the console.txt after to try pinpoint which recipes are still borked
yeah no I even included a version of the model that matches the asset name it's searching for and it just doesn't work
wth
i'm really curious about the quotation mark in your error
that would imply it's trying to load a file called "CanadeModel
i don't really get how it could get that from anything you've written
I think it's an issue with thrown weapons specifically, as in b41 all throwables just used the molotov model
swapping the weaponsprite with PipeBomb works perfectly fine, I don't understand what is different between the vanilla model and mine?
I haven't had this issue with melee weapons
all recipe mods seemingly fixed, just by doing a simple search and replace
(went through and fixed everything i had from the workshop, by just using windows search in workshop folder for itemcount and AutoLearn and then used notepad++ to find/replace all instances with the new terms flags[ItemCount] and AutoLearnAny) though since it's a simple fix, i guess they'll get updated by the mod authors themselves soon enough
If anyone has anything to add as changes, don't hesitate
I may just have to give in and make the held model one of the existing throwables, the actual thrown and ground models would still be the cans tho
hi everyone! I'm new to modding PZ. I was wondering if anyone knows how to hot reload Lua scripts to test changes. I'm testing a few methods now and update with my findings any case 
you can reload files from the debug menu (f11, on the right)
ty
Community debug tools also make it a bit easier to reload multiple files, and not have to constantly search the file you want to reload
Do that, and tell yourself you'll fix it later then move on and never return to it.
That's what I'd do anyway.
I don't even think I could fix it
Nothing is visually wrong, and the error doesn't even make sense
๐ตโ๐ซ
jfc, i have a new issue with my mod, everything worked just fine, and now it doesn't again, and this time there's literally nothing different about one item or another, but one is working as intended, and the other one picks texture at random
We love mysterious inconsistent bugs
seriously what's wrong with this thing ๐ญ local maskRedTex = getTexture("media/textures/Item_FaceMask_Red.png") local maskBlkTex = getTexture("media/textures/Item_FaceMask_Black.png") local maskWhtTex = getTexture("media/textures/Item_FaceMask_White.png") this is the lua part for a mask, local skrtRedTex = getTexture("media/textures/Item_Skirt_Tiny_Red.png") local skrtBlkTex = getTexture("media/textures/Item_Skirt_Tiny_Black.png") local skrtWhtTex = getTexture("media/textures/Item_Skirt_Tiny_White.png") this is for the skirt, they are copy paste the same thing just with changed names, and the skirt one doesn't work
try testing using the mask textures for the skirt and seeing if it still happens
That small update on moodles made me sweat anyway 
the icon gets picked correctly, just the item texture goes random
what does the function look like
wdym
for setting the item texture
a few mods have been flagged up as incompatible with b42 despite being, you know. compatible. is there any straightforward fix for this? i've seen a couple of options (changing the mod.info file, redoing the common/42 folder structure) but so far nothing seems to work
it does say they're only available in debug mode but they don't seem to load in even when activated 
does the skirt item use a model or a texture on the character?
it's on the character
yeah that text is a lie, there is no such feature
oh man thank you so much !
i dont know how those functions work cuz i dont know lua at all
its because clothing items use basetexture for items on the character model but texturechoice for modelled items
it trips me up all the time lmao
good to know, i'll keep that in mind for future, thanks!!!
i also get an error when crafting a tinted version of the skirt, i have this line in the crafting script OnCreate = Recipe.OnCreate.InheritColorFromMaterial,, i copy pasted it from the base game skirt
what does the error say?
java.lang.RuntimeException: attempted index: getColor of non-table: null at KahluaThread.tableget(KahluaThread.java:1667).```
it's something about inheriting color from material
and the thing is it works just fine, it just gives an error
i would guess it could have something to do with skirt i'm using as a base is lets say black, but the thread is lets say red?
the new skirt turns black like the old one
With the new major patch for B42, is the HitChance field in the items_weapons_firearms.txt file now repurposed to the chance to damage? If not, where can I find the damage chance values?
it seems i figured it out, was missing " flags[InheritColor]" in the crafting recipe next to the material i was using as a base for the skirt
function ISCharacterScreen:hairMenu(button)
local player = self.char;
if player:isFemale() then
hairMenu:addOption("Grow Long", player, ISCharacterScreen.onCutHair, "Long2", 10);
else
hairMenu:addOption("Grow Long", player, ISCharacterScreen.onCutHair, "Fabian", 10);
end
end
this is a shortened version of the whole code, but its this part in particular that i wanted to ask about. in the beard menu function ive been able to add "Grow Beard" to the longest setting but I havent been able to get "Grow Long" (hair) to work (the above code)
no matter what I do, it won't show in the hair cut menu, i've made sure that no other mods are overwriting it, so i wonder where im going wrong?
its for MP server btw, i dunno if that changes how player = is
heard that a lot of recipes broke after the new update, any info on what broke them?
mostly itemcount
interesting, the one it is flagging on launch for me only has a single item in and out
Your Honor, I Pledge "Oopsy Daisy"
anyone know how to set snow on the ground in debug mode?
Not sure but you might be able to start a blizzard in the climate debugger shrug
Looks like plumbing changed too. :/
plumbing has not worked in any version of b42
what do I need to do to add a tile in the game as a crafting station
as in workbenches
probably a tag but dont look at me i dont know anything ๐
@tacit pebble
"- If it is too dark to read but the character is inside a vehicle it will be possible to read as long as the vehicle's battery has charge." - 42.1.0
Shortest mod life span speed run ๐
They mentioned something about snow in the update
If it's winter, ability to set snow on stuff or some shit like that
But general, for everything
no problem because they have changed it from java side mean, they did more than i expected.
they have changed how to check for darkness so we can craft something inside vehicle too. (not tested yet tho)
Don't even mention skizoo mod that got insta put in PZ lol
Hell yeah, my next idea is turning open truck beds/car hoods/etc in craft surfaces so gonna look into how they make those
What one is that?
Remote control tv stuff
I think you're fucked for that actually
Did they?
I believe the check for surfaces is hard coded. However you might have to plug into the crafting UI directly
Yea
whoa cool
Yeah my naive idea was use the mechanics area checks to force allow a a craft if I can
If someone is around and able I could use some assistance. I am trying to setup LuaCAT, and using VS code, but when I open the Lua Addon Manager and search for Umbrella, nothing show up, in fact nothing shows up at all it just says "nothing to show" not sure if I am doing something wrong, simply following the instructions from git page.
ah wait, it finally decided to show.
Hey CBF, I know your discussion on this topic is over 2 years old, but it's digging in the exact area I'm looking.
I'm trying to fix a bug with one of the broadcast codes at runtime (so I don't have to replace the entire RadioData.xml file, which would be extremely fragile when the game is updated).
Any idea if this is possible or the data structure which contains the line entries isn't exposed and thus can't be modified at runtime?
The more I look at this the less I think it's possible.
Yea you need to wait for it to load
its working just took way longer than I expected.
No clue if what I am working on will work, but we will see I suppose.
It takes longer than the stable version to load in the list
Hello, I just created my first mod, and I'm still new to this field! I haven't seen a mod like this (or maybe I missed it), so I decided to make one. Let me know what you think, how I could improve it, or if a better version already exists! Thank you so much for your feedback or any other suggestions. ๐
Link : https://steamcommunity.com/sharedfiles/filedetails/?id=3412325553
That's nice !
Thanks a lot !
๐
is there an API reference somewhere?
lmao, I did something similar around 2 days ago. Now it's being tested on a server
Wow is so cool !!! are you going to share it?
here https://steamcommunity.com/sharedfiles/filedetails/?id=3410862525, to add new markers you don't need to republish the mod, just need to use the UI.
thanks a lot !
very good mods
Can I ask for help?
I'm trying to make a translation of a mod, but I'm getting strange characters in the text. What is this related to? How can I fix it?
ะพัะบัะพะน ะฒ ะฑะปะพะบะฝะพัะต, ะฒัะฑะตัะธ ะคะฐะนะป > ะกะพั ัะฐะฝะธัั ะบะฐะบ, ะธ ะฒัะฑะตัะธ ะฒะฝะธะทั ะะพะดะธัะพะฒะบะฐ > ANSI
๐
sorry to bother you but how to add textures to the marker with your mods?
https://github.com/eI1on/pz-map-marker-system/blob/e742ba7d2fec8f743a724dc80e5221eb812fd697/Contents/mods/MapMarkerSystem/media/lua/client/MapMarkerSystem/Client.lua#L38-L41 self:drawTextureScaledAspect plus I'm also scaling depending on zoom
Wiki
Sorry if I didnโt explain myself well earlier, what I actually meant to say is this im referring to this specific point ๐
Is it necessary a texture or can I test it with mesh = and my 3d model first?
Sorry
, I thought you meant in code. Simply the path to any texture in the game and/or any mod. For example I left a picture in the mod. Type media/ui/quest1.png and when you hover over the modal's input for the texture it will show up as preview.
thank you very much I will look, and no problem I should have clarified โค๏ธ
Hello all!
Is there a mod that tells you which track is currently playing? I want to replace the soundtrack in Zomboid but I'm unsure of which tracks are unused or not.
i kind of remember this mod doing that but i havent used it in a while so i'm not sure
https://steamcommunity.com/sharedfiles/filedetails/?id=3394050851&searchtext=volume
Thanks, spongie! I'll give it a try.
random question how would i go about reverting the butter changes for shits and giggles
i never got to exploit the glitch
Change the recipe
B41 - ANSI
B42+ - UTF-8
Has anyone checked if the AnimSet system works now?
Is this true yet, for B42? I don't see any changes in the Translator class that would indicate this is already the case (unless I'm missing something elsewhere)
I remember nasKo reacted with a checkmark when someone asked if it would be done, but I thought they were still using the old encodings as of now. I'm doing mod development on B41 still (because multiplayer) so I haven't checked ingame
e.g. RU/language.txt
VERSION = 1,
text = Russian,
charset = UTF-8,
Ah, didn't check the actual languages. Good to know, thanks!
Argentinian Spanish, Catalan, Czech, and Korean were left out ๐ค Hopefully those are updated at some point too
It's UTF8 only now
The files for the languages I mentioned suggest otherwise
Looks like you need the mod_support channel.
This one is for developing mods.
misclick ๐ข
didnt relize sorry
- Lowered the amount of zombies in the Forest by 5
Five what? Five individual zombies were removed?
They were bad zombies

fuck those 5 zombies in particular

Has anyone figured out how to make a new item act like Whistle/Harmonica and add new sounds when using/equiping the item?
Harmonica has something called ShoutType = BlowHarmonica, I thought it had to be a sound script somewhere but I can't find, looked around in the lua folders too, didnt find anything
/5 lol
I like to the think the devs personally join your game, run into the forest, shoot five zombies, then leave.
---Adds xp boosts from a trait to a player
---@param traitName string
local function addXPBoostsFromTrait(traitName)
local player = getPlayer();
local trait = TraitFactory.getTrait(traitName);
local xpBoostMap = trait:getXPBoostMap();
if xpBoostMap then
print("-------- XP Boost Map: ", xpBoostMap, type(xpBoostMap));
local table = transformIntoKahluaTable(xpBoostMap);
print("-------- XP Boost Map (table): ", table, type(table));
for perkName, boostLevel in pairs(table) do
print("-------- applying boost to traitname: ", perkName, " boostLevel: ", boostLevel);
local perk = PerkFactory.getPerkFromName(tostring(perkName));
local currentBoost = player:getXp():getPerkBoost(perk);
local newBoost = math.min(currentBoost + tonumber(boostLevel), 3);
---@cast newBoost integer
player:getXp():setPerkBoost(perk, newBoost);
end
end
end
java.lang.RuntimeException: __add not defined for operands in addXPBoostsFromTrait at KahluaUtil.fail(KahluaUtil.java:82).
?????
local newBoost = math.min(currentBoost + tonumber(boostLevel), 3);
I literally convert it to number

print boostLevel
check above
all correct
-------- XP Boost Map: {Doctor=1} userdata
-------- XP Boost Map (table): table 0x1027227740 table
-------- applying boost to traitname: Doctor boostLevel: 1
boostLevel is type userdata

local newBoost = math.min(currentBoost + tonumber(tostring(boostLevel)), 3)


it's funny sometimes
I pretty much never done scripts, I can list multiple entries, right?
like
module Base
{
sound ETW_b42
{
category = Player,
clip
{
file = media/sound/levelup.wav,
}
},
sound ETW_b41
{
category = Player,
clip
{
file = media/sound/b41.wav,
}
},
...
}
of course
ah, supposed to be no comma
I don't think getSoundManager():playUISound(str); is workign in main menu unless I'm doing something wrong 
local buttonFunc = function(_,button)
local soundTable = {"ETW_b42", "ETW_b41", "ETW_TLOU", "ETW_SkyrimSkill", "ETW_SkyrimLevel", "ETW_Oblivion", "ETW_Diablo2", "ETW_Witcher3", "ETW_FalloutNV", "ETW_AoE3", "ETW_WoW"};
local idx = SoundNotificationSoundSelectComboBox:getValue()
local str = soundTable[idx]
print(str)
getSoundManager():playUISound(str);
end
I have this func that fires when button in mod options is pressed
It correctly prints which string it should play
but it aint playing anything 
an example
neither do I 
i think category is for volume grouping
Oh ye you're right
the advanced volume screen uses them for the tabs but thats inaccessible now without mods so it might just be unused?
hm I'm looking at playUISound used in game code and it looks fine, idk why it doesn't work on my end 
remove the commas after the sound blocks
which one as example?
nothing works
can it be because pressing button plays a vanilla sound?
And sound manager can only play 1 maybe? idk
Unless yesterday's patch changed it, don't think so
not intentional, just a bug from the new crafting system
well that sucks
technically you can override the entire file it's defined in
Ah right, forgot about the whole Capgras solution
I prefer to avoid overwriting as much as possible, but sometimes you just have to
Yeah for the recipes it seems you have to
I think my sounds are straight up not loaded
Is there an alternative debugger instead of the F11 thing?
I'm seriously starting to loose brain cells trying to figure stuff out
Is there a way to somehow check im my sounds are loaded into the game?
printouts 
Awesome
try printouts
in console.txt it prints out each script file as theyre loaded so you can just ctrl+f for the name of yours
When people make cars do they not use guids
no
Anyone knows if a skill book can give experience multipliers to two skills? and if not, is there a way to give experience multipliers via on-use?
Does anyone know how I can make that the clip of my gun spawn is already loaded?
you might be able to add an OnCreate to the item and then fill it with ammo in the function
What is the common folder for?
its meant to be for assets like textures and models that dont need any version specific files
Professional software engineer here. Looking to work together with an experienced modder as I've never modded pz before; however, I have experience modding DayZ and I know a functional amount of Lua & Java.
Is there a lua version of continue? Need it for a for loop
no
you can do this bullshit if you really want to:```lua
for i = 1, whatever do
repeat
-- put the entire loop body in here
-- in this scope, break behaves like a continue
until true
end
what kind of animation would correspond when the zombie falls to the ground when pushed by the player?
I want to track when a player's push to the zombie is successful if that animation is triggered, otherwise, if he pushes and does the other animation, the one where he goes back a few steps, don't register anything.
Yeah idc about that, honestly fits the modding experience so far.
So I guess I will be forced to break at the end then to continue the for loop?
no, the repeat block will only happen once per loop no matter what
since the condition to terminate it is always true
Ohh yeah... I totally misunderstood that, thx xD
You want to order the container btns which are interestingly called backpacks?
Floor: I don't think so.
Now I understand why that one guy just took the whole Inventory Page and overwrote it
Hello there, what should I do when PZ warns my about my vehicles parts-containers with logs like: "ItemPickInfo -> cannot get ID for container" ?
ItemPickInfo -> cannot get ID for container: ATAInteractiveTrunkFront
Hey it works quite well and I find it ok to read ๐ญ
I write it this way
for i = 1, whatever do repeat
-- put the entire loop body in here
-- in this scope, break behaves like a continue
until true end
So it's better to read
i agree you should probably do it that way but i like to write it out on separate lines when showing it to people for the first time since it's a lot easier to figure out what it's doing
That's fair
i'm trying to remove an event but it still fires; maybe because it is a local function?
Depends how you're trying to do it yeah
That can be a problem
if you want to remove an event listener you need to have a reference to the listener
if it's a local in another file you can't get it very easily
it looks like this
Events.OnHitZombie.Remove(OnHitZombie)
Events.OnHitZombie.Add(OnHitZombieAddOptions)
but now both are firing
Is OnHitZombie in the same file as the line removing it ?
local old_add = Events.OnHitZombie.Add
Events.OnHitZombie.Add = function() end
require("path/to/other/file") -- e.g. require lua/shared/MyFile.lua as require("MyFile")
Events.OnHitZombie.Add = old_add
this will prevent the file from adding any listeners to that event
your file needs to run before the original file, that can be done by making it earlier alphabetically in b41 or by mod load order in b42
It won't work to use remove the same way?
Tho that won't even work properly in B42 right ?
Based on what we had discussed the other day with load order
No not nice actually 
ah, and users have to set it right... I'll stick to events for my timing.
Albion kind of convinced me that the way it loads now is actualkly terrible
Yup, now it's users fault if load order is wrong
Still beating IT for every scrap of performance I can get from it
Realized the grids were deriving ISPanel for no reason and had 100% overdraw as a baseline
Is there any way to give an item its own ID or number assigned to it? I am trying to differentiate from different types of guns and I do not know how to tell the difference between two identical guns such as two m9s
So, they are the same item right?
The backing Item data will be identical, but for the InventoryItem instance you could put some info into moddata.
Also, InventoryItem's have ids already, which are all unique.
item:getID() is likely all you need
anyone know how to make a new isoRoom and add it to a building and add tiles to it?
Uuuh
That's a very interesting question
there doesnt really seem to be any options to modify one. i can make a new one but then cant set any properties for it
from all of my research i have concluded that you probably can't
so i'll be making and tracking everything myself then, thank you
New changelog for modding
You can find a list of changes that were found and that were listed on the modding page. The format for it might change in the future. If you found any changes that need to noted, please don't hesitate to edit the wiki page
good evening, I'm trying to test my mod but I can't find it from the mods menu in-game. What could I be missing? My mod is under C:\Users<<myUser>>\Zomboid\mods\MyMod and the structure looks like
MyMod/
mod.info
poster.png
media/
lua/
client/
<<.lua files>>
Hi! In B42, does anyone know how the position of scrollbars is calculated when adding them to a ui panel via "self.myPanel:addScrollBars()"? Also, is there a way to access the scrollbars somehow and change position using commands like "scrollBar:setX(x)"?
Anyone know if there's a robust way to modify existing entries from RadioData.xml?
The only way I seem to be able is to replace the whole file, which is quite fragile when the game is updated.
I see how ZomboidRadioDebug.lua accesses the entries, but:
- It utilizes getValidAirBroadcastDebug, a debug method which I'm not certain can be used when not in debug mode
- It doesn't change any values
shit wrong channel
@tacit pebble what are you trying to achieve? get clothing item from specific body location?
anyone know how adding a required tool works to a recipe
and having it actually show that its a required item
keep [Recipe.GetItemTypes.Screwdriver]/[Recipe.GetItemTypes.DullKnife]/[Recipe.GetItemTypes.SharpKnife]/SharpedStone,
i will see something and its seperate in game from the materials
but somethings will keep needle
and it does not seperate the item
hey, I need some help with some coding help with changing clothes from zombies.
Essentially, I need to change their clothes from one model to another (to make them look fat, or obese, or thin, etc).
I already did this for the player character, but I had a special function on build 41 that updated the visuals. I do not have this function for zomboids.
Does anybody know how can I force the game to make it reload their visuals?
I worked a little with the RadioData.xml, what do you want to do?
If you want to modify existing radios I dont think there is any other way than overwriting the file, but if you want to add new radios, you could just add them with another name (different to radioData.xml)
Also, be aware that on build 42 they added english translations to the radios, so you have to make a translations file AND the lines will be read from THERE (not your xml file)
I made a simple py script that turns an xml on it's Translation_EN.txt file
Specifically trying to change one of the codes of an existing line; sounds like it's not possible without replacing the file :/
i've actually done this before, i haven't modified codes but i have modified the text itself
i don't have the code anymore (i think it was one of the first things i made around three years ago, i don't even remember why and i definitely didn't release it) but it can be done
i don't know about getValidAirBroadcastDebug specifically but there are other functions in the game with the -Debug suffix that don't actually depend on debug mode at all
yes that's what i wanted to request but i suddenly got a work. is there any function already which can access on IsoGameCharacter?
what i imagined was something like
IsoGameCharacter.getClothingItme(bodyLocation)
dunno if its lua public
letme check
it was for modded body location
these are just proxy methods over getWornItem()
I kinda worked on something like that
e.g getClothingItem_Back() just does getWornItem("Back")
local function UpdateClotheVisuals( chr , suffix)
--if not isCopySkinningDataAvailable then
-- return
--end
---@type WornItems|ArrayList
local wornItems = chr:getWornItems()
for i=0, wornItems:size()-1 do
local wornItem = wornItems:get(i):getItem()
print(wornItem:getType())
local newWornItem = instanceItem(wornItem:getFullType()..suffix)
if newWornItem then
print(suffix.." Item Found")
local oldItemVisual = wornItem:getVisual()
if oldItemVisual ~= nil then
local newItemVisual = newWornItem:getVisual()
newItemVisual:copyBlood(oldItemVisual)
newItemVisual:copyDirt(oldItemVisual)
newItemVisual:copyHoles(oldItemVisual)
newItemVisual:copyPatches(oldItemVisual)
newItemVisual:setBaseTexture(oldItemVisual:getBaseTexture())
newItemVisual:setTextureChoice(oldItemVisual:getTextureChoice())
newItemVisual:setTint(oldItemVisual:getTint())
oldItemVisual:copyFrom(newItemVisual)
end
end
end
end
I needed to get all items worn by a character, and change their visuals for Fat and Obese versions
oh thanks! i had no idea what string was for
gonna note this
I guess you could check if they are on a specific body location
@bronze yoke do you know of something that could make this work?
if it works for players just do the same thing and then zombie:resetModelNextFrame()
is getModData able to store item references
no
it doesn't work (?)
I need to update the clothing, not the character model
that function is necessary to update the clothing
what Im doing is copying everything from a new instance of clothing with a different mesh to the old one
to change how it looks
the problem is that it is not updating that (?)
I guess I could simply make it Wear the clothes (I just didn't want players to be able to get the debug clothes in game)
Hahahahah, I do NOT understand combat in this game lol.
The standard Debug combat text says the zombie got shot in the hand with no defense.
> CombatManager.pressedAttack > Attacked zombie: dist: 5.6978936, chance: (57), crit: false (44%) from behind: true
> CombatManager.attackCollisionCheck > Zombie got hit in Left Hand with a Base.AssaultRifle for 2.364 out of 2.364 after totalDef of 0.0% was applied
Then, with OnHitZombie I have logging outputting the bodyPart hit, and the defense of the clothing in the location.
> Bodypart:
> Torso_Upper
> Defense 20
Then Combat Debug text from zomboid debug says it was hit in the head.
CombatManager::ProcessHit 276 isCameraTarget and hit BodyPart 2 - BODYPART_HEAD
One bullet hit a zombie in 3 places lol
is multiple world item textures possible for one item or does it need multiple items
i just add multiple textures like this but it does not let you choose when spawning
its just random
you could make multiple clothing definitions if you want it to be specific
how can I force a zomboid to wear clothes?
at runtime, like call a function "Wear this" ?
@keen silo can you clarify the question?
Do you want random zombies to spawn in the game wearing your outfit?
Do you want to shoot a zombie with a clown gun and transform it into a clown?
Whatcha mean by "force".
So, im working on a Dynamic Body Shape mod that changes your character body shape based on your in game weight (purely aesthetic).
I wanted to make it work also with zombies. Zombies dont have a nutrition so I dont really care about that. I just want that when a zombie is spawned in he is asigned a body weight using a normal distribution (aprox) and that sets it up to be that weight until it is despawned.
So I can force the base model zombie to be fat or obese, and texture clothing will become fat and obese with the zombie, but mesh clothing arent working correctly
To make it work with the player, I created copy clothings called clothing_fat or _obese. These are not placed in spawn tables so they shouldnt appear normally in game. They are used to create a ghost visual with a different mesh (fat or obese) and then I copy every hole, blood, dirt and stitch to that mesh and back
So you are still wearing clothing, but it shows with the mesh of _fat or_obese versions
The closest thing would be the clown gun or something like that
Current mods that change the character model require a game restart.
How did you make it in Dynamic Body Shape?
Is it possible to make custom depth maps like TIS does for sitting on things?
table.insert and table.remove are giving me these errors
thoughts?
i think i did wrong methods, going to try again now
Project Zomboid Community Human Rig
I've spent the last few days creating a rig for the human character for people to animate with! It should be a lot easier to use than just posing every bone manually. I hope you all like it!
Sorry, was away for a bit. So you programmatically modified the text for a broadcast? (and you're sure it was a broadcast and not a VHS?)
it was definitely a broadcast
Maybe the rig should be pinned? might be presumptuous of me but it would help people see it haha
You can add radio stations in the same way that the game adds the emergency broadcast station. No XML required. I have a mod that does just that, feel free to peep the code.
https://steamcommunity.com/sharedfiles/filedetails/?id=3395616087&searchtext=wkzed
This station runs hourly, forever, with over 142 trillion possible broadcasts.
line 39 is causing errors still, different error though
LOG : General , 1737607908497> 31,582,997,828> -----------------------------------------
STACK TRACE
function: AssignPrey -- file: MInit.lua line # 39 | MOD: Chops
function: onClientCommand -- file: MInit.lua line # 16 | MOD: Chops
ERROR: General , 1737607908498> 31,582,997,829> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in AssignPrey at KahluaUtil.fail line:82.
ERROR: General , 1737607908499> 31,582,997,829> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: Object tried to call nil in AssignPrey
at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:973)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
at zombie.Lua.Event.trigger(Event.java:64)
at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:214)
at zombie.network.GameServer.receiveClientCommand(GameServer.java:4168)
at zombie.network.PacketTypes$PacketType.onServerPacket(PacketTypes.java:1022)
at zombie.network.GameServer.mainLoopDealWithNetData(GameServer.java:1532)
at zombie.network.GameServer.main(GameServer.java:800)
LOG : General , 1737607908500> 31,582,997,830> -----------------------------------------
STACK TRACE
function: AssignPrey -- file: MInit.lua line # 39 | MOD: Chops
function: onClientCommand -- file: MInit.lua line # 16 | MOD: Chops
line 39 is causing errors still, different error though
cool fish you there?
is it chill if i dm with help? if not totally cool but i really dont know what im doing
maybe i just need to read up some more ig
just lmk
Is PlayersToAdd just a normal table?
I presume so this is where its defined
As far as I am aware, table.add(table, element) doesn't exist.
that is commented out now
the thing causing the error is PlayersToAdd:add(PlayerArray:get(PlayerTempNumber))
declaration: module: java.base, package: java.util, class: ArrayList
for normal tables
This is why I asked if it's a normal table or not, but when it's defined it looks like a normal table?
Online players returns an array list, array lists have these...
how do I define it as an array list lmao
{} is a normal lua table, not an ArrayList
okay that makes sense
I think you just don't
you dont need to use them
just use a normal table
I was getting this error until I swapped to this method
PlayersToAdd[#PlayersToAdd + 1] = PlayerArray:get(PlayerTempNumber)
uhh
as in this is what I was doing earlier
then I swapped to using gets and adds
Then it might've been an ArrayList somehow?
should I define the PlayersToAdd or does it self define by the playerarray elemet get?
Though this might've been referring to PlayerArray which is presumably an ArrayList<IsoPlayer> whereas PlayersToAdd is an normal KahluaTable
I think your right
Yes this is what is happening ^
So does this work as a way of not having to define it as a ArrayList?
would I change its init?
No, this is just a performance optimisation for PlayersToAdd:insert(value)
No
You don't need to make it an ArrayList
arraylists are only used when you are given something from Java, like an event arg that is an ArrayList
You should just use normal table for it like it is now
