#mod_development
1 messages · Page 213 of 1
them being identical seems odd, maybe unused
zombies that are being simulated by another client
Well LeaperZed took the time to add those network files
in modern zomboid zombies belong to a specific client, the server doesn't actually run their ai
i would take this with a grain of salt as it assumes the author actually knew what it did and wasn't just copying it to be safe
hmm
Gosh making custom animations for zombies is actual pain lol
Also extremely hard to understand how PZ handles those
Like if I set a custom condition to set different walktype animations, and set for a zombie this condition to true, will it still use the base animations for eating and lunging for example ? Bcs the way I understood it is that by adding this custom condition, it sets it to false by default and animsets consider all variables to false by default besides the conditions written that force those to true/false ?
Also LeaperZed has a .git folder, what's that ?
its github repo folder u can save your code in github
like this https://github.com/blackrainbowtest/PZ_SHF
Ah alright
watch youtube how to create github repo and u can track versions of your code
Well I don't need it to make my mod work so I'll probably not check it out rn but thx !
no, this is necessary for the github logic to work. It protects the code and change history from accidental and malicious modifications, and also allows you to trace the history in full.
u also don't need .gitattributes file too
I don't plan on copying his files
I just read them to understand how he does stuff
I can just ignore it overall
if its syncing, a servercommand is usually sent to update all the clients too
Alright
Guys, by the way, my mod sometimes doesn’t work as intended. Sometimes some plants do not display their growth stage correctly (visually) but the code works fine. Has anyone encountered a similar problem in other mods?
ALRIGHT WE GOT SOMETHING BOYS
I'M ON SOMETHING
Anyone got an idea why they use the custom animation but sometimes they just don't when walking and resume to the vanilla animations but sped up ?
maybe you have the same problem as me, if the code works fine, but sometimes the animations/sprites stop working )))
What's the cause of that ?
Is using OnHitZombie/OnWeaponHitCharacter to determine if damage is enough to kill the target the most efficient way to detect when a player makes a kill?
Just use OnZombieDead
That's server side right?
🤷♂️good question
is there a format or object type to which I can cast the blob data from vehicles.db? I'm thinking there's some kind of corruption that occurred from a mod I enabled, but can't pick anything out with only the binary representation. I presume it's some kind of struct or class-export?
@ancient grail Hey sorry to ping you, I'm currently working to add custom animations to zombies and I know you've done this. I looked at your code and trying to implement my own custom animations. I already have ways to detect types of zombies in my code tho it's not exactly done the same way as you.
However this hasn't really worked, I'm using your animations and AnimSets files as placeholders, modified them my own way and trying to understand how animations get set for a zombie.
if TLOU_Zombies[ZType].isClicker and zombie:getVariableBoolean('isClicker') == false then --if this is a clicker
print("setting walktype of a clicker")
zombie:setVariable('isClicker', 'true')
if isClient() then
sendClientCommand('LeaperZed', 'isClicker', {isClicker = true, zombie = zombie:getOnlineID()})
end
end
However this causes this issue. The zombie switches between the leaper animation of walking and the vanilla one. Is this an issue you got when doing your LeaperMod ?
Also I'm not too sure what's the use of calling the commands ? Talking with others here it could be to sync server and client animations ?
The sped up animation is fine, that's the time scale to set that needs to be changed but somehow it also speeds up the vanilla walking animation
What is the full line of code for this?
For what ?
Just for context, I like reading through the whole thing to see what the problem could be
There isnt really anything else
print("checking a new zombie")
print("isClicker ?")
if TLOU_Zombies[ZType].isClicker then
print("it's a clicker")
print(zombie:getVariableBoolean('isClicker'))
zombie:setWalkType("1")
else
print("not a clicker")
end
if TLOU_Zombies[ZType].isClicker and zombie:getVariableBoolean('isClicker') == false then --if this is a clicker
print("setting walktype of a clicker")
zombie:setVariable('isClicker', 'true')
if isClient() then
sendClientCommand('LeaperZed', 'isClicker', {isClicker = true, zombie = zombie:getOnlineID()})
end
end
elseif TLOU_Zombies[ZType].isBloater then --if this is a bloater
--print("setting walktype of a bloater")
end
print("end check zombie")
Actually I think I forgot to try smthg
The issue with these custom animations things is that there's barely anyone who use them, and no documentation about them as usual
How is animations defined? I have very little modding knowledge on how Project Zomboid is setup. -no documentation? I think they said they would give a bit documentation once 42 drops
I can't really help you on that part lmao
I'm trying to figure out myself how to actual set animations
@bright fog I found a good example for making changes to base game items without overwriting base game files. Turns out Hydrocraft makes a lot of changes. Example:
scriptItem = ScriptManager.instance:getItem("Base.Woodglue")
if scriptItem then
scriptItem:DoParam("DisplayCategory = CraftCarp")
scriptItem:DoParam("ReplaceOnDeplete = Hydrocraft.HCWoodglueempty")
end
Found this in the directory ...Hydrocraft/media/lua/shared
I'm going to see if this method will work to make the changes to car trunks like I was trying to do previously
You pinged the wrong person I think
Or that was a talk a long time ago?
Wasn't it you I was talking with about that like 2 days ago? lol
Yeah it was me I remember
Thought I was tripping for a second there haha
If you make a mod for this, I would happily subscribe to it and use it. I think it would be nice to be able to start with more hair colors
I figured out how I just didn't know what the colors were
ayo
Subbed and favorited 🙂
ty for ur help again, that was the part I was stuck on was trying to find out what the colors were
You're welcome!
I can't code, so just throwing out a "mod idea" to fill a gameplay hole -- I want a steady supply of eggs. Perhaps with a high enough Trapping skill one can capture a "Wild Chicken," which is just a 2d item like a regular dead bird. You can slaughter it like a regular bird, or you build a standard Chicken Coop (like the kind you see on farms) and place the Wild Chicken inside, along with some standard food items. Wait a few days and you'll find an egg inside the coop. The coop can only hold chickens, eggs and vegetables/bugs. More chickens, more eggs. Not enough food placed inside, they become regular dead birds.
Could someone tell me which Event should I use
when i want to fill context menu
when i right clicked an item in my inventory?
OnFillInventoryObjectContextMenu or OnPreFillInventoryObjectContextMenu?
and also can someone tell me if the object info (such as item name ) gets passed through into parameter of OnFillInventoryObjectContextMenu() automatically when i right click that item?
or do i need to designate it previously?
yo guys, is there a way to retrieve a building?
Yes
Check Cordyceps Spore Zone's code
Any good modding servers
Alright, maybe someone can help me.
I have an InventoryItem on the ground which has moddata on it. In MP, how can get that moddata to sync. I know the InventoryItem in contained inside a WorldInventoryItem, but no matter what I do I either get duplicates (using transmitCompleteItemToServer), or the moddata just doesn't persist (using transmitModData).
I am at a loss here!
Also tried :update() which does nothing
I guess I could use the WorldInventoryItem's moddata, but then I need to sync that somehow if it gets picked up
InenvtoryItem moddata is synced automatically
I am not experiencing that
I set moddata on the inventoryitem, and then relog, and its not there anymore
And how do you set it?
item:getModData()["MyProp"] = "some data"
OMG wait.. is this.. the thing where modData has to be simple
I can't assign an object can I?
oof
modData has to be simple key => value, not key => object
im trying to make a c4 item that can be placed like a noisemaker, how would i do that
Literally copy the code of the noisemaker ?
Soo yeah. this does not work:
function WIT_ShopKeepAdmin.UpdateStock(shopKeep, itemType, amount)
shopKeep:getModData()["WIT_ShopKeep_" .. itemType] = amount
if shopKeep:getWorldItem() then
shopKeep:getWorldItem():getModData()["WIT_ShopKeep_" .. itemType] = amount
shopKeep:getWorldItem():transmitModData()
end
end
How I am retrieving the data:
function WIT_ShopKeepAdmin.GetStock(shopKeep, itemType)
if shopKeep:getWorldItem() then
return shopKeep:getWorldItem():getModData()["WIT_ShopKeep_" .. itemType] or shopKeep:getModData()["WIT_ShopKeep_" .. itemType] or nil
end
return shopKeep:getModData()["WIT_ShopKeep_" .. itemType] or nil
end
If shopKeep is an InventoryItem thats on the ground, the second the chunk unloads all mod data is gonezo.
It keeps the moddata as long as I am in the chunk, but once I leave and come back its all gone
Anyone who has some experience with animation sets be able to come in my private messages so I can ask for help about a few things please ?
where is it though
No idea
it's in newitems.txt but it doesnt contain the code
It's a .lua function
You can also just find those custom noise maker mods and find the file they modify
Or use a custom modded noisemaker mod and see how they made their own noisemaker
Does removing zombies in debug menu counts them as dying ?
So Events.OnZombieDead triggers ?
i don't think so
How do I detect a zombie got deleted ?
Bcs I have different sounds playing for different zombies but when deleting them the sound stays there
So I need to deactivate the sound when the zombie disappears
Are you sending the complete item?
transmitCompleteItemToServer()
I am now. That was causing duplicates to show up.. but it could have been some other code causing the issue
Okay there's something I'm a bit confused about lol
The speed a zombie moves, depends on its animations ?
So the dance animations from True Dancing actually stop the zombie from moving
Like how the hell does that even fucking work
I wanted to use them as a placeholder but fml the zombies can't even move xD
Ive been looking into making a electric state project zomboid mod but i have zero experience in modding, is it hard?
depends on what you're trying to do.
electric state ?
Yes, the electric state
What's that ?
A futuristic book set in USA 1997 , its pretty amazing and i think it would fit PZ very well
Yeah id prolly make a map for it
Idk about mechanics or new vehicles
How would that fit PZ ??????
Is making maps hard
Depends if you need custom tiles
Like I said
I don't think it's that hard
But you might need custom tiles
The idea of neurocaster hives (basically zombies) and it happening at very smillar time
You could make that a standalone map I guess
Yea and maybe a mod that adds neurocasters onto zombies heads if i figure it out
Wwit ill continue this in #mod_support
If it's just a clothing to add on zombies, you can copy the fungi hat mod
Someone know how to add to what drops when an object is disassembled?
how would all this look in an isometric view?
You wouldn't see them
lmao
But tbf, if you want to do it, do it
Because while those images show big stuff, there's probably smaller stuff in that world depicted by those images
And it's fine if you don't see the big stuff, it's the point of an adaptation to adapt it on another media
Does anyone know what check I can use to see if an item I am doing a check in a player inventory is a radio? I have tried item:isDevice() tried item:getDeviceData() and instanceof(item, "IsoRadio")
even tried item:getType() because "radio" should be one
figured it out, its... instanceof(item, "Radio")
I would like to add the ability to tow things to my Vehicle mod. I can not find anything about it anywhere? Any pointers on how to do this?
will try that
Might want to look at the files in this mod for reference:
https://steamcommunity.com/sharedfiles/filedetails/?id=2884859083&searchtext=tow+truck
I imagine it's going to require writing some scripts for it to work
Thank you
Proof of work from a while ago.
Was inspired by electric state (Simon Stålenhag) 😄
YOOO thats sick, can you teacg me
Teach
I'll prolly learn to make a map after the update cause alot of new stuff will be introduced
Its just a world object like a nail or something you can put on the ground.
But with a pre-rendered texture.
That part i havent figured out yet:
- How to make it not pickable
- Collisions
- Random Distribution
For placing them in the world there are some mods who managed to place object in the world when the world loads.
AuthenticZ for example places a 3D Sign in the world.
How about making invisible walls around then (if thats possible)
That would be one way to do it for sure
I wouldn't call myself an expert, but I've certainly done so before
Also, is making such thing complex
Placing invisible walls around pre-defined locations should be the easiest thing in terms of mapping.
But of course it would be more elegant to solve that automatically on a code level.
Needs less map overwriting and would be more flexible
But would ask the coders as i dont know much lua 😄
I mean making the ball thingy , and exporting it to pz
Im good at blender but i texture in substance painter
Making the objects themself is pretty straight forward:
- Model your object and put a simple PBR Material on it, like the defaults from substance painter
- Make a screenshot of your Project zomboid which looks like the place where it will be placed in
- Make a sphere Around your model with that Screenshot and bake the reflections on it
- Cut the bottom part to make the illusion that it sticks in the ground.
- Add AO To the bottom as well, or just a black fade
The Screenshots and its reflections is basically where the Details on the texture come from
Its pretty fun 😄
And you can scale the objects really big
What about importing it to the map/game itself
You would render all the reflection on a single color map as PZ Doesnt use any other maps then color.
Then you import it as FBX and take a random object as template.
Well, and as template for the world placing i would recommend you to look into the AuthenticZ Mod as he somehow managed to spawn a 3D Object at a specific location.
Maybe he even made it so that you cant pick it up, but not sure about taht.
Where do I find all the scripts connected to game sounds
finally!
I have finished adding 3D models to all the items in EasyPacking lol
it finally got it's update 🤣
\SteamLibrary\steamapps\common\ProjectZomboid\media\scripts everything with sounds in its name
thank you!
nice idk how ive missed this mod. you did good work on the models
thanks!
It depends on the materials (tiledef) and the lua definitions are handled by client/Moveables/ISMoveableDefinitions.lua.
It's easy enough to add new materials if you need different items from the existing ones.
hello! im working on an update for my mod, Working Seatbelt. The update will make it so that there is a chance that the player may be thrown out of the car through the windshield if he crashes at a high speed with no seatbelt buckled. I am having trouble actually figuring out how to do this. I could calculate the coords the player should be at after crashing, then teleport him to it, but it'd look rather "wonky", and not reliable either if he crashes too close to a building and somehow he's now inside of it. Is there a way to actually do it in a smooth way?
P.S.: I seem to remember that there was a vanilla mechanic for being thrown out, but I am not sure if its just me misremembering things since I can't find any trace of it in vanilla files
UUuuuh
The closest example would be the mod that allows you to go out of a car when it's still full speed
hmm which one is that? I could definitely use it as a reference
Tried looking for it, couldn't find it, someone else could maybe send it
I personal never tried it
Hmmm, sadface; "tags" "..." don't seem to function in metadata.vdf when deploying mods to the workshop, (or I'm just using the wrong tag / values.
is there a way to refresh a texture in game? I did it yesterday and now It isnt working
metadata.vdf? you'd usually set them in the workshop.txt
oh, I thought that was the legacy format...
uh
I'll need to play around with it in the build script next time I do an update. Seems like I'll need both that and the VDF since I'm using a scripted build system.
alr ive looked everywhere, is there actually not a way to reload a texture mid game? if there isnt that is too fucking stupid
like i did it yesterday
now after altering a texture for a gun it just wont change like it did
@mellow frigate hey sry to ping you
I know you reposted that guide but have you done it before ?
https://steamcommunity.com/sharedfiles/filedetails/?id=3035712003
Like I tried exporting and following the same settings but something must be wrong bcs the animation is not recognized
im trying to create a custom context menu when i right click an item. I know when i use Event.Onfillinventorycotextmenu.add(method)
it passes parameter of the contect menu, player index and table of items in the inventory
but how can i specify only the item that i right clicked ?
is it on the first place of the items table ?
or do i iterate through the table and find names ?
i tried For i,v in ipairs(items) do print (i,v)
but it produced another table within a table
local function yourFunctionHere(player, context, items)
items = ISInventoryPane.getActualItems(items);
for _, item in ipairs(items) do
if item:getFullType() == 'Base.item' then
context:addOption("your text here", item, yourContextFunction, player)
break
end
end
end```
wow thanks, Question though. what does getActualItems(items) actually do ?
does it iterate through items table
and only take out items?
I can share a addon that i made here?
yes
https://steamcommunity.com/sharedfiles/filedetails/?id=3138967328 Thanks :)
i didnt know which channel was the correct so i asked first
There really isn't a channel to share new mods but eh you can share it here I think it's ok
I've tried different things and didn't have any success. Imho steamcmd can not add tags.
For the tags here you're doing that right ?
You can look at the function in the game's lua that calls it. I think probably it either passes things as parameters into the function or it has it in a table called 'self'.
ok guys im sure this has been asked I can see from searching some attempts have been made.
Is there a way to force load a chunk? like to spawn an event on MP?
no
I have problems spawning zombies via script. addZombiesInOutfit works as expected, but SendCommandToServer doesnt spawn anything. What am I missing?
local toSpawn = spawnCount
repeat
local tile = building:getRandomRoom():getRandomSquare()
if (tile) and (not tile:isSolidTrans()) and (player) and (tile:getRoom() ~= playerRoom) then
local x = tile:getX()
local y = tile:getY()
local z = tile:getZ()
local femaleChance = 10
local knockedDown = false
local crawler = false
local isFakeDead = false
local isFallOnFront = false
local health = 1
local outfit = ""
if isClient() then
SendCommandToServer(string.format(
"/createhorde2 -x %d -y %d -z %d -count %d -radius %d -crawler %s -isFallOnFront %s -isFakeDead %s -knockedDown %s -health %s -outfit %s ",
x, y, z,
1, 0,
tostring(crawler), tostring(isFallOnFront),
tostring(isFakeDead), tostring(knockedDown),
tostring(health), outfit))
else
addZombiesInOutfit(x, y, z, 1,
outfit, femaleChance, crawler,
isFallOnFront, isFakeDead, knockedDown, health)
end
toSpawn = toSpawn - 1
end
until toSpawn <= 0
Does Zomboid Lua support websocket, any ideas?
Guys, I want to add sections to the farming context menu (types of plants), give me an example.
Trying to set those tags, yes. However as Poltergeist mentioned, steamcmd just may not support this functionality.
version=1
id=3128757602
title=The Last of Us Infected - Overhaul
description=[h1]What does this mod add ?[/h1]
description=This mod updates the work of Monkey on [url=https://steamcommunity.com/sharedfiles/filedetails/?id=3035924033]TLOU Enhanced Experience[/url] that was broken recently by readding the model of the Bloater infected by [url=https://steamcommunity.com/sharedfiles/filedetails/?id=2958052085]TLOU Infected[/url] from drenindok
description=
description=Changes:
description=[list]
description=[*]Readds the [b]3D model[/b] by Monkey to the [b]Bloater[/b] infected.
description=[/list]
description=
description=For an even better The Last of Us experience, go check the mod Cordyceps Spore Zone and my [url=https://steamcommunity.com/sharedfiles/filedetails/?id=3128144245]patch[/url] that adds the durability of filters and oxygen bottles of masks and hazmat suits (vanilla and modded) by utilizing Susceptible features. You can even disable the Susceptible trait if you wish !
description=
description=
description=[h1]Remarks[/h1]
description=Most of the code is from The Last of Us Infected, and if any issues appear it is very likely it comes from this mod. I will however try to fix issues that could appear and keep the mod up to date.
description=
description=One issue in multiplayer that can appear is from grabby clickers as desyncs can appear. I suggest to deactivate this option while playing in multiplayer if you see players freezing while fighting clickers and bloaters.
description=
description=
description=[h1]To-do[/h1]
description=-Clickers and bloaters without correct model (fungi and bloater model)
description=-Clickers going up instantly in multiplayer (?)
description=
description=
description=Workshop ID: 3128757602
description=Mod ID: TLOU_Bloater
tags=Build 41;Hardmode;Misc;Models;Realistic
visibility=public
tags=Build 41;Hardmode;Misc;Models;Realistic
That's an example from one my mods
So that in workshop.txt, then would your whatever.vdf need that description too, or is that just used to provide where the local files are for uploading?
.vdf ?
Never used that
Check the modtemplate in the workshop folder
It gives a good example on how to setup your mods for upload and updates
steamcmd +login $SECRET +workshop_build_item "$DIST/metadata.vdf" +quit
With workshop_build_item, it requires a VDF file.
Hi all. Not sure if here is a right place for a mod suggestion. Would anyone be interested in creating a patch for excrementum and toothpaste emporium (https://steamcommunity.com/sharedfiles/filedetails/?id=2184351884&searchtext=toothpas) ?
It's a function from inventory pane code
I don't understand, what is this for ?
Anybody making a Mod where it gives function to the Vehicle lifts at the mechanic shops? would be kinda cool to pull in and jack your car up and work on it lol
It's for uploading the files to Steam workshop.
Hi everyone 🙂 I'm creating a mod to add some regional culture food and clothes
I found copying+modifying some current mods easier than any doc I found, still pretty hard experience lol
Yup it's usually easier to reverse engineering, because documentation is very rare
Clothes might be the most documented thing though
Oh the guide on the wiki got nuked
I forgot all his stuff was removed due to personal reasons
reuploaded (with permission) here: https://steamcommunity.com/sharedfiles/filedetails/?id=3025955520
guys how i can get all farm objects near of character? Need to use SGlobalObject ?
https://pzwiki.net/wiki/How_to_make_a_clothing_mod I feel like it could be named something a bit cleaner
Having trouble finding a guide for patching a mod. For example I want to tweak the nightvision API to only use one filter and rebind the key to another one for my server. Any lik suggestions? I am on the pzwiki mod section and the fenris modding guid, but i'm not looking for my specific edge case, just a basic example.
oh, suppose i could just rip apart another patch in the workshop.
I suppose it would just be simple file replacement, and proper mod order
im testing PlayAnimUnlooped using a vanilla snippet like so
getPlayer():PlayAnimUnlooped("WindowSmash")
any idea why it does nothing whatsoever?
neither does PlayAnim or PlayAnimWithSpeed
not sure if its relevant but doing so outside of a timed action
Hello, please recommend a mod guide for beginners, I would like to contribute to the modding community.
Rq, does anyone know how to easily pull the weight of all the items in a container?
https://pzwiki.net/wiki/Scripts_guide this is where i startede anything oustide of these functions requires lua
i believe you'd have to iterate through the items in the container and add their weights together
getContentsWeight()
Hello people, I need to make a 3d object (not a tile) in-game to emit sounds. It needs to be triggered by a function. It should work like a wristwatch, just not have any "set the alarm" option or "stop alarm" option 'cause I need to stop it with a function. (also I don't need it to show the time when equipped) I looked around but I have no clue where to start, any idea?
i havent used sounds myself and couldnt find the functions in a quick glance but i would make recipes for this like "trigger sound" "turn off sound" make it so results are removed and use oncreate and a lua function to make the object emit the sound
Thanks for the answer! I used this method for something else and it's an easy way to do it, very effective! But in this case I don't need the player to trigger the sound with a fake recipe, but a timed event. Also I need the object to be the emitter, not the player itself
ERROR: General , 1705324585883> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: attempted index: mapAPI of non-table: null at KahluaThread.tableget line:1689.
local textureSymbol = self.mapAPI:getSymbolsAPI():addTexture(texture, worldX, worldY)
anyone familiar with mapAPI that can point me in a direction? i'm trying to draw a pre-defined rectangle using 4 coordinates
sounds like you need to add a function to one of the Events table. idk which one would be appropriate for this but that allows triggering of functions through game inputs and events
nevermind, i didnt define my class correctly and it wasnt passing down the api
Hey guys! Does anyone know how I can set the glovebox size on the car I'm making? I tried searching for the code in the script but I couldn't find it which is weird since the trunk has one where you can set it
part TrunkBed
{
itemType = Base.SmallTrunk,
container
{
capacity = X,
}
}
Is there anything like this for the glovebox?
check scripts\vehicles\vehicle_car_lights.txt
template = GloveBox,
part GloveBox
{
container
{
capacity = 5,
}
}```
Probably what you're looking for
I'll try this. Thank you!
Yes this works great! Thank you very much!
figured it out 👍
was trying to get it to hatch in the rectangles, but it was looping and crashing pz lol
Well, I'm trying to learn how to make backpacks for a future project, but even though it's just a test, I can't make the backpack appear on my back.
Have you added the proper "CanBeEquipped" property?
What are the body location names for zombies ?
Hi people, i have a question.
I create a mod who can craft an item but, when you craft the item clicking in the item on the floor, the result item drops into the floor, but if you open the craft window in the inventory, the result item put in to the inventory, the question is: how can i get the result item what drops in the floor to the inventory? i mean, whatever the form or the container you click, the result always go to the inventory?
How do you get the items worn by a zombie ?
i create a craft using Scrap Metal and a "Workbench", if i go to the "Workbench" and craft with that, the item go to the floor, but, if i craft with the scrap metal in my inventory, the result go to the inventory
The workbech is an item, but i put the weight at 55.0, that's for make sense as a "Workbench"
Is there a way to query how many in-game days a world has existed? The closest I got was "getWorldAgeHours", but found out it was tied to the day length settings
Are you using custom model?
yeah, first i tried with a fanny pack (but i converted from X to .FBX)
Do you use debug mode? If we could see console it would be better
If there is repeating message about mesh maybe
i don't and can't mod very well, but is it possible to make a mod that adds trains that could run on the tracks?
Been using Notepad++ for my fiddling around with this. Anyone have any IDE recommendations? Looking at using vscode and snagging some lua extensions
I was considering it based on others' recommendations online. Thanks for the confirmation 🙂
I swear English is my native language
local originalISEatFoodPerform = ISEatFoodAction.perform() function ISEatFoodAction:perform() originalISEatFoodPerform() print(self.item:getName()) end
This is giving me errors seemingly pertaining to the vanilla code:
java.lang.RuntimeException: attempted index: eatAudio of non-table: null
Am I doing something wrong? If not, is there any way to prevent it?
call originalISEatFoodPerform(self)
functions declared with : have an implicit self parameter
actually, you have another syntax error here
local originalISEatFoodPerform = ISEatFoodAction.perform() calls the function and puts the return value into the variable, to store the function you want to use local originalISEatFoodPerform = ISEatFoodAction.perform
If I were to make a new kind of adhesive item, how would I add it as a possible repair item for weapons/tools in the fixing.txt file? I'd like to not have to overwrite the base-game file, if possible
I reckon I could write a small script to run as shared to perform doParam but as far as I know, that overwrites values?
You guys’ mods are so very impressive. I hope to make mine as beautiful and as strong as all of yours
How simple or hard is it to make a true music addon mod?
And lets say I have no prior PZ modding experience
hello, im trying to make a mod similar to this guy:
https://theindiestone.com/forums/index.php?/topic/68987-trying-to-make-a-mod-that-plays-sound-getting-error/
Hi there! I'm brand new to lua and modding in general and I wanted to create a mod that plays a sound whenever the player yells. I wrote a piece of code that gives me an error whenever I press Q in game - "Object tried to call nil in OnCustomUIKeyPressed at KahluaUtil.fail line:82." Heres the cod...
i would also like to know how to do this properly
How so ?
I use it, just curious
Very easy
I found tsars tutorial in the meanwhile
This one is a big strech tho. Is there a mod that makes (radio only preferred) voip have a rafio static voice effect. If no, is it even possible to make one?
Depends if you can access the voice within Lua, else it would require to decompile java and modify it and uh idk shit about it
would be pretty cool if u manage to figure it out. me and my friends have been wanting that kinda mod for a while
Like static unless there's something talking?
You could theoretically set up events with commands and push to talk - but radios in game are also busted
Unless you just want VoIP in general to do that
Good morning,
I have been trying to work out if these are dead events, meaning they are not in the game anymore.
Or I am using them wrong, I have tried both and I am getting no prints out of them
local function Lighterchu_OnHitZombie(zombie, character, bodyPartType, handWeapon)
print("Zombie getting hit")
end
Events.OnHitZombie.Add(Lighterchu_OnHitZombie)
local function Lighterchu_OnDeadZombie(zombie)
print("Dead zombie")
end
Events.OnZombieDead.Add(Lighterchu_OnDeadZombie)
they work
So would I just need to restart the server ?
the print shows up in console.txt
Yea nothing was showing up sadly
even when hitting the zombie, or killing it
i've used both before and it works fine 🤔
hmm Ill see if a restart works and restart the lua scripts
if you're on a hosted server you can reload Lua
for onhitzombie, you can use character:Say("I hit a zombie!")
I am just going off the scenarios
scenarios might not load lua scripts
I see, do I need to go another way about it ?
you can test it on a single player game just fine
no just load a single player sandbox
alright ill give that a go
yea that worked. So noted, never use Scenrios
Oh last question untill for awhile. How would i know what is server and what is client. Because you know if Gmod, you can tell what is server code and what is not.
But for this game its hard to tell, because there is nothing saying this is server code
if we're being honest it really is not clear at all
the majority of code even in the server folder is not server code
sooo what your telling me I can put this all in client and it will just work. But then that is a thing where people can see the client
code and I have always been taught. Never trust the client hah
But this says making a mod. I am making a mod haha ?
Mod support would be if I was asking how someone else mod work correct ?
correct
Thank you for clearing that up @rugged latch
Now I do have another question, I have tried to use math.random(0,5)
But no gravey. ummm does not work anymore or am I using the wrong random function ?
ZombRand(5)
you gotta use PZMath

