#mod_development
1 messages · Page 296 of 1
So the problem was the :add method doesnt exist?
yes, that's why I did it
I'll do that then
and now we pray
and reupload the mod to the workshop and restart the server lol
ty I appreciate it
https://github.com/asledgehammer/Umbrella?tab=readme-ov-file#vscode-recommended
Install this (It's Umbrella just a direct link to the setup guide)
When you do, you can add above the variables their types, it's not a "real" type as lua doesn't have real statically-typed types, but it's useful to keep track of what variables have access to what functions
So with the extension you can do
--- @type IsoPlayer[]
local PlayersToAdd = {}
and getOnlinePlayers() already has it's return type documented so it will fill in the blanks for a lot of things automatically
Where do I enable it?
First one if B41, second one if B42.
ye but where is the button to enable it T_T
oh true that
i think the button doesn't show up if you don't have git...?
this happened to someone else and i forgot what happened with that
Oh yep I remember that, yes you need git
no way i dont have git no way
It's possible you have git but it's bundled with some random thing so it's not technically installed
you don't actually need to use git or anything, you just need to install it since this uses it behind the scenes
ik that happened with me with gitkraken for a minute and I was questioning my sanity
welp i just updated git but i think this is the issue but i also am literally going to go crazy
wahoo
hey guys anyone see this happen before i made this bag and noticed this when i joined multiplayer with my friend
have no idea how this is even possible
Bam! I did it. Thanks to everyone who helped answer my questions during the dev of this mod.
**Ammo🔄Swap **
Custom ammo types for vanilla firearms. No more 1 gun, 1 ammo.
https://steamcommunity.com/sharedfiles/filedetails/?id=3412791647
would there be a way to remove something from a table similar to insert?
:remove isn't working for something down the line cause its not a kahula table lol
So you want to remove soemthing from ArrayList or from a lua table?
lua table
do you have the index of what you want to remove?
yes
this is causing errors
AllCodeWordsArray is defined as this (with a lot of stuff in it)
is it possible at all for CodeTempNumber to be nil?
that should work, idk why it wouldn't
what is the error
but the similar equivalent to the table call is tbl[idx] = nil
hmm weird
line 63 hold on
if you have the error, pls post, if not just try using AllCodeWordsArray[CodeTempNumber] = nil
function: AssignPrey -- file: MInit.lua line # 63 | MOD: Chops
function: onClientCommand -- file: MInit.lua line # 16 | MOD: Chops
ERROR: General , 1737614704595> 31,589,793,925> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in AssignPrey at KahluaUtil.fail line:82.
ERROR: General , 1737614704595> 31,589,793,926> 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 , 1737614704597> 31,589,793,927> -----------------------------------------
STACK TRACE
function: AssignPrey -- file: MInit.lua line # 63 | MOD: Chops
function: onClientCommand -- file: MInit.lua line # 16 | MOD: Chops
I honestly can't say whjy that wouldn't work
either table.remove(tbl, idx) or tbl:remove(idx)
do you know what this error log means?
though it's possible that maybe table.remove isn't in kahlua? (doubt)
ill try the table.remove
It means that object (AllCodeWordsArray) tried to call nil (remove)
basically it tried to call the remove() function but couldn't because the function didn't exist
yeah ill try the table.remove ig n see if it gives errors still
I'm not professional with Java but i think remove is for java(arrayList)
and table.remove is for Lua(table)
so if you want to add something which is already existed, listName:add(something)
and if you want to add something which you've written on your lua saide, table.add(listName, something)
i could be wrong btw
This works (PlayerArray is the ArrayList return from all players)
this doesnt work (both are tables)
[im trying the table.remove now]
because getOnlinePlayers() returns arrayList?
yes it ArrayList<IsoPlayer>
lua you can do :remove()
it's just syntax sugar, table.remove(tbl, index) is the exact same as tbl:remove(index)
: just passes self as the first arg (in this case the table is itself)
it works now
table.remove works now
gracias everyone
@grizzled fulcrum you carrying me lmao
im very confused on why it works
but at least it works lol
that's not true, tables don't have a metatable by default so they can't call table functions this way
eh? I have done this all the time in the past to just normal {} tables
I thought tables inherit table functions by default, because I use them all the time like that
I was searching for this but i can't remember the word "metatable" 🤣
if true it would have to be kahlua specific but i really thought it wasn't true even in kahlua
tried it in an online lua interpreter and true it is nil
idk why that I can use it in pz though
i don't know about tech but yeah i tried too and they just didn't work before,
and internet told me something about metatable and __index and blah blah lol
🤯
I might just be crazy
you can do this with strings for some reason so maybe you're thinking of that?
it's probably beccause I don't use any table functions in the first place
just the equivalent of them basically
personally I think the tables should automatically inherit table functions, it kinda makes sense
i feel like it'd be more annoying than anything
lookup tables would come with entries for the table library for example
true
you don't have to post it both mod support channel and mod development channel
calling this in the client is giving me errors (presumably with the playerRef being accurate to the local player)
is HaloTextHelper not global?
when you print(playerRef) before halotexthelper, are they printed?
because HaloTextHelper is global as I'm aware?
I am so damn confused, after some rewrites im getting an error in a recipe, after some attempts just getting the same error i decide to isolate it completely and remove the entire recipe file. But my zomboid keeps giving me the same error, how in the hell is it giving me the recipe code when the recipe doesnt exist anymore. Ive made sure the mod isnt in both mods & workshop and theres only 1 it could be loading. 😭
If Umbrella doesn't complain about it, it's probably global
Object tried to call nil
line 135
is AddBadText not something I can call
or is it supposed to be :AddBadtext
it's not in b41 either
oh you are in b41?
it should be HaloTextHelper.addText(playerRef, text, HaloTextHelper.getColorRed())
anyone know a good RGB value?
dont I need to get the halotexthelper first since addtext is a method of it
also ty I forgor there was get color red
i was hurried xD typo it was
ok cool i just wanted to make sure i wasnt crazy lol
it works!
is there a way to make the duration of it longer?
I don't think so. at least i haven't seen any.
display twice? idk 😛
are say's client side?
yeah
can I make the say's longer?
or rather is there a way to display a client-only message to the player for a duration?
or perhaps delay? (Im sending more than one message)
I could make a reminder to repeat the message thats linked to an event.
i think you have to go over to UI things then
repeating/delaying is able to be implemented without ui
how would I delay it i cant seem to find delays
im gonna try to code something with the every 10 minutes logic
Were sandbox values broken in some way this patch
Custom sandbox option is enabled, I check if it's true, it worked before. Now unless I comment out the if statement checking for the sandbox value, it just doesn't work
My character is also rotating weird, might be a buggy patch. Can't tell lol
oops accidently removed previous message.
I imagined this quick, not sure it's working but anyway,
function sayNow()
HaloTextHelper.addText(getPlayer(), "Hello")
Events.OnTick.Add(sayNotNow)
end
local Tick
function sayNotNow()
if not Tick then
Tick = 0
end
Tick = Tick + 1
if Tick == 150 then
HaloTextHelper.addText(getPlayer(), "GoodBye!")
-- Or function you want to call
Events.OnTick.Remove(sayNotNow)
Tick = nil
end
end
if you want to repeating then
if Tick < 150 then
HaloTextHelper.addText(getPlayer(), "Hello, I'm saying!")
else
Events.OnTick.Remove(sayNotNow)
Tick = nil
end
Do spawnpoint mods really need to return a list of different professions, or will it all default to "unemployed" if a specific profession isn't in the list?
(assuming the spawnpoint mod doesn't want to make use of profession-specific start locations)
Pretty sure just some professions can spawn at specific places while some don't
Quick test - I set up "unemployed" only, spawned a police officer, it worked.
1/7th of the effort for the same results.
Also, seems you can't put the map folder in 42 and it has to be in common.
local skin = InventoryItemFactory.CreateItem("base.example item") why not working structure
if you're in b42 you need to replace InventoryItemFactory.CreateItem() with instanceItem()
Interesting
Bro, you are amazing. I've been trying to solve this for days. And it worked :DD
yes. you can use local item = player:getWornItem(bodyLocation) where bodyLocation contains the string ID of the body location. Works for modded and vanilla body locations.
if png outline is dirty(?), should I turn off anti-aliasing in photoshop?
sorry I don't have screenshot right now, I will upload later. I suddenly realized
- Players with the speed demon trait will sometimes very rarely (1% of the time) spawn with a Speeding Ticket in their inventory.
This value feels too low
I feel like it should be like the profession items, basically guaranteed
- Rope belts that a character crafts should only provide one left hotbar slot.
yet there still isn't a way to spawn without a starting belt?
Would it be possible to make it so holsters need to be attached to a belt?
seems a bit silly to be able to just clip a holster to your skin
anyone figured out the best way to make zeds ignore only specific player
dont wish to use setuseless or setTarget(nil)
I haven't found anything and I searched for a while believe me ...
so whats your go to?
ghost mode?
i have this idea
Currently my go to to make blind Clickers is going to use Bandits's method of manually controlling the zombie
How do you even plan on using that ?
maybe on the lunge
set the anim to idle
its for a trait
so it will still come near player with trait
will stop if it has the variable
(since lunge occur when player is near)
and if the target player doesnt have the trait remove the setvar
vould work right?
but question is
do i need to make all player setvariable
what do you think
I don't get it, you're trying to stop the zombie from attacking or stop it from targetting a specific player ?
hi yes mod commissioner here.
This trait is supposed to stop zombies from attacking a specific player that has it.
You know Silent Hill, how the monsters don't seem to bug characters like Laura who's completely safe within the game?
It's like that. It's for a personal mod to make PZ more like silent hill.
ANY MOD FOR WALLHACK LOG (SHADOWS) TO GET DETECTION OF WHO IS USING IT?
So stop targeting ?
is it possible to make client side mods or is that outside of the scope of what is possilbe
Hey all! I'm new to PZ Modding and was wondering how I can grab when an item is used/updated? I essentially want to do the following:
item is used - > trigger event that checks if it now contains or doesnt contain a liquid -> if it matches criteria, change its category
Thanks!
yea
is that any setting to show full about the left side XYZ location
For anyone looking a fresh guide to get started with Lua, the wiki page for Lua (language) got updated
https://pzwiki.net/wiki/Lua_(language)
If you already know how to use Lua, you might actually not learn much
is it possible to get a forage item category?
fore example, in shared\Foraging\Categories\WildPlants.lua
local function generateWildPlantsDefs()
local itemDefs = {
Violets = {
type = "Base.Violets",
minCount = 3,
maxCount = 6,
xp = 5,
categories = { "WildPlants" },
...
Can I somehow from lua side pick up what forage category item is. I't tracking how many herps players picked up and currently it's hardcoded like this:
local original_forageSystem_addOrDropItems = forageSystem.addOrDropItems;
---Decorating forageSystem.addOrDropItems() here to insert ETW logic catching player picking up herbs while foraging
---@diagnostic disable-next-line: duplicate-set-field
function forageSystem.addOrDropItems(_character, _inventory, _items, _discardItems)
if ETWCommonLogicChecks.HerbalistShouldExecute() and SBvars.TraitsLockSystemCanGainPositive then
local player = getPlayer();
local detailedDebug = detailedDebug();
if not _discardItems then
for item in iterList(_items) do
local herbs = {
-- Medical herbs
"Base.Plantain",
"Base.Comfrey",
...
}
for _, herb in pairs(herbs) do
if herb == item:getFullType() then
-- proceed with my logic here
and I want to avoid hardcoding it
looks annoying, you'd probably have to parse them at launch and build a map
ew
You just want to detect herbs getting picked up right ?
I don't know about the WildPlants category, I'd suggest looking at how they set foraging zone as you might be able to directly pick up on items linked to that category
Something you could maybe do, is link to the context menu option or action of picking up
I'm already decorating picking up foraged items
As for the function you've shown, I don't know when it's called tbf
But you can't access the foraging
its called when u pick up foraged items
You can't actually access the foraging icon item
Which might have the category info you're looking for
i'm trying to make new pants, I imported the base game model, edited it, exported the way it was when i imported it, but i get this error in game WARN : General f:743, t:1737657430583> AnimatedModel$AnimatedModelInstanceRenderData.initMatrixPalette> skinningData is null, matrixPalette may be invalid, it feels like it got imported wrong cuz the mesh isn't connected to the armature, but idk how that stuff works so yeah
wdym by "foraging icon"
The item getting foraged icon on the UI
Why do I want an icon?
That shows either "?" when player can't properly see the item, and that you can right click to forage
Bcs it has some informations about the foraging itself
That's how I did my hunting mod which detects if the foraged item are tracks and override the context menu options of it and the foraging action
HuntingMod.onFillSearchIconContextMenu = function(context, baseIcon)
-- verify it's valid
if not baseIcon or not context then return end
-- verify it's a forage icon
if baseIcon.iconClass ~= "forageIcon" then return end
-- verify it's one of our items
local itemType = baseIcon.itemType
local animal = HuntingMod.ForageAnimalTracks[itemType]
if not animal then return end
HuntingMod.HandleIcon(context,baseIcon,animal)
end
Actually it might not give the WildHerb info you're looking for
But hey, might be an idea to explore who knows
Yea that's the lunge animation, I had managed to do something like that
forageDefs are global actually
for key, value in pairs(forageDefs) do
if type(value) == "table" and value.type then
print("Key:", key, "Type:", value.type)
end
end
Key: Zucchini Type: Base.Zucchini
Key: Corn Type: Base.Corn
Key: Eggplant Type: Base.Eggplant
Key: Leek Type: Base.Leek
Key: Carrots Type: Base.Carrots
Key: Broccoli Type: Base.Broccoli
Key: Potato Type: Base.Potato
Key: Cabbage Type: Base.Cabbage
Key: Tomato Type: Base.Tomato
Key: RedRadish Type: Base.RedRadish
Key: Daikon Type: Base.Daikon
Key: Peanuts Type: Base.Peanuts
Key: Pumpkin Type: Base.Pumpkin
Key: Violets Type: Base.Violets
Key: SunflowerSeeds Type: Base.SunflowerSeeds
Key: GrapeLeaves Type: Base.GrapeLeaves
Key: Rosehips Type: Base.Rosehips
Key: Acorn Type: Base.Acorn
Key: Dandelions Type: Base.Dandelions
Key: Nettles Type: Base.Nettles
Key: GingerRoot Type: Base.GingerRoot
Key: Thistle Type: Base.Thistle
But I don't get why you'd take this approach if the zombie is supposed to completely ignore you
kek
Yeah
yea theni can just fetch category from an item
type = "Base.SawflyLarva",
skill = 0,
xp = 5,
rainChance = 10,
snowChance = -20,
nightChance = 100,
categories = { "Insects", "FishBait" },
zones = {
Forest = 3,
DeepForest = 3,
Vegitation = 3,
FarmLand = 3,
Farm = 3,
TrailerPark = 3,
TownZone = 3,
ForagingNav = 3,
},
months = { 3, 4, 5, 6, 7, 8, 9, 10, 11 },
malusMonths = { 3, 4 },
forceOutside = false,
canBeAboveFloor = true,
},```
Yeah, was the idea I gave before, thought you knew about these 😅
cuz theres no other way to make zed ignore specific player without spamming setTarget(nil) or using ghostmode
it's literally what i was looking for, I was looking how to get all items in specific category
All I need to do is loop through forage defs once
lul
Yikes
when forage defs are generated? I'm thinking when its better to loop over them. will forage defs be ready before OnGameStart?
I wouldn't be able to tell you
I'm not sure
Check the file where they are defined
Things are getting setup in there I believe
yea I looked it over but couldn't find
Eh whatever I'll jsut do it on gamestart and see if it works 
Check the event onAddForageDefs
That's when you need to add stuff to forage def
So you can go back to when it's called
You might actually just need to link to it too
Hi! I'm trying to register pushes ( and stomps but when I get the first one ) and I'm being guided by this:
https://pzwiki.net/wiki/IsoZombie#Zombie_taking_damage
For now it always detects me when I push a zombie but I want it to only detect it when the zombie starts the falling to the ground animation, so that it is successful. Would anyone know how to proceed?
I also looked at the existing animations in the game folder, but I don't see any that fit well ProjectZomboid\media\anims_X\Zombie
theres a typo on that wiki code,

Filtered Types Map:
Base.Basil
Base.Chives
Base.Cilantro
Base.Oregano
Base.Parsley
Base.Rosemary
Base.Sage
Base.Thyme
Base.Plantain
Base.Comfrey
Base.WildGarlic2
Base.CommonMallow
Base.LemonGrass
Base.BlackSage
Base.Ginseng
Base.Violets
Base.SunflowerSeeds
Base.GrapeLeaves
Base.Rosehips
Base.Acorn
Base.Dandelions
Base.Nettles
Base.GingerRoot
Base.Thistle
---Generates a list of herb types based on valid categories
local function generateHerbsList()
local validCategories = { WildHerbs = true, WildPlants = true, MedicinalPlants = true };
local filteredTypes = {};
for key, value in pairs(forageDefs or {}) do
if type(value) == "table" and value.type and value.categories then
for _, category in ipairs(value.categories) do
if validCategories[category] then
table.insert(filteredTypes, value.type);
break
end
end
end
end
local filteredTypesMap = {}
for _, herbType in ipairs(filteredTypes) do
filteredTypesMap[herbType] = true;
end
print("Filtered Types Map:")
for herbType, _ in pairs(filteredTypesMap) do
print(herbType)
end
filteredForageHashMap = filteredTypesMap;
end
try
if zombie:isCurrentState(ZombieFallingState.instance()) or zombie:isCurrentState(ZombieFallDownState.instance()) then
--code here
end
** 10 Years Later v1.0.0 release **
https://steamcommunity.com/sharedfiles/filedetails/?id=3413130261
**Enjoy
🌲 **
Could you add that to the wiki too ?
Ik you got a lot of modding resources in https://discord.com/channels/136501320340209664/1070852229654917180, I think you could archieve those in the wiki which will be better organized and actually be easier for modders to find
where? idk where bro
i thought youre the one handling the wiki when it comes to mod informations
No the wiki is for the community edited by the community
I am not the chief of it, I'm just here to serve as a lighthouse to modders to get their modding informations there
ah yes
but its harder to do the wiki
the resource are just links
but if you can create a list page that i can use to just add links then ye sure
god please no the modding page is enough of a nightmare already
i know but youve been doing lots of work on it
Of course
Yeah not throwing random links in that page anymore
@ancient grail we can discuss more about it, but like the example that guy above sent, you can see the idea I've been trying to get informations stored about specific objects for example
If you aren't sure where to put stuff, you can ask me and we can figure it out
I've been wanting to go through your mod resource list one day, but if you want to contribute to the wiki, please go for it, ask me anything if you need help and stuff, don't hesitate to ask in #pzwiki_editing too for more general formatting stuff or how to do stuff on the wiki
Also check the wiki channel in the modding Discord
There's a bunch of pinned resources
External links are fine, but they need to be well organized and defined or no point
I still need to clean up the external links list at the bottom of the Modding page, but this is an example of what you should not do for example
Hello!
I tweaked an existing mod to add some useful features.
Since there's no "lockdown" mode or something, it's ok if i post it, right?
The mod is udderly cell file lister.
Sorry i don't know much about those posting rules
It doesn't detect it. :S
this latest update making me want to play again mmm so many fixes
default perms is "give credit"
so yes
@bright fog sure lets discuss it in the near future , rn ive got tons of shit to do ,but ill help you out whenever.
maybe provide a snippets page that are categorized by objects maybe or function?
like for example
local function clipAllFirearm()
local result = ""
local items = getScriptManager():getAllItems()
for i=1, items:size() do
local item = items:get(i-1)
if item:getType() == Type.Weapon and item:isRanged() then
result = result .. tostring(item:getName()) .. "\n"
end
end
Clipboard.setClipboard(result);
print(result)
getPlayer():setHaloNote(tostring("open notepad and press ctrl + v"),150,250,150,900)
end
clipAllFirearm()
What does that do exactly ?
ah yeah copy pasta stuff
Imo Clipboard should be a page, as it's an object, and explain how it can be used
For example
most debug related functions i share can be triggered via lua console
Hmm
we should be avoiding big list pages like the plague imo
everyone hates the modding page and its big list of links
Agreed
Hey I reworked it, just need to do some clean up at the end of it lol
But yes
A bit list of things is bad
We might have to see case per case, but we could just make a Debug tool page
For each tools
Depending on how big they are
is there a way to heal a survivor back to 100 without actually healing injuries?
player:getBodyDamage():setOverallBodyHealth(100); doesn't work.
i'm looking for a way to "reset" the time it takes for the survivor to die to said injuries
looks like b41.1.1 broke addVehicleDebug and addVehicle functions. Vehicles spawn in wrong coordinates and the function no longer return spawned vehicle object
Hey guys im trying to replace the modern vehicle with a honda civic any ideas how i can make this use my texture and not generate random colors
i have tried adjusting these here just keeps using the other texture
you are using the vehicle_moderncarshell this has alpha channel where the car has colors so the game randomizes that. u have to use a texture where the UV matches the texture
if you fill up the alpha channel with black all cars will be black
hey, can someone confirm me something? in SP are there such things as server/client commands?
I know that both server and client load their stuff in SP on client but I'm wondering if commands are sent
where do i find the alpha channel
client commands work, server commands don't
so client sending commands -> server receiving them -> work
server sending commands -> client recieving them -> doesn't work
right?
@silent sky the grey checker
i have replaced that whole texture withmine and it does not take
the uv matches?
yeah
hm
What if there was a moodle mod that after you read an adult magazine, you get a (redacted) status
I need something like that for my Chris Chan character

this way or other way around?
#mod_development message
yeah
I see
hmm
does it mean that if I have server-side code that sends commands back to client it should be structured like
function a()
-- some server stuff here
if SP then
-- SP code here as if it was a client file
else
-- send command to client
end
end

yeah probably
i have in the past called the command handler directly to try and imitate the mp structure as much as possible
can you provide a snippet pls? 
like```lua
local sendCommand = function(command, args)
if isServer() then
sendServerCommand("MyModule", command, args)
else
local MyClientModule = require("MyClientModule")
MyClientModule.onServerCommand("MyModule", command, args)
end
end
Oh that's much better than my stuff 
#musicmaniacpins server->client commands in SP
hi all, is anyone set up to remote exec lua commands into a locally running PZ client? I'd like to easily test methods to learn more quickly
@frank elbow if you need it for something specific, you could actually get the contained object in a ClickObject with the field reflection api, it doesn't rely on exposure
🤦 My memory failed me—I remembered the Field class is only exposed in debug, but forgot about those methods. Might just use those then, thanks!
i suspect TIS don't (or at least didn't) actually know that exposure isn't necessary for those methods to work
i'm sure field access will lead to a vulnerability eventually and that's why they don't want it to work outside of debug but i haven't found one yet so i'll just remain thankful for it
Does blocking a user on steam prevent them from accessing your mods?
How do I blacklist a user from ever interacting with my mods again because I'm tired of dealing with them?
Guys, can anyone give me some technical help
Garrett seems to have left out the new head condition Settings
I need to add the HEAD CONDITION to the module file
Hi all so Im trying to change some building recipes like small drying rack to be more wilderness survival friendly and not use nails, and i ran to this issiue that materials get consumed yet entity doesnt spawn any ideas where to look for possible fixes? (Build 42.1)
did 42.1 or 42.1.1 fix the animset problems?
Is there a way to force the player to unequip an item using lua?
Deleting the belt from the player on game start deletes the item, but the game still thinks it's equipped so you have the belt slots still
character:removeWornItem(item)
function: RemoveBeltOnStart -- file: Beltless.lua line # 4 | MOD: No Bel On Spawn
function: OnNewGame -- file: Beltless.lua line # 10 | MOD: No Bel On Spawn
java.lang.RuntimeException: attempted index: removeWornItem of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1667)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:624)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:173)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1963)
at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1790)
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:81)
at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:364)
at zombie.iso.IsoWorld.init(IsoWorld.java:3117)
at zombie.gameStates.GameLoadingState$1.runInner(GameLoadingState.java:301)
at zombie.gameStates.GameLoadingState$1.run(GameLoadingState.java:251)
at java.base/java.lang.Thread.run(Unknown Source)
Am I using this wrong?
local inv = player:getInventory();
local BeltItem = inv:getItemFromType("Base.Belt2")
character:removeWornItem(BeltItem)
inv:DoRemoveItem(BeltItem)
end
local function OnNewGame(player)
if player:getHoursSurvived() == 0 then
RemoveBeltOnStart(player)
end
end
Events.OnNewGame.Add(OnNewGame);```
your variable is player so it should be player:removeWornItem(BeltItem)
character:removeWornItem(BeltItem) -> player:removeWornItem(BeltItem)
worked, thanks 👍
Unrelated, but like.
The firefighter pants clearly have a belt built into them, why do they not take up belt slot + give belt attachments?
PZ logic
Are there any other pants like that?
could be a neat lil mod
would be one less thing taking up carry weight, even if it's only 0.06
The belt holds up the pants. But without the pants the belt would fall down. Therefore combining belts and pants would result in circular logic, so zomboid keeps them seperate. /s
Also, probably because it would be a hassle to have to re-equip hotbar items every time you change pants.
I mean sure but I was more specifically meaning why do the ones that have it visually not take up the belt slot AND have the same belt attachment slots
Not all pants have belts visually
how do I go about making an item take up multiple equip slots?
Do I have to define it or can I assign multiple equip types at once
I wanna make it so firefighter pants take up its normal pants slot and also the belt slot
you have to define a new body location that's incompatible with both of them
how would I go about doing that
local group = BodyLocations.getGroup("Human")
group:getOrCreateLocation("MyLocation")
group:setExclusive("MyLocation", "OtherLocation")
```etc
you'll probably have to copy every location the originals are mutually exclusive with too
Is there a file where this info is visible or is it hard coded
it's all done in a lua file
i don't remember where but searching for BodyLocations.getGroup("Human") will probably bring you to it
NPC folder maybe?
local inv = player:getInventory();
local BeltPantSlot = player:getWornItem("BeltPants");
local BeltItem = inv:getItemFromType("Base.Belt2")
if BeltPantSlot == "Base.Trousers_Fireman" then
player:removeWornItem(BeltItem)
inv:DoRemoveItem(BeltItem)
end
end
local function OnNewGame(player)
if player:getHoursSurvived() == 0 then
RemoveBeltOnStart(player)
end
end
Events.OnNewGame.Add(OnNewGame);```
Haven't run this script yet, any glaring issues that may come up?
easier to read like this
I'm still learning this, so catching any issues before they happen could help my understanding
Hmm no error spit out, but I think that's just because the player doesn't automatically equip the pants due to a conflict with the belt. Guess I'll need it to check inventory instead, and then force wear the pants
just a question, shouldn't it be like this if you want to compare item by type?
local BeltPantSlot = player:getWornItem("BeltPants"):getFullType()
I have no idea what I'm doing
idk what the difference would be
I want it to check player inventory for the pants, if they exist, delete belt2 and equip the pants
I already know the OnNewGame function works fine
did they pass if BeltPantSlot ~~ ? (== function removed belt?)
I do not understand
sorry my bad,
while you worn fireman pants,
and when you fired function,
function can remove belt?
Not for my mod, asking for a friend
Is there a way to change the speed of the animation of zombies so they are faster?
No because it fires on game start, but on game start the player isn't wearing the pants since they conflict with the belt.
I need to check the inventory for the pants since belt takes equip priority on game start
Yo guys do you know a good minimap mod (tried eris but it seem broken)
Isn't minimap just a sandbox option in vanilla?
Really if I can just get it so it forces you to equip the item from your inventory, I could just make it so it always deletes the belt since so many pants types have visible belts anyway
equipping the item is priority
getPlayer():setWornItem("string", InventoryItem)
string is for bodylocation, I guess
local item = getPlayer():getInventory():getItemFromType("Base.Trousers_Fireman")
getPlayer():setWornItem("bodyLocation", item)
maybe? sorry i always say "maybe" :/
i always can't be sure for what i haven't done before.
oh you've already done once before with BeltItem
was I right..? I actually have no idea what I'm talking about 🤣 most confused conversation ever.🤣
Hello 👋 Iam considering making a mod. Planning custom items (Weapons/Clothing) but Iam totally new to this, Iam seeking some informations about what tools I might need to do this.
https://pzwiki.net/wiki/Modding
This page will help you when you don't know anything on start.
Line 61 is throwing this error. Thoughts?
I think im missing a few required lines, im gonna see if that fixes it
what is the ISWorldMap_instance?
I'm trying to add markers to the map via code, so from my very novice knowledge, it should be the instance of the map on the client
local HasFirePants = getPlayer():getInventory():getItemFromType("Base.Trousers_Fireman")
return HasFirePants;
end
local function RemoveBeltOnStart(player)
local inv = player:getInventory();
local BeltItem = inv:getItemFromType("Base.Belt2")
local FirePants = inv:getItemFromType("Base.Trousers_Fireman")
if HasFirePants(true) then
player:removeWornItem(BeltItem)
inv:DoRemoveItem(BeltItem)
player:setWornItem("BeltPants",FirePants)
end
end
local function OnNewGame(player)
if player:getHoursSurvived() == 0 then
RemoveBeltOnStart(player)
end
end
Events.OnNewGame.Add(OnNewGame);```
This script will check the player's inventory for the firefighter pants. If the item is in the player inventory when spawning in, it will delete the starting belt, and equip the pants.
do you get something when you print(ISWorldMap_instance)?
is there a way for me to do that in debug mode and not restart the server/reupload to the workshop for that
bottom left, there's a small window and you can type it directly
when your function is called then? i mean, error will pop-up if you called your function when you are not watching worldmap
It's supposed to get called on a timer... i might see if it works without world map open IF ive already opened the worldmap
well it doesnt give an error after its no longer nil which is good
but now im getting error further into the logic (but again the line isnt giving errors now...)
oh so they seems to be cached after open worldmap
hey everyone, i’m interested in starting mod development for project zomboid. i was curious how easy it is to test the mods you make. do i have to keep uploading a new version of the mod to my game each time i wanna try something or is there a more convenient way to test/debug?
Depends on what your making
i’m planning on messing with how long it takes to do stuff like open cans etc
If your making something like I am which inherently involves a multiplayer dedicated server, then yes you need to upload it to the workshop to test it fully
Most mods can be done locally in singleplayer though, and you can reload your lua files mid game.
Theres a few good starter things on how you debug/test it on youtube I believe one is by Blackbeard and the other is someone who made the dried meats mod
then maybe just add a nil check like
local function myfunction()
local symbolAPI
if ISWorldMap_instance then
symbolAPI = ISWorldMap_instance.java..blahblah...:getSymbolAPI()
else
return
end
end
nil check that just tells the person "Hey open your map or else it wont work lmao"
oh okay nice. reloading midgame is insane. do you setup a custom game setting with like no zombies or something for best testing? i just wanna get it setup to test as easy as possible for development
sounds good, thank you !
If you launch with debug mode enabled in steam options you should be able to customize stuff in game as well as use admin commands like removing zombies from around you
this just checks if its valid right? I don't have to != nil
yep
not ISWorldMap_instance means nil or false
ISWorldMap_instance means everything else. string, number, table, function, int ...
I just imagined this will be better
local function myfunction()
if not ISWorldMap_instance then return end
local symbolAPI = ISWorldMap_instance: ............
...........~~
end
well it works for now
this is giving me a client side error but doesnt break the game
i dunno how to remove the symbol from the map
oh wait
huge
Line 100 giving this error as well
for reference this is what PingData is
omg it was a typo lmao
PingDataArry instead of PingDataArray lmao
ima see if it works now lmao
@bright fog i had this idea
we probably need a page (not just for modders)
to be able to determine errors and use the debug panels error thing
perhaps teach how to open the error, cloee the panel, use the search box and the buttons
if theres no guide yet
is it possible to make traits depend on sandbox options
like one doesn't show in the creation menu unless you have it enabled in sandbox
does anyone know how i would make a sprinter slightly faster, going past the sandbox settings speed
Well it removes some of them...
It gives me a null value and doesn't remove all of them. Thoughts? Might be the remove function.
loop backwards instead with for i = symbolApi:getSymbolCount() - 1, 0, -1 do
when you are removing things from the list you're looping over you should always do this as removal causes the list to change size + indexes of individual elements shift
I was just thinking this ty
but im worried the RemoveSymbolByIndex doesnt actually shift it... but we'll see
Hi all, should I be able to render an icon / texture on a scrolling list box?
Everything seems good, but it doesn't draw and the error counts flys up but never actually breaks out to the debug windows
I assume that means something is breaking in the java side?
I should mention I'm attempting the icon render in an overloaded version of doDrawItem
Is there a way to get a list of every item in your inventory using the debug menu?
These are throwing errors now (I am SO close to finally fully functional) [(thank you albion when you read this, it fixed it flawlessly ^-^)]
You might be able to if you do something like print(getPlayer()) [i dont know how to access the inventory but there is likely a method for it
Currently have every item I need to edit in my character's inventory but don't wanna manually copy every id
print(getPlayer():getInventory()) ?
maybe (I'm looking to see if that would work in the docs lol)
that should work maybe
ScriptManager is your friend on that one
it implements getInventory
sob
you got an error from printing in debug?
yes
I didnt...
print(getPlayer():getInventory())
bottom left command console
print(getPlayer():getInventory():getItems())
function: DoLuaDebuggerOnBreak -- file: LuaDebugger.lua line # 95 | Vanilla
java.lang.RuntimeException: Object tried to call nil in new
at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:954)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:173)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1963)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1760)
at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:76)
at zombie.ui.UIManager.debugBreakpoint(UIManager.java:1516)
at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:79)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:954)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:173)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1963)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1760)
at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:76)
at se.krka.kahlua.integration.LuaCaller.protectedCall(LuaCaller.java:117)
at zombie.ui.UIDebugConsole.ProcessCommand(UIDebugConsole.java:421)
at zombie.ui.UITextBox2.onKeyEnter(UITextBox2.java:1141)
at zombie.core.Core.updateKeyboardAux(Core.java:2524)
at zombie.core.Core.updateKeyboard(Core.java:2690)
at zombie.core.Core.DoFrameReady(Core.java:3706)
at zombie.GameWindow.frameStep(GameWindow.java:949)
at zombie.GameWindow.run_ez(GameWindow.java:814)
at zombie.GameWindow.mainThread(GameWindow.java:615)
at java.base/java.lang.Thread.run(Unknown Source)
whats line 141
player:getInventory():getItems() is what i used
Dawg I don't know what happened to my game, I don't think this is related
I can't open the main menu lmao
gonna restart my game
might be related to errormagnifier
Recipe breaking parser?
Would there be an easy way to loop a function for every item in a list?
instead of copy pasting the function for every single instance?
It depends on how the list is
if its one you got from the game IE arraylist from the :getinventory then you need to do something different
but yes you can do a for loop, hold ill find an example
"Base.Trousers_ArmyService",
"Base.Trousers_Black",
"Base.Trousers_Chef",
"Base.Trousers_SantaGreen",
"Base.Trousers_HuntingCamo",
"Base.Trousers_NavyBlue",
"Base.Trousers_Police",
"Base.Trousers_PoliceGrey",
"Base.Trousers_PrisonGuard",
"Base.Trousers_Ranger",
"Base.Trousers_Santa",
"Base.Trousers_Sheriff",
"Base.Trousers_SuitWhite",
"Base.Trousers_SuitTEXTURE",
"Base.Trousers_Suit",
"Base.Trousers_SuitWhite_White",
"Base.Trousers_Fireman",
"Base.Ghillie_Trousers",
"Base.Trousers_LeatherBlack",
"Base.TrousersMesh_Leather",
"Base.Trousers_CamoDesertNew",
"Base.Trousers_CamoDesert",
"Base.Trousers_CamoMilius",
"Base.Trousers_CamoGreen",
"Base.Trousers_OliveDrab",
"Base.Trousers_CamoTigerStripe",
"Base.Trousers_CamoUrban",
"Base.Shorts_CamoDesertNewLong",
"Base.Shorts_CamoMiliusLong",
"Base.Shorts_CamoGreenLong",
"Base.Shorts_OliveDrabLong",
"Base.Shorts_CamoTigerStripeLong",
"Base.Shorts_CamoUrbanLong",
"Base.Trousers_WhiteTEXTURE",
"Base.Trousers_WhiteTINT",
"Base.Shorts_ShortFormal"
}```
?
oh so you defined it locally
as in you made the list
in lua
yeah you can just do something like this
the # indicates the size of the array
so you start at 1 (IE Base.Trousers_ArmyService) and then go up to the max size [however many items that is, which would be Base.Shorts_ShortFormal as the last one]
so to get it, inside the loop it would be like
PingDataArray[i]
for i=1, #ExampleArray do
ExampleArray[i] -- insert rest of code you want to do with that thing in the list, ExampleArray[1] == "Base.Trousers_ArmyService"
end
[this is for arrays you make though]
yeah I converted the printout from console into the local list I printed above
then you should be able to do this to go through each one of those in the list and do whatever you want to do with them ^-^
change all occurances is such a time saver
Does anyone here happen to know why it's not making a new symbol? I'm not getting any errors but its not appearing where my player is
There's about three things I'm wanting to do with this.
For better understanding, how would it work with this?
if item then
item:Load(item:getName(),
[[{
BodyLocation = BeltPants,
AttachmentsProvided = SmallBeltLeft;SmallBeltRight,
}]])
end```
Ive never done this stuff before but what is the list of strings you have beforehand used for?
like the "Base.Trousers_ArmyService" right
put that inside the loop, and set the getItem("Base.Trousers") to be getItem(ExampleArray[i]) as ExampleArray[i] (for the first instance) would be "Base.Trousers_ArmyService"
Sorry I'm having trouble understanding with the way that's worded
Agreed
I feel this violates several coding best practices...
So
local pantswithbelt = {} -- [your list here]
for i=1, #pantswithbelt do -- this gets the amount of items in pantswithbelt, and then does the code below that amount of times
ItemName = pantswithbelt[i] -- this would be getting each item from the list one at a time
local item = ScriptManager.instance:getItem(ItemName) -- the variable ItemName references the pantswithbelt[i] which is the individual item in the list, and is a string
if item then
item:Load(item:getName(),
[[{
BodyLocation = BeltPants,
AttachmentsProvided = SmallBeltLeft;SmallBeltRight,
}]])
end
end
[this is for arrays you make though, as #Pantswithbelt wouldn't work for arrays given by the game, as well as they would start at 0]
Does that make sense?
This is how I handle doing something for each element in lua:
For each syntax ("for i=1, #things do","for k,v in things do", "for k,v, in ipairs(things) do", "for i=0, things:size()-1 do") {try loop syntax; if (code works) then break;}
I can almost never figure out which one to use without trial and error.
if its an array you make like
MyArray = {} then the for i = 1 and #things do should work
if its an ArrayList like
players = getOnlinePlayers()
then you want to do for i=0 things:size() - 1 do
im only saying this with confidence since i just spent the past few days fixing my code cause ive been doing the same thing lmao
I think that's the root problem - lack of clarity in Zomboid code which type of thing you have.
docs are op (and also coolfish + albion)
This is killing me though im THIS close to having my mod working
im going to see if I can just add a symbol at 0 0
Is the code inside if IsWorldMap_instance 100% for certain getting called?
yes
the print was working
the symbol was just not appearing on the map... or at least not where I intended (on my player)
Does anyone have Idea why outlines are ugly?
(sorry for that code was captured, Discord won't let me upload code directly, idk why)
Outlines for top left?
the UI?
yes the icons
are those moodles or custom made UI
This is how i displayed icons (yes, discord thinks it's spam or something :/)
okay so I got an icon to appear at 0,0 presumably.
do you mean outlines for the UI like the circles around it?
you might want to add a feather to it since its likely not being feathered already
like to the textures I mean
I also don't see what you mean might want to circle it
cause i dont see anything that looks bad... lmao
cool
yep i was talking about this
vanilla circle is pretty and clear
and mine is something brrrrr
Haha I see it. There's a part that looks like it's a link to Telegram.

What resolution are the icons
bigger: 96x96
smaller: 64x64
I'm just wondering if I'm doing wrong or it's just a limit of modification
so how big is your game res?
always testing on 1920x1080
I think it's most common resolution for gamer still?
or I'm too old XD
oh i see i just searched and realized xP
you might want to make it higher res and then lower its scale... it is probably upscaling it heavily
making the icons higher res that is.
There is also a chance that the UI for the left one is being scaled up differently
without feathering
like uh
your UI might be scaled with interpolation
the other UI might not
hence clean pixel edges
on theirs and weird soft blurry on yours
solution might be just to make higher res icons so when it scales it, it has more data to work with and less interpolation
Why is this returning 0
im trying to get the worldX and worldY so i can convert it into the pingmap stuff
PlayerIsoCell:getWorldX is giving a 0/y is too
How can I spawn a car facing a particular direction, or turn a car after it is spawned? the global addVehicle() only has co-ordinates, no facing parameter.
And I can't find an obvious "setDirection" type thingy for a Vehicle
I'm hoping it's not in BaseVehicle.QuaternionfObjectPool because Quaterions can %$#^@! off. I've not dealt with them since screwing around in Second Life.
found it - obviously you have to use the addvehicle function with "Debug" in the name.
local car = addVehicleDebug("Base.SUV", IsoDirections.N, nil, getCell():getGridSquare(13270, 5439, 0));
IsoCell.worldX and IsoCell.worldY aren't used anywhere apart from the getters/setters.
Try using IsoCell.getWidth() and IsoCell.getHeight() for XY values
Hi, having a problem right now with the mods folder in pz, I add my mod to test in there but there is no mods showing up on the menu when I boot the game, even tho the mod.info and the folder is all correct
did anyone ever had this problem before?
yep
thats how do it. we need to test via lua console most of the time
or atleast thats what i do when im trying a function i just wrote that i havent tried before
also it helps to do something like this for syntax
print(getPlayer().getInventory)
it should print function
its a way to check for syntax
learned this from burryaga
Can you share your mod.info?
so if all of mods are gone, the issue could be from mod.info parameters
sure,
name=Stalker Traits
id=stalkertraits
description=Adds a trait that increases blunt weapon damage by 25%.
poster=poster.png
Folder name Stalkertraits
is just a custom trait mod for our server wip, but I'm following the same concept of all the other traits that we worked on, but now the game menu doesn't show the mods anymore, only the ones from workshop, I already tried to reinstall the game fully
oops b41?
Yes yes
my bad I should ask this at first, sorry to say this but I have no ideas if you are on B41 and if it's server. I have no experience with mp
I mean, I am testing on my game first, not on server yet
the mod still wip, but I want to test some stuff and not even shows up on the menu
I know right, should be mod.info, but everything seems right uff, I always get crazy over this small stuff keeps bugging
@tacit pebble Idk man, I just closed and opened my steam and it's showing up now lmao

yeah, I spent like an hour
getting crazy
Well thanks for the help, you are like a godsend, already helped me 3 times just this week
sorry for bothering you, do you know how to get existed vehicle's facing direction?
Any suggestions on how to efficiently identify if a player is within a couple squares of my custom object without checking every OnPlayerMove? I am wanting to highlight the front square much in the same way vehicles do with doors/hoods
vehicle:getAngleY() and if you need IsoDirections from it, there is IsoDirections:fromAngle() (radians as input)
SUPER THANKS! I'm happy ❤️
BTW just in case you didn't notice: The addVehicleDebug only works in debug mode. I made the mistake of trying to use it for normal gameplay... You can just use setAngles():
vehicle:setAngles(0, facing, 0)```
Not sure if there is a simple built in solution. I can't find any events triggering when getting close to something, so you would still need to constantly run some checks.
If there aren't too many of them, maybe add them/their position to a list on LoadGridsquare that is then quick to run checks with
So Ive been thinking that with the new crafting system there is something that is missing, there is no way to set a crafting project and give it an extended duration to completion. all crafts are done while the player is in the UI, within a minute or so at most. An example of the issue is say firing pottery in a kiln, that should take 30 minutes to an hour in game. the player should be able to start it, go do other things then be back in time to finish it, kind of like cooking, or say drying grass, its not something that should be completed instantly, the player should put it on a rack and come back half a day later or so and it be dry. I don't think we have any tools to do this kind of crafting.
There could be A LOT, however caching on client side LoadGridSquare could be sufficient as it would only load those the player came near. I guess ill explore that route. Thanks for thoughts
Not sure if we could highjack the oven logic, and use that as a way to have some crafting take significant time.
Thanks, that just saved a lot of pain
It was even more painful in B41, as the addVehicle was broken. It never returned the vehicle... Thankfully they fixed that
Cooking. If that could be expanded to do more than raw to cooked to burned it would be perfect for a lot of crafts
Yeah thats the only solution I can think of.
Put wet hide on drying rack and it dries, put logs in charcoal pit and let them cook to charcoal, etv
exactly, I think its a major missing part of the crafting system, things being completed near instantly is weird.
this is limited to one input -> one output, but a pre-cooking recipe to make a "raw" item is fine
I'd like to know if they are already working on something like that, I hope so
that too. and we wont know for sure unless they say something, they never have been the best at answering questions.
I don't blame them, if they said "were working on that and exist to have it out early february" people will yell for it being late on Feb 2nd, people will yell if the feature is delayed, people will yell if I'd didn't turn the way they thought it would work, people will yell they should be coding NPCs instead....
well yeah, should never give dates.
"Soon, but on a geological time scale"
They also seem to take queues from the mod scene, so if something was made a mod and people like it, it could inspire them to add it to the base game, has happened many times already.
No idea
it should be possible to add an OnCreate function to the item that sets the texture index to whichever one you want
actually nvm i forgot you'd need to make a new item for that anyway lol
Luckily what I'm doing is gross and a loophole, so I need to create a new item anyway
I wish we had a lot more traits that did things instead of just give skill points.
Those require a lot of additional coding 
well yeah. but they are far more interesting.
@dull moss ah man, not sure if you knew, but Evolving traits seems to totally break More Traits.
how
I am using part of More Traits that modifies the default carry weight, as soon as I activated Evolving Traits, it boke it and reverted it to the default values.
i havent touched more traits yet, I'll look into it
Which means it probably breaks Packmule and Packmouse as well.
More Traits has some really interesting things in it, basically very vew skill point related ones, or maybe even none, I can't recall.
are the sounds .wav?
ye
I'd really recommend using .ogg instead
ogg cuts the file size by an insane amount
i had a sound mod go from 25mb wav to 2.5mb ogg
Oh yeah and I had a True Music mod for B41 that was 1 gb in .ogg
I don't even want to know what it would've been in .wav
10 gb at least.
Would it be possible to make wooden buckets (and other buckets I guess) behave in the same ways sacks do?
I dont think so, they arent actual containers, just liquid containers. but I suppose they could be made both?
Amazing !
Yea that's what I would like to do. I'm not sure where to start - but I'll probably poke at the code tomorrow before work.
So that's when you gain a trait ? Or when leveling up too ?
Is there an easy way to see what file an item is in? For example I'm looking at the items text files ot find where the buckets are listed?
notepad+
And use the PZ media folder as your workstation.
Then search for what you want in scripts
Ah yea I wasn't sure if PZ had a way of showing it in debug or not
Kate has a search function that does the same thing so that's cool
hi, i don't have any prior experience with lua or modding, but i'd like to know if anyone could give me some pointers on how to make an image appear when the jumpscare event is triggered? i haven't found any mods on it.
trait, i'll do a separate mod for leveling up like tomorrow
Nice !
Ima put this question in mapping since its kinda half related to both but probably more likely to be known there. xD
Hi. It seems the jump scare is done completely in java, and doesn't trigger lua events. This might be the reason there are no mods for it as it complicates it a lot.
I think your options are:
-
Implement a jump scare yourself that plays the same, or other sound and shows the image (not very easy to do convincingly, but you can get at least most of the required stats for it with lua)
-
Make a java mod and edit how the jump scare works or an add event for it (harder to make than a lua mod and cannot be installed (automatically) from workshop)
//IsoPlayer.java
public void updateLOS() {
- -
if (this.isAlive() && var9 > 0 && this.stats.LastVeryCloseZombies == 0 && this.stats.NumVisibleZombies > 0 && this.stats.LastNumVisibleZombies == 0 && this.timeSinceLastStab >= 600.0F) {
this.timeSinceLastStab = 0.0F;
long var24 = this.getEmitter().playSoundImpl("ZombieSurprisedPlayer", (IsoObject)null);
this.getEmitter().setVolume(var24, (float)Core.getInstance().getOptionJumpScareVolume() / 10.0F);
}
- -
}```
since it uses timeSinceLastStab to rate limit the jumpscares, you could periodically check that - if it was over 600 last time you checked, and it's under 600 now, a jumpscare has happened
Nice. Didn't think about that, so didn't include more of the code. This might cause some issues if (this.stats.NumVisibleZombies > 0) { this.timeSinceLastStab = 0.0F; } I quess you still have to do some checks, otherwise can't know if the reset was caused by the jump scare or not
i'll see what I can do with the very, very limited knowledge I have. it's just a little mod to scare my friends so it doesnt need to be lua necessarily. thank you for the help.
That's interesting
There is any mod upcoming in 42 about the "light"? like connecting Lamp Post to the generator or making a lamp pillar?
without batteries
I'm doing a retexture of the base-game coveralls for a project, what files/lines of code would I need to put in my mod folder besides the obvious texture and model?
I think it's referred to as boilersuit in the files
Hello,
i made a little **vscode **extension for coloring/formatting/checking the items, recipes and fixing definition files from PZ.
It's in beta for the moment
https://github.com/cyberbobjr/pz-syntax-extension
known issue : if you activate the theme of the extension you loose the coloring for other files.
just the texture
Wait no sorry
I'm programming it as a separate piece of clothing, so it'd need new scripts to tie things together correctly, no?
There's that one too which exists
Zed Script
I will test your extension however
And link it in that wiki page
if youre just using the normal model you dont need to include it
I'm not sure I understood how to download that
Cloned it, but how do I actually activate it in VSCode ?
Hi, I would like to know more about mod dev, I would like to know the ultra basics to create a very simple mod
feel free to dm me
Does anyone know how to use the britas weapon pack claymores on remote mode
you must install it manually for the moment :
npm i
npm run compile
npm run package
then install the vsix
Those are commands ?
Bash commands ?
I'm not familiar at all with compiling this kind of stuff
bash command or git bash command, you must check if npm/node is installed on your workstation.
But if you are not sure, wait for the official extension 😄
Yea no idea about npm and node
The commands are not recognized, so I'll probably not go to the effort of doing things to compile ityea
Make sure to tell me about it whenever it gets in the extension market so I can test it out and link it in the wiki
this is a good place to start
https://pzwiki.net/wiki/Modding
Does anyone know how to use the britas weapon pack claymores on remote mode
Here is a very basic mod that does a image and sound jump scare using timeSinceLastStab that albion suggested (with an additional timer). Do what you want with it (Tested only with B42)
Forgot to reply this ^
it's less how good ogg is and the fact that wav is literally uncompressed audio with a header lol

sizequeen
Hi there, I'm hoping this is the right place to ask this. I've been playing B42 splitscreen with my boyfriend (we know it's not officially supported) and we want to turn off sleeping because it's just a pain with speed controls disabled. We found a mod that does that but it only half works in splitscreen. It works for Player 1 until Player 2 joins and then it only works for Player 2. So I'm trying to edit it to work for multiple players. Here's the original code:
local player = getPlayer()
local stats = player:getStats()
stats:setFatigue(0)
end
Events.EveryOneMinute.Add(EveryOneMinute)```
And here's my attempt to fix it:
```local function EveryOneMinute()
local numActivePlayers = getNumActivePlayers()
for i = 0, numActivePlayers - 1 do
local player = getPlayer(i)
local stats = player:getStats()
stats:setFatigue(0)
end
end
Events.EveryOneMinute.Add(EveryOneMinute)```
It still only works for one player at a time but I feel like I'm close. Can anyone help me with what I'm missing?
use getSpecificPlayer(i) instead of getPlayer(i)
that was a server setting yeah
Ah I see
Are there any modders who are familar with item and recipe modding that I could ask a question? I'm trying to get change an existing recipe and make part of the inputs 4 twine or 1 rope. Im not very experience so any knowledge or would help
So... is the getPerk() and getAmount() of xp_award still locked?
I still have no luck getting through
I was wondering why my moodle mod wasn't functioning. Then I realized that the devs changed the Moodles file structure. This is kind of a pain for me 
i feel sorry for every other dev too. 5 different moodle size folders??
Should this work? If I create and item with this: DisplayCategory = TMSBrains, and Category = TMSBrains, with a sprite that is a container to allow these items if I set it to: braintank:getItemContainer():setOnlyAcceptCategory("TMSBrains")
I have tried setting the category and getting it from the container and it prints the right category, but when I set it, it allows nothing into it afterwards.
I see, even with Category and DisplayCategory set in the item a getCategory() of the item returns "Item"not "TMSBrains"
getDisplayCategory()
does setOnlyAcceptCategory() look at display category?
im not sure
you should definitely be able to do it with tags though
money has the "FitsWallet" tag
The problem is that the object is a sprite originally not a container item to carry.
so if I set the Type=Normal and look at getCategory() despite setting a category it shows "Item" and if i change the Type=Food then the getCategory() is "Food". If I set setOnlyAcceptCategory() on the sprite container to Item or Food in this instance then it accepts those items. So I am guessing it is linking the item Type to the setOnlyAcceptCategory() ...
I had hoped setOnlyAcceptCategory() would look at whatever I added in the item with Category = or DisplayCategory =
or Type = overrides the category setting
type and category are hardcoded since theyre the actual item classes i think
so I guess I wouldn't be able to make a unique item to fit in the container with the setOnlyAcceptCategory() variable then...
I could track when items are added to the container and refuse based on the FullType(). I was just trying to avoid decorating the transfer commands
you should be able to just doParam AcceptItemFunction onto the item i think?
ScriptManager.instance:getItem(Name):DoParam("AcceptItemFunction = AcceptItemFunction.Wallet")
then replace the function with your own
or maybe this OnItemMoved
heya, sorry, im nearly fully done on my mod, just a little confused by the "WeaponSprite" part of rifle coding
is it the icon? model?
also, is the "mesh" the UV_wrap?
it's the model
thank you!
anybody know an example mod for a good start to creating an ammo type for a mod?
Do you mean a new ammo type for a new gun, or are you wanting to do something fancy like give the option of using more than one ammo type in a weapon?
Rain's B42 Firearms adds 7.62x51 and 7.62x39 if you want an example. it's pretty easy provided you stick to the vanilla design of every gun has one type of ammo and one type of magazine.
as in like, if i were to create an entire new ammo type for a mod, sorry,
like able to create boxes of rounds
thank you, i'll take a look at that, and i appreciate the help!
<3
Converting rounds <-> boxes <--> cases is done with recipies.
Ideally you would be able to add a BoxMyBullets -> MyBullets mapping to the existing recipes
This comment will give you some hints on modifying an existing recipe: #1318920979581501502 message
But I'd start by adding your new gun, new ammo and (if applicable) new magazine.
Finally done - a new spawn point that includes your car which has run out of gas, a tire iron in one hand and an empty gas can in teh other, fishing gear in the boot and a perfectly ordinary farm.
Including clearing out the immediate zombies at the gate.
another thing, whats this?
Guess: a flag that makes the item always appreciated when you give it to NPCs to raise their opinion of you so you can romance them.
pfft
don't forget to get an Amulet of Mara
...obviously not yet implemented.
out of curiosity just wondering if recipes can output fluids (or if they can only output a filled fluid container)
just in case i ever try modding out again
Who needs an amulet of Mara when you could 7.62x39mm ammo?
yeah it's ancient npc stuff
does absolutely nothing in this build of the game
thanks :)
Fluid stuff is half-done and janky, but maybe. Definitely possible by gluing lua functions to item creation, but I'd hold off on that until the crafting & fluid stuff is more complete.
...I know I said "finally done" but then I thought of half a dozen test cases I need to try before release. 😂
Hello everyone! In B42, lua code controlling UI elements often has a "create()" function. Does anyone knows whether those create functions are always executed on game boot or immediately after a mod has been loaded vie "Reload Lua"?
they're called when that ui element is instantiated, so it depends on the ui element
many of them are created once at lua load
Thanks for answering. I guess then that in my case, the respective create() funtion is called on lua load since sandbox variables seem not yet correctly set. Makes things 1000% more complicated now. 😭 😭 😂
Can you start with a default value and change it later after sandbox vars are initialized?
Yes. That's probably what I am going to do. Will just make my code a bit more messy...
Messy code will fit right in with the vanilla code. 😆
yeah, definitly need ot work through test cases before release.
a threesome! that's a new one for me XD
The "spawn your car" code has no check for "is there something already there" or "is this a second caharcter in the same save?"
I have 2 questions. Im messing with a pants mod and there is no fbx file in there. The only thing I can find in the scripts is that it calls for the Trousers_Ground.fbx which is like a world static thing that shows the pants on the actuall ground, not on the player model. My buddy sent me a PlayerModel.fbx that he said someone had sent him which is working for the retexture for now. So my question is, how is the mod knowing to skin the legs of the player if the only fbx it calls for is the ground model. and my other question is where even is the player model in the vanilla files? I have the one that my friend sent me which works, but it definitely isnt from the vanilla files
Here is what the clothing script looks like:
{
DisplayCategory = Clothing,
Type = Clothing,
DisplayName = Skinny Jeans,
ClothingItem = Trousers_SkinnyJeans,
BodyLocation = Pants,
BloodLocation = Trousers,
Icon = TrousersDenimBlue,
BiteDefense = 10,
ScratchDefense = 20,
RunSpeedModifier = 0.98,
Insulation = 0.65,
WindResistance = 0.60,
FabricType = Denim,
WorldStaticModel = Trousers_Ground,
}
im just trying to find out what model its calling for in the files to physically put it on the character
Asking for a friend does anyone know how one could theoretically make zombies blind but still functional (and not use the useless mode).
And also without using sandbox settings... as they can still see fairly well.
[im looking at possible ways of doing this myself, thought I'd ask tho]
Guys, a question, I'm making a mod for the main screen, I see that every so often thunder sounds and the background lights up. I understand that the sound of thunder is not linked to that of the rain in the background, since I have found the sound files. Does anyone know if there is a lua file that I can access to modify the time interval at which the thunder sounds?
With this change in B42 "Increase item icon sizes to integer scale from native 48px (previously 32px)" does it mean that 48 x 48 will now be the base size for item icons?
it's hardcoded in java
This doesnt seem to be working... [top numbers are the result of where it says I am/what values I :get from the cell, bottom is the location of the ping in my UI space [[not near me lol]]]
If anyone knows how I can get the correct values for these functions (WorldToUIY/X so I can place a symbol at the players location that would be epic.
I'm gonna keep trying other methods/ideas but I cannot for the life of me figure out how or where I'm supposed to put it...
oh my god i solved it
this is stupid
for if anyone ever looks into this, the worldtoUIX isnt even needed
i'm not sure any of those methods have any meaning with what isocells do
they make a function specifically for converting real world coords into UI coords but then its not even useful T-T
they used to represent map areas but now they're just the entire loaded area, they don't have a fixed width (or even a 'current' width since it can represent multiple different areas at once)
it was the only thing I could find that used the term "World X" as a return place so it was what I tried second
mod is fully functional now i just need to clean up all the debug messages heheheh
but for future reference, when making map locations you don't need to convert it to UI space using the map API. To whomever may keyword search and look for anything about that
This appears to be true for every player... even if the player doesn't have the trait. (This is being called on the server side)
Thoughts? [I might move it to the client side and see if that works by bringing a IsoPlayer ref over]
is someone know how to check profession from player? something like
if player:HasTrait("SpeedDemon") then
if player:getDescriptor():getProfession() == "fireofficer" then
very thank you ❤️ you saved another an hour !
I've been trying to find that like for an hour already :/
yeah it's a little more complicated than traits, profession isn't really meant to matter much
I dunno how to put it more simply but HasTrait is not working... on server side...
hey guys, how are you doing? 🙂 I could use help with converting/parsing a B41 to B42 mod (Weapon Condition Indicator from NoctisFalco). having almost everything of functionality running, but having some trouble with torches 😦
PD: I'm a newbie on this modding world, just starting 🙌✨
It's getting the list of onlineplayers... but its always returning true for has trait despite the fact I dont have it.
this is the line that's giving infinite errors in game, and this is the error itself, along with some debug info I've managed to get, in case that helps. I don't think that the getUsedDelta method dissapeared, coz in the steamapps\common\ProjectZomboid\media\luaexamples\other\recipecode.lua it's being referenced (and so it's being used in-game)
the error happened when I tried to equip this new flashlight to the Alice braces or whatever that item is called, but is the one that allows you to attach this flashlight, and also when I tried to use it on the secondary hand. any piece of advice will be really appreciated, so thanks in advance 😄
PD2: if I'm asking on the wrong channel, please let me know, so I can post this info where it belongs
Is there a way to edit the discomfort modifier of an instance of an item?
My mod idea hinges on that and I don't see any method to set that particular value
hi, I'm testing+learning the PZ Lua/Java APIs. Is there any way to force your character to move to a specific tile (i.e. x,y,z coords) on the map? I'm capturing key combos (e.g. shift+f6) already to print world data and have been trying to capture a combo for moving but it always fails with an exception
this is basically what i've tried:
local position = Position3D.new(10894, 9470, 0)
local action = ISWalkToTimedActionF:new(character, position)
ISTimedActionQueue:addToQueue(action)
error/stacktrace
Is there an OnEat type thing for fluids?
LOG : General , 1737787794002> 31,762,883,333> TraitCollection(Thinskinned, HighThirst, SlowHealer, Conspicuous, HeartyAppitite, Pacifist, ProneToIllness, NeedsMoreSleep, Smoker, WeakStomach, ShortSighted, SpeedDemon, NightVision, Dextrous, FastReader, Outdoorsman, Graceful, Jogger, Tailor, Mechanics, Gymnast, FastLearner, KeenHearing, Hunter, Feeble, Fit, Very Underweight)
LOG : General , 1737787794004> 31,762,883,334> false
I tried to see if doing this would work, IE getting all the traits and seeing if I have it that way. Nope. For some reason the trait simply isnt in the list of traits in the collection.
lua command line, just trying it out in game works fine SAME EXACT GAME i get false in server console [I accidentally added it 3 times trying different add methods to see if hte server recognized any of them]
Does anyone know if IsoPlayer references change between sessions?
Like if I did getOnlinePlayers() on the server, would the isoplayer reference be consistent per character?
Follow up, how does one attach mod data to an IsoPlayer/player obj [and have the server be able to read that data] (in case my previous statement/plan doesnt work)
[[all because hastraits simply is completely desynced on the server for some reason]]
For anyone wondering allegedly traits only exist client side. for some reason.
why am I getting a nil reference when trying to get mod data
How does ModData work for objects/players/etc? I've only used fooData = ModData.getOrCreate("Foo")
Is it the same way of using , but you pull it out of someObject:getModData() instead and it gets saved attached to that object?
yeah
In that case, what sort of object is playerRef?
getPlayer()
isoplayer
(i am losing my mind over this I hate mod data so much)
also this is partially true, they only update upon rejoining the server. soooo not useful
am I supposed to init it or something? the mod data doesnt exist prior to this call
yes
well I actually dont know since you're not creating a subtable, you're only creating a var in the table
but you should put your mod data in a subtable anyway
but it also depends where youre accessing the mod data
--- @type ModDataDummy
local mdata = player:getModData()[mod_constants.MOD_ID]
mdata.testField = 123
This what I did, you should be able to literally just do this
nothing here would initialise it
true there I assume that the table exists alr
I mean in my code I don't use ModData anywhere, you cn just create the table like
player:getModData()["lalala"] = {}
``` and then access it fine
Is there a way to see the engine logs?
Game is just crashing when I try to do something.
Is it when you aim?
C:\Games\Steam\steamapps\common\ProjectZomboid\hs_errXXXX.pid
I just had to do a big cleanup because I was getting carash-to-dektpo when aiming (also, I was overdue to clean up)
It's when I try to access a nested container with a container button, which makes no sense to me since I can print the inventory just fine. The game just instantly freezes when I try to open it, I get no logs also no hs_err file.
I suspect it was a "improved body model" mod, that then causes issues when the game tries to work out which part of a zombie a gun is pointed at...
Very different problem then
Is CPU use/memory going high? wonder if it's getting in an infinite loop somehow
Hmm didn't really check that, thx for the hint
Also, wha do you mean by access - via lua code, or through the GUI when playing?
You see, I have a backpack and there's a wallet inside.
But once I try to access that wallet It will crash the game.
The inventory of the wallet works fine, I can get the inventory / items so I don't understand why.
item textures are 32x32 right
too lazy to open the files and my memory is that of a summer ant
What's the code you're using to access it?
And are you using that mod that puts nested container in the inventory list?
I'm only using my mod which gets the job done so far but not if i want to go deeper.
It even shows the inventory of the wallet but then just freezes.
containerButton = inventoryPage:addContainerButton(item:getInventory(), item:getTex(), item:getName(), item:getName())
I mean it's the vanilla code to create the button so nothing fancy really.
Of course after looping through the items of the backpack.
Is it possible to make a stove that uses propane tanks use propane bottles instead?
Im trying to make new furntirue and want to use the propane bottle. Do I gotta write a new lua or is it possible by editting .tile files?
Like a BBQ where you right click -> add propane tank, right click -> remove propane tank?
That would need some LUA to add the context menu - add a function to the OnFillWorldObjectContextMenu event that is basically
if thing is not myStove return else check if there if propane bottle to remove and if so add "Remove propane bottle" to context menu, then if empty and player has a propane bottle add "add propane bottle" to context menu"
You'd be able to copy a lot of that from the existing BBQ context menu & functions
When exactly does it freeze - when you mouseover the button, when you click button, after clicking and rendering the item list, etc.
I'm guessing the vanilla InventoryPage or InventoryPane is making an assummption that the container is in your player inventory or a directly accessible container, and somwhere that is causing an issue - maybe because it does a getParent and it's not the player or player inventory so it just gives up on life.
Has anyone figured out animal mods yet? I'm Big Hoping for some honse mods lol
or even dogs
Short version: animations are a huge problem
I guess clicking and rendering, since I can see the items of the wallet before it freezes.
Everyone who tries goes insane and starts gibbering about AnimSets
I suggest adding debug print statements to the vanilla functions that get called until you can isolate which one it's getting stuck in
Everything should be in ISInventoryPage and ISInventoryPane.
I'd start with the Update function since that from memory populates all the inventory items
How would I add debug to the vanilla functions? I only have the decompiled version of ISInventoryPage and Pane.
Do I have to copy / overwrite the whole function?
Morning all. Suppose I would like to have a zombie spawns carrying a bag containing specific items (say, a duffel bag full of money, or a mailman with satchel carrying books and magazines), is there a mod that does this or a guide that I could study? Thanks!
Make a backup copy of the vanilla lua files, then start throwing in print("here I am") statements
\media\lua\client\ISUI\ISInventoryPage.lua and ISInventoryPane.lua
That's odd?
The black pants don't get equipped, but every other pants type does.
I know it's the right name for the black pants, cuz it's deleting the belt on spawn properly
If it was the wrong item name, it wouldn't delete the belt and would just ignore it
I'm gonna pretend I didn't see this
and just continue working
You're checking HasBlackPants for the RangerPants elseif clause (so it's running that, in that case, and never hitting the second one)
shii you right
👨❤️💋👨
I also have some general pointers on the code, if you're interested
Sure, I tried doing this a couple other ways but gave up and started doing it manually lol
You're doing identical checks in your HasX functions—for example, you already have FirePants in scope which will be identical to the result of HasFirePants (assuming getPlayer() is the same player, but if it isn't that seems like a bug). You could get rid of those helpers and just use the variables directly. So if HasFirePants() → if FirePants
Further: (definitely pressed enter on purpose, totally intentional, building suspense)
Unrelated but I did the doctor profession to see the pants id and I think it spawned me in the wall of this building??
I spawned in and everything was dark and I had to noclip out
I think it spawned me in this cube??
Since the branches are mutually-exclusive & the function is only doing that one operation, you could do each check separately & return after so you don't make calls you don't ultimately need. So, instead of
local FirePants = inv:getItemFromType('...')
local BlackPants = inv:getItemFromType('...')
if FirePants then
...
elseif BlackPants then
...
end
You could rewrite as
local FirePants = inv:getItemFromType('...')
if FirePants then
...
return
end
local BlackPants = inv:getItemFromType('...')
if BlackPants then
...
return
end
-- etc.
Would that still work for having it all be in the RemoveBeltOnStart(player) function?
because it needs to run on game start
Yeah—the return here is just "done running this function" (rather than "returning a value")
unless i'm missing some context the hours survived check is redundant since OnNewGame only runs when the character first spawns anyway
Does it run when leaving and rejoining a save?
no OnCreatePlayer does that
OnCreatePlayer is whenever you rejoin but OnNewGame is when the character spawns after character creation
no idea why theyre named like that lol
Anyone know if the game always used lua? Back in the original pre build 40 days was it using just java?
Curious to know if they had to go in and reprogram things to expose it for lua or if it just always had it
New issue that I found on accident
dying with only the mod I'm working on enabled causes an error screen :)
My first thought is that it's possibly the fact that my character is wearing a new clothing type? Since it's not using a vanilla body location, maybe it's bugging out on a zombie?
maybe something relating to trying to call for the player character but there not being one? unsure
All I know for sure is I have zero idea how to fix this :)
What does the error say?
Should be visible under Errors in the top left
Oh nevermind it's happening with NO mods enabled!
what is going on
What on earth
https://discord.com/channels/136501320340209664/1332680949300985976
Someone else having same error, left a message there
is there an easy way to tinker attachment offset and rotation without reloading game?
so the mesh is the .fbx right?
im pretty sure its used lua since at least 2012 or 2013 since all the current ui is made in it
im assuming they added a lot more lua exposed stuff in b41 because i remember the workshop being fairly dead before then
I'm shoked
🤣
Isn't there also an event (might be a OnCreatePlayer param I dont remember) that has an newGame param that essentially does the same thing
It'd be nice to know the difference

does anyone know anyone who does vehicle mods? Im willing to pay for a custom vehicle mod
KI5, he's the GOAT, but he's probably also extremely busy
That's exactly what was needed to get it to work. Thank you!
Glad you appriciate it! Have gotten couple of comments informing me it's broken
Did they fix animations yet?
if I do a getText("Recipe_AddACigarette") on a recipe shouldn't it give me the "Add Cigarette to Pack" string back? when I print(getText("Recipe_AddACigarette")) it prints in the log Recipe_AddACigarette the same if I don't use getText()
Currently trying to add a select few items into the character creation menu, and although it is working for most other items there is this problem where the red and blue trainers don't appear in the menu along with the usual randomly colored sneakers, which I am adding in by essentially overwriting the specific dropdown:
ClothingSelectionDefinitions.default.Female.Shoes = {
items = {
"Base.Shoes_Random",
"Base.Shoes_TrainerTINT", -- random color sneakers
"Base.Shoes_Strapped",
-- additions
"Base.Shoes_RedTrainers", -- red trainers
"Base.Shoes_BlueTrainers" -- blue trainers
},
}
As of now the two unique trainers don't show up as separate options and the original "Sneakers" option simply selects the the tinted sneakers. They do actually show up occasionally on a character when you spam the random button a few times but they remain unselectable by the player, my guess is that it has to do with the three different sneakers being named "Sneakers" which causes the option to only appear once for the first item in the list
hi new to modding, how do i add my mod to my game for testing
put it in C:/Users/your name/Zomboid/mods
and then enable it in game
id also recommend turning on debug
thank you
sadly it looks like the mod manager mod from b41 may never get updated, TIS seems to have redone the ingame manger and now its part of the main menu.
the default one wouldn't be bad if it had a more features like the modded manager.
Hey guys, also very new.
Trying to make a very simple mod. Struggling with step 1, the structuring.
I saw the File structure outline on https://pzwiki.net/wiki/File_structure#Workshop_folder.
If I'm only working on B42, do I put all of my mod files into the 42/media/ folder, or if I put it into common/media/, will it pull through?
Do I also need to specify 42.1 // 42.1.1. or will 42/ folder pull through for all B42 builds?
Feel like I'm struggling with the very first step haha.
technically common, or 42 will work. and no you dont need specific version numbers.
anything in common will also show up in other versions.
I thought so. So if I'm building in common, do I still need a 42/ folder at all, even if it's empty?
Im not sure if its needed, remove it and test, but having an empty folder shouldn't really matter either. its not good practice to put everything in common however, as you will get people on b41 trying to use the mod and if its made for 42 obviously it wont work.
Will do, thanks LT!
np
The Wilderness Update for Support Corps is here! Enjoy new features like portable and light stoves and generator, camping heater, cold & flu pills, MRES and much more
https://steamcommunity.com/sharedfiles/filedetails/?id=3409836763
the best mistake I've made. sound on
finally done with a big mod! hope yall enjoy
https://steamcommunity.com/sharedfiles/filedetails/?id=3414584080
do -- add shoes options
local t = ClothingSelectionDefinitions.default.Female.Shoes.items
table.insert(t, "Base.Shoes_RedTrainers")
table.insert(t, "Base.Shoes_BlueTrainers")
end
do -- allow similar names in drop down clothing menu
local fn_false = function()
return false
end
-- makes that the combo allows any duplicates
local function fixCombo(combo)
if combo then
combo.contains = fn_false
end
end
local old_createClothingCombo = CharacterCreationMain.createClothingCombo
CharacterCreationMain.createClothingCombo = function(self, bodyLocation, ...)
old_createClothingCombo(self, bodyLocation, ...)
fixCombo(self.clothingCombo[bodyLocation])
end
local old_createClothingComboDebug = CharacterCreationMain.createClothingComboDebug
CharacterCreationMain.createClothingComboDebug = function(self, bodyLocation, ...)
old_createClothingComboDebug(self, bodyLocation, ...)
fixCombo(self.clothingCombo[bodyLocation])
end
end
Hm, it doesn't work. But now I fixed it. @pulsar sinew
Hey, been thinking for a while and one of the things that REALLY bothers me about Project Zomboid is the whole progression system with reading books.
Think it's a bit annoying and distruptive to the gameplay.
Does anyone know of or ever considered making a mod that removes all the default skill books entirely from the game.
And rather reward a very very tiny % of multiplier for each action you did towards a skill?
So that the more you did e.g. metalworking ingame, the higher your multiplier would become over time?
thanks, as a temporary fix I did use some lua to change the names of the sneaker items but I didn't really like having to change the names of the vanilla items, appreciate it
taken me like 4 months but i finished it 💀
https://steamcommunity.com/sharedfiles/filedetails/?id=3414634809
Hey guys I just had an idea for a mod
It could be either easy as shit to program or hard as shit
Simply water freezes in winter, becomes ice, and all water becomes floor. You can still extract water by drilling or chopping the ice. Maybe in the future things like ice breaking could be added
Would that be easy to add in or hard? Like is it possible to make a lua that once it detects say -5c, it auto converts all water tiles to ice floor
Holy cow, my dream mod
Instant subscribe
Amazing mod bro
awesome
"Adds new UI"
I salute you 
Adding UI 
it took me like 3 days to get a working dropdown menu when i started lmfao
anybody know what is causing this error? Thousands and thousands of errors are popping up for my gunmod..
attempted index: setVehicle of non-table: null function: onExitVehicle -- file: ISVehicleDashboard.lua line # 614 | Vanilla function: damageChecker -- file: ISVehicleDashboard.lua line # 666 | Vanilla java.lang.RuntimeException: attempted index: setVehicle of non-table: null at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1667) at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:624) at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:173) at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1963) at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1790) 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:81) at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:315) at zombie.gameStates.IngameState.onTick(IngameState.java:1893) at zombie.GameProfiler.invokeAndMeasure(GameProfiler.java:195) at zombie.gameStates.IngameState.updateInternal(IngameState.java:1777) at zombie.gameStates.IngameState.update(IngameState.java:1443) at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:101) at zombie.GameWindow.logic(GameWindow.java:377) at zombie.core.profiling.AbstractPerformanceProfileProbe.invokeAndMeasure(AbstractPerformanceProfileProbe.java:76) at zombie.GameWindow.frameStep(GameWindow.java:921) at zombie.GameWindow.run_ez(GameWindow.java:814) at zombie.GameWindow.mainThread(GameWindow.java:615) at java.base/java.lang.Thread.run(Unknown Source)
@umbral raptor how is that going to interact with the mod MRE XIII which makes MREs realistic, ie containers that have the components of an MRE.
awesome job!
it is completely independent
both MREs spawn naturally
anyone remembers if ZombRand(x) generates (0,X] or [0,X)?
there should be no reason for conflict.
but my first strike MREs will make you want nothing more in life. -70 hunger and a juice packet with every single MRE
eh thats too cheaty for me sadly.
i mean they only spawn in surplus stores and military bases
and these places tend to be filled with more zombies than Louisville
but i got like 47 other things in the mod haha
the mre mod has just MREs
yeah, the other stuff is what im interested in, but it also contains the MREs. which would mean I have more than one MRE spawn happening.
just leave em behind if u dont want em
i based my MREs off the vanilla MREs mod
which is awesome imo
Thinking through it - you need to do a lot of tile replacing for water <-> ice, so risk of huge performance impact especially if you have to check every square of every cell that is loaded. Then when you dig up ice what is left? Making a hole down to the next Z-level sound like a coding nightmare, but "ice but I already took some away" would be a weird tile type.
Maybe (and this is huge maybe) you could redefine the water tiles to ice tiles with different texture properties & passability flags so you don't need to update tiles. Also, you're going to have to figure out what happens to a player/zombie that is on the ice when it melts.
Mods I didn't know I wanted. Thank you!
With your mods I can now wear an open jacket to show off my abs.
Does it have sandbox options for spawn rates for these items? if it does that would be amazing, could fine tune it how id like for the various parts etc.
No, that's on the list of things I should remember by now but always forget,.
[0,X)
i jsut ctrl+f in game code for it 
function ISLootStreetTestUI:getRandomKitchenCounter()
local nbr = ZombRand(4);
if nbr == 0 then
return "KitchenDryFood";
elseif nbr == 1 then
return "KitchenBreakfast";
elseif nbr == 2 then
return "KitchenBottles";
else
return "KitchenRandom";
end
end
found this
so figured it's [0,X) xd
this error recognized by anyone? 😭
ive seen a few mods do that, not sure what causes it, something is conflicting with the ISVehicleDashboard.lua
offffcourse...
search for another mod that was doing similar and reach out to its creator to see how they fixed it? sorry, best advice I have for you.
So the error happens when your mod is in use? Does your mode have lua code, or just weapon items?
remove all your b41 recipes
did you accidentally break getPlayerNum() somehow?
amazing work! this is so cool
having b41 recipes in a b42 mod bricks player data
My mod has just atiny bit of lua code- a weapon gunshot sound randomizer
gotcha
If you remove that, is the problem fixed? that's the quick way to know if it is that code causing odd issues.
the recipes, or the lua?
either one I haven't removed yet
recipes makes sense, as the entire system changed for b42.
Even if they are in the B41 folder? Or do yo mean if the B41 recipes get into the folders for the B42 version?

