#mod_development
1 messages · Page 536 of 1
I think I found it. Browser8 on Steam, made Tape Recorder, Unbreakable Windows and more?
I love that mod, I have it in my favorites for when we want to build an actual economy on our server.
Thanks! , Ive been meaning to add some more functionality to it with calculating cash on hand and such.
I haven't used it in a while, is the monies super light weight and lighter in stacks?
Nah, I think it works out to 100 bills = 1 weight unit loose or in stacks/rolls or in an envelope?
You can stuff 100 bills in a sealed envelope and write on it though.
what im working on is a bit different
price editing interface
as for currency will be a sandbox option where you pick which item is considered the currency
Anybody familiar with this? I searched and have seen other run into it but don't see a resolution anywhere
It says "There are unrecognized files in your Contents/folder. Only folders are allowed in Contents/." but based on what I see above that folder is empty
You got a disallowed file type somewhere in your directory structure is all.
Probably in a subdirectory then, it's not very specific with that message unfortunately.
It helps to know that I can consider the subfolders as well as the Contents folder! Thanks!
👍
I just figured it out... its the .DS_Store hidden files
they keep auto regenerating, but if I delete them in Contents and Contents/Mods it fixes it. Must be a mac thing
Well, that's a new one for me, but every day can be a magical adventure alright 😄
One more corner case issue for the corner case bucket!
idk where to post it since this is not even a mod but anyways, i made the "Dizzy" Moodle! what you all think?
looks good
quick mod idea
throw bags or gas cans over tall fences
i imagine it would make some noise, and the gas could spill a bit losing some
I meant locality as in the player client that owns the zombie and where the zombie code runs in.
I made a clothing mod that just adds a few branded tshirts and hoodies. i cn confirm it works in single player (it spawns in clothing shops fine). but when i add the mod to multiplayer it doesnt seem to be loaded at all, and cant even spawn it with /additem. do i have to do something else to make it work in MP?
Hey everybody, I have learnt some Lua and now I want to learn about the zomboid modding API, where should I learn the API from?
I tried making a mod, but found it hard to make as I was relying on Lua events but the events I needed were obsolete or didn't exist.
Most zombies look cleaner than my character, if I could I would add random stuff from surroundings like branches or cushions from couch to the zombies. Maybe even give them buff to not get detected by player.
Imagine seeing bookshelf with hands and head chasing you, something in that sort.
Could somebody please point me in the right direction on making vehicle and clothing mods? I have some ideas based around WW2 RP stuff to do with my friends but seem to come up empty handed when looking for tutorials.
not sure about vehicles but these are good guides for clothing
https://steamcommunity.com/sharedfiles/filedetails/?id=2648115890
https://theindiestone.com/forums/index.php?/topic/37647-the-one-stop-shop-for-3d-modeling-from-blender-to-zomboid/
This guide will provide all necessary to create a clothing mod for Project Zomboid.
Get now all clothing models in Clothing Assets !...
Hello and Welcome! Here you will find a concise and comprehensive guide and tutorial of making 3D models for Project Zomboid. Currently, this will mainly pertain to custom Clothing creation but may include weapon creation in the future. This will present how to create models from scratch with Ble...
Thank you very much!
this wiki page has a big list of guides for a bunch of stuff but i'm not sure how much will be useful
https://pzwiki.net/wiki/Modding
Is there a better built-in way of logging rather than just print function?
I'm having a weird situation where I packaged my first mod and uploaded it to Steam, but now I cant run it locally? The mod is showing up and the lua is getting loaded but its not working and its not showing up in the debug menu
Anybody have any ideas where I can debug?
The screenshots below show
- It seems to be loading successfully according to the logs
- Its not available at actual game time and not showing up in the debug menu when i search for it
@gaunt belfry as soon as you add your mod to the Workshop dir, it'll be preferred from that location over anything you put in the mods dir
prints are directed to console.txt, so what kind of better logging are you looking for?
I was hoping to find an error since the .lua doesn't seem to be loading anymore and I'm not sure what I inadvertently changed
Anyone here running TED Beer's Skin Retexture for 41.68 MP?
I can't seem to get it working on mine
Maybe a function that utilizes already built-in log levels like WARN, ERROR etc.
None that I know of, but I haven't been modding PZ very long
Do you see any LexError exceptions appearing after the load?
➜ logs```
[19-04-22 10:49:12.554] LOG : General , 1650383352553> I am testing a print at game boot.```
Well now its loading since I truncated it and just added debug code
So it must have been silently failing trying to parse it
that might not be the exact right exception name
Don't have a current one without breaking my code right now
does anyone have an insight to this? hosting a game has the workshop mod in its list, but in the game doesnt appear to be loaded at all, but in single player it loads fine
not exactly a builtin logger, but its pretty versatile and handles different levels
local Logger = require('Zmu/Logger')
-- create a ZLogger instance to log to a shared log file.
-- This can be created automaically if desired
local zlogger = ZLogger.new("MyLog", false)
-- now create 3 different Logger instances with different output levels and link
-- them all to the same log file. Normally these Logger instance would be in
-- different mods instead of one place.
local log1 = Logger:new("Mod1", Logger.INFO, zlogger)
local log2 = Logger:new("Mod2", Logger.ERROR, zlogger)
local log3 = Logger:new("Mod3", Logger.DEBUG, zlogger, fuction(text)
-- have the player say the message for log3, instead of printing to console
-- note this still goes to our custom log file.
local player = getPlayer()
if player then player:Say(text) end
end)
-- log some various messages to the different loggers
log1:info("log1 shows info messages, warnings and errors")
log1:warn("this is a warning message")
log2:warn("log2 doesnt print warnings") -- wont print or log to file
log2:error("log2 only prints error messages")
log3:debug("can even format %s like %s", "messages", "this")
log3:info("it uses string.format syntax like %.2f and %04d", 123.4567, 55)
is there any way to get the field details that all the objects have if they don't ahve getters?
Javadoc Project Zomboid Modding API declaration: package: zombie.scripting.objects, class: Item
to add to this, I'm tearing my hair out with making the world model actually work when its on the floor. worn is perfect though.
like, everything seems to be linked up fine. and yet it just shows the icon and no model
ok fixed this one. the gound model definition HAS to be in module Base.
doesnt explain the wierdness in multiplayer though, still need help with that one
it does, and it's dumb. lol
yeah i was trying to be all good programmer by putting it all in my own module
Does anyone know if there is an item you can equip but isn't shown on the character model?
do you have any thoughts on how i can make the mod load properly in MP when it works fine in SP?
looks awesome right? IT'S NOT
reference this:
it makes the DAMAGE USE THE HSV COLORING.
did you add the mod AND the workshop item to the server?
just the workshop item, surely thats enough right?
mod is on the workshop, i subscribed to it, and added it as a mod in the hosting settings
i even renamed my local files mod.info sections so it doesnt see that local dev files as the ones to use
then... hang on
how come i can add other workshop mods fine without having to do that?
Workshop ID: 2781895054
Mod ID: SprinterAE86
How does the game know what walking animations to use? Like is someones leg is hurt. I'm trying to make a trait that forces the character to limp.
every time i add a mod.. i have to add both.
surely thats like, the whole point of the workshop 😛
lol yeah
with other mods from the workshop i havent had to do that, which is what makes that wierd for me..
unless the game kind of does that automatically, but fails when its your own mod?
possibly?
I'll compare mod and workshop lists and see if thats the case
indeed. the mod and workshop lists are different
funky
@vernal island @quasi geode you don't need that; the DebugLog class is exposed to Lua, example:DebugLog.Lua.warn("foo: %d", 3)
Where is cargo space allocated for vehicles?
the script for each vehicle.
Yeah, but what line is it?
I can't find anything related to cargo/inventory
the one about the trunk?
Yeah
part TruckBed
{
itemType = Base.SmallTrunk,
container
{
capacity = 45,
}
}```
i mean the one that handles the trunk
Let me add that and test
is this a NEW car?
Yes
mod
Adding the format you sent fixed it, thank you 👍
Anyone know why my 3d clothing item when placing looks like this?
and then placed like this -
bad texture path
ah ok! are you able to send an example a good texture path? I thought i had it right (but clearly not lol)
thanks!
thanks to you both, will try and fix
so texture= Clothes/Pipboytexture1
the whole file path would be "media/textures/Clothes/Pipboytexture1.png"
but no file extension right?
no problem my dude
will tweak the model but it's gonna get ther
yeah, all that is now is an image edit
Is there a way to make a new Bodylocation equip spot
doubtful
In the media/lua/shared directory
require "NPCs/BodyLocations"
-- Locations must be declared in render-order.
-- Location IDs must match BodyLocation= and CanBeEquipped= values in items.txt.
local group = BodyLocations.getGroup("Human")
group:getOrCreateLocation("YOUR_NEW_BODY_LOCATION_ID")
Thank you!
👍
oh shoot, nice!
Anyone that has used True Music here that could help me out pls?
I'm trying to make a trait that forces you to limp at all times. I'm not able to find where the game calls for the walking animation. Help?
A kludgy way could be to keep adding/renewing a leg injury every tick or day
Check out hypno toads mod called More Traits. There is a trait called broke where you start with a broken leg.
Test out that mod, see if it acts the way you want and then check the code to reverse engineer
Here is the github code: https://github.com/hypnotoadtrance/MoreTraits
I have that mod. I want the limp to be permanent. Broke heals.
I either need to have to checking and redoing the damage every hour or so, or assign the animation for limping.
THank you though!
Literally the first time I've ever been responded to here.
And I'm struggling to get it to check and reinjure.
Does anyone know where to install project humanoid
Does the broke leg animation look like how you want it to work?
Do you mean, is it the animation I want? For this particular thing I like deep wound in the lower leg
Hello, is there an event that triggers when all mods are done loading?
I found the OnGameBoot, but when mods are getting reloaded during a game
Does that mena this event triggers between mods?
getting loaded is a onging action
How does the math work on determining if a firearm jams? Not sure if this is exactly the correct channel but it seems coding adjacent.
steamapps\common\ProjectZomboid\media\lua\client\TimedActions\ISReloadWeaponAction.lua
every gun has a jam chance defined
- every condition loss increase the chance of jamming the gun
baseJamChance = baseJamChance + ((weapon:getConditionMax() - weapon:getCondition()) / 4)
The lower the condition, the higher the chance
if baseJamChance > 7 then
baseJamChance = 7;
end
if ZombRand(100) < baseJamChance then
weapon:setJammed(true);
end
This last bit means that highest jam chance is 7.
Every time the gun is fired the chance to jam is:
** gun specific jam chance **
PLUS
** weapon condition loss based jam chance **
RESULT will never be higher than 7,
Then roll a 100 sided dice and if it's less than your current jam chance (max at 7), your gun jams
are there any mods for hallucinations akin to Barotrauma's psychosis?
i want to throw together a server where many people have it, for gits and shiggles
How? I can't figure out how to change what animation the player uses when they walk.
it would be based on what they are holding.
rather than the walk anim.
where can i find the list of these? ```ProceduralDistributions["list"]["GarageMetalwork"]
@faint jewel
Thank you very much for the thorough explanation.
I have a follow up question actually about jamming then, can the base chance be a decimal or does it have to be an integer?
So if I wanted to set it up that a player is always limping, I'd have to change all of the animations?
does anyone have any recommendations for mods to make, for someone starting out with modding?
depends on scope, start with clothing or weapons those are documented more
id recommend weapons or a simple item mod for a beginner
it will allow you to fully get to grasps with how the game operates
like adding an item in?
indeed
I see
also im pretty sure my mod isnt being detected, im in debug mode, have my mod in C:\Users\compl\Zomboid\mods\snipedtest\media\lua\client\snipedtest.lua, and theres no errors or anything its just not in the mods menu
Sounds like you borked up the folder structure.
Here's an eample of one that works for me
C:\Users\blair\Zomboid\Workshop\Kukri\Contents\mods\Kukri\media\lua\server\Items
I dunnno, but in general the directory structure and formatting stuff with modding is absolutely ruthless in how you have to implement them "properly".
There's 2194793014743 mod directories in a PZ install? I just use that one for making mods.
You should be able to put your code directly in the mods folder, that's how I most-often test.
You gotta be absolutely scrupulous with formatting + directory structure stuff however, regardless.
thats what i did pretty sure i have the directories correct
Did you check console.txt to see if it claims to load your mod?
Absolutely.
My argument for using the workshop directory as I do is that, vs the mod directory, is that the mod needs to be in the workshop directory anyways when/if you want to upload it to the steam workshop?
So better off learning how to use that directory now than have to fuckaround learning how to use it later?
aight i need one of you code monkies for a bit.
MRBOUNTY @drifting ore ! you sir are who i needs.
hey guys, looking for mods, does anyone have any to recommend
anyone know how to add event on stomping? like additional hp lost
what do you need Skiz?
more coding skill than i have
hey guys, how do I add all the mods to the server I am hosting, all at once?
Map=TreadsMilitaryVehicleZoneDefs;Muldraugh, KY
#mod_support is the channel for inquiring about these sorts of mod-user issues? This channel is intended for mod making. No big deal though, but you'll find it more helpful there 🙂
No worries 👍
what is the all distributions table for? is it for procedural or suburb?
Do you know guys a mod that drops the map of a player when he dies?
Like you have a map with markers written on it and someone kills you and loots your map so he can see the markers you had written
I have table.insert(SuburbsDistributions.all.crate.items, "ITEM"); table.insert(SuburbsDistributions.all.crate.items, 0.8); which works for me and everyone else subscribed. But one person gets the error
attempted index: crate of non-table: null
Are you sure it breaks it?
Nevermind, I was mistaken, that should work.
uhhhhhhhh
Yeah huh
One of the rare tables in Distributions.lua that you can add items directly to.
table.insert(SuburbsDistributions["all"]["cashregister"].items, 100);```
they also get an error on
table.insert(SuburbsDistributions.Bag_SurvivorBag.items, "ITEMM");
So I guess someone on one of the mods he has installed screwed up their distribution table
Yeah, that should work, same code works for my stuff?
Yeah, maybe they're using one of many, many, many mods that nukes distributions?
Well, people love using mods for build negative twelve that were last updated in 5,000 BC as well?
Ah, when people use mods, especially old ones or poorly made ones, all sorts of magical things can happen?
good point lol
i don't think my tables have anything wrong
maybe theres a mis-matched mod id?
Yeah, offhand they look solid to me?
And most of the time when it's a situation like which works for me and everyone else subscribed. But one person gets the error, that one person is using a mod or mods that fuck up shit, or maybe they're using an old build of PZ, or maybe something else on their end is just cooked?
Why would you want to change your mod ID?
because mine could easily be used elsewhere i suppose
Yeah, your call. It's very very very no bueno to have a modID that's the same as other mods' modID.
Just be aware that it could cause issues for subscribers' savegames or servers, you dig?
NP, good luck! 👍
Hello! 🧑💻 Is there a way to check whether is day or night?
"....1998....I'll never forget it...It was the year when those grisly murders occured in the Arklay Mountains..."
thx
Can someone point me in the right direction I am trying to make an item that you can equip but has no world model. I just want it to be equipped to the player in their inventory
Are there any similar mods I can look into the source code to figure out?
Something like that. Lets say like a trinket that gives you a buff
I tried using silver ring as the base for the item and tried removing certain properties
But I am getting some errors that I dont quite understand
I created my own body location where the item can be equipped to
Which model of pip boy are you making? Is it the pimp boy 😂
aha so far only added the one from fallout 76 (not a great fallout game) but a cool looking pip-boy
gonna add the other ones too
Nice, looking good and can't wait for it all 👍👍
Anyone know if survivor respawning is enabled in the superb survivors mod
I keep driving through town and causing all the ape brained NPCs to run outside and get eaten, and I'm hoping I won't run out of survivors before I can rescue any lol, I have zombie respawning off so if I kill all the zombies, and then more survivors respawn for me to rescue it'll be nice
Hello, where can i change the text of
"This is how you died"
I would like to change it to say something else.
gj man ❤️
thanks :D
its my first mod, eventually i will add more content
B:\Games\steamapps\common\ProjectZomboid\media\lua\shared\Translate\EN\UI_EN.txt
ty
it'll be a bit different for you, since I have my steam games on a different hard drive, but everything after "steamapps" should be the same
yeah i found it ty!
im looking to commission a full drug mod. from producing the drugs to packaging them, to crafting into usable items. i used jiggas and i love it but the problem is im looking for more then weed. and i'd like to have namely all the most popular drugs including (heroine, meth, weed, cocaine, pills, lean, shrooms, etc.) this would be a large mod that adds alot of items, crafting, farmable plants. and id pay a solid price to have it all done. the mod would have to work beside a police mod as well on my server i have another developer working on. pm me about it if you'd like to help or if some one could get me in touch with jiggas and he'd like to be paid for actually making a larger mod let me know ! thank you 🙂
Did you have to create a new Body Location for it?
idk if the devs............ nvm
stole this post from reddit because its asking a question I've long wanted an answer for :
"Is there a mod that lets players create their own power grid in a fully-player-made base/home?
I'm essentially looking for a way to be able to build my own house from scratch, and be able to make my own ceiling lights, light switches on the walls, and have a working power grid so I can throw a fridge or two down in various places.
Any help/suggestions you can provide would be much appreciated!"
what is the correct way to get the localized text for a recipe name via lua?
ie recipe:getName() will return the english name in the script
but what about other languages?
I think getText(TEXT_HERE) would probably get the appropriate translation for the client's language selection?
So switch client language to desired language and run a getText on it?
Then switch back.
In my case, I am looping through recipes, so TEXT_HERE is not a value I am able to locate via the recipe itself
getText(recipe:getName())
ERROR: Missing translation "Build A Workbench"
Oh my bad I figured they probably didn’t care, because of how popular jiggas is. Plus it’s just a workshop item it’s not like I want it added to the game haha! My bad though.
Nah, drugs are fine.
Looking thru ISCraftingUI, it is unclear where the localized text is derived for a recipe name. I have the relevant text file setup etc.
Yeah, that was just guesswork on my part anyways?
Nvmd, what you suggested works. Seems lua refresh didnt work first time round
no blair, you cant turn back time
Huh, well anyways that sounds like that might have some neat utility for say procedural text generation?
turns out that little refresh issue on my end was the issue altogether. the localized text is returned on getName()
Cool! Could have neat utility for generating messages in different languages and such.
does anybody know if its possible to make "extension cords" to extend the range of a power generator or power source?
Maybe anyone know how to add event on stomping? like additional hp lost
Also.. which function affects bleeding damage?
It’s used in the same place as a watch
Hello. This question has probably been asked before but what is the best way to learn about modding PZ? I am a Computer science student and am very interested in learning since I really enjoy this game. Any input/information would be greatly appreciated.
You should check those at least:
Thank you so much!!
does anyone know the resolution of trait icons?
I know it's 1x1 but like
pixels and stuff
18 pixels
by 18
8x8 or 16x16
all video textures have to be powers of two.
2 4 8 16 32 64 128 256 512 etc
18x18
Thank you
If I'm trying to do a HUD overlay over the entire screen, should I just go with the screen size of most monitors?
Err
Hold on I can't word for crap
Aye Fellas anyone know why is my custom vehicle distribution not working? I just copied the vanilla one that uses specific distributions for my Gigamart Van.. The first Distribution uses food items and the second one uses Toys and stuff. Here is how I set it up.
Where can I find the mod tools?
guy do you have any guide on how to set up gun attachments?
hey am trying to set up a melee weapon to be able to attach it onto multiple points. An attachment on the back and the belt.
Would "AttachmentType = BigBlade/Knife," work or am I missing something?
Pretty sure that's not how it works. You can only put 1 slot. But TIL you can hold the button for a radial menu of all attachables huh...
ergo for that to work you'd need to define a new attachment type and make it so it's accepted on BeltLeft/Right and Back (look at media\lua\client\Hotbar\ISHotbarAttachDefinition.lua for the vanilla stuff)
i need some code assistance, anyone free?
Does anyone know if there's a mod that lets you chain up zombies to act like guards and/or alarms?
We found the mod that is the culprit its one known as "AZN_Crossbows"
for those curious this is what happens when your distribution code looks like this
Save everyones sanity, and don't do this!
Because that is not the way you do it
table.insert(SuburbsDistributions["all"]["cashregister"].items, "Base.item");
table.insert(SuburbsDistributions["all"]["cashregister"].items, 100);
Switch suburbs out for the vehicle distribution table
lol i recognize that.
it makes me want to slam my head against my desk when people copy the vanilla code and think it will work, yes it'll work for your mod, but any mod loaded after won't have any distributions loaded xD
it would have actually worked if he put it at the end of the Distributions table, the game merges them on top of the first element
local function mergeDistributions()
SuburbsDistributions = Distributions[1] -- the games distribition table should always be the first in table.
-- if there are modded distribution tables merge them into the main suburbsdistributions
if #Distributions>1 then
print("### Merging distribution tables ###")
for key,dist in pairs(Distributions) do
if key > 1 then
print("Merging distribution addon #",key-1)
MergeDistributionRecursive(SuburbsDistributions, dist)
end
end
print("###################################")
end
-- ...
end```
still why copy all that and make it look like a mess when all you need is two lines
well the indenting is a mess apart from that I'd do it like that too
doesn't really matter now, that most stuff is in the procedural distributions anyway
was reading the modding guide on github, these 2 are empty
Lua question: How do you get the items from an item of 'Container' type? I'm presently stumped and probably missing something obvious 😩
nvmd, figured it out. Just needed to do a 'getInventory()' on the item itself
I’d love it if someone could make a mod that introduces welding goggles to the game. They can be rare or common, so long as they’re lighter than the mask and don’t override the entire face. I wanna wear my novelty Todd Howard mod mask while I disassemble doors!
On the topic of welding eye protection, aren't welding mask almost impossible to see out of normally? They should affect player sight radius imo
They are tinted as well
How do you prevent PZ from removing your "stale" zombies
I think I figured it out. You can set its authOwner. Let me test it.
How do you set the authowner
Yeah... never mind
anyone know if there is a hand warmer mod anywhere? playing cryogenic winter and i feel like thatd be a great mod to go along with ot or is there some game code tht makes that too hard to do?
How do you prevent your zombies from being removed due to be "stale"?
Where does the game track as to which clothing item covers what?
like you can get a long sleeve t-shirt and it covers the torso, upper arms, and forearms; on the same slot the bandeau covers the torso, and upper arms.
I'm trying to use this Json util, but I don't seem to be getting an output. I'm simply registering a function on boot to dump a table to a json output, but nothing is happening. Code snippet below, any ideas?
local Json = require("Json")
local function dumpProps()
local fileWriter = getFileWriter("farming_vegetableconf_props.json", true, false);
local json = Json.Encode(farming_vegetableconf.props)
fileWriter:write(json);
fileWriter:close(json);
end
Events.OnResetLua.Add(dumpProps)
Events.OnGameBoot.Add(dumpProps)
I'm an idiot, ... passing json to fileWriter:close()
Fellow modders!
I made a small CLI to scaffold zomboid (workshop) mods. if you have npm just run npx mx-create-mod in the Workshop folder.
https://www.npmjs.com/package/mx-create-mod
Very cool!