I see, odd they would not add that function to embed game code. But that is alright. Time to use ZombRand haha, that is gonna be a some time to get use to
10 years of coding in lua and that is gonna throw me haha
just remember zombrand returns an int starting from 0
ahh so like the starting of a array. So ill just add a 1 to get 1 to 5 instead of 0 to 5
yep
nice, thank you for the heads up 🙂
Ohh thats what I forgot to ask, has anyone made a VScode extention for syntax for zomboid ?
as far as im aware
because im not well versed outside of writing the code
follow this
its not VS code (trust me I wish it was) but
it will get you intellisense working
and with zomboid decompiled you can always poke around if you want to figure something out or yknow
have a nasty bug that just doesnt make sense and you suspect its zomboid(usually its not)
just use umbrella
this one is really old + makes you waste time generating them yourself
Quick question:
What’s VScode and Intellisense? I’ve heard them brought up before
Are they code editors or decompilers or…?
vscode is an editor
yeah, but notepad++ barely counts as an ide, it's basically just a text editor with colours
intellisense basically gives you autofill and stuff, it'll point out a lot of syntax errors
Sounds handy
This is if you did not know what IDE stands for
integrated development environment
Ah, thank you!
Not a problem at all 🙂
Apparently it’s a sort of toolkit for software engineering
So VScode is an IDE, and Intellisense is a helpful… no idea what the term would be. Either way it’s a helpful thing to have
I currently use Notepad++
Is there a better editor that I should use?
yeah, vscode
just use windows notepad 🤔
ohhh that hurts my soul haha
😂
I cant tell if that is worse then not having dark mode on
Haha yeah I totally didn’t use to do that 👀
Very clean looking
Also sorry for not responding to the conversation for a dozen minutes or so
I went down a software engineering Wikipedia article rabbit hole
I learned about obfuscation
So there’s that
You dont need to say sorry. I am just here making a mod for when a zombie you kill. It well set off a bad smell and the zombies in the area will come to you. If you are close to it, meaning. You got to be careful if you want to kill a zombie or not 🙂
Thank you 🙂
I am really trying to work out, if I should have server code or just do it all in client
But then again. I haveeee noooo clue what is server code or what is client code haha
Me neither :p
Not as simple as gmod haha
I thought client meant things specific to client-side and server meant things specific to server-side
With shared being things that are both
Well yes that is the case, but the problem with that, there is no docs to tell you if its server or client and the engine does not throw a error for server or client code,
well what I have notice so far anyway
For example
setFitnessSpeed()
that could be server code, but it could also be client code
Does it make a difference if you have something run in server vs. client? Can’t you always just place it in client?
Or would you want things that happen server-side, like world generation and such, to be server, and other things that are player-specific to be client-side
well that is true you can. But think of it this way, if you had something that could upgrade your skils etc and you had that code on the client. What ever is in the client code, the user can change that code and break the gameplay, meaning in other words hack it.
But if you make the client have code where, if they kill a zombie, the client will then send that info to the server and the server,
will do all the calcations and then send back the right amount of xp to the player
Ahhh, okay
Because if you had all the client code with
function changeXP(amount)
player:XP(10000000)
end
thats all they have todo, that is a example, but thats something they can do
So wait, is having code be split as client/server an example of something like obfuscating it to make it more difficult for people to hack?
but if you did it this way
client
function KilledZombie()
if(player) then
sendKillDataToServer()
end
end
server
function CalcateZombieXP()
if(player) then
player:XP(10)
sendKillDataToClient(player)
end
end
Can’t someone simply edit the server code?
the client has no way to access the server, unless they had a rcon password or something like that to access your server files
Oh
the only thing that gets sent to a user when you join the server is client files, that is it
and the client files will talk to the server and the server makes the idea on what happens
But it’s excellent to know
Well I am glad I have taught you something. Golden rule of coding, NEVER TRUST THE USER
That sounds fair lol
Same with websites, apps etc.
There is always a server involeved
I spelled that wrong
involved
But now you can see, why I am trying to work out what is server side and what is not haha
Yeah
@cedar kraken here you go, have a read of this haha
https://theindiestone.com/forums/index.php?/topic/15256-multiplayer-coding-questions/
Hey guys,I've been working on getting my mod to work on multiplayer and since there are very little resources on that topic I have a few questions. isClient() / isServer() What these methods do is clear, however when I call isClient() in a file that is located in shared it returns false althought...
I still have such a long way to go with Lua coding, I haven’t been to practice much recently due to being so occupied with schoolwork
hahah that is fair, well happy to show you the ropes and if you need any help. My dm is open, just message me and ill respond 🙂
Thank you very much 😄
all good
hmm sooo looking at other peoples scripts, it looks like anything can be server or client
Hello there, is vehicle ownership a vanilla thing ?
that sounds like a mod. Buttt I am not 100% sure.
vehicle ownership is a valhalla thing i think?
confirmed
confirmed
Nice 🙂
anyone here that is a vertran in coding for Project Zomboid, understand how to send and recived data from the server to client and back.
Or do I have gmod sending in my head and thats not how it works here haha
onclientcommand and onservercommand
i think is what you mean?
syncing data is usually a client-server interaction thing and you'll want to have the server communicate and update the client, so you might use OnClientCommand and OnServerCommand events
but that is just like a say command correct ?
like for example /givemoney player
is that the type of command or is it just made like that, because that is confusing haha
that's a command send to the server
righttt
hmmm so if I kill a zombie, then it sends that info to server, the server says you have attract a large horde because of the smell
then send it back to the client
in what world would I be able todo that hahah. I have gone through 30 mods so far and not found one where they communcate server and client
search the ClientCommands file in media/lua/server
Hey guys, anyone has an idea why that would never output the clothings of a zombie ?
It always gives out nil
local clothingLocations = {
"TankTop",
"Tshirt",
"ShortSleeveShirt",
"Shirt",
"Sweater",
"Jacket",
"TorsoExtra",
"TorsoExtraVest",
"Pants",
"Skirt",
"Hands",
"Torso1Legs1",
"Legs1",
"Socks",
"Shoes",
"Underwear",
"UnderwearTop",
"UnderwearBottom",
"UnderwearExtra1",
"UnderwearExtra2",
"Tail",
"Eyes",
"LeftEye",
"RightEye",
"Mask",
"Hat",
"Scarf",
"Belt",
"BeltExtra",
"AmmoStrap",
"Neck",
"Necklace",
"Necklace_Long",
"Nose",
"Ears",
"EarTop",
"Right_MiddleFinger",
"Left_MiddleFinger",
"Right_RingFinger",
"Left_RingFinger",
"RightWrist",
"LeftWrist",
"BellyButton",
}
for i = 1, #clothingLocations do
print(i)
print(zombie:getWornItem(clothingLocations[i]))
--print(zombie:getWornItems():getItem(clothingLocations[i]))
end
thats where all the vanilla client commands are located
I've been trying every combinations to get worn items from Zombies
Trying all sorts of commands that should output the clothing somehow and I'm never able to get anything
@bright fog are you doing this in Scenarios or just normal sandbox. If Scenarios then you might be having the same problem I was having at the start
And its best todo it in a solo sandbox. But if you are not have that problem, then are you attaching this to a event ?
because I cant see a event where this would call this peace of code
It's attached to events.onZombieUpdate
The function is proven to already update
The game does print out in console the stuff I need
the zombie is recognized as the zombie
Outputs this
LOG : General , 1705436490960> 1
LOG : General , 1705436490961> nil
LOG : General , 1705436490961> 2
LOG : General , 1705436490964> nil
LOG : General , 1705436490964> 3
LOG : General , 1705436490965> nil
LOG : General , 1705436490965> 4
LOG : General , 1705436490965> nil
LOG : General , 1705436490965> 5
LOG : General , 1705436490966> nil
LOG : General , 1705436490966> 6
LOG : General , 1705436490966> nil
LOG : General , 1705436490966> 7
LOG : General , 1705436490967> nil
LOG : General , 1705436490967> 8
LOG : General , 1705436490967> nil
LOG : General , 1705436490967> 9
LOG : General , 1705436490968> nil
LOG : General , 1705436490968> 10
LOG : General , 1705436490968> nil
LOG : General , 1705436490968> 11
LOG : General , 1705436490969> nil
LOG : General , 1705436490969> 12
LOG : General , 1705436490969> nil
LOG : General , 1705436490969> 13
LOG : General , 1705436490970> nil
LOG : General , 1705436490970> 14
LOG : General , 1705436490970> nil
LOG : General , 1705436490970> 15
LOG : General , 1705436490971> nil
LOG : General , 1705436490971> 16
LOG : General , 1705436490971> nil
...etc
LOG : General , 1705436490982> 38
LOG : General , 1705436490982> nil
LOG : General , 1705436490982> 39
LOG : General , 1705436490982> nil
LOG : General , 1705436490983> 40
LOG : General , 1705436490983> nil
LOG : General , 1705436490983> 41
LOG : General , 1705436490983> nil
LOG : General , 1705436490984> 42
LOG : General , 1705436490984> nil
LOG : General , 1705436490984> 43
LOG : General , 1705436490984> nil
For a zombie with a shirt, pants and a mask/hat
Have you tried turning off and on again?
I'm sorry but I hope it's a joke right ?
(Yes)
Alright and do you know anything about my issue ?
Uhhh
I'm sorry but this is already frustrating enough. I've been asking questions about this issue for days now and I don't get any answers
I've checked precedent messages on how to get the items worn by zombies, used the same code, at least 10 different commands and ways to get the inventory and worn items of zombies and nothing works
can you print out the name instead of the number, that might give you a better indection on what is going on ?
The name ?
with getName ?
Ah the clothing location you mean
yess
I think you need to make it loop since if you only check the value at key 1 then it’s going to return nil if there’s no tank top
^
try zombie:getWornItems(), it might return a table or array?
It does output it
But looking at all the messages here, it's possible to access a specific clothing location ?
LOG : General , 1705436490960> zombie.characters.WornItems.WornItems@5f70fa23
Oh wait, I see
i is between 1 and the length of the table
yes
i guess you're trying to get the item thats on the particular body location?
So this is inventoryItem, do zombies have that ?
ohhh wait, yea they do. Just killed one and that thing that shows on the left is there inventory
hmmmm...
try this
for i = 1, #clothingLocations do
local wornItem = zombie:getWornItems():getItem(clothingLocations[i])
print("Location: " .. clothingLocations[i])
print("Worn Item: " .. tostring(wornItem))
end
zombie:getWornItems():getLocation() will return you the location, and zombie:getWornItems():getItem() will get you the item
I think I did try that already, I'll try again
any luck ?
local function getWornItemInLocation(playerObj, location)
local wornItems = playerObj:getWornItems()
local bodyLocationGroup = wornItems:getBodyLocationGroup()
for i=1,wornItems:size() do
local wornItem = wornItems:get(i-1)
if (wornItem:getLocation() == location) or bodyLocationGroup:isExclusive(wornItem:getLocation(), location) then
return wornItem:getItem()
end
end
return nil
end```
straight from ISInventoryPaneContextMenu
Then surely that one will work for Sir ^
I'll try again
outputs nil for wornItem
for everything
hmm try Lect's one
wornitems returns a table so you need to parse the table to get what you're looking for, just search for stuff in media/lua and most of the time you'll see how it's done in vanilla
I'm adapting the code sent
Doesn't work either
print(#clothingLocations)
print(zombie:getWornItems())
local wornItems = zombie:getWornItems()
for i = 1, #clothingLocations do
print(i)
print("Location: " .. clothingLocations[i])
local location = clothingLocations[i]
print(wornItems:size())
for i=1,wornItems:size() do
local wornItem = wornItems:get(i-1)
print(wornItem:getLocation())
if wornItem:getLocation() == location then
print(wornItem:getItem())
end
end
--print(zombie:getWornItems():getItem(clothingLocations[i]))
end
And the size of wornItems is 0
It says it's 0
When the zombie dies it recognizes the clothing
zombies might not use wornitems to save memory or something
(also yeah the code is not optimal)
it would make sense not to have full inventoryitems for every zombie
maybe zombie outfits use a different system
My issue is that, the original TLOU Infected mod puts outfits on zombie types, but this doesn't allow a lot of flexibility to have zombies with various clothing. So my idea was to rework it by putting the right clothing (which is a clicker face) on the clickers if they miss it
I already had a check to reload the outfit with the clicker variant for the clickers if they didn't have the outfit "clicker"
But they all have the same clothes and no inventory
Bcs it seems to define their inventory (find pen or other stuff in their pockets)
This causes some issues for modded clothing that are added to zombies and also issues for finding items in pockets is now way harder
also print(wornItem:getItem()) outputs every clothing items even tho it should output the item that's been checked ?
yeah, looks like zombies don't use worn items until they die
they just use ItemVisuals
fml
well, they do use worn items in some cases, but not most
Is it possible to set a clothing of a zombie on a specific body part ?
Bcs I guess I could just not check if the mask is here, and force equip it and do a check for that zombie to say he's checked ?
have you tried dressInClothingItem?
How does it work ?
void
dressInClothingItem(String itemGUID)
this ?
zombie:dressInClothingItem("98582d96-1035-42a0-b2ea-d472f9883569")
I'll try that
I don't think it worked
well fuck
maybe this ?
Are you checking when they're dead? Or alive
When they are alive
I tried maybe basing myself on Project Fungi to see how he adds the items
require "Definitions/UnderwearDefinition"
UnderwearDefinition = UnderwearDefinition or {};
-- Super Sledgehammers on certain zombie spawns
UnderwearDefinition.Female_F_Black = {
chanceToSpawn = 1000,
gender = "female",
top = {
{name="Hat_Fungi", chance=100},
},
bottom = "Underpants_Black",
}
UnderwearDefinition.Male_F_Black = {
chanceToSpawn = 1000,
gender = "male",
top = {
{name="Hat_Fungi", chance=100},
},
bottom = "Underpants_Black",
}
He basically rewrites every Underwear
But I don't think I can add such an UnderwearDefinition and have a condition for it
And even then, would it force it equip ?
idk what this type of file works really
Late reply, but thank you very much!
The reloading lua when I want to load my mod taking to much time...and freeze, and dont want to launch anything, no error message, and before i didnt change anything, i checked all file of PZ on steam.
Someone know how i can fix that please ?
check the debug log. sometimes something in your mod can be broken enough that the game can't load it. such as a forever loop. i can sometimes check the last logged thing and it'll point me in the right direction
removed all files i didnt work on it, and trying to try directory per directory
Working without the script directory
item AFAK {
Weight = 0.2,
Type = Normal,
DisplayName = AFAK (Advanced First Aid Kit),
Icon = AFAK,
WorldStaticModel = AFAK,
ok hope
that wasnt that
i missed an }
likely it. that will break the game
Yea missing a curly bracket will do that
missing curly bracket on pz :
Hey, does anyone know where the code for the zombie infection takes place? Not necessarily the part that calculates your chance of getting it, but where it actually messes with your character health on a clock
zombie/characters/BodyDamage/BodyDamage.class
Thank you!
Why do you need to do that ?
is it ok if i copy someone else's code for my own mod?
it's a pretty small code. if not, can anyone help me "personalize" it? i have zero lua knowledge
It's bad form to copy directly without permission and they can take down your mod if they report to steam
which event is triggered after the player completely load into the server?
If you literally just copy their mods files then uh don't do that
If you just use their way of coding a functionality then it's definitely ok
If you want to change something in their mod, make it an addon so it just requires to have their original mod, unless it requires full rewrite then ask for their permission maybe
It's ethics and stuff to think about. Just be smart about it and don't act like a jerk
Also depends on the modder
yeah no i basically just copy pasted this guy's code
https://steamcommunity.com/sharedfiles/filedetails/?id=2960089295&searchtext=shout
i'd love to learn how to write my own but i just dont know where to start
it's basically 47 lines of code
Personally, I just tell people whenever they are looking to do something to search for someone who did something similar and take inspiration on their methods. Sometimes however, you can't find a mod to do that so uh
What did you change ? The sounds ?
no i took the code that plays a sound when you press Q
i could but i needed a similar function for a larger mod that im working on
unless i could just make it so my mod requires his mod
You can
You can import functions from other mods
Very easily in fact
The question is just: do you want to force your players to have this mod active ?
yeah but then i thought, i dont really want my mod to need other mods. a lot of players hate that kinda stuff
and it's a simple enough code. so if i could write it myself or get some help that would be better
Is the feature from this mod actually required to use your mod ? If not then don't add the mod as a requirement, don't force players to download a mod that you don't actually need besides just a function it adds
If your mod is just about adding exactly the features of this mod by just copy pasta it, don't do that, just add it as a requirement
ok so basically my mod gives the player a "voice"
i already did the other stuff like grunts, pain, etc
and so i wanted the shout to be vocal as well, but i had no idea how to do that. so i stumbled upon this mod and wanted to add a similar thing to mine
like i just spent an entire night reading the documentation for the game and i just couldnt absorb any of it
There are mods that add a voice to your character
Reverse engineering other mods is usually better
Tbf, go ask the original modder about the mod if you can copy his line for shouts
ok i'll do that. thanks
You can do those shouts with the OnCustomKeyPressed Event
But you only get a string passed through
So you get the player with getPlayer and access his Emitter with getEmitter
And then pass the sound you want to play
thanks but i need a little more than that to make it work and ive no idea where to even learn
and this is coming from someone who knows basics of C++
Youd make a function and then add it to the said event queue
Events.OnCustomUIKeyPressed.Add(myfunc)
I think overriding the Callout method Lua-side would be ideal
local _IsoPlayer = __classmetatables[IsoPlayer.class].__index
local _Callout = _IsoPlayer.Callout
function _IsoPlayer:Callout(playEmote)
-- code to play your sound
-- ...
-- pass to existing method for normal callout behavior
_Callout(self, playEmote)
end
yeah this is basically how the mod author did it
where do you guys learn this stuff?
woah
the dude who commented on that post is the co-author of the mod i copied from
should i dm
That's amazing I'll definitely try to follow that
Is there a known issue to zombies having high health pool becoming one shotable ?
Yeah that I know
But is more of something with general attacks
Like 25x health works well in TLOU Infected, but going too high like even 50x health makes their health not that high and oneshotable
so like if they had base hp amount
I haven't checked how the mod sets the health yet, just wanted to ask before going in if it was a known issue
Certain attacks instant kill
Eh
Crits you mean ?
Or the spear stab or knife jaw stab ?
Bcs I'm talking about normal hits
Hey hey, i'm hella new and i found some of my answers already. Is there maybe anybody that can guide me to a place where there's maybe a guide or tutorial on how to make car mods with interiors/opening doors/etc. I found a model of a car i'd love to have that has an interior, opening doors, hood/engine bay and i'd just love to make it into a fully functional mod. Seems to have the right amount of poly's n stuff as well for PZ
it's gonna be a lot of work to get this functional though but im willing to do it
thanks on beforehand
KI5 has animations for their M998 humvee model, you could probably see what they did in their LUA for some inspiration, (though their mod is listed as "ask for permission" so I don't know how open they are to sharing their "secrets")
i believe Hea (SOTO mod author) tested spear crits, even setting the spear damage to 0.1-0.1 a crit would kill a zombie
I think we're using that specific mod on our server! I was thinking of looking into how others made theirs but yeah it's certainly worth asking i think
it's just hard to judge what exactly needs to happen
im guessing bare chassis (no doors / wheels / trunk) needs to be as the main model and everything else is "added" ontop as seperate models?
Yes but I'm not talking about spear crits (spear stabs)
no it was just a regular swing crit
Just please.... use vanilla items for things when possible. Having duplicated dedicated parts for EACH AND EVERY DIFFERENT VEHICLE just gets tedious, (at least for me)
My question was if setting zombie health too high can cause them to actually go back to normal health levels (like 100%)
oh yeah that's the plan
it's a normal sedan, no need to make seperate items
I still don't know why KI5 insists on that, but it makes me not want to run their mods on my server.
There's a few mods out there like that sadly yeah. But it's what they want i guess
its just hm disappointing to try find a good parts car for other cars
if people would eventually want my mod as a background car they want as a parts car, it's their right to do so
which event i can use to do sendClientCommand, OnLoad() doesn't work. Is there any event later than OnLoad()?
Someone needs to do a mod creating universal ki5 parts. lmao
I keep looking at other mods and their code myself for private usage to learn how PZ's .lua goes.
There's so many interesting different ways coders have hooked into the systems.
I'm just extremely unfamiliar with coding myself so it's gonna be a hooptie i think.
Most i've done is rig/weight paint/texture character models for games
Guess there's no event later than onload. I just do a ontick.add and ontick.remove right after.
Just do what I'm doing. Grab every interesting mod you see off Nexus, and use them as examples for coding.
Build a library.
I've gone through every steam page on the workshop to do it.
Learn by observation does work. It means you're not starting from the ground up.
There's also a lot of really useful API with good documentation.
off nexus?
thats why i originally asked for a tutorial or guide. It's easier to start with some help than nothing but i guess looking at others work would help too
im just, again, with 0 lua coding experience
I mean if you want I can bundle up the whole thing of downloaded mods I got and send it over to you.
would be very kind of you if u want to do that
Just look through all my trash. They still have the mod ids to tell you what they are.
And yeah same here. So far .lua from what I've seen from other modders isn't that complicated.
package index
Firstly here's the index of every reference I Found.
It's what PZ uses.
They explain what they are on here.
I have experience with coding arduino shit for high school years ago
XML and C++ from Rimworld modding.
Otherwise i'm better at graphic design.
Myeah gonna be interesting for sure
But yeah I have a folder for framework I was setting up. I'm not going to resort- You can do that however you like. Otherwise it's a mess of random shit.
Saves you from going through 500+ pages on Steam like I did.
Adderall.
im mainly after just car stuff with interiors/animations/doors/blabla so wouldnt be using everything of it xd
Oh I can just grab those. It's some Ki5 stuff I guess.
You got Blender setup?
Download uhhhh Shark's Car Overhaul it should have everything there.
And grab some of Ki5's mods off Steam. Use them as references for building lists.
I've replaced some texture files already, fixed the jap subnames of textures to english ones so i understand them
Right now I'm trying to consolidate a bunch of crafting mods and rig them to two API.
One for Crafting Enhanced Core and the other that allows alternative recipe ingredients.
it was originally an MMD file but it has everything basically
Sounds good.
Its just hm i need to get used to some thing again, been a good time since i used blender
ontop of it's textures being all over the place
I'll see though, it seems like a fun project to get into but i'm sadly gonna be busy for a week or 2
I just realize sendServerCommand can be send to a specific user, all of a sudden I feel my mod is extremely unoptimized but too lazy to optimize it.
Would you recommend extranoise his stuff BTW? I tried messaging him on reddit, seems active there, but no luck
I am using some of his stuff
Not sure I looked at Extranoise's stuff.
I released my 3rd vehicle mod, a 6th generation Mitsubishi Lancer. Tell me what you think
https://steamcommunity.com/sharedfiles/filedetails/?id=3141457368
3rd gen is cool but evo iii> 
God.
How have none of us made a Beanie Baby mod?
Those things were fucking everywhere in the 90s.
Anyone know how to open the .x model files for the zombies?
I can open non-animated models using Blender and a plugin, just having issues with the animations
I am a noob at modding and was hoping if someone is willing to help me set up my first firearm mod. I spent the day learning blender and have made a basic model with color. Thank you.
Thoughts on my completely amateur experience with Blender? Think this fits into the look and feel of the game?
how do I add a prompt?
like when I right click a zombie a ui shows
with the "Walk to" and "Sit on the ground" ui/prompt
https://steamcommunity.com/sharedfiles/filedetails/?id=2487022075 adds a prompt for sitting on furniture; require "CommonTemplates/ISUI/ISContextMenuExtension" appears to be how they support it. Events.OnFillWorldObjectContextMenu.Add to add the hook. Not sure exactly where the context menu comes into play though, but if you sift through that code, I'm sure you can find it.
that sounds like their own library
vanilla doesn't have any file structure like that, and no files that require is meaningful for
does OnFillWorldObjectContextMenu run when I right click on a zombie?
then i'd like to get the zombie's information
AH, yeah, good catch. They require Tsar's Common Library.
how do I know if the event even runs?
local function OnFillWorldObjectContextMenu(playerIndex, context, worldObjects, test)
print(worldObjects)
player:Say("HI")
player:Say(worldObjects)
end
Events.OnFillWorldObjectContextMenu.Add(OnFillWorldObjectContextMenu)
I right click on anything but nothing happens no print and no message
Try making that a global function; not sure how scopes work with those events.
it doesn't need to be global
its on client/Test.lua
test1 = test1
local player = getPlayer()
player:Say("RELOADED")
local function OnFillWorldObjectContextMenu(playerIndex, context, worldObjects, test)
print(worldObjects)
player:Say("HI")
player:Say(worldObjects)
end
Events.OnFillWorldObjectContextMenu.Add(OnFillWorldObjectContextMenu)
my player says the "RELOADED" though
bruh this event doesnt run
i think a mod like this exists already? but the 3d RIMS usually arent used; usually the rims are 2d no?
im absolutely garbage at blender as im realising now but ykno 
Usually, but folks didn't like my "Ima just gonna be lazy and use the 2d image" approach, so I went through and recreated everything in Blender then exported to pixel art.
(Current released version for reference)
Most folks understood though that I'm a developer and not a designer.
u used a model like this: for the wheels
being able to see through it
while most people make their car mods with wheels that you cant see through
woah, that's WAY more complex than one I could make!
thats the only remark i have 
im saying u need to make it simple 
simple wheels with texture slapped on
this wheel is from a hq model so dw hahah
its from this which had 90k poly's, trying to lower it now to ~9k
that wheel + strut was 5k on its own 😅
That's the actual texture of this wheel I made. Still pretty simple, but rather challenging for someone with absolutely no Blender experience, (such as myself)
yeah it would be me too tbh
u couldve just used a normal model of the game instead of making your own no? 🤔
None of the tutorials on how to use the tool are actual tutorials, but instead they all seem to be Youtube videos of folks who already know the shortcuts and just blaze through at mach 1, meanwhile I'm sitting here thinking "WOAH WOAH WOAH, how the crap did you open that menu?!?"
i watched a tutorial which had an input visualizer
absolute legend
ahahah
ive never tried to make a model myself i usually edit others
so making something from scratch is always funky
and yeah, I would have used the UV from the base game.... if I could figure out how to actually use UV overlay maps :/
"Just unwrap your model and it creates nicely layed out sections ready to paint".... yeah, that didn't work for me! The resulting map was all sorts of cobbled up, and I couldn't figure out how to move the sections to the section of the image which I wanted without completely botching up the perspectives.
doesnt give me confidence since ill have to do that later too :D
https://www.youtube.com/@LarsMezaka/videos was who I found which I was able to kinda follow, though half of what they did just didn't work for me.
Hey :)
I am Lars and I make 3D art and games since 2014. Stay around if you want to watch videos about Lowpoly, Pixelart or all the other fun stuff you can create in Blender. If you have questions just ask.
For work/comissions please contact my company directly:
https://irox-games.com/kontakt/
u can do it i feel it B)
Probably due to differences in Blender versions, but at least was able to cobble it together well enough to render something.
bro the diff blender version reminds me of when i tried ripping rigging and setting up a character
it was actual hell since the ONLY TUTORIAL was like idk
6-7 years out of date
ancient ass blender compared to now
never again hahaha
yeah, I can say that this tool HAS matured quite a bit, I tried it a number of years ago and couldn't even figure out how to draw a box!
ey at least it's something
im slowly learning it again as well
at least you got a head start compared to me on coding. I'm gonna be lost in that part
Yeah, I do coding professionally and have been in code for about 2 decades now. Just the design portion always trips me up; never have had an eye for colour.
I had a very interesting idea for a possible modded trait that I would want as a challenge to do:
Genetic Monstrosity: Traits are randomly removed and added from your survivor, making your current selection of traits unreliable (+18 Points) though those points will mean absolutely nothing :)
and if there's options, I feel like the best option would be relating to frequency of trait randomization and how many traits can be added and removed
like this:
Trait Reshuffle Time - time values here
Trait Reshuffle Amount - num of traits to add and/or remove (i think of this as a failsafe so you don't just have one trait occasionally)
And I made an icon for it (edited from the "impregnable veins" trait from facility-7)
woah, what type of game did you pull that icon from for it to have a trait name like that? Nevermind, don't answer that...
Hm?
The icon is from the mod facility-7, it was originally half a DNA strand with the upper-half being a fortress tower,
then i modified it into a full strand of DNA
I like the idea. Could actually prove to be a challenge!
Yup
hi, anyone knows how to unpack tiles2x.pack?
i tried all the tools that available and it wont unpack
i also tried the tilezed and choose to extract image but it not doing anything
That's how I made my wheels as well
i havent seen anybody make them see through yet 🤔
Motorcycle mod's wheels are usually see-through
I've seen a couple. They look extremely detailed
I don't know how the game handles them
the wheels i showed (the see through ones) are 8k vertices/faces/idk
8k vertices; thats a car on its own
its crazy how detailed people make them for non-pz
But because I'm still kinda new to Blender I made them to the standard, non-see through approach
yup thats probably how imma do it too
Jeez not even my car's body model is that detailed
I asked for advice how many tris the game can handle when I made my first mod
im hoping to make my model i got to something like that
the general answer was 4-5k
huh well then
my car's body model clocks in at around 3.5k
i do plan on making mine with interior n such so hm
and it doesn't have an interior or animations (cause I don't know how to animate in Blender)
i dont know how to make a car mod at all
im starting from 0
i do know blender n animating (in not blender)
so i shoouuuld know how to get started but ye
This video is what helped me out getting the shape for my car
Create Low Poly Vehicles Easy and Free in this Blender 2.8 Beginner Tutorial!
CG Boost Blender 2.8 Launch Pad: https://cgboost.com/CGGeek (First 50 viewers get 20% off)
Ewin Racing Chairs: https://bit.ly/2ltqTAS (Save 25% with code CGGeek)
Downloads on PATREON: https://www.patreon.com/cggeek
Blender: https://www.blender.org/download/
Car Ref...
im making a high quality model low q
prob not the best way to do it but
¯_(ツ)_/¯
and here's some reading, one from the dev and one from someone who actually made a mod
- The first thing you want to do, as with most mods is to create your mods folder structure, use the image below as a reference, replacing MOD_NAME with the name of your mod: Spoiler mods MOD_NAME mod.info MOD_NAME.png media lua client MOD_NAME.lua models Vehicles_MOD_NAME.txt scripts vehicles M...
Hello and welcome to my tutorial. It covers full workflow of vehicle creation for PZ. If you are a complete beginner in 3D modelling, you'll have to watch/read additional tutorials, I won't cover every aspect of model creation and 'where this button is located'. I divide vehicle creation in these...
These are a bit outdated though
yeah i know of these
and sadly yeah a bit outdated for sure
doesnt cover the main thing im afraid for which is the euh
animating doors n such
Yeah... The biggest barrier for me is not knowing Lua
+1
I can code in C# and Python, but I never learned Lua
Back to the wheels though
this is the model I made for my 5th gen Lancer wheel
the inner part is deeper on this because it's actually the rim
looks smooth compared to most
and this is the model I made for my 6th gen Lancer wheel
the inner part on this is shallower because it's the hubcap
thank you!
the mod im looking at for "inspiration" (more reference ig) has square faces, not triangular
is there a reason to use on over the other?
When I was making my first mod everyone told me to triangulate my models
you do it by pressing ctrl+T while all the vertices are selected
I researched a bit about the topic as well
apparently it's much better to triangulate your models
because if you export them using squares instead of tris
other programs you load your model into will triangulate them wrong
and it will look off
because apparently most game engines do triangulate models you import into them
I don't know if PZ's engine does
hm hm
i mean the mod im referencing looks fine ingame
but ye i get it
it's more for consistency/making it look correct ingame then
here's a video I watched on the topic
In this video, I'll discuss why you MUST triangulate your game assets to avoid issues in other software.
➤ Get our free Game Asset Guide - https://www.blenderbros.com/game-asset-guide
Website - https://www.blenderbros.com
Patreon - https://patreon.com/theblenderbros
Hard Ops/Boxcutter (affiliate): https://gumroad.com/a/811037811
Gumroad - ht...
then maybe PZ doesn't triangulate models
but a lot of game engines do
I made my models using squares
and triangulated them after everything was in place
Blender has this annoying feature that you can only use ctrl+R (knife tool) on faces that are squares
It doesn't let you use it on triangulated faces
so you can't cut a line
here's what I mean
Here I removed some triangulation lines from some faces
as you can see I can cut a line into it if I want
or multiple if I scroll up with the mouse wheel
slowly turning #mod_development into #modeling 
or I can do vertical lines
yeah maybe I should have posted this there 😅
its very interesting tho
But on triangulated faces it doesn't let me cut a line
only a single point right in the middle
yup
So you in my opinion you should make your models out of squares and after everything is in order, you should then triangulate it
its so it can make more triangles ig
but keep in mind I'm still a novice in Blender 😅
novice is better than beginner 
well... depends on how detailed you want to make your model
curves require more squares
test1 = test1
local player = getPlayer()
player:Say("RELOADED")
local function OnFillWorldObjectContextMenu(playerIndex, context, worldObjects, test)
print(worldObjects)
player:Say("HI")
player:Say(worldObjects)
end
Events.OnFillWorldObjectContextMenu.Add(OnFillWorldObjectContextMenu)
the event isnt running
you can't print worldObjects because it's a table
local player = getPlayer()
player:Say("RELOADED")
local function OnFillWorldObjectContextMenu(playerIndex, context, worldObjects, test)
for key, value in pairs(worldObjects) do
print(key, value)
end
player:Say("HI")
end
Events.OnFillWorldObjectContextMenu.Add(OnFillWorldObjectContextMenu)```
try this
you probably dont want to do player:Say because it'll just disappear in a second and the list might be long depending on what you're clicking on
Dredging this old issue / mod up cause I'm getting more reports related to it:
https://www.reddit.com/r/projectzomboid/s/qHH05uqUdG
Hi, i'm trying to make a sound mod to the footsteps, i already have unpacked the ZomboidSound.bank into a .wav but i have no idea how to start, can you help me?
Hey hi, perhaps you're aware @sour island, how does one edit compiled .class files for PZ? Doing a quick patch for map loading timeouts. I can decompile using e.g. FernFlower, but making changes seems to be hard 
Tried using Recaf, but that's complaining a lot regarding missing symbols, even when I do try and add the necessary library files
Never tried recompiling or editing java
Yeah I saw that. I ended up archiving it.
Any idea which knucklehead is overwriting the tooltips?
UndoMaskExclusion Oh.
Not just that mod, any mod that adds new body locations, it's an all or nothing overwrite.
Can't insert with how it's exposed.
The mods may not even be broken, If you have more than 1 that needs new locations to work, the last loaded will overwrite. Then items from the previous ones will have invalid locations for their items.
Hell. Would it be possible for smaller end users to extend the tooltip function through a decompile and rewrite?
I'm not anything near a professional modder- Just considering what I can think of off the top of my head.
recipe:addRequiredSkill("MetalWelding", 6) or recipe:addRequiredSkill(MetalWelding, 6)?
to use quotation marks, or not to use quotation marks, that is the question
I'll be your quotation mark.
just try
The issue isn't tooltips.
that's not great advice fyi. neither one threw an error, and in the actual use case I have doesn't distinguish between the correct use and incorrect use, since i was using it to disable a recipe entirely
And modders could actually make a workaround API for bodylocations - but it doesn't matter if no one uses it.
tho i appreciate the help either way
Yeah that's one of the big caveats with this community I suppose. If you put out an API it's hard to get people to use them.
I have all yours, actually. I bundled them up into a reference archive. Might end up hooking some other mods to them.
Try your recipe maybe and see if it applies ?
again, it works both ways, since requiring the skill null and requiring the skill "Obsolete" both successfully disable the skill
i just wanted to know best practices
thanks!
i love the modding community, i'm not sure this game would be a quarter as popular without mods lol
Finally got my development environment setup in VSCode.
Decompiled the game, etc. etc.
Has anyone taken a look at https://github.com/mlem/storm
Apparently a Java modding setup to do even more with the game.
I'm not familiar with Java yet but I think I'll give it a go.
Hi, How can I get anim name of the player current playing? I want to check if the anim is "Idle".
You can use getVariable to get the animation variable and check if the one for idle is on
Any tips for exporting a model as a .x file in blender 4.0? Am noob
I was able to import .x files with a plugin but just can't export
if player:getVariable("Idle"):getKey() == "Idle" then
Something like that?
You could export it in FBX, its supported by PZ aswell and commonly used by modders
Ah. It was saying the meshdata was not being found when I saved it as an fbx
I'm not too sure about the "getKey()" thing
Export in .fbx
That's what I was testing it as
Lemme get the error message
Ah got it. It was a mismatched file name. Now I just gotta fix my texture map heh
Thank you for helping clear my error message 🍞
I mean, np lol
hey all, i'm looking into making some alternative textures for the overalls in the game with three different textures (similar to the jeans in the game; the black, dark, and light wash jeans) and i've messed around with the .xml for the dungarees and made sure to clarify that there are three options for textures (i copied the bottom three lines of the .xml for the jeans) and yet it seems to only load the default texture when i spawn them in game. any idea what else i could change to allow for the other textures to show up on the model?
or ofc what i could be doing wrong bc that is certainly a large possibility bc im new to modding this game
first image is the names and textures and the second is the edited dungerees.xml, for reference
Hello! Im trying to change some sounds for a mod, one of them is HouseAlarm, but I dont understand how this event works, ive tried to change it to file = address but it didnt work, the base game has event = Meta/HouseAlarm but I cant seem to find where the audio file is to replace with a new sound, any ideas how I could replace house alarms?
Every mod ive seen changes sounds by replacing existing sounds triggers with file = address but this one in particular is not working
Original code from zomboid:
sound HouseAlarm
{
category = World,
clip
{
event = Meta/HouseAlarm,
}
}
Looks like Zombies are spawning with the new hair colors. Was that intentional?
It's not a problem but just curious
it's just because of how it's implemented, it's adding the colors to the NPC file to get them to appear in character creation, it was the only way I knew of so as a side effect all new colors appear on zombies
yea no problem! I kinda like seeing the colors in the wild, at least with the other one I did with new colors. if I were just trying to go for the vanilla ones then maybe I'd like to see them less, since there are special 'punk' zombies that have dyed hair but I don't know of any way to do that
I ran into a normal looking zombie with green hair and I was like "why the hell is that zombie's hair green?" then I remembed I had installed your mod haha
@lethal dawn what's interesting is in the file MainCharacterMethods.lua there are lines commented out for a few different colors that I guess the dev decided to cut out or it didn't work right?
-- SurvivorDesc.addHairColor(ColorInfo.new(0.8313725590705872,0.6705882549285889,0.2705882489681244, 1)) -- blonde
-- SurvivorDesc.addHairColor(ColorInfo.new(0.6235294342041016,0.42352941632270813,0.16862745583057404, 1)) -- light brown
-- SurvivorDesc.addHairColor(ColorInfo.new(0.572549045085907,0.4274509847164154, 0.27450981736183167, 1)) -- sand
-- SurvivorDesc.addHairColor(ColorInfo.new(0.4156862795352936,0.18039216101169586,0.07058823853731155, 1)) -- brown
-- SurvivorDesc.addHairColor(ColorInfo.new(0.6980392336845398,0.21176470816135406,0.13333334028720856, 1)) -- red
-- SurvivorDesc.addHairColor(ColorInfo.new(0.572549045085907,0.6235294342041016,0.6549019813537598, 1)) -- grey
-- SurvivorDesc.addHairColor(ColorInfo.new(0.12156862765550613,0.14509804546833038,0.16078431904315948, 1)) -- black
Yeah I saw these, this was one of the files I looked at initially while trying to find the rgb values for the dyed hair. I didn't mess with them much
Looks like it could be old code. May have been a decimal format instead of x/255 as it appears now
I'm also not sure abt the rgb values, I'm assuming it's just 1=255? idk
yeah
could be worth trying to see if adding any new colors to that file would appear in character creation, I don't really know much abt lua I just got curious enough on how to add the hair colors that I dug through the files and looked at other mods that did the same thing
mostly so I could finally replace the old mod I had that added the dyes to character creation
It had the same problem iirc
should be pretty easy to switch it over though and see, not sure if it'd work
Based on what I'm reading, the function that is called to make playable characters is the same one used to make zombie characters which is why others' mods and yours that adds hair colors also affects zombies
Not sure if a modder could do this but I think one would have to somehow differentiate the function call for playable character creation to use a separate function to include unique colors
that's just speculation on my part
I assume in the future it'd be the same function to create NPC survivors too, so it'd probably affect them as well
I wonder how it handles the hair dye colors normally, I already forgot what file the values were in
unless the dev(s) decide to separate zombie/player/npc survivor creation into different functions, I share the same thoughts
It's not normally in the file I'm using to add it into character creation, so I wonder how they get the special zombies with dyed hair
@lethal dawn
yes that's right
I'm guessing the vanilla zombies with dyed hair then have more to do with the zone stuff you can use in worlded, using those is how you place areas where military zombies spawn or the doctors and all that
Maybe
But I have since seen soldier zombies and police zombies spawn with the added colors from your mod
My assumption then is that when those zones spawn zombies, it calls that same character creation function we were talking about
I'm sure it does but it might also let you force a certain hair color, or maybe a group of colors, there's an easy way of figuring this out which is just looking through the files but I'm liking guessing right now
Speculation can be fun sometimes, for sure lol
it also wouldn't help avoid giving random zombies dyed hair, more so just curious abt how it works
An alternative method to make a player character have a given hair color is to provide an option in the character creation skin to spawn with a choice of hair dye which the player could then use to change their hair color
This would avoid zombies spawning with whatever hair colors you might add with a mod
It does seem like it take more work and a little more in-depth knowledge though
easiest way of doing that that I can think of might be with traits, granted it would be a lot of clutter in that menu depending on how many colors
then again if it was through traits might as well put them all in one bag to spawn with
namely editing the UI to provide a place in the character creation screen that you would normally choose your name, hair style and colors and clothing and colors, and then using the player choice to have the chosen hair dye color added to the player's inventory
I think the latter would be the easier part since the game already has an option to start with a "starter pack" that gives a character a backpack, baseball bat and I think a hammer(?) at spawn
I feel like I remember seeing where that was, but I can't remember if that was when I was looking through the files for hair or if it was while I was looking for guns
I just had a separate thought: knowing how to manipulate what a character starts with might allow for a mod idea I had floating around ye olde brainspace
Which is occupation-specific starting gear
Like a nurse might start with basic medical supplies in a backpack, for example
or a lumberjack will start with a lumberjack shirt, jeans and a woodaxe and maybe like a saw or something
I can't remember if that was in the files with all the bag stats or if it was its own lua file