#mod_development
1 messages · Page 345 of 1
I'm Jim from Jim's Paradise, 156.236.84.50:16261. I'm looking for a modder to join the team. Short term or long term, we have a good team and a great community. Any resources or information on a better place to seek help would be appreciated also.
I'm still having an issue with receiveObjectModData index= -1, which I've been told is from transmitModData() being used on a player, or an object not having a correct index.
Does anyone have any more information on what other methods might be ran to cause this issue?
I have tried searching through over 600 mods lua files for transmitModData() calls, and none of them have changed since well before the time the error started occurring, and none of them seem to be called by a player either.
Is it something I am missing? This bug is server crippling, and with the sheer amount of mods I have, binary subtraction and running our test server is going to take forever, especially if it's not always reproducable. Sometimes the error occurs, sometimes it doesn't.
Any help would be appreciated. Pulling my hair out over this one. Thank you!
Hello,
I am developing a SaltyChat integration to move voice chat to Teamspeak.
I was wondering if it was possible to open a websocket connection directly from ProjectZomboid to a localhost address ?
anyone want to make 5x faster washing machine/dryer/combo washer dryer?
You might want to make a Java mod for that
And modify how voice chat works
Has anyone added a new item into bags like HikingBag, ALICEpack_Army or SchoolBag? it's a file called Distribution_BagsAndContainers.lua, I can't figure out how to add new items to these bags :/
You posted this twice btw
Hey guys, im developing a mod that adds custom 3d hats, when i equip a random of the four that im making, the tooltip and the models doesnt show up and when i hover the cursor over the item a lot of errors occur, here's the script for anyone willing to help:
i had no problem with this (b41, not sure if its the same for b42)
i just overwrite the file and it reflects ingame
tho iirc it only does this if local hosted not SP
Make sure you load the game in devmode and look at the little window/console that boots up with zomboid it will usually give you an idea whats wrong with the mod
I have to assume its script related though
Away from pc so can't help further
Also try to indent/space the code out a bit. I dont think thats the problem but it could be
i have the mod errorMagnifier so i can see the errors but since im not a developer, i cant "decifrate" it, so i put the errors in chatgpt, but, yk, chatgpt isnt really a good buddy to errorsolve with
ight
Send me a screenshot
1 sec
hmmm maybe include "imports base" at the very top, all of my mods seem to have it
imports {
Base
}
yea i tried to like copy the script of a mod
wait ill send u the screenshot of the error
oh yeah also make sure the very last item has 2 } under it
yea that's checked✅
Is there a way to mute specific world sound locally (e.g. for one client only in mp)?
maybe its the models? im working on em
like one worked a few days ago
but then after i added some more
nope
no more
this was a nightmare/learning experience but ferk yea
im happy 4 u man!
and my wife made fresh applesauce so I'm happy too
hell yea
still nothing, i tried changing the model and everything
might be a long shot, but have you tried to change the icon to a vanilla icon, like JacketSuitTux
no i havent let me try
well the icon generates, but the tooltip and the model arent showing up
this does nothing, i don't know why it's been popularised so much
this usually indicates an issue with your clothingitem
I only did it because the mods I looked at had it
yeah, everyone says that 😅
I learned it form you, dad
^
there's a bug that causes an error that says 'forgot to import Base' in weird situations where it isn't true so i think it might originate from that
imports are mostly only useful for recipes (and even then i recommend against their use)
they let you refer to script objects from that module without qualifying it with the module name... except from when they don't, which is quite often
for stuff like items it's not really useful
I thought the duster / riot thing were you scripts. So the masks, I know vanilla uses all caps for CanHaveHoles like CanHaveHoles = FALSE
idk if that's your problem. everything else ok
case doesn't matter
shootin' spitballs
the missing tooltip usually means the bodylocation is bad or the clothingitem is bad, and the bodylocation looks fine to me
Mhh
i dont know what the issue could be..
bruh why does modding have to be such a pain in the ass
Or maybe it could be the model
honestly all the 2 script files look fine to me
destroy the emitter playing the sound haha
I am thinking of trying to mod in a real basic item (cold brew coffee), but honestly I work best by having an example to work from. Does anyone know of an open source PZ mod I can look at?
I did ask Gemini, and it looks kind of accurate, but I'd still at the very least be able to fact check the response
{
imports
{
Base,
}
item MyCustomDrink
{
// The item's display name as it appears in-game
DisplayName = Zomboid Cola,
// Defines the item as a food/drink type
Type = Food,
// The item's category in the inventory menu
DisplayCategory = Food,
// What happens when you eat/drink it
EatType = popcan,
// This is the icon file name. The full path would be `media/ui/MyCustomDrink.png`
Icon = MyCustomDrink,
// How much thirst it quenches. Negative values reduce thirst.
ThirstChange = -20,
// How many calories it provides
Calories = 50,
// How much hunger it fills. Negative values reduce hunger.
HungerChange = -15,
// Reduces boredom and unhappiness.
BoredomChange = -20,
UnhappyChange = -10,
// How much the item weighs in-game
Weight = 0.6,
// If the item can hold liquid
CanStoreWater = TRUE,
// Can be used to collect water from a source
IsWaterSource = FALSE,
// The item that replaces this one when it's finished
ReplaceOnUse = Base.EmptyPop,
// Sound played when the item is used
CustomEatSound = DrinkingFromBottle,
}
}```
Hi! About the PZ modding policy: Is it allowed to publish your own mods on GitHub, even if the mod files contain asstes from the vanilla game (in my case, some textures and icons)?
i don't think that's clear from the policy but it seems like everyone gets away with it
just checked the moddiing policy again and did not find any restrictions on the platforms where you can publish it.
to be a bit more on the safe side of things, I always add a custom license text to my mods and also to my GitHub pages:
License: Project Zomboid is owned by The Indie Stone. Except for any restrictions imposed by The Indie Stone's modding policy, I consider all my mods to be open source in the sense that as long as you do not publish a plain copy of them on Steam, you are free to use any element of them, modify to your liking and share the results with the public. Note that some of my mods may contain third-party assets. These are either CC0, CC-BY or owned by The Indie Stone. In the latter case, they can only be used in accordance with The Indie Stone's property rights. In case of CC-BY, my mods contain a file listing the sources. Make sure to comply with the CC-BY license in case you want to re-use them.
If your using vanilla textures/icons, you can usally link to the vanilla versions and not need to include them. If you significantly altered them and are not charging for the resulting product, its generally considered 'fair use' (Though I am not a lawyer, etc etc)
(ie your mod should be able to use the vanilla versions just like vanilla code does, so you don't need them as part of your mod to use them)
So... does anyone know why this exists other than the very vague comment
-- we duplicate copies of business to weight the ratio of EMS to business vehicles to as was in b41 VehicleZoneDistribution.business2 = VehicleZoneDistribution.business VehicleZoneDistribution.business3 = VehicleZoneDistribution.business VehicleZoneDistribution.business4 = VehicleZoneDistribution.business VehicleZoneDistribution.business5 = VehicleZoneDistribution.business VehicleZoneDistribution.business6 = VehicleZoneDistribution.business VehicleZoneDistribution.business7 = VehicleZoneDistribution.business VehicleZoneDistribution.business8 = VehicleZoneDistribution.business VehicleZoneDistribution.business9 = VehicleZoneDistribution.business VehicleZoneDistribution.business10 = VehicleZoneDistribution.business VehicleZoneDistribution.business11 = VehicleZoneDistribution.business VehicleZoneDistribution.business12 = VehicleZoneDistribution.business
Im guessing its because of instead of each subitem having its own % to pick variable (and doing a lot of math to pick one), its picked based on just on picking a random entry, so the more entries = more chance.
I feel like there were multiple other ways of doing that lol
Absolutely. But lazyness.
The proper way is to write a whole chances variable to each distribution table entry, code to loop through all the elements, add up a chance, pick what element based on a random roll based on the total chance.. etc.
the lazy way is vehicletospawn = VehicleZoneDistribution[ZombRand(#VehicleZoneDistribution)]
(or some horrible java equivilent of that after parsing the LUA table)
(Yes I get the code doesn't work because its not actually an array its a table but you get the idea)
For some reason the business vehicles don't have any sort of definitions for them (in the normal lua file at least), just vehicle spawns, so I'm guessing there's a lot going on behind the scenes like the stupid traffic jams
Of course, considering hoooowwwww many 'pick a random element from this table based on chance % of each element' zomboid does, the fact it doesn't have a universal 'pick random thing from table' function is kinda sad.
OH IT JUST CLICKED IN MY HEAD
(or maybe it does. I dunno)
VehicleZoneDistribution.business.specialCar = true; now the ems part makes sense, chance to spawn in parking lots, and they didn't feel like reworking how special cars spawn in normal lots
wait
does this mean...
I can steal vehicle zones from vanilla?
What's stopping me from just.... VehicleZoneDistribution.business12.specialCar = false; and giving it a new definition
I mean, lots of mods completely rewrite those tables yea
Nothing is stopping you from VehicleZoneDistribution = {} and starting over.
or anything else you wanted to do.
I couldn't figure out how to make my own vehicle zones so...
Depending on the license, just altering an image is in general not enough to publish it somewhere in your own work afaik. I guess it is allowed in the context of Zomboid modding in case you use indie stone's own assets for a mod. But in general, I would be really careful even with those things.
Anyone can help me how i can send data from Client to Server in B41 ?
Code Snip from Client.lua:
local function AWLR_reportChunk(player)
[...]
local data = {x=chunkX, y=chunkY}
local success, err = pcall(sendServerCommand, "AutoWeaponLootRespawn", "ReportChunk", data)
end
-- 1 in-game minute = 2.5 seconds at default game speed
Events.EveryOneMinute.Add(function() AWLR_reportChunk(getPlayer()) end)
Server.lua:
Events.OnClientCommand.Add(function(module, command, player, dataTable)
if module ~= "AutoWeaponLootRespawn" then return end
if command == "ReportChunk" then AWLR_playerReportedChunk(player, dataTable) end
end)
but i dont receive anything on server-side
what does pcall look like? thats where it sends the command to the server right?
yes, its an internal function to catch lua-errors
just ignore it, it wont work without it anyway.
https://github.com/MrBounty/PZ-Mod---Doc/blob/main/How to use global modData.md
see the section "Networking"
yea i dont want to use ModData because at some point thats too much traffic
not sure whether there is another way of doing this...
i just want o receive a message on server-side which the client sends 😉
are you sending a client command to the server?
i see the function to receive the client command but i only see send server command
and also you need a function to recieve server command
sendClientCommand is what the client uses to send, sendServerCommand is sent from the server to the client
well i didnt post the complete code but sure there is a function for receiving 😉
guess my misunderstanding is that the client needs to use sendServerCommand as of "send to server" 🤔
So then this is correct?
sendClientCommand - to send a message to the server
sendServerCommand - to send a message to the client
OnClientCommand - is triggered on server side when a client command is sent
OnServerCommand - is triggered on client side when a server command is sent
Using ModData.transmit(String key) and the event OnReceiveGlobalModData is definitely a standard way of doing this. I don't think it creates or is vulnerable to "too much traffic" more than any other construction which might work. Just make sure to use a unique key.
i dont think that this is a intended way to use ModData.
yes
that is definitely a way that moddata can be used. I don't know about how efficient it is though. typically moddata is used to store data and transmitting is when you want to update that data between the server and client. server commands are used to trigger functions on the server or client side.
I'll link that on the wiki
Yea that's a classic one
It's bad ... if your mod data is too heavy you can't transmit directly properly
In fact that's why using commands is sometimes better
I remember Burryaga banging his head on it bcs it wouldn't transmit properly, or maybe it was someone else
mod data transmits the entire table at once no matter what
for larger tables it's completely unviable and you can even hit the packet size limit
personally i do not use the mod data networking methods whatsoever and always use commands instead
You know, maybe making a networking lib for default stuff like that could serve less experienced modders
Would reduce risks of copy pasting stuff for example and creating code clashes with other modders
what would it do? i stay pretty raw with commands personally
oh... I thought it would just transmit a reference, say some hashmap key or smth...
but I have no clear reason for this. just thought this would be the most intuitive way of realizing such a system lol 😅
i thought that would be the case. i just didnt actually know. its good i learned the right way the first time!
Provide mod data proper transmit and module command handling
Wrong one I wanted to link but you see the idea, the whole process of intercepting commands handled for them
i don't know, do what you want but it seems excessive, networking is already extremely simple
starlit originally had a networking framework but halfway through writing it i realised it was just a bunch of boilerplate for the sake of it
when it comes to mod data transmission it's more of a conceptual issue that is difficult for a library to take care of, you can work around the issue by sending the mod data in chunks but the actual problem is that you're trying to send insanely heavy data when you really shouldn't
typically you'd work around it by sending only the changes to the table rather than retransmitting the whole table every time
but when possible the best workaround is to not synchronise data at all
a class that tracks its changes and can transmit them would be kind of cool to write but still overkill i think
yeah it takes no time to write a client/server command setup that updates parts of moddata. it does sound like overkill
when i have local wx, wy = player:getX(), player:getY() what do i have to do to calculate the chunk? wx / 32 ?
test results of lua calls in craft recipes:
OnTest - basically isValid. Fires about 20 times and then a couple more times after starting to craft
OnStart - fires after you've completed crafting *sadface*
OnUpdate - never fires
OnCreate - fires after you've completed crafting
OnFailed - nothing, but it's hard to test every way it could fail
if you have the player x,y you can getCell():getChunkForGridSquare(x,y). if you have a world x, y, z you can getCell():getChunk(wx, wy, wz)
you can also get the chunk of of almost any object iirc
getCell also has functions to get world coordinates, width, height, etc
oh i need z? damnit 🥴
Hmm true
getChunkForGridSquare ignores z
My thought wasn't for experienced modders but newbies instead
Of course it's not hard for us to do
But networking best practices seem to be an issue for new modders
Chunks don't have z coordinates tho
Do they ?
i think better documentation would do more to this end, i'm still struggling to think of what a networking library would really do
the documentation that exists is okay but a little difficult to find and i think the concepts are a little difficult for newer modders to grasp
a lot of new modders think that stuff in the shared folder is literally shared between the server and the client over the internet 😅
I spent some time a while ago looking for a way to spin up a coop player just long enough to grab the chunk and then kill it - but no luck
the folder structure was 100% confusing when I started
documentation can only do so much there because it is objectively confusing from a design standpoint
well i want that the client sends its new entered chunk to server which then checks for objects in that chunk.. But the server throws an error when i run ```lua
getWorld():getCell():getChunk( math.floor(player:getX() / 10), math.floor(player:getY() / 10) )
getPlayer():getSquare():getChunk() would return the current player chunk
Yeaaa I didn't take the time to do it bcs I didn't want to put effort for B41 exclusive stuff but a Networking page would be useful for the futur to add onto and modify for B42 when MP releases
I think it's fairly easy to understand, just needs to be properly explained
i got a question
could someone direct me as to which file controls what sort of clothing XYZ type of zombie will wear?
<@&671452400221159444>
like say i want to add extra piece of clothing to army zed- also hi albion
hey jan, feels weird seeing you here 😅
yup im rarely here
but today is one of those rare moments when i gotta seek extra know how
because i cannot find it on my own lol
that would be the outfits in media/clothing/clothing.xml
wait really? its the same file from which we can pick premade set ups in the character creator
yeah, the character creator thing is just a debug thing to check outfits i think, it's not normally visible
huh, i thought zeds might use seperate file or something but thats cool with me, helps me learn when i eventually create zed type altogether
thanks for the help
Hey guys, I've been trying to get a custom cell into the vanilla map, and I have it enabled in the mods list, but when I try to load the map in game, it crashes to desktop. Related errors that I found are on lines 2733 and 2939. Any ideas how to fix this? The cell im trying to replace is 53,22 if it matters.
my mod is "BetterCabin" if you're curious...
In B42, is the contruction
if modInfo and isModActive(modInfo) then
-- do smth if mod with id modID is enabled
end```
still valid?
yes, but remember that mod ids are prefixed with \ now
also usually the idiom```lua
if getActivatedMods():contains("\modID") then
-- do something
end
many thanks!
so did they change this in one of the recent updates (that you have to use \modID instead of modID)???
it's been this way since build 42's first release
wow. ok. somehow didn't notice this but it silently broke a lot of compatibility patches I included in one of my mods. 😭
Hi guys, what is the B42 equivalent (if any) of ISCharacterCreation ?
Isn't that the same ?
i still have problems using getChunk() serverside of playerdata
I'll use
function AWLR_getPlayerChunk(player)
local px, py, pz = player:getX(), player:getY(), player:getZ()
local cx = math.floor(px / 10)
local cy = math.floor(py / 10)
local cz = pz or 0
return cx, cy, cz
end
which returns imho correct values. but when i run
local cx, cy, cz = AWLR_getPlayerChunk(player)
print("DEBUG: cx:".. cx .." cy:".. cy .." cz:".. cz)
local cell = getWorld():getCell()
print("DEBUG: cell ".. tostring(cell))
local chunk = cell:getChunk(cx, cy)
print("DEBUG: chunk ".. tostring(chunk))
the output is:
LOG : General , 1756373582965> 7,829,952,937> DEBUG: cx:1086 cy:986 cz:0
LOG : General , 1756373582965> 7,829,952,938> DEBUG: cell zombie.iso.IsoCell@1c72189f
LOG : General , 1756373582965> 7,829,952,938> DEBUG: chunk nil
i need the chunk to run getObjects() etc.
How can I synchronize the display on the client side when container operations like container:AddItem or container:Remove are performed on the server side? The Add/Remove functions work correctly, but from the client's perspective, the items inside the container do not change. However, restarting the server correctly shows the updated state (with items added or removed).
does container.requestSync() sync things?
I tried executing container:requestSync on the server side, but it didn't change anything. 🙁
Looking at the vanilla files, after AddItem is used in a server\ lua file you see this:
local item = character:getInventory():AddItem("Base.LightBulbGreen");
sendAddItemToContainer(character:getInventory(), item);
in B42, your milage may vary if your using B41, that or look in the lua\server\ dir for AddItem and see what shows up if thats not valid for B41
this probably only applies to b42 where adding items is server authoritive
Thank you. In B41, sendAddItemToContainer exists on the Java side but isn't registered with LuaManager, so it seems it can't be called. I also checked the vanilla Lua on the server side, but I couldn't find any useful commands and am stuck. 🙁
You could maybe make the client do it by sending moddata or something on the container in question but dunno.
Or just try to move the process client side?
No server lua calls AddItem?
container:removeItemsFromProcessItems()
container:clear()
container:requestServerItemsForContainer()```
this will sync server and client
line 1190 to 1195 of ISInventoryPage.lua
Thank you. That seems to be client-side processing, and since I want to synchronize from the server side, it's a bit different. But thank you.
Thank you all for your advice. I'll give up on B41 for now and try again with B42.
i add items to containers using OnFillContainer serverside code and don't have any issues with the items showing up on different clients
your issue is probably that the item is added while the character has the container opened
if that's the case, the client will need to update
you don't need to synchronise changes to containers during that event because it is triggered before the server sends the contents to any clients
ahh
unfortunately b41's client centric design means that changing containers from the serverside is actually quite annoying
you can use sendItemsInContainer to send added items but iirc there is no way to send removed items
on the client you would just do add/removeItemOnServer instead of the regular add/remove methods
Yes, for B41 multiplayer, I've implemented a temporary fix using add/removeItemOnServer on the client side. This approach may cause several other issues, so we plan to properly address it in B42. Thank you!
and I'm back to getting distracted to the point I never finish anything
because now I need to retexture the log stacks and the camping logs
It isnt actually, I finally found it though: CharacterCreationMain
Made a nice little UI hook 
Is there no Events.OnGameExit.Add?
no
I'm not sure if this will help you. But just in case, maybe I found something interesting there for myself.
https://theindiestone.com/zomboidjavadocs
Since it's modding related and probably won't show up often enough for anyone to care, there's an exploit to duplicate vehicles that are floating under the map, like the shadow cars? If you get into them by using the radial menu (spam clicking) and exit, the vehicle duplicates and you can use the same key for both vehicles. The containers inside do not duplicate unfortunately, but the vehicles themself are exact copies.
Anywas, is there anyway to flip a vehicle over WITHOUT it spawning under the map? Because when you change the vehicle angle without increasing the height, all it does is flip under the ground... and I don't know how to increase the height.
If the car is underground, you won't be able to get it out using standard means.
Alternatively, you can try the "car teleportation" mod.
https://steamcommunity.com/sharedfiles/filedetails/?id=2994732935
Well, no, I'm spawning the car with my mod, and I'm also rotating it, but if I rotate it upside down as a story event it just falls under the world layer.
Aaaah, that's it. Hmhmh 🤔
vehicle:setAngles(180, 0, 0)
flips it facing north, but the entire car rotates around a central point that is the bottom of the vehicle, so now it's underground
Maybe I could change some properties of the vehicle itself? That feels like I'm doing too much.
it also seems like getWorld():registerZone() doesn't seem to care about vz.z, so that doesn't help
have you tried using the built-in debug functions?
Yeah, I was trying that a while ago. The vehicle would never respond to anything I threw at it. I even made my own button to flip it, tried calling the button (which worked MANUALLY) and it didn't work. So I managed to get the vehicle, it would throw up vehicle angles (which I could hide), but it would NOT set the angles afterwards and I never got any errors to troubleshoot with. So when I teleported to the region with the vehicle I wanted to flip, it would pop open vehicle angles, but I had to manually hit flip for it to flip it. I'm not sure what I'm missing there.
It's possible. Most likely, the vehicle's state simply isn't syncing with the server. For example, using the vanilla "flip/rotate" tool for vehicles, it will change its position only visually on the client side for the person who is using it. In order for these changes to take effect, there needs to be interaction with the vehicle— for instance, the player must be inside it— only then will the server process the vehicle's state.
But this relates to the vanilla tool. Your issue might be something entirely different.
Or are we just thinking about different things 
looking good
commission
OKAY nevermind everything from what I said, apparently it's called setDebugZ which does not sound like something related height, angles, vehizles, zones, objects, or anything specific and is only used ONCE, I've been completely thrown off all day just from that
cool
Better vehicle + player interaction update when? Climbing on vehicles is a noob trap for unprepared survivors, very funny
Hey guys, I’m new to PZ modding. What’s the simplest thing I could try modifying, so I have a small problem to solve and get some practice?
That'd be cool yea
If you want to get into understanding deeply Lua, I suggest modifying UIs
They are almost 100% implemented in Lua and so you can modify a looooooot of things regarding thing
Try changing the background color of a UI
Try chabging its border color
I think that'll teach you well how Lua classes work, and how to modify simple elements of existing objects
I pulled out the vanilla animation using "ZomboidAssetConverter" and changed its Z position so that the animation was visually higher. Please tell me how to save it back correctly now? Now when I try to start the animation, the character just freezes in place, I think the problem is that I am saving the animation incorrectly
Remove the camera and light, I think those are exported too, however they shouldn't be the cause of the problem
As for exporting properly the animation from imported assets idk I haven't seen anyone do it
nope, it didn't help
Yea like I said they aren't the reason your export doesn't work
But they will throw messages in the console when present
when i started i only used recipes
simple scripts and a few lua
thats limited but it will give you what you need to understand pz i guess
Got it. So is there a way to visually raise a player higher?
Guys I'm really tired
I got everything right. File structure is right, lua script is fine, and the mod is loading, but nothing prints in console.txt at all.
I'd really appreciate if some VC with me to help me.
you might just have that bug where prints don't work
How to fix it?
it happens sometimes when you switch from b41 to b42, you can fix it by deleting your cache directory
i think there's only one specific file you actually have to delete but i don't remember which one
that will reset all of your settings and be sure to copy any mods and stuff out of there first
You mean the Zomboid folder in the users directory?
The enitre folder should be nuked?
yeah, unless anyone knows the specific file you need to delete
the game recreates any files that are missing from there, including the whole directory if necessary
the issue is something to do with old files from b41 messing up b42
Ok, I'll try this. I should cut my mod folder and put it back when the files are recreated, right?
yeah, backup the entire cache folder if you're worried honestly
omg i forgot your fucking saves are in there
i use a separate one for modding so that doesn't come to mind 😅
It's fine I died in my last save and didn't care to make another character in the same world 😭
blah
reflection ignores visibility modifiers 🤫
trying to find a way to nuke a craft recipe since the enabled and debugOnly flags will nuke your game
why it kills the game instead of throwing an error and ignoring the recipe
how to visually raise the player by Z coordinate during animation?
I've only done this with setZ() by decimal amounts. Also have to set as climbing or they will be injured if they go up a whole level. If it can be done in the animation xml I wouldn't know
Got it, thank you
Events.OnGameStart.Add(function()
local SI = getScriptManager()
local newRecipe = SI:getCraftRecipe("JBLogging.JBSawLogs")
_ALLTHEDAMNRECIPES = SI:getAllCraftRecipes()
_ALLTHEDAMNRECIPES:remove(newRecipe)
print("Papa, can you hear me?")
print(_ALLTHEDAMNRECIPES:contains(newRecipe))
end)```
ugh
trying to find what's reloading craftRecipes inside the beast named ISInventoryPaneContextMenu.createMenu. maybe it's just a debug thing.
isnt that just one massive function? i hate directly modifying the inventory/world context cause of that
don't worry, they moved the world context menu into java recently so you can't mod it at all anymore 😃
guess I won't worry about fixing that part in my max capacity override
I should procrastinate more
it's getting serious now. Even stuffing prints in the beast.
Events.OnGameStart.Add(function()
local OnTick
_JBSAWRECIPE = getScriptManager():getCraftRecipe("JBLogging.JBSawLogs")
_ALLTHEDAMNRECIPES = getScriptManager():getAllCraftRecipes()
_ALLTHEDAMNRECIPES:remove(_JBSAWRECIPE)
print("Papa, can you hear me?")
print(_ALLTHEDAMNRECIPES:contains(_JBSAWRECIPE))
OnTick = function()
if _ALLTHEDAMNRECIPES and _ALLTHEDAMNRECIPES:contains(_JBSAWRECIPE) then
print("Papa can hear you now, son")
Events.OnTick.Remove(OnTick)
end
end
Events.OnTick.Add(OnTick)
end)```
thats nice of them. lets move everything to java we'll just be java modders
that didn't help at all. guess I'm back to following the many threads of craftRecipe javas
so it's a me problem
making assumptions without testing again
Why is Feeble, Weak and Weak, Puny

in today's How Stupid Is He? My log item script has no tags at all. I open the crafting menu, and there's still a bunch of recipes that hinge on tag=Log - like most kiln recipes.
idk why this is. I've restarted, reloaded, etc, and the recipes are still there.
if you're overriding the vanilla script, in b42 tags and other things can linger
scripts work really strangely in b42
hmm, ok. I'll keep poking at the keyboard then
no Log, no game
it didn't like that at all
I'll assume(because that's what I do) that the Log tag is a remnant of the OG item script that persists even if you 'overwrite' the item
If I wanted to catch an item when it spawns, I can get it from OnFillContainer and change the item from there? Or is there a better way?
you could do that or use the item's oncreate function
ooh, forgot about that, thanks!
how do i play custom animations? i followed the guide here (https://steamcommunity.com/sharedfiles/filedetails/?id=3035712003) and made it for b42, i added print statements on numpad press. I see print statements but dont see my player play the animation, how do i solve this?
had a spelling error when i moved things to b42
test worked, very nice
and no, I don't leave everything global - in case you were wondering
is there somekind of mod for events or something
game gets little boring once you have everything setup
Expanded helicopter event
Can someone explain what in hell is going on?
Code
Last time playing PZ it works fine. It seems like some update change something and I can't figure it out. Send some help please🙏
Bag is full ?
If empty the same effect
No idea here
It might be a feature of inventory tetris for some reasons ?
I think try asking the IT dev
They should know way better than anyone what could be the cause
Because it can be either:
- the bag function that defines what items it accepts (which you don't seem to have)
- the IT UI blocking the item transfer for some reasons
extended anims ui is broken on b42
im guessing its the old code but the anims trigger changed
Networking guide
Is anyone working on a ammo crafting mod for b42? Because the only one that is working atm is ammo maker and it has a awfully complex ammo making system.
Not to my knowledge
Dang it. Thats sad, my modding knowledge is way too small to make my own (and i dont have patience to keep updating 🤣 ).
idk why I can't figure out how to get the container of an inventory item / ComboItem. I thought I knew but it returns nil.
I've tried getContainer, getOutermostContainer, getItem():getContainer, etc. It's not a table and it's not an array. I'm lost.
it should be getContainer() but its an itemContainer
getItemContainer
getItemContainer is a no go
maybe it's the way I'm getting the item
function JBLogging.OnCreate.GardenSaw(comboItem)
local container = comboItem:getItemContainer()
print(container)
end
Events.OnGameStart.Add(function()
instanceItem("Base.GardenSaw"):getScriptItem():setLuaCreate("JBLogging.OnCreate.GardenSaw")
end)```
local itemCont = bag:getItemContainer()
if itemCont then
local spawned = itemCont:AddItem(toSpawn)
this is from a recent code
on game start is triggered before you even have a player object
afaik
as long as I don't try to get the container, the rest of the code works ok
what do you want to do with the container?
getItemContainer() is for getting the inventory contained within an item, not the inventory the item is contained within - use getContainer() for that
however, that will not work here either, because items are not placed into a container when oncreate is called
remove the item, and add a different item
that was an assumption, but usually when I assume...
you assumed about your assumption...
then
getItemContainer():Remove()
getItemContainer():AddItem()
yep, if I could get the container
try it using lua console
cuz you tried it before the bag item existed
you can use
getPlayer():getInventory():getItemsFromCategory("Container")
I was trying to catch the item when it spawned as loot. like albion said, the item doesn't have a container when it's created, so I'll have to catch it the old fashioned way
i didnt know that. when do they gain container then?
Anyone able to help me with adding a moodle? I've got a blank one to show up so far but it isn't displaying the picture. The moodle is just supposed to be an indication there aren't any levels to it. It should either be shown if the condition is correct and not shown if it isn't.
looks like 1 to 2 ticks
heavy on the 1 tick, 2 ticks not so much
Maybe I'll just wait a tick or 2 and then switch my items
my stupid way of doing things. reusable now. I might add weighting to it, idk
local function swapItemOnTick(item, replacements)
local function OnTick()
Events.OnTick.Remove(OnTick)
if not item:getContainer() then
Events.OnTick.Add(OnTick)
return
end
local container = item:getContainer()
container:Remove(item)
--print("Removed " .. item:getType())
local rand = randy:random(#replacements)
local newItem = replacements[rand]
--print("Adding " .. newItem)
container:AddItem(newItem)
end
Events.OnTick.Add(OnTick)
end
function JBLogging.OnCreate.GardenSaw(item)
swapItemOnTick(item, {
"JBLogging.CrossCutSaw",
"JBLogging.RipSaw"
})
end
Events.OnGameStart.Add(function()
instanceItem("Base.GardenSaw"):getScriptItem():setLuaCreate("JBLogging.OnCreate.GardenSaw")
end)```
you can use the item property OnCreate maybe.. (not the recipe)
that is what he is doing
doing it the stupid way
<@&671452400221159444>
The onCreate is fine, as for the on tick -- I'd look into inventory updates instead - There should be one like "OnFillInventory"
But onCreate should cover most cases I would imagine
it's not mid-game friendly but I don't think a lot of this mod is - it changes so much. I do need to add a fallback in case the on tick fails for whatever reason.
I think the 'stupid' way is less heavy.
and if I could figure out how to call a function with only the string name, it could be injected in to any item script. which I know is kind of pointless.
sifting through the lua like, where is it calling these ISWorldObjectContextMenu functions from? when it hit me - it's in the javas now
yeah 😭
I think it was you who told me, and I immediately blocked it from my memory
ouch,
they're left in because there's a boolean to turn the lua context menus back on but i suspect they won't actually update the lua side so it'll break soon enough if it hasn't already
that was probably just there for testing while the java conversion wasn't complete
this video is a fun take on programming
follow form more programming content specially in javascript , python , c++ , java and become skillful coder and developer
Don't forget to LIKE, COMMENT, and SUBSCRIBE for more tech comedy and insightful developer content!
#programming #coding #DeveloperLife#WebDevelopment #UIUXDesign #JavaScript #Pyth...
I did find LuaManager.getFunctionObject(string) so my 'stupid way' of injecting an OnCreate into an item might get 'stupider'
hey, im trying to change Trunk Storage, i found
ProjectZomboid\media\scripts\vehicles\template_trunk.txt
and they contain a
Capacity = XXX
but changing these does nothing?
vehicle_trailer_cover.txt has no Storage in it
any generic vehicle has this
``` part TruckBed
{
itemType = Base.BigTrunk,
container
{
capacity = 130,
}
}```
you can easely change this, but Trunk vehicles sadly dont have this
build 41 or 42?
latest
https://steamcommunity.com/sharedfiles/filedetails/?id=3452113500
pretty simple if you use this mod
wow thanks.
it's not perfect but it can overcome the games hard set max capacities
Neat! I had some ideas for this but would love to see how you implemented it. I had some random midnight thoughts about a trunk capacity extension mod, and apparently just calling the setcapacity() on the trunk doesn't work too well on save/load/damage without something to persistently apply the changes.
@queen oasis Or is it cause I applied those changes in a client\ lua and not a server?
(b42)
capacity is capped in java
Oh, the 1000 cap?
yep
Oh, me and Morlog where talking about the regular capacity
stuff changed by
test:setContainerCapacity(test:getContainerCapacity() + 50) ```
that works till you hit something or save/reload.. at least, on the \client lua it does.
ie, trying to increased a 150 trunk to 200
(or trailer)
(Morlog was trying for trailers, so slightly different ID)
trailers just use TruckBedOpen I think
Yea he figured out 'TrailerTrunk'
Truckbed is what cars use, for reasons
and even has a comment to say 'should be changed to trunk because truckbed is dumb'
(paraphrasing)
yea, TrailerTrunk1, 2, 3 can't believe I missed that
yea, but the ID is TrailerTrunk with no postfix
can't believe no one has said anything on the mod
@gleaming haven Im thinking at this point you'd have to like, save your new capacity in modData and then just setup a function, like one of the part.update() functions that runs every 1 second on parts of active vehicles.. or.. something, and just constantly set the setContainerCapacity
of your trailer.. Unless doing it on the server properly sets it.
I dunno how your going to selectively get the vehicle you want, on the server side 😛
I see what I did. I made it future proof already. nice
^ or see if this guys mod fixes the issues!
if you're staying under 1000 you should be good to go
(you'd change the setContainerCapacity for.. whatever moddata set that his mod instructions say to use)
does your mod listen for the moddata on the server or client side to execute setContainerCapacity?
for modData, it's all client but the main bits, I hook in to the meta tables to tell lua to use my capacity functions
Niceeee
PS: I lost like at least 4 hours of my life trying to change the capacity for gas tanks in vehicles.
I think you have to getItemContainer on the vehicle part to set the capacity
god damn im an idiot I could have just faked it with moddata on the gas tank and screwing with the guage and/or fueltank.update()
the only mod data I use is to override for "special" containers
no IIRC it uses something else and you just can't change the capacity because its linked to the scriptitem and not the item
but I realize now, with all the modding iv done, my engines could run off moddata just as well as they can real fuel!
Pretty much the only real thing would be hook the mechanic menu to display the new faked value
NOT THAT I CARE ENOUGH now that I finally figured it out.... espeically since I guess that still wouldn't work with gas pumps properly... meh.
VehiclePart:getItemContainer() will give you the container, then you can setCapacity() on that
For gas tanks? Im sure I tried that but will try to remember it, thanks 🙂
gas tanks can eat me
someone else was messing with them
trunks,. easy! gas tanks? GO TO HELL PUT A JERRY CAN IN YOUR TRUNK!
just add like 40L jerry cans or something I dunno.
add a vehicle context menu to refill from inventory while driving, I dunno. anything but try to alter gas tank size again.
and just download a gas tank trailer mod for taking large amounts of fuel home
it worked btw. just added TrailerTrunk
or useful barrels or something.
Yay!
By our powers combined, a fully functional mod emerges!
holds up his gentle encouragement ring as his apparent contribution
Add a second gas tank, problem solved
Does that work with gas pumps?
1 gas tank on each side
problem solved x2
cursed I tell you. Realistic but CURSED
Someone should mod in gas tank addons that replace car seats
remove an entire section of your car for more fuel lol
that was literally what my trunk expansion mod did
and then I was like.. oh hey, I bet fuel could be done too!~
butNOOOOOOOOOOO
not fuel
:(
ok but as @gleaming haven found out, it doesn't survive past damaging or save/load without using @queen oasis 's mod lol
Im sure i could refine it some someday.
maybe using jimbeandiablo based TECHNOLOGY.
if there is demand for trunk based expansion with seat removal...
the main issue I found with it though, was, lets say you have a van right, 2 seater, cargo. 150
but then you have one of those stupid station wagons.. 6 seats, maybe more, 90 capacity.
What's the issue specifically for that?
20 capacity per seat you remove.. it ends up as more capacity then the stupid cargo van!
I need a way to upgrade the cargo van.. to be.. cargoyer then the stupid multiseat SUV
that got its seats ripped out..
lacking seats shouldn't be a disadvantage in cargo capacity.
True
Hmm, may be I shouldn't be looking at seats removed, but seats remaining instead.
I remembered how to add a context menu option without looking at an example. That's a win.
tomorrow, I got to get this tree mod out of my ~~logging ~~deforestation mod. it's getting too big.
How is this screenshot low resolution
bout to get fuzzier cuz it's almost uh, high time to turn this ish off
Ask the almighty reddit at peak hours of the day and I think a lot of people would like to see it, just include a screenshot of a concept so their brains can be hooked into the post first
some low hanging fruit for capacity mods using the override mod. jus sayin
the biggest issue is the "heavy load" moodle. if someone could lua that away...
<@&671452400221159444>
Thanks
saves and spawns properly, up to 48 custom items, needs some general cleaning up, but almost done.
- give weapons efficiency to reduce action speed
- designate a skill to give a 20% bonus to when item is held
- default numbers automatically set in ui when base item is changed
- alter drop rate and choose any spawn location categorized or uncategorized
X ignore damage over time, doesnt work, yet atleast, might be dropped
guys?
why is these zeds
not at where i changed their X and Y?
local player = getPlayer()
local playerX = player:getX()
local playerY = player:getY()
local playerZ = player:getZ()
local currentCell = getCell()
local radius = 10
local radiusSq = radius * radius
-- getWorldMarkers():addGridSquareMarker(sq, 0.8, 0.8, 0.0, true, radius)
local squaresInRadius = {}
local startX = math.floor(playerX - radius)
local endX = math.ceil(playerX + radius)
local startY = math.floor(playerY - radius)
local endY = math.ceil(playerY + radius)
for x = startX, endX do
for y = startY, endY do
-- 플레이어 위치와 현재 순회 중인 (x, y) 좌표 간의 거리를 계산합니다.
local dx = x - playerX
local dy = y - playerY
local distSq = (dx * dx) + (dy * dy) -- 두 지점 사이의 제곱 거리
-- 현재 GridSquare가 반경 내에 있는지 확인합니다.
-- 제곱 거리가 반경의 제곱보다 작거나 같으면 반경 내에 있는 것입니다.
if distSq <= radiusSq then
-- 해당 좌표의 GridSquare 객체를 가져옵니다.
local sq = currentCell:getGridSquare(x, y, playerZ)
if sq then -- 유효한 GridSquare인지 확인합니다 (맵 경계를 벗어나는 경우 등).
-- 테이블에 추가합니다.
if sq:getDeadBody() then
local deadbody = sq:getDeadBody()
print(deadbody)
-- deadbody:removeFromSquare()
deadbody:setX(playerX)
deadbody:setY(playerY)
deadbody:setZ(playerZ)
table.insert(squaresInRadius, sq)
else
end
end
end
end
end
print("Around Player's " .. radius .. " Radius " .. #squaresInRadius .. "squares were found.")```
this is the code i did
i made the deadbodies teleport it's X and Y to where player X and Y is at
but as you can see in the pic. their sprite is there.. but not their inventory
Oh yeah... this is definitely gonna be a muliplayer issue with ragdolls lol
I have this issue too. I've tried all of the ways to make it work but its always broken in some way. like if you get the sprite and the container then you drag it is invisible in your hands but still on the ground, or it duplicates visual in your hands while being visible on the ground. The solution i've been told is to "refresh it" by putting it in the player inventory, i still had the same issues though
if you have any luck with this let me know. i want to move dead bodies in my elevators 😭
maybe you need to set dirty the inventory UI for it re refresh.
like take the mod off?
no, thats not what he ment
lol sorry, bad at understanding
public void setDrawDirty(boolean b)```
ISInventoryPage.dirtyUI();
is this inventory class
belong to world inventory?
and could you explain what does dirty inventory function really do ?
I heard adding the petrol tag to propane tanks makes them refillable with gasoline. Will this still work in b42 with the fluids update and what not?
Possibly not no
I actually don't think they consider propane a fluid either
Gasoline uses the fluid components now
should i just include that dirty ui in the code after setX()?
is there a way to sync the objecet information
once the object is moved from 1 place to another?
i think that's the problem...
yeah propane tank code doesn't have fluid container code
The fluid code can barely handle fluids that are always liquid, I don't think it's ready for gas stored under enough pressure to become liquid.
So I'm trying to create a custom pill. It essentially works like Sleeping Tablets, however I want my custom function for it to apply well my stats and whatnot. However in the vanilla code I can't find where in the items_medical.txt, tells it to act a certain way.
Essentially what im asking is: Do pills also use OnEat?
Nop, pills are mostly Java sided
And I believe it's still the same thing in B42 if you're modding on that version
Yeah modding in B42
Yea pills are annoying to mod, essentially what you want to do is basically reprogram the pill behavior in Lua 🙄
Or
I believe pills are recognized by a certain method
Can you set the pill offset value in its scripts ?
If so then you need to find how the game identifies the pill to add the context menu option to use it
But yea meds are a bit weird in how they are implemented
Well from the looks of it, the game identifies it as a pill, when you add Tags=Pills, to the script
At least when I did that, it added the context menu option
to take pill
Now where tf it's pointing to, I have no idea
I assume its probably in the Java side
Yea
To teleport containers you basically have to remove and re-add the world objects. Here's how I was first selecting a backpack on the player square using G, and then walking away pressing H to teleport it:
local currentItem = nil
function RC_RoomLogic.CustomKey(key)
local player = getSpecificPlayer(0)
if key == Keyboard.KEY_G then
local sq = player:getCurrentSquare()
local objects = sq:getWorldObjects()
for i = 0, objects:size() - 1 do
currentItem = objects:get(i)
print("Selected:", currentItem:getItem():getFullType())
end
elseif key == Keyboard.KEY_H then
if currentItem then
local sq = player:getCurrentSquare()
local item = currentItem:getItem()
-- remove the existing world object
currentItem:removeFromSquare()
currentItem:removeFromWorld()
-- re-add the inventory item at the new square (creates a new world object)
sq:AddWorldInventoryItem(item, 0, 0, 0)
currentItem = item:getWorldItem()
-- some inventory refresh stuff because you never know
triggerEvent("OnContainerUpdate")
local pdata = getPlayerData(0)
pdata.playerInventory:refreshBackpacks()
pdata.lootInventory:refreshBackpacks()
end
end
end
This would teleport the visual object and the container object to the new square.
I would assume something very similar would work for bodies as well
Yeah just tried, it works. Just use the dead body as the currentItem
@open drum Try the method I use in the code above, just replace the currentItem with deadbody
oh wow nice
can u direct me to ur code?
Haha sure, it's the comment right above 😄 #mod_development message
oh sorry, i ddint' see that, im dumb
hahaha all good 😂
looks like it deletes the deadbody and make a new one in the new position
i wonder whether it would have the same ID or have diff. one
I think same one, because you're only removing and re-adding the visual representation of the object, not the logical part of it
Glad I could help! It was a headscratcher for me too, but with help from Albion and Doggy I found out how to do it
Only part I think i didn't try before is the refresh at the end. Thanks ill see how this works in my case
Hello!
I want to create a mod for a visual fatigue effect. Can I dynamically change variables in screen.frag by accessing them through a separate Lua script?
If you just want visuals on the screen you can create them by adding ui elements
You can hook the 'eat' function reasonably easy
local oldComplete = ISEatFoodAction.complete
function ISEatFoodAction:complete()
self:BFcompleteEating()
return oldComplete(self)
end
``` copy of my hook for eating
oh, also hook stop:
local oldServerStop = ISEatFoodAction.serverStop
function ISEatFoodAction:serverStop()
self:BFcompleteEating()
oldServerStop(self)
end
Yeah but the question is what the context option "Take Pills" points to
I.e when you click Take Pills, is it considered ISEatFoodAction
Yea im saying, push comes to shove you can try making them regular food instead. Or maybe just hook the right click context menu generation and add your own take pills
Ig yeah
Yea someone answered suggesting its handled in java, so offering some alternative ideas
this still breaks the corpse when grappled for me
it does not duplicate it this way though' i think its a step forward compared to how i was doing it before
its about where i was last time really, im not wasting another weekend trying to make this work 
I'm confused. I get comments like this all the time on a mod:
Yeah there was an typo or something in the mod.info file requirement \StarlitLibrary I changed it to StarlitLibrary and now I can activate the mod
My mod.info has require=\StarlitLibrary which I'm 99.9% sure is correct for 42. Am I missing something?
i don't really get it, i've heard the same thing once or twice but it's simply not true
i wonder if nosteam changes it? i haven't had to use nosteam since b42 doesn't have multiplayer anyway
oooh, I never thought of that
since the reason for the \ is technically that the workshop id is supposed to be on the other side of it
I don't have any desire to test it with -nosteam but at least I have a question I can ask them
Yes, sounds good, but I would like to use some native GLSL shader parameters (like blur, noise, color HSL, etc.) so as not to create them from scratch. Is this possible in principle?
why not just require it thru the workshop page
it is
oh then idk
I'm hoping it's like albion pondered, that way I at least have an answer
color can be done easily and there is a built in blur function, it may need to be tweaked to do what you want, but as far as noise i dont think so that may need to be added
So hey all, I’m new to project zomboid, I have tinkered with programming for years, I’ve had some luck modifying the lua files in the base game to get mod-like functions but I’m interested in packaging up thinks to distribute in future. What are some guides/resources/tips people can provide to this end?
I wonder if it's possible to make a submod to Furry Apocalypse..
like make a reskin
I have this idea of adding the Rage infected
Not sure I understand the plan here lol
Wdym a submod to Furry Apocalypse to add rage infected lol ?
What's the link between both here ?
Oooh reskin the furries into looking like rage infected ?
Does anyone know where in the game's files traits are handled? I wanna add a trait to my mod that affects reading speed but I have no reference on how to do that so I'm looking for how the game does it
jimbeam are u there?
hello
i have a question, i use this JB_MaxCapacityOverride.addContainer("TrailerTrunk", 600, false) JB_MaxCapacityOverride.addContainer("Bag_MedicalBag", 100, false) JB_MaxCapacityOverride.addContainer("Bag_Military", 100, false) JB_MaxCapacityOverride.addContainer("Cooler_Seafood", 100, false) JB_MaxCapacityOverride.addContainer("Mov_ClothesStand", 500, false) JB_MaxCapacityOverride.addContainer("Mov_GreenWallLocker", 500, false) JB_MaxCapacityOverride.addContainer("furniture_shelving_01_27", 500, false)
the first 4 seem to work but not the later 3?
the last three are moveables
oh they wont work then?
like the last one, it's container is metal_shelves
the other two I would have to look at
aahh is there a way i can look up what the containers are? 🙂
if you search for the tile definition in the game lua, it could turn up
sure ill search the files thx 🙂
the last two probably use a generic type
Someone on poedgirl's Infinite Carryable Containers made a list of most/all container names
thx found it
hi, which client event is guaranteed to fire after the player is fully created and ready, so that I can safely send a client command to the server? I tried using OnGameStart, OnCreatePlayer, and OnPlayerUpdate, but they didn’t seem to work. The only one that fired was OnPlayerMove, but only when the player starts moving (b41)
I only needed it to fire once, so I unsubscribed right after it triggered
because of a bug you can't send commands on the first tick
local commandsReady = false
local function onTick()
if commandsReady then
Events.OnTick.Remove(onTick)
sendClientCommand(...)
else
commandsReady = true
end
end
Events.OnTick.Add(onTick)
when do initmoddata trigger? before or after oncreateplayer?
am i right to assume
moddata
distro
player
?
global mod data is after sandbox options are loaded, 41 and 42
distro is before mod data, and players much later
and this is where I leave it tonight. lots to fix but better than where I started
if I had known "TreeDamage" was only for HandWeapons, I would have done it all way different.
can I grab RenderEffectType from java so i can stuff it in to lua? I swear I've grabbed enums before.
public enum RenderEffectType {
Hit_Tree_Shudder,
Vegetation_Rustle,
Hit_Door;
}
TIL you cannot put certain key words into vehicle zone names (even when combined with other words), or else they just don't work for whatever reason...
Yeaaaaa. Just zomboid hacks.. In vanilla, Any car with 'trailer' in its name won't have the brakes forced on when towed 😛
Is there anywhere we can set profession requirement for a recipe (B41)? I looked over the pz modding site, but I don't see anything that sets it.
The only close one I see is to learn the recipe when you're declaring the trait, or under CanPerform
I'm hoping to see the actual profession required under Craft helper
that won't be possible
you can check profession in the CanPerform function or only give the recipe to that profession but there isn't any system to recognise that you are doing this
so it won't be possible for a tooltip or something to represent it, without hacking a custom ui element in or something
thanks albion, yeah i'm afraid so. I do see this
setFreeRecipes(List<String> freeRecipes) from Profession Factory but I haven't seen an implementation so I dont have reference haha
Hey! sorry, been busy and haven't noticed I already released Project Zomboid Mod Updater/Downloader v1.1.5 for the game!
👑
Update 1.1.5:
- updated SteamCMD executable.
- new feature - resuming downloads, now when there is a problem, the program can resume downloading missed mods.
- code refactoring and adjustments.
- fixed issue when you start fresh and program crashes.
Instructions: - download and extract the archive preferably into your PZ installation folder.
- if "mods" folder doesn't exist (weird...) in your PZ installation, do create it.
- if C:\Users\yourusername\Zomboid\Mods folder doesn't exist, please run the game once just to create the settings environment.
- run with PZModUpdater.exe
- minimum screen resolution required 1600x900
If you have any feedback/bug reports/good vibes, do tell and share...
https://drive.google.com/file/d/1_yCDaG3yRhWBo6Vdz6LH6rz8PJCUjs4S/view?usp=sharing
i was about to post this on the tool thread but you already did. thnx
😉 thanks!
Hi... my backpack is not loading(invisible) when in game but I have it weighted paint(full red), parent to bip, even rotated it .. also the texture is not appearing even when I have it in xml and texture folder
B42. I gave the player a zombie walk, but when holding a weapon during this walk, the weapon just floats in the air. How can this be fixed?:
Anyone know where to look to render sprites with depth?
you have to modify the x or fbx file to actually place the prop bone onto the hand of the zed
(textures)
Could you please explain in more detail how to do this?
you have to learn animations
its not something that can be explained really
learn blender iguess
i use fragmotion for animation
and blender for modelling
tho using fragmo is frowned upon
so its not really recommended
Thanks, I’ll give it a try.
Are images required for adding an item for a mod to function? I keep getting CTDs. I've added Grits, Pot of Grits (Uncooked), Pot of Grits (Cooked), Bowl of Grits (Uncooked), and Bowl of Grits (Cooked). It was pretty much a copy and paste of Stew/Soup to get working, so it feels like it should work even without an image.
Or wait, did I not need to make different items for Cooked and not cooked?
Nevermind, I figured it out.
are you trying to add tiles with depth maps? the tile sprites are the only thing i know that have depth
Might have to just draw proper models.. though I think inventoryitem 2d sprites also have geometry depth?
(they are flat but actually do clip behind players and such that walk in front of them)
i would think if you made depth maps for the sprite and are calling it as a sprite, rather than the texture, it would use that depth map
Iv yet to find a single drawing function that actually takes a Z depth -_-;
Rendering a model would also be acceptable if I could do it without like creating a whole inventory item per model rendered..
can try this Render3DItem(itemObj, square, xCoord, yCoord, zCoord, itemRotation)
would need an item per different model but if its all the same model i think you can use one item over and over
YAY
Hu its LUA side too
Hu, CleanUI uses it
Oh, I think its being used for the 'place item' codepath
Use Blender
And see the Animation wiki page
But when trying to import a .X file into Blender, the animation doesn’t play, does it?
The less you use fragmotion, the better it'll be, trust me
Glytcher is one of the extremely rare cases where he uses this absolutely dogshit software
DirectX is NOT up to date, it's old and there's a reason barely any software support it by default, bcs the whole industry moved to fbx
At the very least
There's literally rigs that were made specifically for pz animating
Nothing really supports animated .x format
Yes, I tried to use ZomboidAssetConverter to import a vanilla animation, but I couldn’t figure out how to properly export it back. Could you please tell me exactly what needs to be done to export a modified animation?
So what should I do then, create animation manually?
Dunno, I don't do animations
Hmm, No alpha input.. but it does lead me to: TextureDraw.nextZ =
Anddd technically these smoke effects where for a java mod.. anywayy.
Ah renderTextureWithDepth...
That's not true either tho
But it's quite an old ass format
I posted this in bug reports but now I’m unsure if I did it in the right place
Is there somewhere specific to post mod dev related issues?
The Problem: Tooltips on Mod Option Combo boxes are not shown despite the API function accepting a tooltip entry. In MainOptions:addModOptionsPanel(), the mod combobox path creates the control but never assigns a tooltip. There’s no setToolTipMap(...) call in the option.type == "combobox" branch....
I've given up on RenderEffectType because I'm a quitter. But, I can saw trees like a boss now.
might be helpful in there, too
Ah, ty.
Nice, can you not have a set timed action progress bar ?
In this case, you're sawing the tree with a fixed time no ?
That's the right place actually
#1318920979581501502 they never do jackshit with things sent there ....
it's doing tree damage like an axe
I'll go test this out, and I'll add it to the wiki as a bugbox
I see nice
hey they fixed the zombie blobs and the ZombiePalsTM I reported... I know they fixed it for me
Yea but these were literally generic bug sent in bug reports on the forums anyway ?
no. Just. For. Me. 🙂
before I get crazy(er) with this code, is there a way to put the outputs from a craft recipe on the 'floor' that I might not be finding?
I can't find a good way to do that. it looks like ISHandCraftActions calls Actions.addOrDropItem to put the outputs in player inventory
Is there a way to get radios and TV to play endlessly, maybe loop back to the beginning or at a certain point
That way they never turn off
I did just the stupid thing
Let me know if you need anything 🤗
You guys know what he means right? 
Least dramatic reddit crash out lol
This should be a copypasta actually
these gatekeeprs that run the company
ok, so I don't think player:Move(Vector) and MoveUnmodded is what I wanted. Trying to nudge the player a few pixels forward before starting an action
Move looks like the player jumps to the location
say the "c" word one time and the DM's don't stop
Do you think it's possible to teleport the player up 1 level to stand on an invisible floating tile if they walk onto a tile occupied by a vehicle?
I know when you press F2 and move your curser around a vehicle, it doesn't detect the vehicle until it is the center tile, so I think there's some potential there (it would be janky but cool)
Wait, why not?
they'll be way too high up
in a hardcoded manner 😅
Shit yeah of course
i'm not 100% but i don't think there's much potential for custom height levels
yeah could look okay
I just don't know how the player would reach the tile the car takes up if it's in the middle...
It works fine when falling on a car because it just pushes you out, but getting to that tile is impossible without no clipping
Maybe if it was in the radial menu and it just straight up teleports you
This is basically just the RV mod but for roofs lol
is it just me or
right clicking the Trees don't function as the way they suppose to?
like... simple right click over trees don't take you to isoTree class
they are just considered as isoObject
until you press the Cut Trees context menu with an Axe
maybe use a transition via animsets xml
theres a mod that adds a rooftop to its vehicle i forgot the name of the mod. its a huge ass vehicle with interior . it was top 1 for a long time
Poorly.
IsoTree derives from IsoObject and whatever your accessing isn't overridden by IsoTree so it falls back to whatever function IsoObject has for that situation
yea i know but
before 42.11
when u right click .. worldcontextmenu event passed
worldobject of a tree as isoTree class
but now it passes as isobject
thus causing error to some of the mods
not sure if this is a bug or indiestone decided to change the way tree class works
i wanted to make sure so i can adapt my mod to it
if it's a bug then i can just wait till the next patch
if it's intended then ill have to fix the code
Yea im not sure exactly how java/lua classes/derived classes all work out when accessed via LUA since LUA doesn't entirely have that concept?
whats IsoObjectType getType() return?
though even if it is still technically a tree, Id have no clue how you'd go from java passing you an isoObject to getting the isoTree part again...
that kinda assumes its a reported, known bug that they intend to fix...
yea the weird thing is
getType() causes error too
lol
they.. broke.. getType?!?
seems like it...
Does IsoObject just return nil on getType()?
yeap
like, they managed to pass you the IsoObject instead of.. the actual tree object
yeaaa...
unless i messed something up
I can only assume that when you pass the baseclass in java to LUA, LUA has no clue about the derived interface.. or ability to access it.
Unless they added like a 'GetAsType' sorta function to IsoObject that I can't find.
i guess its more like
tree object is not getting passed to worldobject parameter
but when after i press the "cut tree" with axe
it shows up correctly
having any item that has "axe" tag in ur inventory i think
no I mean, look at the code the cut-tree context menu calls and how'd it get a tree instance
Or how the menu that even creates the cut-tree context menu knows a tree exists. (since its axe in inventory AND right clicking on a tree)
Maybe they moved trees somewhere else because theres so damn many of them and they do so little processing?
Again, Id look into how 'cut tree' context menu knows a tree is on the tile your right clicking
clearly it can figure out a tree exists, because it doesn't show up from just clicking grass
And generally the context stuff is LUA unless they put in some nasty java patch for that explicit thing 😛
At this point iv given up and assume bugs are intended. 😛
Now I just fix them myself and release mods
anyone know a working json methode to use for a B41 mod? rxi-json doesnt work
You mean to read json files ?
I believe @red tiger had something for that ?
json.encode doesnt work
function: encode_table -- file: rxi-json.lua line # 68
function: encode -- file: rxi-json.lua line # 135
Exception thrown java.lang.RuntimeException: Object tried to call nil in encode_table at KahluaUtil.fail line:82.
local tbl = {
animals = { "dog", "cat", "aardvark" },
instruments = { "violin", "trombone", "theremin" }
}
local encoded = json.encode(tbl)
Idk what rxi json is
I wonder why the modder doesn't make a separate mod for literally just this mechanic?
last last updated sept 2022, ok understandable lol
Not sure what you mean
Do you mean as a framework for other modders to use ?
world objects passed by the menu is unreliable. try square = worldObjects[1]:getSquare() and then you can walk that or just check square:hasTree() and get the tree with square:getTree()
also, the cut tree menu calls ISChopTreeCursor which in turn calls ISWorldObjectContextMenu.doChopTree, which then calls ISChopTreeAction
Depends what the mod does tbf
Some stuff just can't be made into frameworks
Sometimes at best templates
I’m not exactly sure what you want to do or if this will be useful. You can make a floor with ramp properties appear under the player, and the player will be elevated to the position you want, whether it’s 10 or 33 (100 is z=1). You can check out my StairsEastSouth mod and do some testing. These new floors also have limitations.
In B42, is there any way of printing the content of an item? Something like print("Item: ", item) even when item is a hash value or nil? That used to work in B41 but I have problems with it in B42. DebugLog.log does not work either for me.
that should work
there is currently a bug where everything before the first : in a print is dropped
so that may be confusing you
what is the first : ??
item: <- that part
so it is the double dot ":" within the string???
print("Item : hello : foo") echos Item : hello : foo to the console and hello : foo to the console.txt log
yes
DebugLog.log prints just to the console.txt log, (that is also echoed to the ingame console because reasons)
if nothing is displaying, chances are your code isn't executing.
The code runs fine. It is related to this weird ":" bug.
overriding craftRecipe inputs is the same as outputs. I figured but you know, PZ...
local scriptManager = getScriptManager()
local function overrideDrillPlankInputs()
local originalRecipe = scriptManager:getCraftRecipe("Base.DrillPlank")
local overrideRecipe = scriptManager:getCraftRecipe("JB_Big_Wood.JBDrillPlank")
if not originalRecipe or not overrideRecipe then return end
local originalInputs = originalRecipe:getInputs()
local overrideInputs = overrideRecipe:getInputs()
if not originalInputs or not overrideInputs then return end
originalInputs:clear()
for i = 0, overrideInputs:size() - 1 do
originalInputs:add(overrideInputs:get(i))
end
end
overrideDrillPlankInputs()
I'll still keep checking for ways to just get the recipe out of the craft recipe list
It sadly turns out there is no easy way to fix the butcher animal size
If the devs use modData["originalSize"], it is wrong, since this does not exist for ground corpse.
If the devs use getData().getSize(), it is wrong for hook corpse
If the devs use getData().getOriginalSize(), it is wrong for ground corpse
.... and modData["animalSize"] is ALWAYS wrong 
i.e. we can’t make a bug report and point to a specific bug, the whole architecture (or rather data structure) needs a rework
It's confusing what you're talking about
That is what happens if someone says go here to talk about it :D the context was in the other chat. Basically I looked at the animal size used for the meat quantity etc. in butchering
In the vanilla code
What butcher animal size bug are you talking about ?
Is that still a thing ? This dates back from 42.3
yeah
I see a problem in your testing
I used the butchering debug to butcher the first sheep on the ground, and due to the debug keeping the sheep I then hooked it and butchered it a second time from there
It is not my testing
Did you test it out again ?
I read the code
Their bug report has a problem here, this is not proper testing
True, the bug report is still correct sadly
Does the carcass lose size when butchering ?
I’ve put the info in more detail here: https://theindiestone.com/forums/index.php?/topic/78339-4230-rev25882-issue-with-meat-hook-yeilds-i-think-i-figured-out-the-issue/page/2/#comment-442743
But it’s a bit hard to understand without reading all the code
I hope the devs can use that info
hi
Can someone help me? I'm creating a food mod. It seems easy. I did everything, the items, the distributions, but the mod doesn't appear in the list of mods for me to choose from. Can any professional or someone who knows what's going on help me? Please send me a DM.
Pinned messages
More specific: If your mod does not show then it's an issue with the folder structure and/or mod.info so check the pinned messages especially "mod structure"
Unless you've done something rather exotic to create a different problem, but that is very unlikely.
??
fuck can't anyone help me?
We did?
Has anyone made a AIO menu? Making one now, will be adding some QOL options to it. The usual admin options, and various other things.
bro my mod doesn't appear in the list to activate the mod
What have you done to validate your mod structure and mod.info since being told they were the likely causes and given links to information on these things?
can i show the mod info
No.
Because that suggests you have not put any effort in yourself, and if this is not worth your time I'm not going to spend my time on it.
Bro, I've been trying to make this work for 2 weeks
But you can't spend a few minutes to investigate now you've been given specific things to look at?
Remember we're not paid support here, it's a bunch of modders hanging out and happy to point people in the right direction but not on standby to do the work
damn brother, you are rotten and colorful, improve yourself, or life will punish you
thanks
If you are not willing to put some basic effort in to work with the help you've been given why would you expect other people to help you?
ain't having none of it tonight
good girl
damn brother
I'm not genderfluid enough to switch genders in a minute. 😂
Guys... how does the void appear again? I definitely did something wrong lol
deleted floor tiles with nothing under them?
youre making it so player can walk on top of vehicles? should just need +1 to player Z level and do getOrCreateSquare() . set square isSolidFloor(true) before moving player.
Thanks for the tip here, didn't know that existed. BUT somehow... it comes back lol
Now it's even weirder because I'm not deleting anything...
Now, I do have to mention that I have to go 2 floors up (I know, weird) because some vehicles are a little taller
iirc vision is weird when doing this
I still see the black tile when exiting the vehicle
non-clickable void
I'm literally leaving a trail of void every time I move and go up again ha
It has to be something else... surely
Idk i've done this and not made void before, i only ever got void when i deleted floors
What an horrible person you are
You are not welcome here if that's the attitude you have
The pinned message we sent you has all the main major guides to getting your mod recognized again:
https://pzwiki.net/wiki/Mod_structure
And you didn't take a single minute to read this page which has every informations nor have you even given us a single information to actually help you
And like Stalker said, we're not paid to help you and if you're such a little bitch about it you can kindle fuck off from here
I have never ever seen this in my entire life lol
Please fix it for me oh please please please NO? THEN FUCK YOU
Since you say you basically done the whole mod already you probably worked off the wiki before, maybe send your mod info and if there’s a mistake maybe someone will see it or you see it yourself while copying it
Hey all! I tried to find a way to debug the current player mod data in-game but I couldn't find how.
IS there any way to see it in-game? (using debug)
What's the code you're using to add/remove the tiles?
Do you just want to see all teh player objects moddata? Pretty sure one of the buttons on the debug menu does that (or opens a UI with a few tools, one of which does that)
Exactly, I remember that one day I saw this, but can't find it again hehe
And of course it's a lua table so you use the lua console to look at specific stuff, or dump the entire thing if you want
B41 or B42? A lot of the debug tools are new in B42 but I forget which ones.
b42
like just pasting in the console: getPlayer():getModData()?
I stick in in a variable: x=getPlayer:getModData()
just to make it easier
for k,v in pairs(x) do print(string.format("%s = %s",k,tostring(v))) end
then you can drill down into more specific tables inside x
Is hate a valid motivation for making a mod? I'm so sick of seeing this shotgun axe show up on Reddit with a post about how amazing it would be.
So I'm thinking of making a mod for it, having it utterly obliterate whatever zombie it hits... then you need to reload, then you have to deal with all the noise you caused...
Does anyone know why the text fields are so close to each other? I tried to add a separator, but didn't work
Is that a custom UI, or the default mod info display?
Wait, it's not the screen I thought it was.. but still, is that a custom UI screen or one of the default ones misbehaving?
That's the default Mod Options UI
But I applied an empty description between them, now they have space hehe
Best motivation to make a mod
You should do one for making burnt food unedible completely, so people stop trying to eat charcoal
Better yet, eating burnt food makes you explode.
No way i was about to suggest the same thing lmao
Hahaha
Pipe bomb type, of course
I fixed it, been dealing with black out because I'm technically inside the vehicle now lol
It only happens at certain angles as well...
Do you know of a mod which can set zombie count? Like from 150k to 10k?
NEVERMIND, I was using n to quickly toggle invis and god mod and forgot it enabled no clip... nearly done with this!
I'm gonna go back and see if all the patches I did make it compatible with the tile version of this so I can place lawn chairs on top lol
(it did not work)
i dont know if its coding or modelling related, but i got a mod that adds flags to the game from the steam workshop (https://steamcommunity.com/sharedfiles/filedetails/?id=2933186564&searchtext=flags), i added a own flag, but i can only place it on the Y Axis and not rotate it to the X Axis? or would i need a custom script or anything?
Is it just me, or is the OnMechanicActionDone event never triggered? (B42)
Have you tried using floors with the ramp property? Set SlopedSurfaceHeightMin and SlopedSurfaceHeightMax to the same value, and it becomes a flat plane at the height you want.
Well, now that I think about it, you can’t place sprites on those floors, only 3D objects.
That would actually be sick to one hit chop trees down with for the cost of 1 shell and noise
Hey probably a dumb question but i want to add a soap item to the "soaplist" mentioned in the "ProjectZomboid\media\lua\shared\TimedActions\ISBaseTimedAction" What would be the best way to do that and where can i find the Soap list?
Hi guys, I'm new to modding, I tried to create an idle animation, I read the wiki and use Mystery Rig to create it, but I have a bug with my legs. When I move jerkily, my legs behave strangely, does anyone know how to fix this or what is the reason for this?
I have no idea, but honestly, ts made me laugh
irish river dance
I've watched it like 10 times now and it's still awesome
Bro managed to make the character skedaddle, it's just that great
Nah but in all honesty, i don't even think this is the right channel to ask, go to #modeling
They deal with the models and animations
hell yeah
hahaha the idle animation itself works fine)) but when you spam the movement, this hell happens)) and idk how to fix this and why this happen
Does the animation need the legs to move? there's a parameter for it in the xml it has to be enabled, if it is deleted it will not do animation on the legs
Hey guys! I'm working on a custom zombie mod, and I want to make it extremely tough. I know tough zombies have 300 HP, so is there a way to have a zombie have 3000 HP or even more? Is there a limit?
I know The Last of Us zombies use an Armor code, but that's not what I'm looking for. I just want it ti have a lot of HP.
Is there anything else I should do? I feel like this works good. You can even use this as a ladder if you park close enough lol
Didn't capture audio, but that doesn't really matter
You can't walk off the edge accidentally until you do a shove, that allows you to jump off freely, otherwise you cannot fall off.
I feel like I should put that in showcase, but I think things get lost in there
I didn't quite understand about the legs, in any case I didn't touch the XML file at all, I just created an animation according to the guide and put it into a game called Bob_Idle, and everything works fine, except for the moment when you start from a place with jerks
That's really cool !
Also maybe make sure the player can't build there no lol ?
Nah they can't
They could only do it when I was using tiles, but since it's just for the collision it hasn't worked like that
The final issue is making sure all these invisible collisions are getting deleted, it's not that big of a deal, but I wanna clean it up
Sorry i misunderstood. I didn't realize it's a replacement. I only tweak animations so idk sry dude
anyway ty for answer
How does that even work? Does it create invisible tiles above vehicle? What if you turn it straight to the top of screen and not sideways?
Yea
Could anyone please help me find a mod that adds mines which work in online multiplayer against other players?
With the magic of setSolidFloor(true) and math
Cursed
And yes, even with it turn sideways/diagonal, the invisible wall your run into on the sides of the top of the vehicle are not jagged.
I've walked on air several times!
It's only good for KI5's military, school, and prison buses so far, but I'd just need to adjust some numbers to fit on other vehicles. Now I could make it into little sub mods... oooooooor I'd just shove it into my already misc car mod for general things like spawn rate, spawn zones, flipping vehicles, corpses in cars, etc. It'd be a good addition!
I should probably do it for vanilla cars, but they're so short it might look weird without custom heights
Can we get a mod for b42 that allows you to dissolve zomboids in acid
How can I add a property to an item definition? Example adding "AnimalFeedType = rock" to stone so my chickens can eat rocks
Will it be possible for us to climb on top of the vehicle from the outside?
Yeah, probably eventually, that's just a lot harder to do and there wouldn't be any animation for it
That's why I only started with the buses, they have the emergency exit hatches
Actually, I don't know how much harder since I hadn't tried, but I will soon
Basically does what Custom Consumption did but with tons of the new items, and many broken items removed
Yea, you need to use DoParam. There's no proper guide on it currently so you'll have to do a search in this channel, you should find plenty of examples that way
This is nice, does this invisible floor accompany the bus all the time, or is it only created when it is accessed by the specific seat?
It can't exist at all times because people would exploit it and build invisible bridges by towing the car away lol
It would be cool, but as of right now I can't figure out a way to delete it if the car is moved away in all circumstances
I'm sure there is A way, but that's not really my focus right now
Fair enough, another thing, how do you calculate the area that the vehicle occupies, to build these invisible floors. Do you analyze the cells and if it has the vehicle then build this second floor or do you use something more complex calculating the rotation of the vehicle in the world on the Y axis and something like that?
Tiles are set to solid based on the player's movement, what limits how far the player can move is the invisible barrier I set around that vehicle roof, which is different for every vehicle and uses different math so it's smoother at diagonal angles. So they're separate systems.
I can't wait for you to publish this; I really want to read the codes.
Would it be a solution to put a conditional if the vehicle has a non-zero speed (getCurrentSpeedKmHour) then turn off the code magic, and use (getVehicles) through (player:getCell) to be able to implement it on all vehicles present?
I'll try to do it again after I finish this first vanilla car
Yo!
I need a mod for explosive traps like mines: you place them — and if a zombie or player steps on it, boom 💥!
We’ll sort out the payment details later.
Post a commission in PZ Modding Community discord 👍

In online mode where fire is disabled, it doesn’t work.
pipe bomb neither? or specifically the bombs with motion sensor (I never played multiplayer)
All of them are non-functional
Brita ?
are you a pz modder? can i pitch my mod idea for you snd youll write it if you find it interesting enough? its quite simple
No, I don't create mods, I just want to buy a ready-made mod.
if anyone has the time, could this b41 item stats be converted to b42's current system? mainly as a reference for myself to go off of.
item MethPipe { DisplayName = Pipe With Crystal Meth, DisplayCategory = Drugs, Type = Food, Weight = 0.3, Icon = DrugPipe, Packaged = FALSE, BoredomChange = -50, UnhappyChange = -80, StressChange = -60, HungerChange = -50, FatigueChange = -300, RequireInHandOrInventory = Lighter/Matches, ReplaceOnUse = DrugPipe, CustomContextMenu = Smoke, CustomEatSound = LighUpMeth, WorldStaticModel = DrugPipe, Tooltip = Tooltip_MethPipe, }
But most of it hasn't changed from b41 to b42 so yeah
i noticed comparing it between one of my working b42 mods and the unconverted mod files
im not publishing this project until i get the permission from the original creator
or otherwise until i get greenlit by the pz steam staff
Fair
primarily the swtich from recipe to craftrecipe
which is confusing to some but i find it pretty easy to use
i set the placeholder model to be a cigarette; but its clipping through the group like this. what should i do to fix it?
how would you go about overwriting certain base game text? I want to change the dates on newspapers and certain radio broadcasts and vhs tapes.
Newpapers/magazines use an OnCreate function
Track that down and you can change it... and theres' probably extra hassle to make the newpaper display the correct image when you read it
Sure, make a "barrel of acid" world object that is a container that only accepts corpses. And every hour, it makes all the corpses inside vanish.
Jush change the translation entry
Override it
No it's not ...
Just override the translation key
That's it
it's just a bunch of getTexts appended at the end of the day