idk if i should ask here but can i give my friend the cheat menu if i have the mod installed (he has it installed too)
This might be better suited for #mod_support , but what do you mean? What cheat menu and what mod?
yea i typed it in mod support but in the end couldnt solve it, but i was referring to the mod cheat menu
Could you send a screenshot? @vocal saddle
I have an idea for a mod but could I run it through here, it sounds a little stupid
go for it
There are literally mods that add defecation to this game, so I think the field of relevant ideas is pretty broad!
anyone can tell me how take value from other mod?
Can you be more specific?
It was actually to do with an aging mechanic
where you get benefits for being younger/older (younger gets shit like bonuses to fitness), older gets bonuses like wisdom? also a chance to die of old age and related stuff like heart disease
How is value A declared/instantiated/exposed in mod 1?
@chrome egretfor example one mod set weight 10 and i want to use this value -2 in my second mod
Hello. I want to remap the key-bind from 0 /zero/ to Numlock 0 /zero/
elseif key == Keyboard.KEY_0 then
ui:refresh()
Is there anyone who knows how to change "Keyboard.KEY_0 " to NumLock 0 pls?
Just thought I'd share this with everyone. Comes in handy when working with the OnKeyPressed event:
Tank you. Should I change it to:
elseif key == Keyboard.KEY_82 then
ui:refresh()
end
you can simply compare key to the value, key == 82
thank you..it has worked 😄
Only by override some default functions (or hook to them)
yeah i think ive found the code in media/lua/client/xpsystem/ISUI/ISCharacterScreen.lua
do you know where IGUI_char_Age is from?
ohh so its a translation thing i see
yepper
good to know, I defo feel a bit out of depth rn
It can be a bit overwhelming getting started!
Yeah especially looking at a 700 line lua script half of which is how the char is being drawn haha
There used to be an Age display in the character info screen.
But it was just a placeholder that didn't change; you could survive 10 years in-game and it would be the same as when you started the game.
It was removed because it just confused/misled people.
yeah, but the translation is still in the game files
which is pretty neat
Oh yeah, they never really remove anything 😄
It would be cool if you could age up the character's face, hair, and such
well thats kinda what im trying to create
but im not sure if id be able to edit the characters face?
I'm afraid since I don't mess with that kind of thing I don't have a clear grasp of what is or isn't possible
If you can change someones hair color via lua, should be able to just tie it to the characters current age in days survived
ah shit 38 errors
nice got it working
its pretty funny cuz you need to put the variable as a string
not an int cuz the function doesnt like it like that
Yeah, I don't think labels, buttons, etc., understand anything but strings
I think a cool and fun feature that someone could incorporate with age-related modding would be giving characters a birthday?
not a bad idea, pretty sure you can add extra boxes at the char creation screen
make their birthday 1 week after they spawn. just in time for the heli to come wish them happy bday.
I was thinking maybe add like an xp boost on their birthday
I'm not really that much of a joke mod guy myself, but there could be some good fun with having some party-outfit zombies spawn in for a players birthday 🤪
or someting balanced
send in the clowns.
Giant novelty cake with a stripper zombie inside it.
🐔🐔🐔
Hey guys, I've been toying with hallucinations in project zomboid and I wanted to know if there is a way to directly make something client side. Say for example you spawn a zombie everyone on the server will see it. I'm looking for a way to make a client side zombie if its even possible
I dont know if anyone has toyed with this idea before, or if they can give examples of a mod thats done it before
any help is apricated
Does anyone have the code / lua for the generator fumes?
Is it possible to keep your zombies from being removed due to being "stale"?
Any good mod creators (3d modelers mostly) looking for a big job/project would mostly be quality of life items, also some other cool rp items. It would be similar to hydro craft but a custom mod for my server. Looking to pay quite a few dollars for some one willing to take on the task 🙂
ill shoot you a message it would be a pretty big mod.
There is a client-side thing that renders an item's model for choosing how to put it on a table.
I actually didnt think about that
I wonder if I can abuse that for a possible client side zombie
i double wonder if there is a lua thing for it
Anyone know why Hydrocraft items are invis when equipped in mp?
Lua can be used to render the item. It needs to be something that does something:Render() though. If you use the UI, it's not going to smoothly follow the isometric tiles. Items are not animated like zombies are.
Though i've not checked, You can spawn a non aggressive zombie. The idea is to have a client side non aggressive zombie go to your position, to make it look like its going for you, but when you look in its direction or see it I plan for it to disappear
So i'm not 100% sure it would work, its something I would have to look into
I keep having an issue were I get an error eating in game and when the animation stops the food is still there and hunger doesnt decrease. Any idea what mod might be causing it ?
is there a mod or function in the game that allows you to quick equip and quick-drop primary and secondary hands items? For instance: Quick equipping a toolbox from the ground or shelve, then quick dropping the toolbox in front of a car
i have an issue with a weapon model
apparently the model is shown lying on the ground
but when i equip it, doesnt show
the code of the weapon model is like this
module Base
{
model Crucible
{
mesh = Weapons/2Handed/Crucible,
}
}
and this is the path of the model
Edited to reflect progress, see later comment please.
~~I'm in the middle of writing my first mod (so excited!) (been programming for years for work and school, but new to Lua, seems relatively easy to pick up so far) and am making good progress. I want to find any firearms the player has in their inventory so I can take advantage of the methods that they have as a HandWeapon. So far I can tell if the inventory item is a weapon by:
player:getInventory():getitems(), for-loop through each of those items: IsWeapon(). (alternatively, getCat().)
But I can't seem to find out how to access the methods of the HandWeapon subclass, or to determine what subcategory of weapon the item is. Any advice on how to do this? ~~Thanks a ton in advance!
Can powered items be told to detect the presence of power in multiple tiles?
Like could I code a lamp to be powered if the either the tile behind it(directionally north) or the tile in front of it (directionally south) has power.
I'm only using the lamp as an example because I want to create a power cord/line mod that would allow you to place down power cables that can extend the range of a connected "power zone".
If anyone is interested in helping me make extension power cords that you can use to... y'know... extend power, from a generator or an already powered house I would really appreciate the help cause I have no idea what I'm doing
The main issue I see is, your texture path is off, re-evaluate that. Also make sure that you have applied all transforms with CTRL+A.
thanks, ill check it out in a moment
I'm making progress! The Lua function "instanceof" is what I needed in order to determine if it's a HandWeapon or not!
New question: How do I get it to tell the difference between firearms (like the VarmintRifle/MSR700 Rifle, for example) and say, a kitchen knife? (In the items_weapons.txt, there looks like what I assume is a comment header over the section saying ITEM_FIREARM, but that isn't a class or anything so far as https://projectzomboid.com/modding/allclasses-noframe.html tells me... so how do I tell them apart?)
Hey folks! I'm new here and fairly new to PZ but fell in love with the game after it was gifted to me. I've been inspired to create mods that I hope people would enjoy, but know absolutely little about programming a mod for PZ. Any idea what skills I need for doing it and how I can learn to mod for PZ?
Thanks ahead of time!
now attached in the back, looks like this lol
painfully attached
There's two main things that gets checked, if square(gridsquare) has electricity and second was something like if chunk has touching generator.
Game Devs have said they will do some changes to generators and fuel, so it might be easier to mod in the future.
A cheat you can use is place a generator 5 squares away from generator you want to extend, so you can cover more squares.
so if i wanted to make a lamp output power like a generator when on but need to be powered by a generator what would i need to add or adjust in the lamps code?
I am new to this, but I would probably make a global objects, like campfire / plants.
And check if square has electricity and if a generator exists closeby.
Something like this is done by immersive solar arrays.
Check if generator exists and if it's on. Obviously you'd need to exclude the lamp, if you make it a generator.
There's also steam powered generators.
what happens when i want to start to daisy chain them though
im using the lamp as a placeholder for the power cable
Same but with something like water pipes mod. Irrigation farming on Steam ?
thats EXACTLY like what i want to do just with power
Is it possible to make it a select a random car when the function "Car_Random_OnCreate" is called? Instead of the code i have below.
function Car_Random_OnCreate(items, result, player)
local ranValue = ZombRandBetween(1, 5)
for i = ranValue,1,-1
do
player:getInventory():AddItem("Base.Car1");
player:getInventory():AddItem("Base.Car2");
player:getInventory():AddItem("Base.Car3");
player:getInventory():AddItem("Base.Car4");
player:getInventory():AddItem("Base.Car5");
end
end
Im very new to coding so any help would be appreciated!
Electricity might be a little tougher to get, generators are mostly java.
how do i mod a new trait?
@willow estuary Probably should pin these:
https://github.com/FWolfe/Zomboid-Modding-Guide
https://github.com/MrBounty/PZ-Mod---Doc
jesus man, did you still not verify your stuff?
😂
Hi ! We have found this road map of the Knox County and would like to add it in our server
Do you know if there's a mod that does this already ? And if it's not too complicated to do it ourselves ?
Heyo can someone help me out with something regarding starting traits/clothing and the coding for it?
Essentially I am going about modifying the starting outfits and items for professions which I've done already, but now I want to know if it is possible that if one were select a specific trait for their character then they would be exempt from the occupation loadout or outfits that my mod provides.
To be more specific, I have an "Injured" trait and want to make it so if somebody were to select said trait for their character, they would be forced to spawn without the items that my occupation mod provides and to spawn only with a hospital gown or if not possible to also add the hospital gown to the outfit selection screen when the injured trait has been selected.
So far this is what I have for the trait section:
EDIT: Figured I'd try "player:getInventory():RemoveAllItems;" and it seemed to have worked so far with what am aiming for.
----Trait Items
if player:HasTrait("Alcoholic") then
player:getInventory():AddItem(getRandomStringFromTable(Alcohol));
end
if player:HasTrait("Smoker") then
player:getInventory():AddItem("Base.Cigarettes");
player:getInventory():AddItem(getRandomStringFromTable(Lighter));
end
if player:HasTrait("Injured") then
player:getInventory():RemoveAllItems;
end```
I trust discord with my private details as much as North Korean pirates
fair
Hey folks, I'm trying to remember what the name of the mod is where the character talks to itself about how it feels, but I'm blanking out. Would anyone have an idea?
conditional speech
you bloody legend, thank you
how could i forget when it was made by my friend chuckelberry finnm
Curious what else one would use a mechanical table saw for beyond cutting wood logs and planks? Ideas or things I might not be seeing?
Zombies, people.
How is inventory stored in this game? Ive noticed that when you overload your character by loads, the game laggs immensely. Been running in debug and seeing like how much loot is in each area. When reaching high amounts of loots the game slows down ALOT.
I was wondering if it was possible to make the sun hurt the zombies so a "I am legend" like mod would be possible
Anyone that could help me sort load order for my MP game with friends? The weapon mods are never working like arsenal guns missing icons and being invis same with b rita weapons but in SP they work fine
Have you tried #mod_support? This channel is really more about making mods
Blair's NightZeds code modifies zombies based on such conditions, you could adapt it to damage them instead:
I wish I could but I don't know anything about modding and the only thing I found about modding for pz didn't have anything to do with code but I was wondering because my friend knows a little and I just really want as close as possible to an "I Am Legend" mod
Have you seen the Modding section of the Wiki? https://pzwiki.net/wiki/Modding
Ugh, that code could be so much more elegant 🤮
Looks like I've got another one of my mods to fix! 🤪
If you so decree 😄
I'm on about translation support currently
I wish there were something built-in that would help me get a plural form of an item name, or get the appropriate article for a word, in the current language.
Yea but I would still need to know how to code because from my experience more damage would be done than possible
I understand that you're not experienced. I'm struggling to understand how I (or anyone else) can help you at this point.
The answer to your initial question is "yes, it's possible".
Zombies for medical xp, or something. People same and / or food.
I wanted to make zombie parts weapons at some point.
Skizot made those garbage trucks that produce meat cubes when corpses are "disposed of". Perhaps this could too!
Yea that was mainly what I was wondering but thanks for answering
np
Ay can anyone help me with a set of lines real quick?
I am trying to remove all items at the start of a game and then equip a hospital gown onto the player character if a certain trait has been selected but I don't think I am doing this quite right.. 😛
if player:HasTrait("Injured") then
player:getInventory():RemoveAllItems();
player:getInventory():AddItem("Base.HospitalGown");
player:getInventory():EquipItem("Base.HospitalGown");
end```
Do you get an error? Does some of it work, but not all of it?
nah no errors just not the desired outcome. only thing that works is player:getInventory():RemoveAllItems();
I honestly think what you have looks right, but have you tried removing "Base." and seeing if that affects the outcome?
Also if you'd like you're welcome to send me your console.txt to see if I can spot anything
My apologies guess there was an error in the console
says line 298 which is where the first "additem" section is for the hospital gown which is weird.
Also the remove all items command seems to only remove any actual items that arent equipped but none of the clothing.
Yeah, I don't think worn/equipped clothing is considered "in" the inventory at that point.
ERROR: General , 1650720588341> ExceptionLogger.logException> Exception thrown java.lang.RuntimeException: Object tried to call nil in Add at KahluaUtil.fail line:82.
ERROR: General , 1650720588341> DebugLogStream.printException> Stack trace:
java.lang.RuntimeException: Object tried to call nil in Add
at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:82)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:973)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:163)
at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1980)
at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1812)
at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:66)
at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:139)
at zombie.Lua.Event.trigger(Event.java:64)
at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:130)
at zombie.iso.IsoWorld.init(IsoWorld.java:2691)
at zombie.gameStates.GameLoadingState$1.runInner(GameLoadingState.java:262)
at zombie.gameStates.GameLoadingState$1.run(GameLoadingState.java:219)
at java.base/java.lang.Thread.run(Unknown Source)
LOG : General , 1650720588343> -----------------------------------------
STACK TRACE```
The inventory is considered a series of "backpacks" each of which has its own contents-- minimally the player-held inventory and keyring, but also any true backpack they're wearing.
Which line of Add is 298? Is it part of the snip you already sent?
To make this easier to suss out, and for best practice anyway, try storing the result of getInventory() in a local variable. That can make the error/issue more apparent in the break debugger as well as more specific when you're trying to look into it. It also avoids the overhead of calling getInventory multiple times and simply re-using the value from the local variable-- miniscule in one instance, but every little bit helps.
if player:HasTrait("Injured") then
local inventory = player:getInventory();
inventory:RemoveAllItems();
inventory:AddItem("Base.HospitalGown");
inventory:EquipItem("Base.HospitalGown");
end
hmm yea I tried this and it seemed to disregard everything all together, got the same error as above but instead it is line 299.
Which is right after the "local inventory" line
so when I look at the ItemContainer class, I don't see RemoveAllItems
I see removeAllItems
alrighty ill give that a shot
I would definitely commend you to check out the Java source, either through your IDE or using the online Javadocs
The other option is trying to scrape the vanilla Lua for clues
okie dokie
and that version of the line worked, it removed all the items in the inventory in its entirety but the character still has the set of clothing that was selected in the creation screen lmao
Yeah, I bet you'll have to combine another method to get everything out
Perhaps the player object has an unequip all that you can call before removeAllItems
Maybe i'll give it a tinker and see what happens
anyways tho thanks for assisting I am gonna pick this up later am dead tired, I will check out that Java source you mentioned later today. 😄
Sure thing! Take it easy.
For your future reference, it looks like you could run a loop over the result of IsoGameCharacter.getWornItems() to call IsoGameCharacter.removeWornItem(InventoryItem), before you call removeAllItems.
Can someone remind me what the mod is for having zombies be mainly fast shamblers but now and then throw in a sprinter?
So does adding translation (i.e. porting code to use strings from getText lookups) necessarily break the mod for any language which doesn't have a defined translation? Or is a default (EN?) used when the chosen language has no translation?
this isnt a modding channel question, but its called customizable zombies
It should should default to English in those cases.
can someone explain the difference between CharacterCreationHeader.lua and CharacterCreationMain.lua? In SteamLibrary\steamapps\common\ProjectZomboid\media\lua\client\OptionScreens
im trying to add an extra dropdown box below surname
in the character creation menu
where can I find some of brita's armors?
In short, the CharacterCreationHeader (which seems primarily concerned with displaying the avatar preview and some other info) is used as a component by CharacterCreationMain
so if i wanted the user to select an age from a dropdown combo box of ages id have to look in CharacterCreationMain to get that code (kinda like the male female but different options)
I tried ripping the male female dropdown box from header and seeing if it would put another below but it just errored
Errored how? It does look like *Header has the responsibility of creating a lot of the input entries
If not all
ill try rerun it again give me a second
so i found
but im not sure where ISComboBox is located so I can check the function to see what it takes
anybody know how to set and/or check for states? Stuff like idle, bump states when you trip by fence/sprint into a tree, yk. I've tried looking for it in modding library website but couldn't find anything for it.
you wouldnt happen to know the location of ISComboBox?
or ISTextEntryBox
nvm found it
im planning to make a mod (first time), and i was wondering. can i somehow replace the music in the game with my own without making a mod?
There is music that plays during combat or just random ambience, and i was wondering if whenever the combat or ambience theme triggers, it could play my own mp3?
People say: "Use youtube" But i cant alt tab out the game while fighting a horde, play my song and tab back in
self.ageCombo = ISComboBox:new(entryX, self.genderCombo:getBottom() + 6 + (entryHgt - 18) / 2, 80, comboHgt, self);
self.ageCombo:initialise();
self.ageCombo:addOption(getText("18"))
self.ageCombo:addOption(getText("19"))
self.ageCombo:addOption(getText("20"))
self.ageCombo.borderColor = {r=0.4, g=0.4, b=0.4, a=1};
self:addChild(self.ageCombo)
I have a combo box here, to select the characters age, but I cant seem to figure out how to get the selected value from the combo box and save it as a variable, everything I try it just errors and the combo box disappears
thank you so much dude
np, big credit to MrBounty for creating the original guide
saved me when I went to create the UI for Item Searcher
Yeah, I'm not sure I have the energy or the correct vision
But I do wish there were better supplementary documentation
I think the code I'm seeing around that is using the index of the option that's selected
well i tried to do this
function onAgeSelected(combo)
if combo.selected == 1 then
charAge = "18"
else
print("Sjot")
end
which doesnt work lol
You could look at ISComboBox.lua to see how to tell which option exactly is clicked?
Nah I'm gonna use the get selectedtext
It looks like that function implementation has an error
you're missing an "end"
both the conditional and the function need an "end"
Oh yeah lol that explains it
Yeah, small syntax errors will kill ya 😄
I hear ya
Aside from just running the code in PZ, I highly recommend using repl.it to test bits of Lua syntax
Yeah it's annoying at times have to load up the game each time I wana test something small
For sure
I'm sure many do
If you want your mod to be compatible with other mods that modify character creation, then instead of overwriting the original functions to make changes, you could let them run and then make changes, like in someone's render example.
in the github examples?
how to check that error?
every time i press Q to yell, or i want to open the map, doesnt work at all
my mod have an error but i cant find it
c:\users\ [yourusername]\Zomboid\logs and debug log .txt
Yes.
Hey, i was wondering if it was possible to make the menu in the character creation bigger via a mod ? There's a great mod on the workshop "Improved hair menu" that creates new character windows for haircuts but i was wondering if it was possible to make those windows bigger. Especially the one where you see your character fully 🤔
just got here
does anyone know what map this could be from
best image i have since its from a clip
I cant remember the name of it for the life of me
imma check rq
Hello, can there be a problem if I put twice the number of pixels in the texture of the clothes?
youre right! thank you so much
have you tried it anyway?
no problem! Enjoy! There's another great base location on the main road at the top
Knoxville refuse station or something, has a gas pump too
It works, I just don't know if it will let me upload it to the workshop.
Well I feel like it is going to work then, have you tried uploading it to the workshop?
Can always make it unlisted
or just delete it if it's glitchy
if it's still wip
I haven't uploaded it yet, I'm correcting errors, but I'll keep it in mind, thanks.
No worries, not sure if I've helped much lol
@winter bolt might be able to help more 🙂
nah its fine I think
most of the textures in brita's clothing mod are pretty high res and i dont think it causes any issues
Then perfect.
Testing out some stuff for mod
DOPE
Hi, what do I use so that my clothes do not have holes in the mesh?
Hello. I want to adjust the amount of gas in a Gas Can. Does anybody pls know what should I adjust pls?
All i can think is that you can maybe change the
UseDelta = 0.125,? @sharp crystal
item PetrolCan
{
DisplayCategory = VehicleMaintenance,
Weight = 5,
Type = Drainable,
UseWhileEquipped = FALSE,
UseDelta = 0.125,
DisplayName = Gas Can,
Icon = Petrol,
ReplaceOnDeplete = EmptyPetrolCan,
StaticModel = GasCan,
ReplaceInSecondHand = Bag_GasCan_LHand holdingbagleft,
ReplaceInPrimaryHand = Bag_GasCan_RHand holdingbagright,
WorldStaticModel = GasCan_Ground,
}
im new to all this aswell so i wouldnt know forsure
Right as a bottle of water is 10 units and use.
Use Delta = 0.1
yeah the lower the delta the more times you can use it.
item PetrolCan
{
DisplayCategory = VehicleMaintenance,
Weight = 5,
Type = Drainable,
UseWhileEquipped = FALSE,
UseDelta = 0.125,
DisplayName = Gas Can,
Icon = Petrol,
ReplaceOnDeplete = EmptyPetrolCan,
StaticModel = GasCan,
ReplaceInSecondHand = Bag_GasCan_LHand holdingbagleft,
ReplaceInPrimaryHand = Bag_GasCan_RHand holdingbagright,
WorldStaticModel = GasCan_Ground,
OK..thanks ...gonna try it
forsure hopefully it helps
Does anyone know if anything is wrong with my code here? i keep getting an error when trying to craft the item.
function Random_Item_OnCreate(items, result, player)
AddRandomItemToInventory({"CreditCard", "LightBulb"}, 0, 1)
AddRandomItemToInventory({"Screwdriver", "Battery"}, 0, 1)
player:getInventory():AddItem("Screws", 20)
end
WTF am I even looking at?
Thanks, but it's not what I'm looking for, I want a specific garment that doesn't erase polygons when it breaks.
in the item script i think you can add something like "noHoles=true"
not sure if thats the exact variable name though
if you can check the vanilla item scripts for underwear i think some of them have it
itll make the item completely unbreakable though im pretty sure
Ok, I think I found it is:
CanHaveHoles = false
How does the game check if a magazine has been read/finished? I'm trying to to trigger an event once this state is successfully met
Is it possible to modify zombie hearing/detection to next to none if the player is behind them?
I use VSCode. but where can i get intellisense for all available lua functions for pz? I saw there was one for jetbrains but I cant find one for vscode? It would be nice for autocompletion
this would be dope
ive been hoping someone would make gas masks useful
spores are the best use
Not Intellisense, but the Java class LuaManager has both the list of Java classes exported to the Lua environment, and also the globally defined Lua functions you'd always have available.
Ah I see
is there a guide on how to make custom animation in project zomboid?
good old offset error
With Eris NVGs?
uh huh
Have you been getting an error where the screen turns gray instead of green?
A couple of people reported that to me, but I couldn't reproduce it. 😛
nah, but then again i ignore most of the people who run up to me
it was up and running fine last time, i wonder if adding a tooltip via the item script broke it?
That's why I tend to shy away from tooltips, they seem to break things more than being helpful.
i am on my third coffee
ill look at whats doing it in a bit
its a shame because i wanted a short instructional since too many are confused
Eris's is easier to use than the other one too.
Are you me? Bloated and tries to do to much was my thought. 😄
This should probably work for you as an example?
require "TimedActions/ISBaseTimedAction"
local old_ISReadABook_perform = ISReadABook.perform
function ISReadABook:perform()
old_ISReadABook_perform(self)
local modData = self.item:getModData()
if modData.bonusLevel then
bonusLevelBook(self.character, self.item)
end
end
How can I adjust the chance of a weapon appearing impaled in a zombie? I made this one mod for one knife, added it to all the zombie distribution parts, and now it's showing up everywhere. I've got like 12 of them now.
Recommended 3D modeler application?
For PZ? Blender.
Free, and literally anything else is a waste of money or overkill.
The tools I use for modding this game are Notepad++, GIMP and Blender, if you're curious. All free.
Thanks
have you used Blender in the past?
No
Have you used any modeling program in the past?
No
Actually I used sketchup
Maybe, but I'd rather use a modeler designed for this
I think the devs use Maya, but don't quote me on that.
Like 90% of the peeps on this thread use Blender, myself included.
Well if you use Blender, download it from Steam and use the 2.93.8 version.
I say that, because you're going to need the Export to FBX plugin, and that don't work in 3.0+.
Ok
What does that do?
ewww
Lets you export to .X and FBX. Game uses both.
Then the first one isn't needed
Ehh, you might be right.
Grab em both just in case, 3rd party things can break randomly.
Good idea
It's not showing anything when I import FBX files
Ok, some it shows, some it doesnt
It doesn't export right either. The game isn't loading it.
Does it support multiple meshes?
What are you trying to do exactly?
You need to have it all one mesh.
Weird things happen when you have multiple separate meshes/objects.
In-game, either one mesh or the other will be there, and more likely neither because the origin's in a weird place.
Okay, thanks
Yeah, join them together as a single object.
I guess that's one of Blender's idiosyncrasies. 😛
1 mesh + also one material/texture.
Still not working
Only one mesh, only one material
Running Blender 2.93
Wait, there are two FBX export options
Yeah, that's not working either
I tried exporting with both of these:
Using the first FBX tool you posted
Does anyone know if anything is wrong with my code here? i keep getting an error when trying to craft the item.
function Random_Item_OnCreate(items, result, player)
AddRandomItemToInventory({"CreditCard", "LightBulb"}, 0, 1)
AddRandomItemToInventory({"Screwdriver", "Battery"}, 0, 1)
player:getInventory():AddItem("Screws", 20)
end
what does the error say?
I'm finally nearing the finish line for my mod... please enjoy this trailer I made for it: https://www.youtube.com/watch?v=gmJnkQWM_XY
Will you be able to find a cure for the Knox Virus? More importantly, will finding a cure be enough to get you published in a respectable journal? Embark on a journey to earn the respect of your peers... and save the world too I guess.
Based on my hardcore version of the Antiserum mod by b1n0m. This latest version features fully 3D items which ...
@crimson spindle function does not exist
is this in seconds or? trying to understand how it measures time since last seen, or just float time values in general
is there a function that checks what day/ and what month it is?
I know this might be a very complicated thing, but is anyone working on a "working cameras" mod? like you know how outside the prison there are all sorts of machines in a place that are supposed to be security cameras/screens. How hard would it be to make them functionable and installable? I'd love to have one of those and a couple cameras around the perimeter of my base, for example. But it's not a thing yet, and I'm not sure if it'd be possible or how to go about if I wanted to modded it in.
I imagine you'd have to do some funky stuff
Like teleporting the player to the camera location
And making them invisible
Hello, I'm really new to this, I looked in mods which tweak loot spawn on zombies but didn't find the specific thing that I wanted.
How can I select only bald/short haired zombies to spawn with my mod's clothes?
I've heard that AutoTsar Motor club doesn't yet have a means of towing motorcycles, which I find to be a huge shame, because I love the motorcycles. If towing requires a special trailer/rig, how hard would it be to make it so that you can turn the Motorcycle into an item with, like, 75 weight or so that could be loaded into the trunks of large cars/vans/trailers? Too heavy to lift, but maybe there could be a command to transfer it directly into the trailer/trunk? Would that be an acceptable work around?
Anyone know how to solve this issue? https://steamcommunity.com/workshop/filedetails/discussion/2459061763/3185740658306308971/
Tested singleplayer, everything works.
Tested multiplayer, everything "works?" (maybe something is broken, but characters are gaining exp, being able to walk and read, faster reading based on skill) but the console here is spammed.
I have the issue with traits as well. everything works singleplayer, but some times the server will send an error for multiplayer and yet still function.
does anyone know how to fix the offset of the weapon when attached to the back?
I have a custom definition for a zone defined and I have waaaay too many items spawning even though the loot rarity should be set to rare... how do I turn this down?
I want to be able to spawn maybe 4-5 items with chances of duplicates. Instead I'm getting 3x that much. What am I doing wrong?
ugh im trying to include an example but the character limit is too muhc
heres an example:
Yeah, 5 rolls is a lot of rolls + a lot of items in the list + a lot of those items have high spawn values?
= a lotta stuff spawning alright.
try something like addxp(perk,float,true,true,true)
last true will stop from sending to server
Updated
v 41.78.16 - They seem to have wrong index between client and host for me.
print("Debug Perk Information")
for i=0, PerkFactory.PerkList:size() -1 do
local perk = PerkFactory.PerkList:get(i)
print(string.format("Perk %d, \tindex: %d, \t%s",i,perk:index(),perk:getId()))
end
so how do rolls work exactly.. would should this get tuned down? Do I actually need an item listed multiple times to get dupes to spawn?
Rolls = the amount of times the game will roll to add an item to the container.
can more than one item be added per roll?
Basically when the container is generated for the 1st time, the game does some funky maff to determine what goes in there.
When items spawning is checked every item is checked vs a random number one time per roll.
More rolls, more checks.
The math behind the spawn chances is..... ...ugh, I'll let you look at the code yourself vs feebly attempting to explain it https://pastebin.com/ArNSSM2m
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Yeah, duplicate entries is probably better than having high rolls amounts if anything.
Honestly, trying to understand the math regarding item spawning is headache inducing. I've been at it for a few years now and even I barely understand it.
But the simplest solution would be to reduce your rolls to something lower, test, and see how you like those results.
👆
alright ill give it a shot
Fiddle with the numbers, test, Fiddle with the numbers, test, etc.
Big number = higher chance. Use vanilla item spawning chances as a guideline and test to evaluate your results.
That's pretty much it? It's some lovecraftian horror story nightmare trying to make sense of the math in that function for most people IMO.
alright gotcha thanks
"lovecraftian horror story nightmare" is exactly how I would describe it.
I've legit tried to math it out, and gave up when the math wasn't matching the game. 😄
"How to the numbers works? Ughh.... ....they're not a percentage and that's pretty much the limit of human comprehension in this matter"
Zombies in the vicinity inflating spawn chances make it a complete clusterfuck anyways trying to evaluate shit in the abstract vs actual game environment testing.
@crimson spindle, be sure to test your mod under typical gameplay situations too. Like Blair said, zombies can mess with spawn chances too.
Using the game's debug mode can help with not getting nibbled to death in the testing environment too.
Do you have a dedicated save for testing?
i usually end up making a new save file and yeah ive been using debug mode to fly around invisible
Good, good.
A tip I can give you to sort the loot tables quicker is to delete the cell the container(s) are in between exiting to menu and loading the save. You'll have to work out the coordinates of the specific cell, then dive into the save game file in the File Explorer, then find the file with those coords and delete it.
For instance, I can tell you, from memory, that the Cortman Clinic in Muldraugh covers 4 cells: 1087_1002, 1087_1003, 1088_1002 and 1088_1003.
@crimson spindle So 1, load into the save. 2, judge the contents of the container. 3, exit. 4, fiddle with the values in your text editor and save. 5, delete the cell in the save, 6, repeat from step 1.
That's my process in this shindig. If there's a quicker/better way though that someone else uses, I'd love to know.
I'll use that too, yeah. Often times though I've had to be more surgical.
Yeah, it's only good for clean sweeps? Great for testing vehicle spawning as well.
Can someone help me with that?
This file, in C:\Program Files (x86)\Steam\steamapps\common\ProjectZomboid\media\lua\shared\Definitions for me, is used by the vanilla game to assign specific haircuts to zombie outfits.
So you'd need a file in the shared lu directory like so
require "Definitions/HairOutfitDefinitions"
-- your new outfit hair definitions using the same formatting as in the vanilla file like so
local cat = {};
cat.outfit = "MY_NEW_MODDED_ZOMBIE_OUTFIT_NAME_HERE";
cat.haircut = "LibertySpikes:5;MohawkFan:5;MohawkShort:5;MohawkSpike:5"; -- total should not exced 100! anything "left over" will be a random haircut
cat.haircutColor = "0.98,0.87,0:10;0.82,0.15,0.07:10;0.21,0.6,0.3:10;0.26,0.6,0.81:10"; -- forcing a haircut color, total should not exced 100 anything "left over" will be a random color from our default color
table.insert(HairOutfitDefinitions.haircutOutfitDefinition, cat);
local cat = {};
cat.outfit = "ANOTHER_NEW_MODDED_ZOMBIE_OUTFIT_NAME_HERE";
cat.beard = "Long:30;Goatee:10;Full:10;LongScruffy:20";
cat.haircut = "MohawkShort:5";
table.insert(HairOutfitDefinitions.haircutOutfitDefinition, cat);
using the vanilla Bandit and Private Militia outfit entries as an examples here.
what are the numbers after the haircut/beard?
The probability, as a percentage, of the haircut spawning for that outfit type.
what happens if I don't write the "cat.outfit" line like you also didn't? It will spawn naked zombies with the hair/beard I choose or they will spawn with any random clothes?
I don't know? It's meant to be assigned to a specific zombie outfit.
In a lot of these cases it really comes down to testing and experimentation.
I was imagining a zombie with literally any outfit with bald or bald spot hair to have a chance of spawning with wigs, because when you have a big hair it glitches through
Yeah, that would require some custom lua coding to do. Not something that I can just cut and paste an example from a file for or anything like that to demonstrate?
Thanks anyway, I would not know about the outfits if it was not for you, I'll maybe just make the items craftable to not be jenky and poke through random zombies if I just add it to their inventory
Is there a way to limit the colours the item will spawn? like in the code you sent, I don't want to craft hair and it comes in a different colour every time
well, maybe I do, but it would be better if I could make different recipes if possible
z is chance of spawning
x is the chance per roll
y is number of rolls
used the wrong expression before
Missing about half a dozen variables, but in its most basic expression? Yeah, that.
Nearby zombies, Lucky/Unlucky, and world settings also play a role.
Do custom skills work with book bonuses? Just checking as I have created a new skill along with relevant skill books, yet they never gain any bonus modifier (little arrows next to the skill) when I read or finish the book.
Pretty sure you need to do some UI tweaking to get those - they're UI elements and not all of the skills have them.
make sure you add the skill book multiplier under the right section
Can you elaborate on this pls
check server -> XPsystem folder
Bless your kittens. That worked. Thank you 👍
Next question: Can you set/change a sprite's properties (tile definitions) via code? E.g. change the IsMovable flag for an object on a square
Turns out there's a fair few items in PZ that could realistically double as water bottles. 😄
Not sure. Might be worth experimenting with to see if doable.
Maybe start with a different question, is it possible to either get IsoSprite or IsoSpriteGrid without a square or object (i.e. the global reference of these)?
Hell if I know.
If you know what those words mean, you're better suited to finding out than I am. 😄
Lol...yeah sorry, I come from the mapping side, so those terms are quite bread and butter for me. They represent the tile properties we can edit in the Tilezed map editor. I want to force change the properties ingame for some sprites without having to override the actual vanilla 'tiledefs' via the editor.
Well IDK how much if at all lua can effect tiles. I know that it's possible to check to see if the character is standing next to a powered stove/fridge with lua, my cooking mod does that.
Are you wanting to know if a script can replace a tile with another tile?
because if that was possible the possibilities would be endless.
To map out the logic IsoSpriteGrid (tilesheet) > IsoSprite (tile) > Properties (all the various flags on how the tile acts ingame)
Im trying to edit any of those properties.
Ah, yeah, I don't know if it's possible, but being able to modify tile properties via lua the way script items can be is a personal holy grail and would allow for a lot of cool stuff.
There must be a way given there are some Set capabilities for the PropertiesContainer of IsoSprite 🤔
https://zomboid-javadoc.com/41.65/zombie/core/properties/PropertyContainer.html
Javadoc Project Zomboid Modding API declaration: package: zombie.core.properties, class: PropertyContainer
Well, that is interesting and seems to imply that there are code allowances for that? I don't know offhand if that's for specific instances of the object or all instances however?
Yeah, I would be looking for all instances (globally change an oven's flag for example)
what application is this?
This the map editors for PZ. Here is a link to RingoD123's mapping channel post with link on how to install, setup and use them.
#mapping message
ooo thank you
I tried this once, but properties changes for all items with said sprite. If you find something, please tag me.
Ive got a question yall, if i add a mod midgame into multiplayer, will the server explode? talking about adding repair options to madax pack weapons
this might be what i need. I want to set it for the sprite globally
Then yeah it's possible
I thought I would ask, do you guys know any function that would work to make something client side only? I'm looking on making a zombie client side
if isClient() then ... end
or
not isServer()
so that it works for singleplayer
Ooh, so using this I could hypothetically make a client only zombie on a server?
Yeah
The driving skill and scavenger skill mod both have respective books
Oh nvm. Answered
can you possibly share how you managed to change properties via code?
local sprite = IsoSpriteManager.instance:getSprite("sprite name") local props = sprite:getProperties() props:UnSet("IsMoveAble") props:Set("IsMoveable","") print("test ",props:Is("IsMoveAble"))
I can unset, but not set, second string needs to be some value
works for things that have IsoFlag though
And that would work to make a zombie client side Only in a multiplayer environment?
yeah
So I assume it's as easy as setting is server to false and is client to true?
I don't know much about adding zombies.
isServer() returns true only on server, so you can use that to check if it's server
Yes, but I'm attempting to make something client side only
So a zombie to only be seen by one person
Gratz on being featured by IS @late hound
Ie yourself
For what ?
lol you is like 3 days late my dude.
I made a mod already but now want to update it and add some more features but I have no clue how to setup the Code Editor, I tried to set up IntelliJ Idea from Jetbrains with the wiki but an important step seems to be missing... 😅
help is greatly appreciated 🙂
I believe the guide to which you're referring is assuming that you took this step: #mod_development message
I'll take a look at it, thanks 👍
Anyone of you mind checking my message in the mod support channel?
anyone has instructions on how to decompile java source of the game?
The link from this guide isn't working anymore
https://theindiestone.com/forums/index.php?/topic/61-robomats-modding-tutorials-updated-12112013/
RoboMat's Modding Tutorials - An introduction to modding for Project Zomboid - I - Introduction I1 - Where to start I2 - What is neededI3 - Lua TutorialsI4 - Other Resources II - The first steps II1 - Getting the connectionII2 - The entry point: Events III - The first mod III1 - Preparations III1...
local player = getPlayer()
local test = getClothingItem_Legs()
local test2 = test:getActualWeight()
function player_say()
player:Say("Hello World"..test2)
end
Events.EveryTenMinutes.Add(player_say)```
Im just messing around with functions trying to get familiar with syntax, but im not exactly sure what im doing wrong here it keeps erroring on line 3 (getClothingItem_Legs) returns InventoryItem
probably a very simple issue but im still new to modding
Eggplanticus also released a good tutorial on how to decompile the java source over here.
The link should be this https://theindiestone.com/forums/index.php/topic/1156-
are there mods that add spawn spots into those small towns/villages that arent the main 4?
only thingy i have been able to find is louisville
Try:
local test = player:getClothingItem_Legs()
worked cheers mate
I am working on a mod to create sandbox options to give more control over the sound radius of guns (the standard ones that come with the game). I know how to add a .txt file to overwrite the base game's items with new properties, and I know how to create the new sandbox options... But then I start having trouble. I can use Lua files to reference my sandbox options variables, but I don't know how to use Lua to change the base item properties (instead of, say, a specific item in a player's inventory, for example) that would be found in that .txt file. Can the .txt file reference my sandbox options variables (or other Lua file variables for that matter)? Or is there a better way to do what I'm trying to accomplish?
download arsenal+brita mods and look at how they do it imo
Thanks for the suggestion. I thought about doing that, but don't those just add new weapons to the game (so they'd handle it all in that .txt file)? Hmm, do they also add sandbox options for how loud they are, sound radius, etc.? If so then you're right I should def look at how they do it 🤔
@latent orchid properties set through code are not persisted
And from all the testing i did never saw them being applied globally
Through lua you can edit the script item instance it wont change items created before settings are changed but from that point items created get the new settings
Can you tell me more about how to do that or point me towards an example?
That sounds like what I'm looking for! 😁
Not on pc right now but something like getScriptManager():getItem("itemName")
Ok thanks, that gives me a starting point to work from
getScriptManager():getItem("Money"):setActualWeight(0)
Found this from my messages
Keep in mind existing items arent changed
I am at my wit's end.
I am completely unable to make a script that gives you the building key of the place in.
When I do, it only works 50% of the time.
Anyone here willing to help?
sup, mind elaborating?
What do you mean by building key, and what's the problem the other 50% of the time?
Alright so, I have two mods.
One spawns you in the Riverside Pharmacy, the other at Cortman medical.
That part is fine, and I have some code that is meant to scan the building you are in
and give you the key of that building
And this works 50% of the time, I get a key and all is good.
The other 50% of the t ime I get no key.
Yeah, the actual key of the building you spawn in
Now I originally tried to code it myself, but that caused errors
so I took the code from a mod that I know works
But the same problem comes up
I'm at my wits end here.
Can you post a snippet of the code?
I'll post the entire thing here brb
Or link to the source.
Can you also show the GiveBuildingKey code?
Does the character get the key ring when they fail to get the building key?
They spawn with a keyring
not sure if it's the default thing that happens when you spawn or if it's the mod
In vanilla you will start with a key ring, so it may not be necessary unless something else is doing work to remove everything
Not sure man, I just need a piece of code that scans the building you're in on spawn
and gives you the key of that building
Yeah, well looking at this I would just add some print lines to GiveBuildingKey
to ensure you have all the needed values in keyRing, buildingDef, keyIdNumber, and key
if they're nil for some reason then it's liable not to work
How does one do that? I'm a total noob with lua coding.
I have a mod that adds a few tshirts and hoodies, but get an error when trying to wear head protection if the hood is up. the tooltip sys "replaces: hoodie" and instead of unequipping the hoodie when you put a hat on, the hoodie just vanishes with a stack trace. when looking into it with debug mode, i get this trace: I've coped the item definitions and xml files from vanilla hoodies so something else must by at play here.
simple stuff like after local buildingDef is declared, add a new line print("buildingDef value: " .. tostring(buildingDef))
its referencing some base game code that I havent touched, that works with normal hoodies
yep
then you play around and figure out where the issue is
Reminder that errors and other print output should be going to your console.txt file
alright, thanks
Sure thing. Don't hesitate to reach out if you need more assistance.
does anyone know what might be causing a stack trace when simply trying to wear a hat? it feels like theres some function missing to unequip the hoodie but i cant see anything in the vanilla files that would control that
And one more thing, where is the console.t xt
I'm at work but try to check every now and then
<Zomboid dir>\console.txt
mine is under my user directory on Windows
Have you looked at the ISClothingExtraAction code to see where it's trying to get an object and call getVisual? It may be expecting your custom clothing to have something else set
Isn't printing to console.txt
Any where I can learn how code lua for
project zomboid?
Can you confirm it loads your mod? Here you can see a line noting my mod is loaded, then some printing from the mod itself:
Moment
Check out the pinned link to the Modding page on PZ wiki, it has a lot of resources including Lua.
How difficult is it to learn how to code lua?
Do you have any previous programming experience? I didn't find it very difficult.
yeah, its pretty unhelpful to be honest. highlighted is the line at fault. which looks like its the java class
I have extremely basic knowledge of HTML
which... I never touched, and I copied the initial clothing from working vanilla game files...
also the tshirts i added dont have this problem of wearing them and trying to wear something else that takes the same slot, it does as expected and just removes the tshirt
I have a quick question/suggestion
but if it sounds way to far fetched then im sorry
but do you think it'll be possible to add pets into the game or companions?
Animals are coming to the vanilla game, so it should be a relatively simple mod at that point
Hey guys, I thought id ask if anyone basically knows the project zomboid equivalent to while true do
There are while do loops, can you not use a constant true value with a break?
Or simply store the value in a dummy variable
Well, i've tried it but each time I tried the game froze up
That means you didn't hit a condition that would break your loop
I did the same thing to myself
Well, what I mean is
For example lets say I have a while true that counts to 100 then ends
For those counting to 100, the game would freeze
as soon as its finished, the game returns back to normal
There's really nothing you can do about that other than minimizing the code you're running during the loop, or decomposing it into chunks that can occur over time. Your loop code is the only Lua code that is being run by the game at that time-- it must wait until your work is done (unless it trips one of the conditions to be killed, which is ofc not ideal)
If I want to just up the forage rate of one item (cockroaches) do I have to edit a table or is there some function or event I can override
This is for a server
Any vehicle devs looking to get involved on a pretty big project? You’d most likely be creating early 90’s-00’s American cars and trucks. and it would be large.
Pm for more details about it and we can talk about it.
On the initial release of a workshop mod, is it normal that the workshop page seems empty? It's been a while since I've uploaded something and was wondering if that's normal. Also is it because it is awaiting for approval?
Nevermind I had files that didn't belong to the mod structure (error 2). All good now!
Hi all, I have started a non-dedicated server with two friends and we would like to claim the fire station in Rosewood as our safehouse. However it is a spawn point. How can I claim the fire station ? I have admin powers.
i think just changing the setting 'safehouseallownonresidential' might fix that
ive also painted areas as safehouse as admin if that isn't an option for you
It did not fix that, because the fire station is a spawn location. I have even subscribed to a mod which "should" allow for claiming safehouses no matter what, to no avail
I have seen the tool to set a safe zone but since it is, again, a spawn location I can't validate that either
It's a shame because that fire station is really cool
I have tried setting a fixed spawn point for all players, in hope that would remove the other spawn locations, but no
