#mod_development
1 messages · Page 323 of 1
But you have done ✨ Something ✨
Its only showing up in the solo menu
I cant select it as a spawn location in my server
It doesnt show up
I hosting from ingame
how do i make it available on the server too?
It’s since been fixed!
Though I have a new problem now
perchance does anyone here know how to add a third tow attachment point to a vehicle? i tried just adding a new one but that didnt work
It should work the same way. You just have to ensure the trailer has the correct canAttach (normally just "trailer"), so it can actually use the attachment
yeah i did all that but it still doesnt work, i cant tow normal vehicles with it either
I think every vehicle would need to have the canAttach configured to be able to connect to it. Did you check the trailer connects when the attachment has the standard name?
I had hard time trying to connect a semi trailer I was trying to make, even when it "worked"
for example, both would look like this?
right now im trying to make sure the attachment point thing works, but i do know i might also have issues getting past the "cannot reach trailer" thing
I'm not sure, but seems with a quick search that only the trailers normally have canAttach defined. Maybe try with the trailers attachment named "trailer" and the vehicles attachment without canAttach
I’ll try that in a moment!
doesnt seam to have worked
currently looks like this
truck
attachment TrailerTruck
{
offset = 0.0000 -0.2747 -1.1703,
rotate = 0.0000 0.0000 0.0000,
zoffset = -1.0000,
trailer
attachment trailer
{
offset = 0.0000 -0.0549 1.0110,
rotate = 0.0000 0.0000 0.0000,
canAttach = TrailerTruck,
}
My life would be so much simpler if there was an event on the server that did this, but now I need to implement a filter for /whisper and some Sanbox settings.
remember to always test your code
not X == Y → X ~= Y. not has higher precedence so you'll be comparing a boolean with a string (and it'll never pass)
I have some other points of feedback if you're interested, but holding off unless you indicate that you are to not be rude
You can send it, I like to learn and it's always useful to have someone to evaluate you.
but know that I don't know lua very well, I write C and ASM
Gotcha, all good. The main thing: you should prefix your variables with the local keyword—this makes the variables local to their scope. The default is global, so everything you defined there will be polluting the global scope
I will do that, thanks for letting me know.
@frank elbow any more tips?
Looks good to me. I'd probably extract it to a function on a table returned from the module just in case someone else wants to override it for mod compatibility reasons, but for logging messages idk how likely that'd be
What I mean by that, if you do end up wanting to do that:
local YourModName = {}
function YourModName.OnAddMessage(message, tabId)
-- ...
end
Events.OnAddMessage.Add(YourModName.OnAddMessage)
return YourModName
(the return with access to the function is so someone can remove your listener & replace it if they so desire)
That's good, I liked this idea of modules, I'll research more later and the mod isn't exactly for logging messages
When I test this recipe in game, it makes 250 nails. What am I missing?
recipe Carve Wooden Pegs
{
Log,
keep [Recipe.GetItemTypes.SharpKnife]/MeatCleaver/SharpedStone,
Result : Nails=50,
Time : 1000,
Category : Carpentry,
CanBeDoneFromFloor : True,
Sound : Sawing,
AnimNode : SawLog,
Prop1 : Hacksaw,
Prop2: Log,
OnGiveXP : Recipe.OnGiveXP.SawLogs,
}
Nevermind, I think I see it. this is from base
recipe Open Box of Nails
{
NailsBox,
Result:Nails=20,
Sound:PutItemInBag,
Time:5.0,
}
Good thing the Australian game rating is based on Vanilla and not modded gameplay.
is AK-47 something else than a range weapon ?
A strain of Marijuana, apparently,
I love my AK-47 sealed, ready to pewpew..
Also a very good example of why you need to use unique names for items if they are in the Base namespace when Rain's Gun mod and this drug mod both added Base.AK47
does anyone know why my custom clothes are crunchy? XD
if anyone has exported .fbx clothes for project zomboid before, may i request a quick walk through on how to do it? im not sure whats going on.
What do you mean by that?
Oh now I see... It's hard to notice on phone
yeah for some reson its bugging out when i try to load them in game, but they look okay in blender. ive tried exporting the clothing as .FBX and .X and neither work. X files are invisible, FBX are crunchy
https://steamcommunity.com/sharedfiles/filedetails/?id=3444877391 for me it looks like they're not weighted properly
Or at all.
Did you parent then to armature and weight paint parts to corresponding bones for it to move with character?
It looks oddly similar to vanilla player model that has been modified. If that's the case you do need to check if every part of model has at least one bone affecting it. If there is a part that's not weighted it will act like on picture you've send
yes.
also, yes. wedding dress and long coat models were reused for this.
So you're sure that everything is weight painted, like every face/triangle? Can you show your XML file?
every face has weight.
how big is your texture?
512
its something to do with the mesh.
but idk what
like it crunches and spazes out in game
That's first time I see this pop up...
its fine in blender...
its a plug in i have that lets me know if verticies are empty.
But are the bones named correctly to those from vanilla?
yes. i was sure not to touch any of the names.
I have one more thought but as I said I'd need to see your clothing item XML file
okay so i think it might be that im exporting it wrong? because of how its fine and following the skeleton on blender but buggy in game. i had this issue on another platform and it was an export issue, so im trying to figure out whats going on. and this for now is a direct replacement of another clothing object. i do not understand XML so i am not touching that file.
Can you show whole blender window opened with everything?
what are you trying to look at? i can show you the export window? i think that will be more helpful. the game i modeled for used .dae files. this is my first time working with .fbx and .x files
Might I ask where you got that armature from?
throttle kitty's character files. they are fbx versions of the default zomboid ones. they load in flawlessly, but the moment i pop it into blender and export the darn thing, crunch
This?
im not a maya user
im basically just doing a reskin of some of the primative survival mods as a placeholder for when a friend of mine finishes his mod.
but ill convert it to the blender file you linked and try it
What exacly are you Exporting from blender when doing so?
Everything or?
selection only. just the coat and/or skirt
I was wondering why your files were so small in terms of size
okay fair... translation data... gotta figure out what that means
that makes total sense now LOL
Let's just say that Translation Data MUST be there when you have weighted model
It makes character move, so probably clothes
I don't know exacly how it works.
yeah the game i made for previously only has you exporting the clothing and nothing else. not sure if there ever was, im guessing so, i never touched it
For animations its required to be moved when you want to make character's animation move actuall character
that is fair. im self taught so i have blanks in my knowledge LOL so thank you. let me try this and see how it works.
#modeling message I can suggest using this. I've made it some time ago. I know it has some "duplicated" bones, but i've been using it so far and had no issues. You can always just delete duplicated ones. It has Both characters on same armature, aswell as female player model positoned pretty much 1 to 1 as ingame character. When using other's files i had issues when i made Jackets and such that arms were not in same positions when imported to game. It turned out that when i made clothing item of that model and equiped it, arms and some other parts were not perfectly placed, making clothing models out of it troublesome as you had to tweak them after.
ill try this out. thank you so much. ive always been a texture artist first and foremost, but i enjoy making mesh. im glad to me making for more than one game now ahaha!
THANK YOU
I on the other hand rely mostly on software for textures. Substance painter my beloved
Yay!
i LOVE substance painter ehehe
if you ever need some textures or patterns, hit me up. i figure i owe you one.
You don't owe anything. We're modders and were here to help eachother.
"Double it and give it to the next person"
fair enough. i really should set up a tutorial for this as i see now a lot of things that is not entirely intuitive for beginners. i suppose this is the benefit of doing something for the first time... that depends on my schedule though...
its for the player to move around basically
its a bone(ish)
lots of modders who does animation said this
but no one actually did it
animsets == maze
o wait youre talking about clothing mod
damn i need to sleep
all good man XD ugh i cant waaaiiit till i try animations LMFAO
clothing models only need to bones theyre weighted to
if you have a hat or something you can just delete everything except the head bone to lower the file size
anyone know why thistexture thing is happening?
working on the b42 port of my mod, i know its the overlay textures but not sure why
Hi everyone, I'm looking to make a small mod that changes the flag of a certain item. Specifically I'm trying to add the RepairWithEpoxy flag to the Metal Baseball Bat with Sawblade. How does one create a mod for this?
You're looking for script fixing blocks: https://pzwiki.net/wiki/Fixing_(scripts)
figured it out
If there's one thing I hope AI figures out, it's how to be more of an "automatic photoshop". Reskinning stuff this way gets old. Unless anyone else knows of a better way than manually...?
What do you want to do exactly ?
I think that's a little too basic imo, but you do you of course hahaa.
What are you talkin about?
I'm just saying it would be nice if I could just tell an AI "hey, turn this red" and it will do so with minimal input. I just don't like photoshopping hahaa.
I can't find references to how to know if a square has power and how to "register" usage of power. Does anyone know?
That’s just a waste of time
Takes longer to ask something to turn something red then it takes to use a fill tool
also, can I suscribe to an event conditionally like
if SandboxVars.FunctionalCarLift.ConvertVanilla or SandboxVars.FunctionalCarlift.RevertVanilla then Events.LoadGridsquare.Add(functionalCarLift_OnLoadGridSquare) end
You could create separate gray scale layer for the stuff you intend to color differently and then just apply multiplier layer to that that does the coloring
How do you use a fill tool for complicated textures? In my experience it just messes the whole thing up. You need a finer attention to detail with a digital brush.
Turn the tolerance to zero
I'll "outline" an area so the fill tool doesn't mess it up, but that's about it.
Yeah that went poorly lolll.
Hmmm. Maybe if I did that from the start, but unfortunately the originals weren't my own.
Can't you like select by color then colorize it?
Though im not sure what software it is. I use gimp, but im also lazy so i usually screnshot my models and make it an icon
Just copy the layer, remove everything else from it and turn it gray scale. The coloring is non-destructive, so you only have to do it once
Show me your settings
It's alrighty, I'll just keep doing it the way I was doing it. Grayscale turned out kinda... meh... and it's really not a huge deal, I was more or less expressing that it would be really cool if AI could handle something tedious like this in the future (it can't, I've tried, it doesn't understand the image is a UV map or icon or anything like that. It'll mess it up one way or another and isn't worth the hassle).
But, why ask an ai do do something that take like thirty seconds?
It just doesn’t make any sense
If if you can’t do it in photoshop, only takes a few seconds to load up another program where you can do it
I'm just gonna drop it because we're not talking on the same wavelength here.
I mean you asked if anyone had a better way than manually and I asked what you want to do because I didn't understand what you wanted to do
Because there really is no other solution. That's why I brought up how nice it would be to have something like that. I can't really "simply" do any of it; so I ask again, won't that be nice when AI gets to the point where it can 'photoshop' anything automatically? I could just say "hey, turn this cart red" and it would change everything to the color shade equivalent on its own (and probably be able to ignore the boxes).
for me, short answer is "it would be nice". the long answer questions the impact on human stupidity in the near and not so near future...
Oh yeah, for sure.
on a question of my own, I'm having issues creating an object with a specific sprite.
The reference of IsoObject constructor goes something like this IsoObject(IsoGridSquare square, String tile), but I'm not getting the result I'm looking for when executing this:
if spriteName == "location_business_machinery_01_11" then
-- column W
print("[FunctionalCarLift] Replacing car lift tile "..spriteName.." with car_lift_01_0 at X="..square:getX()..", Y="..square:getY())
square:RemoveTileObject(obj)
square:AddTileObject(IsoObject.new(square, "car_lift_01_0"))
end
basically, I'm not getting the sprite rendered on the map. Instead, when debugging the map I see an "empty" object with no name and no sprite
and this is what I'm looking for
nvm, found the isoObject:setSpriteFromName() and skipped removing the undesired object and reusing it:
if spriteName == "location_business_machinery_01_11" then
-- column W
print("[FunctionalCarLift] Replacing car lift tile "..spriteName.." with car_lift_01_0 at X="..square:getX()..", Y="..square:getY())
obj:setSpriteFromName("car_lift_01_0")
end
I don't know why it didn't work before... I just grep'd the vanilla lua folder and found tons of identical references 😦
./client/DebugUIs/Scenarios/Trailer2Scenario.lua: sq:AddTileObject(IsoObject.new(sq, "overlay_blood_wall_01_3"));
is there a way to determine if the contextmenu is open?
this is not synced for mp , just saying (tho you might be doing this for b42 so should be safe i guess)
thanks! I will then add
if isServer() then obj:transmitUpdatedSpriteToClients(); end
if I end up running AddTileObject(), will that be synced for MP?
Because Zomnoid loves concolted ways to do things, it works like this.
- Is global power on?
getWorld():isHydroPowerOn()will tell you. - is the square indoors?
not(square:isOutside())will tell you - Is the square powered by a generator ? square:haveElectricity()
Most vanilla stuff only considers outside tiles to have power when the electicity is on if they are inside.
As for registering with a generator... pretty sure you're out of luck if it does not already work, it happens in IsoGenerator.Update() and is hardcoded on object type.
oh, so I won't be able to register a power consumption from the Car Lift. The tiles are simple IsoObjects. I will still be able to check for power availability at least
you got me confused with the inside/outside thing. Should it matter? I mean:
if getWorld():isHydroPowerOn() or square:haveElectricity() then doSomethingOrNot() end
if youre doing this server side then yeah thats what you need, theres another one for client side
I don't exactly know where this is running. I read somewhere that it depends from where it's called, not on the folder is placed on. It's executed on this subscribed event Events.LoadGridsquare.Add(functionalCarLift_OnLoadGridSquare)
At this moment I'm trying on SP and I'm still having issues with tiles, but I think isServer() and isClient() both return false on SP. I guess I don't need to sync on SP
yep
updated version of all the "all of it" reference template since it got changed in b 41
better color choice
does anyone know if tilezed has been updated for b42? I am thinking of maybe trying to make a custom map but I dont wanna go through the whole thing if it turns out it doesnt work anymore or whatever
I'm not sure, but in the mapping channel there a lot of messages talking about B42 maps
didnt know that was a channel, ty
they helped me a lot when dealing with TileZed and its convoluted tile properties
There's events that trigger when you open a context menu. You can check the place where you add the context menu UI to be activated
Hello chat,I need someone who knows how to use the debug mod, and who can tell me how to change the configuration of my game, I want to change from rainy to normal.
i dont need it anymore but thnx . might do this in the future
Yo chat,The "better fps" mod It doesn't work anymore for this update, and I really need it, can someone make a patch?
It's the one you insert into game's folder?
Have you done it AFTER it updated?
Ye
I've always used it, and suddenly, after this update, it doesn't work. I deleted and uninstalled pz and the mod, and installed it Manual, and nothing. Many people have the same problem as me.
It will break every patch
You're going to fix it ?
Please make it work.
???
The better fps mod..
You think modders here are your slaves or what ? You think every modders will fix every mods out there ?
Can i make it work? Bc in new update not working
I don't want it to be an discussion or am I obligated to, I'm asking you, if you can't, thank you and have a nice day.
Like any other mod, just wait
It's incredible how someone can take something like that so badly.
"You're going to fix it ?"
You're coming here thinking modders will do it for you ?
I'm using translator, and I think the way I wrote it wasn't aggressive, but okay
Have a bit of respect for modders ?
Just wait for the modder to update
Accept the fact java mods need to be updated every game patch
Your save will work fine without the mod anyway
👀I guess you're having a bad day for being so aggressive.
No you're just not respectful and asking modders to do things for you
Bye. If anyone could make a patch I would appreciate it.
Do it yourself
Ok, your way is already bothering me.
Ignoring is the best option
Lol what
I'm only here for 20 hours now, but I think everyone would appreciate it to have this channel for development instead of personal conversation.
(In my opinion blaze was just very direct but not aggressive or disrespectful. Just not very polite. )
But anyway, would love to have this thread here to scroll through some useful information 🙂
useful in what way?
try the mod resource and mod tool threads
Useful in that way, that here we can talk about mod development, issues, fixes & solutions 🙂
well thats the point of this main channel
what you just witness rarely happens here
thats for the #mod_support
non modders who needs help from modder i guess
you should look at distributions
im replying from you post on mod support
you can also just spawn the item using debug console
yeah, found it out myself already.
Finished my first mod tonight
Thank you !
Very surprised of this big Zomboid-Modding-Community!
yeah the modding community hjere is huge, mostly because of how intergrated modding is in game
Also check the modding wiki
Hi guys, new aspiring mod creator here (mainly focused on QoL enhancements and not actual gameplay), I started yesterday and was realizing some things but wanted to confirm. I have questions around I/O.
Is it actually true that getFileReader is protected only to have access to the Zomboid/Lua folder? but not Zomboid root? I noticed this behavior when trying to access files console logs at the root directory (Zomboid/coop-console.txt and Zomboid/console.txt).
The filepath resolves, but throws an IOException if I try to read nil. I'm trying to figure out if this is because I indeed cannot access these files or if it's because LoggerManager.class is recreating these files and so at time of read it's technically not available to find yet (though, I have tried Events.OnTick.Add and delay() but looks like the engine doesn't like that, which makes sense).
I ended up finding this: https://theindiestone.com/forums/index.php?/topic/6111-lua-file-io/
I'm trying something like this: local filePath = Core.getMyDocumentFolder() .. getFileSeparator() .. "coop-console.txt"
local reader = getFileReader(filePath, false)
I would like to handle with files out of a lua script, but i don't get it working. I read different code at certain websites, but nothing does work at all.It is not possible for me to create any directory or open any files. Does anybody have some example-code for me?
I am able to read in Zomboid/Lua, so my thinking is that we indeed are protected against Zomboidroot. If so then how can I actually read console.txt and coop-console.txt. I was thinking maybe creating a new LoggerManager instance and logging to Lua, but I'm worried about reducing performance for players by duplicating files just to Read.
My brain thought that functional stovetops would be easy af to mod in. turns out I should spend some time learning lua first. I was thinking oh i'll just hook into the ovens code and just run it on the outside, nope. time to simulate every facet of the oven. T.T;
Haha yeah welcome to PZ modding! If you think something is gonna be easy, it's probably not
tbh, that seems to be PZ in a nutshell. if it looks easy, it's not.
I'm yet to reach your conclusions, but I've been using TileZed for the Car Lift mod and the tile properties are what makes the ovens ovens. I thought I had to make a ton of Lua code to make the Car Lift moveables, but it was just playing with tile properties
can anyone explain to me why there is a discrepancy between ingame info and source code here?
ok on second glance, every plant is 1 number staggered in terms of months to their real life month
looks like january would be 0, right?
Feels weird that sowMonth and bestMonth would be 0-indexed but not badMonth (since it has 12)
12 is january, 1 is feb, 2 is march, 3 is april
so I got it wrong
1 is feb not dec
Jesus christ, that is a mindfuck
should I back up my saves if I want to switch to B42 for porting and testing my mod?
or I can just leave them be if I'm not using them?
Best is to make a new cachedir, that way your settings won't reset every time you switch.
I'd suggest following this https://www.reddit.com/r/projectzomboid/comments/1hite37/guide_have_both_b41_and_b42_installed/
thanks, I was looking for this kind of guides
Tht's cursed lol
the best issues
yes, what you are trying to do is not possible
Ack. Looks like there's getLogsDir() for what seems to be Zomboid/Logs... struggling to figure out how to use it though, can't find any discord history... relevant docs.. nada.
Anyone know of a way to intercept what LoggerManager is streaming at least? D:
anyone have any idea why this is happening?
you can't really, there's no way to read files from outside of Zomboid/
that function doesn't exist for lua usage
Would someone kindly tell me how to give 2 items from a single recipe result?
I am looking for an example in the game's recipes but can't find any.
someone asked the same question a few days ago, and the answer he was given was to hook to the recipe done event and add the second item manually
which build? build 41?
b41, apologies.
yeah, you need an oncreate function to add the extra item(s)
Thanks both of you <3.
Going to search here, didn't occurr to me because tired as hell.
I'm going to have to look into tilezed thank you
hello guys, can i ask a question about zombies spawn control ? (WorldEd:ZombiesType/ZombiesZoneDefinition.lua)
so how does one make a mod to make something normally uncraftable craftable
in this case my intent is to make pasta with Flour and eggs.
Yes feel free to ask, if anyone here knows they will answer. It's best to just ask, instead of asking to ask 😄
You would just need to make a new recipe, look at some vanilla examples in ...\Steam\steamapps\common\ProjectZomboid\media\scripts\recipes and you will see how they are made.
You can read more about it on the wiki:
https://pzwiki.net/wiki/Recipe_(scripts)
https://pzwiki.net/wiki/Evolvedrecipe_(scripts)
i try to define specific zones in my map, ZombiesType zones in WorldEd refer to white pixels in map_ZombiesSpawnMap.bmp
ZombiesType names refers to ZombiesZoneDefinition specitfication, where i try to force zombies only with my defined outfit.
i can spawn zombies with outfit, but i always see other random zombies. And i don't understand why.
ZombiesType zone cover white zone in BMP file.
i use mandatory=true with ToSpawn=15 for example, or chance=100 but random zombies stil spawn with mine
is there a vanilla force chance random zombies ?
ZombiesZoneDefinition.ZoneGardes2 = {
chanceToSpawn=100,
ZekeGardes2 = {
toSpawn=15,
gender="male",
mandatory="true",
name="ZekeGardes",
},
};
Simply make a new recipe, like Alex said
For B42 use https://pzwiki.net/wiki/CraftRecipe_(scripts) instead
NGL i jsut copied the "make bread dough" recipe to a new file in notepad plus and made some adjustments to it
That works too
{
timedAction = MixingBowl,
Time = 50,
NeedToBeLearn = True,
category = Cooking,
Tags = AnySurfaceCraft;Cooking,
xpAward = Cooking:10,
AutoLearnAny = Cooking:7,
inputs
{
item 1 tags[MixingUtensil] mode:keep flags[MayDegradeLight],
item 1 [Base.Bowl;Base.ClayBowl] mode:keep,
item 1 [Base.RollingPin] mode:keep flags[MayDegrade],
item 6 tags[Flour],
item 2 tags[Egg] flags[IsUncookedFoodItem;InheritFoodAge;ItemCount],
item 1 tags[DullKnife;SharpKnife;MeatCleaver] mode:keep flags[MayDegradeLight],
item 1 [*],
-fluid 1.0 [Water],
}
outputs
{
item 1 Base.Pasta,
}
}```
If you ever want to modify some bits, don't hesitate to read the wiki page I sent
It has all the info for B42 crafts
Here the recipe looks good, you're not overwriting anything
hmmm, might also have this be learnable from the "Italian Delights" magazine and/or from traits
You'll have to check recipes that do that then, I'm not sure how to make a recipe learnable from magazines
seems simple enough, though how to make it compatible with anything else that modifies those is probably a bit much for now
i think i'll just have "need to be learn = False" for now
or maybe "autolearnany = Cooking: 1"
or both
I don't see any incompatibly issue that could arise from your current script for the craft
my concern was also having it change the script for the magazine and traits
Like I said, no idea how these work but I doubt it'll cause much incompatibility if you do it right
And I'd be surprised if it required a huge amount of work to do right
this is mainly for me right now, i will upload it to the workshop once i am sure it wokrs right and if people ask for it then i'll make it more "progressiony"
hmmm, where do i put the file in my game to test it?
i have it heer but it's not showing up in the modlist?
make sure your file structure is correct, should go
mod name -> media -> whatever folders are relevent
also make sure you have a mod.info and preview photo in the same folder as media
I’ve got no clue then, sorry!!

what i have in the Mod.info file
name=make pasta
id=make_pasta
icon=icon.png
poster=preview.png
description=make pasta using Flour and Eggs
modversion=42.7```
put it in %UserProfile%/Zomboid/mods/
did catch i forgor to rename the photos in the second pictures file
the one in the ProjectZomboid folder is fake and exists for no reason 🤷♀️
oh add a common folder in mods/Make Pasta/
it refuses to load the mod if there isnt a folder in it called common, it can just be empty though

i was able to make 10 pastas from 1 item worth of flour babyyyy
which is slightly more than what you'd get out of the same flour using a make bread recipe
specifically 9% or 2,744 more calories
though accounting for the eggs it'd be 4.8% or 1,484 calories
what am i missing here?
okay don't know what i did but i fixed it
It'll stay bugged
Add & at the end
It'll update way later once Discord resets cache
That happens bcs you sent it the first time the moment your mod was hidden due to changes to description, new upload etc
oops
anyway
enjoy for all my yeast and salt haters
(assuming i didn't brokes it)
just want to check - there are no issues with adding a required mod to an existing mod?
What is the best testing flow people are using? Is it quite literally editing in VSCode and opening up the game to test every single time? Closing the game (or relaunching Lua depending on what's changing), making the code change, saving, and then reopening?
I think that's typical, yeah. If by closing the game you mean returning to the main menu—for stuff that can't be easily tested by reloading the file that should be sufficient
Unit tests are possible but require a lot of mocking for stuff using global game functions
Yeah, I was trying to figure out how unit tests would be done for games (new to game modding), ty!
I use busted to write unit tests for my library mod, but idk if I'd do it for a regular mod. Doesn't seem worth the time sink imo, but it certainly has been useful for catching stuff
In my case, I was making main menu and OptionSheets code changes, so it really meant either refreshing Lua at main menu or if the menu got hung up then close/reopening. :/
Ah, gotcha—that's unfortunate
https://outplayed.tv/project-zomboid/EEJ40x
does anyone here know how the suspesion stuff works? i have tried to fix this but everytime i change something it gets worse
Outplayed - The ultimate capture app for gamers. While playing, it automatically captures your best moments and biggest plays. When the match is over, relive your best (and not so best) moments by watching them in the match timeline.
(persists after fixing center of mass)
Hello, I'm not sure if I'm in the right place but I have an idea for a mod but I have no experience developing mods so I am certain that I am not capable of making it yet. I am hoping someone can point me in the right direction to starting learn to do somethin like this. I want to start small so, I want to add a single throw that will takedown Zomboids, to the game initially. I have a complete vision for what I'd like the mod to look like eventually but I want to start here. Are there any resources online that I can learn from to be able to do something like this?
I reload Lua usually directly in game
But yea that's basically it
Hello! A mod like that would require working with animations, and currently there are no updated and fleshed out animation guides really.
You can check out https://pzwiki.net/wiki/Animation_guide but with no modding/animation experience it will be hard to put everything together.
I'm planning on writing a tutorial for it though, hopefully should have some time this week to do it.
Has anyone played around with attaching stuff to backpacks?
I found that the bedrolls are attached by just putting
AttachmentType = Bedroll in the item script, and this can be used for any item it seems.
But what if I want the item to be attachable to both backpacks and back? So like having AttachmentType = Bedroll;Shovel
I'm thinking I could add another attachment type as modData and then hook into the context option to add my custom option.
But if there's an easier solution that would be nice
You mean attachment slots that appear in your hotbar ?
Yeah, and have it visible on the backpack. If I change my weapon item script to have AttachmentType = Bedroll then it works exactly as I want. I can attach it to a backpack and when activating the hotbar slot it's equipped into my hands.
But when i don't have a backpack I want to still be able to attach it to my back
I see what you mean
No idea how that'd be doable. You can probably fuck around with hotbar stuff bjt I'm not familiar enough with it
Ah okay, yeah it seems the attach submenu is created in ISHotbar.doMenuFromInventory so I'll try messing around with it when I get home
So confused. I uploaded a new version of a mod last night and checked 2 hours later before going to bed to make sure I didn't break anything and I have these comments. I've done everything I can to figure out what the issue might be. I uploaded a test mod so I can go through the upgrade path they did, which includes a new mod requirement. Everything works fine for me.
The snippet of error log shows it couldn't find a variable, which it gets from either from player mod data or, if it can't find that, it will set a default value. But none of that should cause a black screen. The B41 version didn't change a bit, only the B42 code so the mod.info's are different . The 42 version has a new mod requirement. 42 also has mod options now. Those are the only big differences.
If anyone has any ideas on what I should look for, I would be forever grateful.
https://steamcommunity.com/sharedfiles/filedetails/?id=3468612770
Kind of hard to find much just from that
I know. It's works fine for me so I'm hoping someone can drop an error log. I was kind of hoping y'all be like, "you're mod info is jacked bro" or something else stupid I overlooked
Hello all I am curious if anyone has a good guide on making traits. I found this one: https://steamcommunity.com/sharedfiles/filedetails/?id=3022905387 which is great for the covering how to make the framework of them, but it does not cover how to actually have the trait do anything to the player as far as I can tell. Does anyone have that part? Or know where and how to actually modify the player stats using a trait? Thanks! 🙂
My approach I plan on using is to find out how to check for the trait from the API and then apply things using a function on character creation etc. I think this will work well but haven't dug into these systems yet. If there is a better way, let me know! 🙂
I haven't dug very deep into it either, but I think you're on the right path. From what I gathered when I last checked the traits are basically just params that are checked before performing certain actions, as modifiers for certain stats and settings, etc.
So for example when creating the context menu option for reading, it checks if the player has the illiterate trait and disables the reading option if they do.
Or it can be used to modify the player stats. So if you know how to check if your player has your custom trait, and you know how to write the code for modifying the stat you want, then that's all you need
Awesome thank you! I was thinking this may be the way but was uncertain if there was a built in system. I appreciate the feedback!
desensitized is specified as "far less prone to panic", can anyone clarify how exactly it works?
or at least if it's different in b42
No problem! Good luck with your mod 😄 Just come back here and ask if you have any questions while making it
nevermind, wiki has a page for the unstable, and it's basically identical
Is there a way to get the untranslated item name, or to force it to return the English name?
you can get the internal name with item:getFullType()
But the same fulltype can have different names representing different items, so I need to retrieve and record that name. But after reloading the game, it can no longer recognize names in languages other than English.
Just like Base.PopBottle, it represents several different items — cola, orange soda, etc.
they're the same item, they just have different fluids in them
I know they’re technically the same item, but I want a more accurate way to identify them.Other than using the item name, I can't think of any other way to distinguish each item like the inventory pane does.
I'm going to preface this by saying that everything works when I run this mod. The only actual logged error that is reported is:
function: HighlightMouseSquare -- file: JB_ASSUtils.lua line # 223 and function: onTickEvent -- file: JB_ASSUtils.lua line # 135
which has to do with color, which to me doesn't make any sense because there are defaults set in case it fails:
-- fires on right-click menu
local highlightColorData = modOptions:getOption("Select_Color"):getValue()
JB_ASSUtils.highlightColorData = { red = highlightColorData.r, green = highlightColorData.g, blue = highlightColorData.b }
playerObj:getModData().highlightColorData = { red = highlightColorData.r, green = highlightColorData.g, blue = highlightColorData.b }```
```lua
-- in mod options file
local colors = { 0.2, 0.5, 0.7, 1 }
config.colorPicker = options:addColorPicker("Select_Color", getText("UI_options_JBLogging_Select_Color"), colors)```
```lua
-- how the selection utility retrieves a color
function JB_ASSUtils.GetPickedColor(playerObj)
local highlightColorData
if playerObj:getModData().highlightColorData then
highlightColorData = playerObj:getModData().highlightColorData
else
highlightColorData = { red = 0.2, green = 0.5, blue = 0.7 }
playerObj:getModData().highlightColorData = highlightColorData
end
return highlightColorData
end```
Is there something obvious I'm doing wrong here that could cause a black screen and/or the getPickedColor not to be able to get the highlightColorData?
and sorry for the wall of text.
You refer to the various 3 colors as red, green, blue in that last code snippet but in the one right above you use r, g, b
ooooh
Normalize that anywhere you use key colors to r, g, b as it's kind of the norm, is easier to manage overall I'd say, takes less space etc
The game uses r, g, b, and everyone uses rgb
That's probably the problem here I guess
you should define it as a type
---@class (exact) JB_ASSUtils.Colour : {r: number, b: number, g: number}
---@type JB_ASSUtils.Colour
local colour = {red = 0.5, green = 0.5, blue = 0.5}
-- shows warning because red, green, blue are not valid keys in JB_ASSUtils.Colour
Do you guys know if theres any event called while the ingame "helicopter event" starts?
Maybe even with the location of the helicopter?
I've found out that the helicopter is an invisible physical object.
Want to play around with it, but can't find a lua-event.
I'm not aware of any
Have you checked the event list on the wiki ?
@sour island might know more as he's the creator of Expanded helicopter events
I believe I remember a function that allows you to check if the event is started
Urgh, sorry for the less technical question: I got dragged in an argument on a server im playing about patch mods. There is an argument that you need the consent from the original mod author to override or remove stuff. Like for example: remove an item from the distribution table, or overriding a fix so that you cant repair an item with jsut a torch but need metal, little stuff like that.
Whats the stance on that from indi and the modders in general? I personal always thought thats ok, but i might be wrong so i wanted to ask.
That would be all I need. Actually
all you can really do is check if it's started, and either start or stop one
But I think theres somewhere the helicopterfile with the code in it to spawn the helicopter.
I think I just reedit the file.
the helicopter event isn't lua
You can make addons to a mod. The important part is not reuploading a mod without consent of the modder
if it's done without reuploading the original mod/specific files from it there isn't a copyright concern
but ignoring legality, most modders won't mind if you do something like that
You can make an addon that overwrites one of the mod files and have the original mod be required
So modifying distribution can be done without any issues, just don't reupload the original mod and make it an addon to the original mod instead
- what albion said
To answer the "stance on that from TIS" bit: if you're ever in doubt about that, check out the modding policy. What you described is not prohibited by that
So as long as i use the original mod and then write a mod addon thats ok? Thanks, that clears it up for me. Was worried i was wrong about that. And no, except from learning from other mods, i dislike stealing their stuff. Better to use the original mod and then just change the things that are are problem with a second mod. 🙂
Aprechiate the help and fast answer guys. Thx. 🙂
Exactly, make a second mod which requires the original mod and change things there
Speaking of patching existing mods, what's the best way to remove duplicate recipes?
It looks like they can share names, so how exactly do Obsolete:true and Override:true work?
if they do share names, they don't work
obsolete/override target only the first recipe defined with that name
that's one of many reasons the ability to have more than one recipe with the same name was removed in build 42
Is that just in b42?
so I downloaded the broken mod zip from my steam change notes and it's missing the common folder.... .. .
they can't share names in b42 at all
and now my main menu is gone. Never been more thankful for an error screen
anyway, as usual you guys are correct. it is indeed the janky way I was setting colors
Little question:
Is there only pzwiki and demiurgequantified.github.io for documentation?
For example I'm searching for the perks a player currently has.
If I take a look on IsoPlayer it does inherited several methods like "getPerkList" from IsoGameCharacter
But the Doc says kinda less.
Is the PerkList what I need to get the active perks?
public ArrayList<IsoGameCharacter.PerkInfo> getPerkList()
When I dive deeper into "PerkInfo" I see something like:
int level
PerkFactory.Perk perk
Diving deeper into "PerkFactory.Perk" turns out theres a String getName()
Feels like the doc is a whole labyrinth.
getPerkList() gives a list of IsoGameCharacter.PerkInfo
But this class only has a method called getLevel()
even if it has the fields
int level
PerkFactory.Perk perk
So I'm struggeling on how to find which active perks the player has including their level.
Is there a way to reload the mod while the game is running?
Than I can debug and try&error myself through it.
Would really really appreciate helping me with the knot in my brain.
About the very last question, check out the community debug tools which has an easy to use tool to reloading the game. However note that some quirks can appear in some type of usage. This is something which is in the base game too but kind of unpractical
For your first question, give me a sec to check again on how to do that as I always forget it
player:getPerkLevel(Perks.Fitness)
This is how I retrieve the fitness perk level for example
if you want all perks you'd just iterate over the perks table and call that each time
Yaa. simply said 😄
since visualX studio is not displaying all the possibilites it takes quite a lot of time to find all the classes I can call from the IsoPlayer class.
I'll try to document that on the wiki
if you're using a lua plugin with support for luacats typings you can use umbrella for intellisense
So what is Perks exactly ?
It's not a Java object right ?
Wait no it is
Added a wiki entry
https://pzwiki.net/wiki/IsoPlayer#Retrieve_player_stats
Thanks for the reply and info. I'm looking forward to your tutorial.
I know this, but what I was struggeling with was to find the list of perks a player has.
I that it would be as simple as something like player:getPerkList()
This is my solution so far:
function get_perks(player)
-- get all perks available in the game
local list_perks = PerkFactory.PerkList
local player_perks = {}
-- get perk from list
-- get level of perk from player
-- put perkname and level as keyvalue into a table
-- return table with all perks and levels
for i = 0, list_perks:size() - 1 do
local perk = list_perks:get(i)
local perk_type = perk:getType()
local string_perk_type = tostring(perk_type)
local player_perk_level = player:getPerkLevel(perk_type)
-- debug
print(tostring(perk).. ": " .. player_perk_level)
player_perks[string_perk_type] = player_perk_level
end
return player_perks
end
Asking because of “lists of perks a player has”: are you thinking of “traits”?
“Perks” is used for skills, which all players have, at some numeric level (even if they don't have experience in it, they have the perk)
This code above lists all skills (in lua called perks) ingame.
That was was I was looking for.
Its just veerrry struggeling to crawl my way through not simple to understand code.
Especially this one makes no sense in my brain:
Imagine I want to add a players skill (perk) level.
local perks = get_perks(player)
player:getXp():setXPToLevel(Perks.Aiming, perks["Aiming"] + 1)
player:getxp() in my brain returns the XP
player:setxp() would set it
I wonder what the programmer made here.
I also would understand
player:xp:set
player:xp:get
The part whats freakin' me out is that there are different methods used for the same result.
logically "getPerkLevel(perk)" adds in my brain the function "setPerkLevel(perk, level)"
but why player:getXP():setXP..?
This is insane 😄
Xp is the object that houses all the xp's and methods related to it
One of which is setXPToLevel
Yeah... I see.
I just found out that the docs aren't really helpful.
Instead I've put the whole zomboid folder into my workspace and search there.
Thats >the< solution so far!
Thanks Chuckle!
The doc is useful, but it doesn't hold all the answers
The same way looking through the game code doesn't hold all the answers either
You're supposed to use all of them together to have a good picture of the game code
The java doc gives you all the possible methods. The game code shows you how most of it can be utilized, but it doesn't give you all the possible uses either
And the decompiled java shows you what the java methods actually do.
Since it's not wlways obvious from just the name.
You only need the game's media folder, and you can set the search to only look at *.txt, *.lua files. optional: exclude *Translate* so you don't lots of hits from the translation files.
Hi!
I'm working on a mod for Project Zomboid that is supposed to make certain melee weapons not lose durability when attacking zombies, but still lose durability when hitting objects like doors or windows.
However, the mod doesn't seem to work as expected, and it's even throwing an error during runtime.
I'm not sure where the problem is, so I'd really appreciate any help or suggestions!
Thanks in advance!
function: Add -- file: NoZombieWear.lua line # 22 | MOD: ZombieSafeWeapons
java.lang.RuntimeException: Object tried to call nil in Add
First question: what is NoZombieWear.lua line 22 doing?
"tried to call nil in Add" means you probably have an issue with something being nil instead of a valid object, so look at line 22 and think "what could be nil here that should have a value?"
Unfortunately the copy-paste you did makes it a bit of guesswork as to the line numbers.
a lot of the code was written with help from a friend, so I'm still learning how all of this works myself.
😦
i feel dumb as hell yall i've combed thru this lua as much as i can I can't find where the stoves 'burn' the food I have no idea what file even has the stove functions T.T
it's not going to be lua
I kinda assumed there'd be a burned flag but does it just rename it and adjust it?
it just sets a flag on the item yeah
That's fine, we all had to start from not knowing how to code.
I highly recommend getting ZomboidDecompiler and decompiling the java to use as a reference. https://pzwiki.net/wiki/Decompiling_game_code
There's a lot of stuff in there that you'd think whould have been lua (like a washing machine choosing what to clean)
Can you post the .lua file on it's own, or if the whole thing is in your previous paste indicate which line is line 22? There's a good chance someone can give more specific help.
here
The core function of this mod is to prevent certain melee weapons from losing Condition and HeadCondition when attacking zombies, animals, and windows.
Since that function is expecting an object and a string that it can match up to a Java class from a list
got it
Without the quotes the second argument is the variable HandWeapon. which is probably not defined and is therefore nil
I think this needs quotes too:
local trackedWeapons = {
[Base.BaseballBat] = true,
[Base.HandAxe] = true,
}
so it would be
local trackedWeapons = {
["Base.BaseballBat"] = true,
["Base.HandAxe"] = true,
}
since you want the string "Base.BaseballBat" to be the key.
(or I may be wrong because there are a dozen slightly different syntaxes for tables in lua!)
OK
Is playergetLastHitZombie()defined somewhere else in the mod?
it looks like the ai you used stripped out a lot of important characters
so the syntax is all messed up
How should I solve it
Short version: learn some basic LUA.
I asusme you're using AI to generate the code?
It's very difficult to help because we suggest a specific fix, and suddenly the code is completely restructured and works in a different way.
From some perspectives, ChatGPT is indeed one of the few friends I have.
i don't approve of intentionally concealing your usage of ai either - you posted earlier that you had used ai, and then deleted the message and posted a new one saying 'my friend'
That's fine, it just makes a big difference to how we can help.
it's true that some people won't want to help with ai code, but it's also important context for people who still want to help
my fault
If I understand Vibe Coding correctly, the way to do it is just keep telling the AI what error is generated and asking it to fix the code until it eventually works.
Yea which takes ages to do for PZ lol
...which sounds like a terrible workflow to me, but ¯_(ツ)_/¯
Yea it is
It's getting advertised as a job description now.
I think it sytarted as a joke, and managers/HR have taken it seriously 😦
💀
it'll die off quickly when managers realise they're paying people to do literally nothing
TIS should hire a vibe coder to rework zomboid's code to use blockchain.
oh god I feel so dirty saying that
even as a joke
ai bros say stuff like this and think it means anything
Anyway basically what Albion said. AI currently can't mod PZ and I've yet to see a functional mod made fully from an AI
Codes made by AI can be noticed fairly easily most of the time. A single completely imaginary function and that's pratically an instant sign of AI usage
The important part is learning that, that AI currently in any shape or form just can't make your work if you don't know your work already. And it won't be amazing at teaching you from 0 either, you need to get started with learning how to mod PZ before starting to use AI and AI shouldn't be used to write PZ code
I'm going to cross that out now and pretend it never happened
Jesus that's terrifying
I had my first successful use of AI to code yesterday! Hacking together a quick cheat engine table I can never remember WTF is going on with floating point operations so I asked it how to do movss [rbx+rax*8],xmm6 only if the value in register xmm6 was bigger than [rbx+rax*8]
...then I had to doublecheck it all anyway because you can't just write to a random register and hope it's not soing something important, you really need to check that sort of thing...
...and then I found that I could have just swapped the two things because the floating point compare comiss xmm6, [rbx+rax*8] is perfectly valid but you can't have a memory address as the first argument. So... half points to ChatGPT I guess.
Why my mod dont show up in the mod list? I uploaded it to the workshop? B42.7
I think I might be going mad.None of these recipes are showing up. I copied and pasted the third one directly from another mod that was working but is not active.
{
Water;10,
Salt;5,
PopBottleEmpty/WaterBottleEmpty,
Result:Disinfectant,
Time:100.0,
Category:Survivalist,
}
recipe Make Disinfectant
{
Water=10,
Salt=10,
PopBottleEmpty/WaterBottleEmpty,
Result:Disinfectant,
Time:50.0,
Category:Survivalist,
CanBeDoneFromFloor: True,
}
recipe Make DisinfectantEC
{
Water;5,
Salt;5,
PopBottleEmpty/WaterBottleEmpty,
Result:Disinfectant,
Time:100.0,
Category:Survivalist,
NeedToBeLearn:true,
CanBeDoneFromFloor: True,
}
This is a mod you made?
Yes
Don't subscribe to your own mod, that ends up with two copies (one downloaded by Steam, one in your Workshop folder)
And was it showing up before the steam upload?
When I put the mod into the mods folder of Zomboid inside steam it does not show up.
Have you put it in C:/User/Zomboid/mods?
Check console.log for any errors around recipes, or any exceptions.
Check debug mode's recipe list too in case the recipe is in game but your character isn't showing it for some reason
Get it working first, then upload to steam workshop
Where is your mod located?
Do you have both a 42 and a common folder in it
C:\Users\Freeman\Zomboid\mods\MakeshiftGuitarAmp
Its a buildable noise maker mod what i am trying to do
yes
mod.info description:
name=Craftable Guitar Amp
id=MakeshiftGuitarAmp
description=A handmade guitar amplifier that attracts zombies with noise.
poster=poster.png
Doesn't matter what the mod does, showing up in the mod list is just a matter of correct folder structure and a valid mod.info
What directory is that mod.info in?
I have the example mod at the same older, and that did not sow up too
(also, good mod idea)
I dont know why, back then B41-i do see example mod in the mod list...
Are you on B41 or B42?
B42.7 right now
Is there a 42 folder in C:\Users\Freeman\Zomboid\mods\MakeshiftGuitarAmp
Is there a common folder in C:\Users\Freeman\Zomboid\mods\MakeshiftGuitarAmp
And where is mod.info?
mod.info is in the C:\Users\Freeman\Zomboid\mods\MakeshiftGuitarAmp
42-folder is needed?
Thanks for helping me
Short version: make a folder called 42 and put everything in there
Make a folder called common, it can be empty but has to exist
Its working now 🙂, (at least shows up in the modlist)
Now i have to test what chatgpt did with the code:D
Add a 3d prop
i already have some planed
This mod.info file have to be in multiple folder?
Only if you want the mod to work on B41 as well
Due to bugs a few things only work on the 42 folder, not common, so most modders are putting everything in there
There's not really much value to the new structure right now unless you're crazy enough to want to support multiple versions of B42 instead of just the latest one, but it will help when B43 comes out.
B43 will come that soon? 🙂
No, this is for when your grandchildren make mods.
"A society grows great when old men improve functionality in whose features they shall never code" - Ancient Greek proverb,
Don’t think any ancient Greeks said that
Aristotle wrote recursive functions while still wiping his ass with clay plates
It's a well known fact that the counting system used by the Roman Empire had no way to represent zero, which left them unable to determine when their programs had finished executing successfully.
it was called the halting problem
Lucky AI has solved that for us.
Yep, defnitely 100% solved.
AI makes everything so easy.
Rebuttal:
Sorry everyone I've forgotten how to code properly and will have to resort to old fashioned methods like "have a vague plan and some basic knowledge of how coding works, then bash the keyboard until it works."
(I sure as heck am not paying money to code with ChatGPT!)
Hi guys, could someone please tell me how to animate shotgun model to be functional in game? I know how to render and do other important stuff but i cannot manage how to animate that shotgun. If I need to use parent and use armatures to make it work. Iam kinda new to this stuff and saviour would be welcome, it would be sufficient to send me link to some acient forum that i haven't found. Thanks
Hello there! How are you implementing the shotgun? Are you basically just duplicating the current shotgun weapon script and putting in your own model? Or do you have have custom animations for holding/shooting it as well?
If you want it to use just the base animations that already exists for the vanilla shotgun then you don't really have to do anything at all in terms of animating the shotgun, you just have to make sure it's exported properly and set up with a weapon script that mimics the vanilla shotgun.
If you want to actually use custom animations for reloading/holding/equipping/shooting the shotgun then you just animate the right hand prop since that's the default bone that weapons attach to.
I can give more info on custom animations if that's what you're looking to do.
Is this a new shotgun model you're adding? And do you mean "animate" as in the actions the character does, or do you want to actually animate bits of the shotgun so they move about?
Yeah also important distinction, because currently it's not known how to animate the individual parts of a weapon while it's held and used.
Good timing for your question, Alex is probably the most experienced at animating "weapons" after his the skateboard/kickscooter/bicycle mods.
Do any vanilla weapons animate? The double barrel breaks open for reloading, but that is probably just a model swap during the reload action.
Thanks for the fast response. I wouldnt waste much time animating my hotgun in complete new way. I would just use Vanilla anims to make it pump after shooting. i will post screenshot of my model just in case, and if you be so kind and just tell me what to do, I've already wasted much of my sanity
Yeah it just switches to a different model. I've been trying to find any item that has animations while held, so far haven't found one. I thought maybe the fishing rod, but there's no visible line, and the bobber is a 2d sprite so no luck there
items are never animated
That looks good to me. How is your weapon script setup?
some gun mods fake it by toggling weapon part models
The pump could do the same thing - swap to a model with the pump back.
That's more animated than any vanilla pump action shotgun.
Where i can send it?
To be honest, at the level of zoom you're playing at it's not very noticable... that's why weapons get away with the ka-chunk racking sound and no animation.
We'd need "heroic scale" proportions to be able to see the details well,like some tabletop miniatures games/RTS/ARPGs use.
And that is not going to look good if only one mod does it.
if you didn't even know the vanilla shotgun wasn't animated, that's proof that it doesn't matter
You can copy paste it in here, just do three backticks before and after the code, so for example:
``` your code here ```
If you mean script as a item specs here it is
I've been thinking about making a bow and arrow mod using a method like this. undrawn bow is one mesh with string straight, drawn bow has string pulled. I could have it be one handed so the bow is animated using prop1, and when you equip the bow it automatically equips an arrow in your left hand which I then animate with prop2 so I can make a grab from quiver animation and have it look like it's being pulled back
Hmm yeah that looks correct. What is the issue you're having with it? Does the model not display at all?
Thanks guys, I've learned to much. So youre telling me I should just leave it be and add it into the game as it is? No parenting and armatures needed like in other games or edit my script to change models(if it is possible)?
Yes, it does
I just want my character to pump it and my shotgun pump to move after being shot/after empty mag *reload
As long as you're just using vanilla animations you don't have to do anything other than making sure your model is exported at the right size and position/rotation, which from the looks of your blender it is
Ah okay, to animate the pump is a bit more tricky, you will basically have to make one model that has the pump in neutral position and one when it's pumped back, and then you have to switch between those two models between shots. So it won't actually be animated, just a visual trick.
For the character to just move their hand as if they're pumping, it should work with just the vanilla pump shotgun animation.
This is what i have been looking for, very nice. So any advice how to do it?
Oh, I get it now. Thanks for your time guys, you're very helpful and saved me some sanity.
Crossbow would be an easy starting point, but until we have a way to launch projectiles that aren't bullets it's not going to be very satisfying.
Yeah crossbow is a lot easier for sure, could basically just make it a rifle and use vanilla animations
But bow would be so satisfying 😄 Maybe the projectile aspect could be cheated a bit by making a new bullet tracer effect that is just a long dark brown line. Not sure how that system works though, might not be accessible to mod in Lua
And put a bolt or broken bolt in the inventory of any zombie killed.
Yeah! good idea
very sure that is in java
Feels like a java thing for sure
And given how all over the place the aiming system has been, not a place worth trying to mod.
Low-key been wanting to make an MMA mod, just a bunch of custom animations that are triggered by different hotkey combinations
Hopefully devs rmember they were excited about converting other throwables to physics aiming.
Oooooh, I think I might make a quick one-off mod that adds a dropkick
Haha I was thinking 100% knockdown chance, but takes a second to get back up
hahaha
Make the chairs and ladders equippable weapons
What can go wrong?
Sledgehammers everwhere, but when you use them in combat you short-handle them and do no damage.
we're cooked now
I'm putting zero effort into supporting modded multiplayer
vibe coding is cool an all, but it makes things SOOO much more difficult, can make a 4 hour project take days because the llm is trying to solve for syntax by writing 100s of lines of debug junk. I use it for bug checking my shit sometimes but you've gotta take it's code with a grain of salt for the most part it's a crutch that can make things worse.
Out of curiosity I asked chatgpt to make a Zomboid mod to increase headlight distance, and it hallucinated four very useful looking functions to do this.
I'm perfectly capable of turning a 4 hour project in to a days long project all by myself
Good point, if I need someone to try random stuff until something works I can do that myself.
I tried qwen locally and lemme tell you, I wish I saved that code because it was an absolute mess
I'll code myself right in to a wall and then spend 4 hours staring at it wondering where I went wrong
I did get working code when I told it to make a zomboid mod that does something, I didn't care what just make it work.
But that's a lot of GPU time to put "Hello World!" into the console log.
I might run a local llm again this winter to keep my feet warm
my poor little 3080 was screaming in pain
I feel like I'm stuck with a 3060 12GB for a few more years looking at the mess (and price) that is nvidia's 5000 range.
they're fun i used to keep one spun up regularly but i'm behind CGNAT now and can't figure out how to expose the proper ports for me to use my home LLM.
My wife is still rocking my old 2070 super. That thing is a beast.
I used ollama with 7g qwen and continue for vscode. It was easy to setup but I didn't see the usefulness of it. I can f up my own code
oh i don't use mine for code most the time, i was letting them 'live' in a node.js mud i was working on
had them 'wacthing' movies and listening to music via subtitle tracks and kareoke lyrics
I asked it to check my code for any optimizations and it spat out some 5.4 code. I told it "no goto's, this is 5.1" so it came up with a goto function that took in a function as an arg and then called that function.
I was done at that point.
killed at least 12 trees for that one
"we have goto at home"
either it's too early or i'm too stoned. I can't for the life of me figure out how to get this thing to play sounds.
what thing are you trying to get to play sounds?
and it's too early to be too stoned
sawed my first log in 42... can you only saw one log at a time now?
Hi everyone! 👋
I'm working on my first local mod for Build 42, and I'm trying to implement a manual save/load system, like classic single-player games. I managed to make the mod appear in-game and even added a button in the ESC menu using Lua, but I’m having trouble triggering and debugging the Lua code (no print() or UIManager:queueMessage() is showing anything so far).
I wrote a detailed post with screenshots on Reddit:
🔗 https://www.reddit.com/r/projectzomboid/comments/1k62k5t/need_help_with_my_first_project_zomboid_mod_build/
Any tips or examples would be greatly appreciated – I’m new to Lua and learning as I go. Thanks so much in advance 🙏
food items, mod i'm making makes stovetops useful, so far it can cook, and burn food but i can't figureout how to get/play the sounds from the fooditems
Like i know each food item has a cooking sound i just keep getting nil everytime i try to pull the sound
did you set up your sound script?
i'm trying to use the built in sounds, thought maybe i could bypass that
that should be fine. are you triggering it on an event or with playSound()
for dx = -1, 1 do
for dy = -1, 1 do
local sq = cell:getGridSquare(px + dx, py + dy, pz)
if sq then
for i = 0, sq:getObjects():size() - 1 do
local obj = sq:getObjects():get(i)
getSoundManager():PlaySound(obj.getCookingSound(), false, 0.5);
if instanceof(obj, "IsoStove") and obj:Activated() then
local heatFactor = getStoveHeatFactor(obj)
local worldObjects = sq:getWorldObjects()
Play sound but i'm fairly certain it's how i'm trying to get the sound
I'm pretty basic, I would square:playSound("sound")
but like, soup
some objects boil some objects fry, how would i go about getting the right sound if i'm not obj.getCookingSound()?
like item:PlaySound("FryingFood", false, 0.5); should work right?
I'm not sure 'item' would have a playSound. if your object is a food item, you 'should' be able use getCookingSound
have you tried printing obj.getCookingSound to see what it's returning?
maybe throw some checks in there too, like "if instanceof(obj, "Food") then"
you can also use script manager to get the sound I believe
this is fun. run RecipeTestOne("whatever") and if it fails, your player inventory disappears
Hey! Still trying to figure out how to trigger custom buttons from Lua in the ESC menu for Build 42.
My mod shows up in-game and the structure is fine, but I can’t debug OnGameStart or print().
Anyone got a working Lua UI mod example or some tips on where to hook into the menu?
What happens if you write a function that you pass to Events.OnKeyPressed.Add(customKeyPress)?
Your customKeyPress could look like
print("Key pressed: " ..tostring(key))
end```
I haven't tested it, but I'm pretty sure that this is still triggered in the ESC menu. You should see the message logged in the debug after closing ESC menu.
Thanks Alex! 🙌 That’s super helpful — I hadn’t thought about testing with key input like that. I’ll try using OnKeyPressed and see if I get any output in the debug log. If that works, at least I’ll know the Lua file is loading properly!
Really appreciate the tip
Wat
Part of the setup for that is to clear the inventory
Presumably the same for the "unit tests" in the b42 debug menu (or at least one of them)—found that out when exploring that
I didn't look in to it because it seems like a debug thing. but you better be sure it's there.
I know this crafting system is giving me a headache. doesn't help I keep getting distracted.
I might have to roll my own recipe for "saw all logs" since the crafting menu seems to only want to do them one by one, even when crafting "max"
I think you could do it with an onComplete callback, where it checks if you clicked max, and when you complete sawing one log it checks if you still have logs in the inventory then just perform the crafting again.
Does anyone know how to set hotkeys in-game? I want to set them through a UI instead of using ModOptions.
first test
Not a difficult fix!
Just move the model around aswell as the wheels
Yeah, ik, but there's more to it
Aye could still be worse
Yeah
Hey, I might need some help in here, since I've done know 4 hours of debugging and my brains stops working:
function get_perks(player)
local list_perks = PerkFactory.PerkList
local player_perks = {}
for i = 0, list_perks:size() - 1 do
local perk = list_perks:get(i)
local perk_type = perk:getType()
local player_perk_xp = player:getXp():getXP(perk_type)
if perk then
print("adding perk "..tostring(perk_type))
player_perks[perk] = player_perk_xp
else
print("error (nil) - skipping perk "..tostring(perk_type))
end
end
return player_perks
end
local function OnPlayerAttackFinished(player, weapon)
print("dbg1")
local perks = get_perks(player);
print("dbg2")
print("printing perklist: "..tostring(perks))
for perk, xp in pairs(perks) do
if perk then
print("perk not nil")
end
print("dbg3 "..tostring(perk).." "..tostring(xp))
if xp > 0 then
print("dbg4")
player:getXp():addXP(perk, xp)
end
end
print("dbg5")
end```
It throws error "nil" after dbg4.
"Object tried to call nil in OnPlayerAttackFinished"
running the "get_perks" function throws no error, adds all perks without problem.
the loop mostly goes until the first perk with xp appears (like here Axe)
Any ideas?
How can something be nil when I check before?
Hey all! Im looking for a way to create a mod to replace the generic audio that plays over the TV and possibly the radio. It irks me that the audio is audible enough to clearly not be talking about what is being said. I have VO experience and am more than willing to VO the lines if someone can help me replace them as a mod?
Not capital XP in AddXp I think
Sorry the a should be capital. AddXP
Capital is right actually.
Copied from game folder
Yours is lower case addXP
This is insane.
Thanks for fixing four hours of thinking.
I fixed my suspension on my vehicles finally: :3
just add print("file foo.lua loading complete") to the very end of the file outside any functions. But if a lua file fails to load it will show in console.log with an error (usually a silly syntax error that completely stops the file loading, at least when I'm the coder)
Look into mods with fully voiced radio stations, like "survivor radio"
Or more likely: Broadcast Voicer: https://steamcommunity.com/workshop/filedetails/?id=2973493897
Actually recording all the lines, processing them into the sound files and linking up all the guids is a lot of work, but shouldn't be technially challenging - just extremely tedious.
Do you use VSCode or a similar IDE? It will give a lot of little helpful notifiers such as "undeclared global" when you typo a variable name.
Add in the Umbrella plugin and it also has a lot of awareness of Zomboid's available functions/objects
hello,im curious, is there a mod to count and located all the items in the pz world. so i can track down massive amount of item in a container anywhere on the pz world
I'm not aware of any such mod, and it would be a massive amount of data to track.
yeah, but it really helpfull for server admin. so i thought somebody might have created it. lol
Hotkeys are just a variable, and when a key is pressed you check "if keypressed == myHotKeyVariable"
Is there a way to detect the name of the pressed key? I’m in 42 and getKeyName doesn’t work.
So you can set them any way you set a variable. You probably want to set them to something in the Keybaord global instead of using numeric values; run for k,v in pairs(Keyboard) do print(k) end to see all the possible values for Keyboard.KEY_SOMETHING
Thank you! I also found the relevant information in wiki. https://pzwiki.net/wiki/Keyboard
is there a decent video or tutorial explaining the soundManager? I don't think i'm understanding emitters
I'm trying to do a simple client->server command and I'm just not sure what I'm doing wrong. VERY new to zomboid mods:
client\mymodclient.lua
print("[mymodclient] client file loading....")
// ...
local function trySpawnZombie()
print("Sending server command")
sendServerCommand("MyMod", "Command", {})
end
// ...
print("[mymodclient] client file loaded.")
server\mymodserver.lua
print("[mymodserver] server file loading....")
// ...
local function onClientCommand(module, command, playerObj, args)
print("onClientCommand")
end
Events.OnClientCommand.Add(onClientCommand)
// ...
print("[mymodserver] server file loaded.")
I self host a game and the console outputs:
[mymodclient] client file loading....
[mymodclient] client file loaded.
[mymodserver] server file loading....
[mymodserver] server file loaded.
Sending server command
but I never see a console.txt line with "onClientCommand"
check coop-console.txt for server log
console.txt is only the client log (server files do run on the client which is why you are seeing some of the prints)
it IS THERE!! thank you
if you don't want the server files to run on the client (generally preferable since you specifically wanted them on the server) you can add to the start of your file if isClient() then return end to exit the file immediately on the client
I should redo this screenshot with a more obvious example
No not really and the problem is that you can't access data of items if the tiles they are in are not loaded
Well hell no matter what I do I can't see my own message when self hosting... Do I not need lua in server when self hosting?
the client should send a client command, not a server command
the commands are named after the sender
client -> server is sendClientCommand -> onClientCommand and server -> client is sendServerCommand -> onServerCommand ?
yeah
man scratching my head for 2.5 hours on this haha
is there any good documentation on this? I looked at the wiki and see the java objects, but no real like detailed documentaiton
for this game the general answer to that question is 'no'
the wiki's the best place, it has links to a lot of resources on this page https://pzwiki.net/wiki/Modding and there's some stuff actually on the wiki now
but there is no real large scale documentation for modding
Currently the modding wiki is still in development and as such you won't find a lot of stuff
Also I'm not making pages for B41 stuff
It's a loss of time
Especially for things that we don't know if it'll change or not with B42
You can get 100% accurate documentation by decompiling the Java files and opening them up alongside all the lua and txt files.
I wouldn't call it "good" documemtation though.
Well hmm... Should I try making a boat? If I make it equip as a clothing item you could still equip a fishing rod 🤔
kayak?
Back to the Future hoverboard is already done as a mod for your mod.
kayak better fits the "wearable" design IMO
rowboat should be a vehicle.
Yeah I agree, I could even make the paddle a weapon that you have to have equipped along with the kayak in order to move
You found a proper way to walk on the water tho ?
Not sure about proper, and it might not be possible, but figured I'd find a way to enable the godmode noclip thing while boat is equipped and the tile under is water
Seems setGhostMode or something like that should work
But I need to play around with it to see if it does what I think it does lol, you never know
The cheats can't be activated without debug mode activated in B42 I believe ?
Ah that's a problem if so
Hmm, maybe it's possible to hook into some functions and just override the isDebugEnabled() checks. Wishful thinking though
Speaking of hoverboats...
You can't hook to things that are only triggered java side tho
Aquatsar did it in B41 for "swimming"
I believe the way the game checks for debug mode is completely different in the java
What they did it is they made the tiles passable I believe
updating the water tileproperties could work?...
Yeah was hoping maybe there was something Lua side that could be manipulated
Yeah that's what tsar did if I remember right
Not a bad idea
If you make them passable then you need to implement swimming, not just kayaking
otherwise it will be weird when everyone can walk on water.
I don't think I'm gonna do it anytime soon tbh, it's gonna be too much work. Would rather just focus on making the other mods better 😄
Hmm, what if I make a new custom tile that acts as a floor, but it's invisible, and then if I have the boat equipped and I try to go on a water tile, it automatically builds my custom floor tile so it allows me to walk on it.
Would just need to make a good system for spawning and removing the tiles, but shouldn't be crazy hard right?
Will probably make you lurch to a stop every tile.
Oh, does B42 already have car ramps?
Debug mode.
I was thinking it would build in a 3x3 radius around the player
Oh, nice, do are they planning to have them in the actual map in B42 release? Or are you just playing around with it for the sake of it?
I'm sure they showed off a parking garage at one point.
No just dynamically update the needed tiles like Tsar does
Can't drive from a ramp to flat tiles.
Wdym you can't ?
You could on unstable release
Try different vehicles
just hits the end of the ramps and stops. Tried two, no luck for either. fast and slow.
Uh
I might have picked two cars that don't work with ramps, I didn't try any vanilla cars.
I assume that's not a vanilla location?
Could be related to Z levels? maybe the tiles right after the ramp need some kind of special flag
Vanilla location, but I spawned the ramps and tiles.
Not worth putting a lot of effort into when it's clear ramps aren't supposed to be done yet.
Are there no vanilla ramps yet?
Stairs had a similar issue (unsure if it was fixed) where you (on foot) couldn't cross from 1 set to the next (side to side)
Making wide stairs not really functional
That's still the case I believe
Anyway that doesn't sound like the same issue
Try vanilla cars
Some cars are lower than others and don't react the same with ramps
Still the case in 42.7
The "don't fall off the side of the stairs" barriers don't account for putting two staircases side-by-side.
Hi everyone! I'm currently working on a mod for Build 42 that adds a perk to the game. This perk gives a new character a custom melee weapon upon spawning, with completely new attack mechanics such as faster and cancelable LMB attacks, powerful charged attacks, and parrying instead of pushing...
I've spent 3 weeks coding and haven't made much progress — so far, I’ve only managed to get the perk to show up and give existing in-game weapons, but not the custom one. Are mods like this even possible in this game? Because in the entire history of the game, I haven’t seen a single mod that does something similar...
I’m looking for any kind of advice or help that could get me unstuck. I can share all the current files and error logs if needed.
I’d be truly grateful for ANY help.
Probably best to study an existing mod that attempts to do the same. I believe dhert's brutal handiwork mod does something with the combat system?
Strange that I missed this mod. Huge thanks! Time to take it apart piece by piece...
It's possible, but you will have to mess around with the animsets and custom animations if you don't want to use existing ones.
To make attacks faster you would just increase the speed scale of the animation. To make it cancelable you'd have to make a hotkey that when enabled will interrupt the animation. I think there's a way to do it without messing with animsets, but it should for sure work if you make it so when you press the hotkey it changes a variable that is checked in your animation, and if that variable is changed then the animation cancels.
Were you planning on making custom animations for these, or just use existing ones from vanilla and just manipulate how they're played/used?
I’ve got the full concept in my head — complete with flashy custom animations and effects I still plan to create. But first, I just want to get the core idea working with vanilla animations. One step at a time!
Ah okay gotcha, it will be easier if you set up a bunch of custom animsets, so you should play with those
Is it easier to get custom animations working with custom items than using vanilla animations with custom items?
They will be implemented the same, but vanilla animations might not look good with a custom item.
But if your custom weapon looks similar to a vanilla weapon then you could use the vanilla ones with no issues.
For example if you're making a different looking sword, then you could just use the animations that exist for the current sword.
Yeah, I want to bring a bit of that Sekiro: Shadows Die Twice spirit into zombie apocalypse survival. 😄
haha hell yeah! One of my all time favorite games 😄
You're definitely gonna want some custom animations then. There's no very up-to-date guide on custom animations in B42, but I hope to have time to make one pretty soon, like in the next week or so.
Hands down the best in its genre!😍
There could be two versions of the mod — one with totally overpowered mechanics, and another that gives the experience of a 'lone shinobi' in a post-apocalyptic world, with built-in breathers after attack combos or other mechanics to increase the challenge, like requiring rare materials to repair the katana.
#mod_development message this and 4 msgs under
How do I get my mod/patch see a different mod for items or to override recipes? I thought it was just a matter of load order but I must be mistaken.
if you're in b41 using the recipe override: thing, you just need to make your file alphabetically later than the one that has the recipe you're overriding
for anything else it should just work regardless of load order
Does the local mod folder not see the Steam mod folder then?
there has got to be a better way to check if you can craft a recipe. I mean, holy ifthenfordo. Is there something akin to 'canCraftThisRecipe(sawlogsrecipe)' I'm missing? or better yet, getRecipesWithOutputItem("Plank") would be neato
if instanceof(o:getItem(), "InventoryItem") then
local recipes = CraftRecipeManager.getUniqueRecipeItems(o:getItem(), playerObj, containers)
if recipes then
for i = 0, recipes:size() - 1 do
if clickedFlags.sawRecipe then break end
local recipe = recipes:get(i)
for j = 0, recipe:getOutputs():size() - 1 do
local resultItems = recipe:getOutputs():get(i):getOutputMapper():getResultItems()
for k = 0, resultItems:size() - 1 do
if resultItems:get(k):getName() == "Plank" then
print("Planks are delicious!")
clickedFlags.canSawPlanks = true
clickedFlags.sawRecipe = recipe
break
end
end
end
end
end
end
There's canPerformCurrentRecipe() on the HandCraftLogic
CraftRecipeManager.getUniqueRecipeItems is nice enough to return the recipes you can craft with what is immediately available, but then I need to dig to get to the outputs and check if it's a plank. unless I'm missing something?
trying to future proof this thing. I guess I could stick with just the SawLogs recipe
Are you basically trying to do a catch-all for all recipes that outputs planks, or you just want to be able to check if the saw logs recipe can be performed?
I'm trying to get all recipes that output planks
just seeing that staircase of "end" makes me sad
Ah okay, gotcha, I thought you just wanted to be able to quickly check if you meet all requirements to craft a specific recipe
Anyone have any Superpower Mods in development?
No one does
The true heros are the one that simply just try to mod 😎
Anyone with experience with PZ models able to shed some light on a fairly simple question?
is there a way to increase the washer/dryer speed with a mod?
Hello everyone, can anyone tell me how to implement automatic wipe of houses?
I've seen this feature on various servers, but I don't think it's listed as a workshop mod.
Wdym wipe ?
For loot you mean ?
That's a sandbox option
Vanilla
Loot respawn
I don't mean vanilla options
full wipe of the building, restoration of destroyed boxes, windows, doors, etc.
is the damn lib id damnlib both for b41 and b42?
Used ChatGPT O4-mini-high
name=BasicVan
id=Van
description="My Summer Car Van, the Hayosiko Pace from 1977!"
---Please report any bugs!---
poster=preview.png
icon=Icon.png
category=vehicle
require=\damnlib
versionMin=41.0.0
modVersion=1.0
author=Aeronava
Is there any problem with require line for B41?
Some say it does not work to enable the mod because it can't find damnlib, same script works on B42
You shouldn't have \ in front
For B41
aight, appreciate it
\ is needed for B42
such simple fix
Also you probably shouldn't put 41.0.0 for the version
Even if I believe thqt's unused for B41
At least put the last B41 version
Bcs your mod won't work for 41.0.0 most likely lol
Tho that really doesn't matter anyway
yeah yr
Hey guys, quick question. What defines the firerate of weapons in code? Iam using automatic pistol and I want it to shoot slower, what props should I edit in my code?
I'm not 100% sure, but try editing the weapons MinimumSwingTime = 0.5, SwingTime = 0.5,.
Yes, guns use swing attacks and it makes complete sense, don't question it.
Some people using the bicycle and scooter mods are having a very strange bug that I'm struggling with.
The bicycle appears in the world when placed, but when equipped the model goes invisible. The animations play and it "works", you just can't see the bike. The skateboard and folded scooter works fine, but the unfolded scooter has the same issue as the bike.
Only two people so far have reported it, but I can't reproduce it no matter what.
Tried changing graphics options, accessibility settings, using controller etc.
One of them plays on a docked steam deck, the other I'm not sure if he is as well, waiting for him to respond.
The only difference between the skateboard and folded scooter, and the bicycle and unfolded scooter is that the former two are weapons and attach to Prop1, while the latter are containers and attach to Prop2.
But it's weird that it seems to work for majority users still.
I hope that switching the bike and scooter to weapons will resolve it, because I plan on doing that anyways. But I still want to try and figure out what could cause it
Sadly, it does nothing. Also I tried to edit "RecoilDelay" = 0 to 0.5 and that just broke my models & props. Isn't there "swingrate" or "firerate" prop to change firerate?
I think actually that the firerate is tied to the animation, there's <m_SpeedScale>singleShootSpeed</m_SpeedScale> in the AnimSets\player\ranged\handgun\HandgunDefault.xml.
Depending on whether or not this singleShootSpeed is fully Java controlled or not, your approach will be different.
If it's something that can be accessed in Lua and it's supported decently then there's probably a setter you can use.
If it's fully Java side, then you'd have to make your own animset that activates when you hold your gun, and change the speedScale variable to your own calculation.
Is there a tutorial on how to make a weapon mod? I want to try make 1 but I dont know where to start
There's a few depending on what you want to do. Is it a firearm or melee weapon? Are you using custom animations or no?
firearm and ideally I want to try using custom animation
For firearm this is the best guide https://steamcommunity.com/sharedfiles/filedetails/?id=3060255898
For custom animations there's no up-to-date guide at the moment, but if you download https://github.com/Paddlefruit/ProjectZomboid_CommunityRig I can tell you how to set it up
Your first time trying to create your own gun mod, or struggling with making it work? I've been there. I've spend days figuring out why my gun model does not show / is semi transparent / is upside dow
Hello again folks.
I'm trying to add a function in build 41 that plays one of 10 random sounds when hitting with a specific blunt weapon.
For some reason they are not playing. Perhaps I have messed up the sound definitions.
Has someone here made something like this in the past ?
ay thanks man
I'll let you know once I have time to set it up
Unfinished if I remember right tho
But still decent
Thanks Alex, I proclaim you as my sanity saviour. Now, i shall learn anims to make my gun P E R F E C T L Y scaved.
Yeah true it has some good info in it. It's just missing some stuff if you're using paddlefruit's rig, which requires a bit of setup compared to Mystery's rig
The setup needed is explained on the git page of the rig tho
It assumes you have a bit of prior blender knowledge, Mystery rig opens with the NLA strips, keyframe recording and Auto IK already set up. Those have to be manually done when you open Paddlefruit's and if you don't have any Blender knowledge you'll have to do some googling
(auto IK as in the pose option)
What 
Paddle's got IK bones too. You will ALWAYS need Blender knowledge to animate it
Any rig you use
Yeah not the IK bones, just the option to toggle auto IK on, it's disabled by default in paddlefruits and have to be enabled in the "Pose options" in the top right corner
I get what you mean, but I had never used Blender before and when I tried Mystery Rig it was all there already set up, and the animation guide uses mystery rig so it was easy to follow along.
When I started using Paddlefruit's rig I had to google some stuff to be able to get the same UI setup as I had on mystery rig.
For a complete beginner to get started it's slightly easier with myster rig, but it's really only because of like 3 settings that needs to be toggled in paddlefruit's. The rig itself is excellent and very intuitive to use once you get into it
What's auto IK ?
It activates IK for the parent bone and the parent's parent etc, I think it just affects the arms, but I feel it's easier to work with it when enabled
Hmm
@vivid imp
Don't hesitate to give feedback directly to paddle
Also you can always fork it
Oh yeah, I just didn't think it was that big of a deal, and as you say most people will have or want to have some blender knowledge before going in.
I was going to include a .blend file with everything set up when I make an animation tutorial
Dont enable auto ik! That just interferes with the already created ik
On the github it explains how to enable IK for the arms
Ah okay, thanks for the info! I have been using it and it felt okay, but maybe I've just been lucky and haven't run into any bugs yet. I'm gonna disable it from now on
Is it bad if I kind of prefer having FK on and using Auto IK? I feel it gives me so much control, and as long as I'm careful not to rotate things weirdly, I haven't really had any issues with it
This issue was resolved by making the bicycle a weapon instead of container btw, super weird
Does anyone know which file contains the game version display in the bottom right corner?
ISVersionWaterMark
For non-automatic weapon shoudl be RecoilDeelay. Reight click -> Edit in debug mode and you can tweak this to test.
For fully automatic, B42 is broken and just spews out pullets at an insane rate.
For burst fire, it doesn't seem to work at all. Don't use it; none of teh vanilla guns do.
Anyone else ever had problems with vehicle editing menu where it is all grey when accesing it and requires game restart???
I literally can't edit my vehicle bruh
anyone interested in helping me, maybe i can send the mod over and you can tell me if you encounter the same issue
Till then, I'll do a verify of installed files
I think that happened to me with a vehicle script that tried to access body model that didn't exist, or something like that
Does anyone know if it's possible to assign names to zombies and display them above their heads like it works for players in multiplayer? Or maybe someone has already made such a mod
yes
What's your goal ?
I want all zombies to have their own random name displayed above their heads. The dictionary of names is known in advance. If there is an example of a mod that does something like this, or code examples I would be grateful. Or at least a direction where to dig
You've got many ways to do that
Either have custom nametag visuals
Or use addLineChatElement (which I wouldn't suggest tbf)
This is one of my mod where I do that
However it might be complex to retrieve the code that might interest you
I got a better example wait
Thank you very much! I will check that
Does anyone know how difficult it would be to embed a commodore 64 emulator into the command line interface mod?
@coarse sinew did a lot of UI stuff to add games in PZ
everything exists in model definitions
PS
It's technically possible, but extremely complex to do inside Lua because of PZ's Lua environment limitations.
Why?
PZ Lua runtime doesn't include bitwise operations (bit, bit32, etc.) which most emulators heavily rely on, because emulating hardware like the C64 needs to manipulate bits a lot (e.g., shifting, masking, setting CPU flags).
PZ's Lua also doesn't allow native C libraries or external compiled modules, meaning you can't easily load a real emulator library like VICE or even something lightweight like fake6502 without rewriting huge parts manually.
Unless someone reimplements an extremely stripped down, integer-only C64 CPU core directly in pure Lua without bitwise ops (emulating bits using math), the emulator would either need to be fake (like a "simulation" running pre-coded scenes, not an actual CPU emulation) or you'd need to handwrite a minimal pseudo-emulator that interprets basic instructions manually. This would be super slow but possible if you only wanted to "simulate" some commands.
Realistically you'd need to build a custom Java mod to embed a Java-based C64 emulator. Because it's Java-side, this would require users to manually install the Java mod, it's not pure Lua, so it won't work automatically through Steam Workshop.
I'm currently working on a S.C.R.A.P. Terminal mod (name will probably change), basically a retro CRT-style terminal interface with modular apps (modules) like a lore database, admin tools, a directives system (server wide events) and a game module (I already implemented Snake, Tetris, Pac-Man, and a copy of Doom). It has CRT screen simulation (flicker, scanlines, dynamic UI with boot sequences, animations), custom sound manager for keyboard clicks, hums, etc. And it's extensible: you can register new terminal modules using an API (but you still have to write your own code to render the elements ...).
Your code works like a charm, thank you! One more question, is there a way to get only visible zombies by the character view, as I seegetCell():getZombieList() returns not only visible
getPlayer():getStats():getNumVisibleZombies()
I need ArrayList<IsoZombie>, getNumVisibleZombies() returns int
you could check each zombie for isVisibleToPlayer(playerNum)
idk if there's a better/different way
I will try, thanks!
getting there
Will this scrap terminal be available for B41? I’m very much looking forward to having a functioning computer in zomboid
for some reason isVisibleToPlayer array is always nil
can you post your code?
if you're expecting an array that's your first problem 😅
Yup! It will be fully compatible with B41, including MP support, this being the main reason it's on B41.
Nice, any idea when it’ll be ready for the workshop?
Like sometime in the next couple months or is it still a long way from done?
HandleVisuals = function(_)
local zombieList = getCell():getZombieList()
for i = 0, zombieList:size() - 1 do repeat
local zombie = zombieList:get(i)
if zombie.IsVisibleToPlayer then
print("not nil")
end
until true end
end
Events.OnTick.Add(HandleVisuals)
if zombie:isVisibleToPlayer(playerIndex)
if you don't have the playerIndex you can use getPlayer():getPlayerNum() for testing
that's a hefty call for OnTick too
It's a pretty complex project, between MP syncing, fixing texture rendering quirks and finding new methods for storing dynamic data efficiently, it's taken a lot of extra work. Right now I'm aiming for a preview build release in about 1–2 months for closed-testing on a server first. If that goes well, it'll move toward full release.
I did find a way, it's in Zomboid Forge. Should be in OnTick
Here
Hello Sir, do you perhaps have an API or something similar to load a custom item granter through a trait?
You are my hero, it's working! TY
I've been struggling with this error for two weeks already.
So I want to ask again, Grey bugged vehicle editor is duo to unexistent models or what?
because it worked once on same mod, now it won't anymore
because i checked and all models load, i really don't know what causes it
Can I get a little help understanding "Override:true"? I thought I needed to copy and paste the original recipe exactly and just add Override:true before making a new entry with my recipe but it must not be working since both are showing up in game.
I can try it now if you post it. I can't remember what I did to break it the same way before
i will post it then, but its really unfinished btw
I think the broblem should be in the script
here
i thought u might need the model too
i found an issue with rear window i think
it should load in the gas tank but it does nothing
might be the issue
talking about the rear window
nop
You want the item to be granted when creating a new character ?
Or when doing something ?
When selecting a specific trait, the new character receives a custom melee weapon in their inventory.
OnNewSurvivor - doen´t work
OnCreatePlayer - doesn´t work
i´ll try OnPlayerLogin...
Also that one should work as long as your code does in fact do what's needed to spawn a need item
Looks okay so far...
Maan that's a looooot of code that you shouldn't ever need
You're doing sooooo many checks here that are just straight up not needed and will bloat your code if not slow it down for literally nothing
-- Проверяем валидность объекта игрока (оставляем проверки на всякий случай)
if not player or type(player) ~= "userdata" or not player.isPlayer or not player:isPlayer() or not player.getUsername or not player.HasTrait or not player.getInventory then
print("KatanaMasterMod.OnPlayerLoginHandler: Invalid or incomplete player object received. Type: " .. type(player))
return
end
This is straight up bloat
Also make sure to clear all these prints when you release the mod, do not leave a single one
See this
Yeah
Anyway give me a minute to verify your method to adding items to the player
Ty!
I use this 😄
Wdym you use this ?
This is for AOE damage on key
you should not copy the original recipe, create a new recipe with the same name and put Override: true inside it
So you manage to spawn the item in game from the debug menu ?
recipes with multiple definitions (multiple recipes with the same name) cannot be overridden this way
No, I didn´t tryed it yet
You mean there can be an issue with custom item`?
No just verifying that your item does in fact exist in the game
Gimme a moment
And the issue is not that you're trying to add an item that actually can't physically exist
I got my answer already
That's not needed
Anyway try doing that code on a completely different event
Like OnKeyPress or something like that, and see if it gives you your item
That way you can verify if the issue is the event or your item spawning
Imo the item spawning method looks good but I'm not familiar enough with it to recognize the proper way
I checked based on stuff I personally did and this looks good, from memory too
Alright, I'll make the changes and try again!
Thanks for the answer. So I only should need to copy the name and enter my version with Override : true to override it?
To remove a single recipe with no duplicates do I need just the name and add Obselete: true?
yeah that's right, but keep in mind that also won't work if it has duplicates
As the nuclear option, if a mod is not on lockdown and conflicts with other mods, is it appropriate to rewrite the pieces needed and incorporate it into the new mod and then credit the original author/modder?
Etiquette
You can always make a patch to that mod instead
That's part of what I am having trouble with. Mine doesn't seem to see theirs and is throwing errors.
They each work individually.
Not sure what you mean
You need to require the original mod
And make sure to load the other mod first
Can you clarify what you mean by require the original mod. Is that in the Steam setting or us there a part that needs to be done in my local folder too? Load order is set by name and double checked with mod manager.
Removed static = FALSE, from every model definition and the editor works (for me at least)
Thanks, ill do it
in the mod.info
Check this page out
And require
Thank you, I'll read it.
the override is not dependent on mod load order or even requires
It seems to have something to do with the models (or lack of them for me), because it works with the static line when the model is replaced with one from a vanilla vehicle
Seems like i do need it for animated parts, but i think i found it, the rear windows is not animated but it had static false, ill test it rn
you might need to make your file alphabetically later than the original file that defines the recipe (script files load in alphabetical order and ignore mod load order)
This doesn't apply to B42 tho does it ? Unless scripts still load like B41 ?
getting somewhere
nice! I always thought that was for "get the zombies that see you"
I've got programming experience and I've certainly looked into modding this game before, just never got fully into it. How difficult is it? I know it uses Lua, I've got no experience with that, but I've made a few games from scratch before if that tells you what level programmer I am.
Oh you should have a pretty easy time getting into it. There's some weird stuff here and there, and there's some restrictions on what you can do with Lua (some things are controlled in Java), but overall it's a fun time
Dope. All I need is an idea lol. Something will come to me when I'm playing
Yeah that's the best way to get insipiration tbh 😄 Just play until something annoys you and you want to fix it
You could also check https://discord.com/channels/136501320340209664/1075939080287834113
You'll be fine - if you have enough programming experience to understand the near-universal basics (variables, functions, flow control, local vs global variables) you'll manage lua.
The hardest part of code based zomboid mods is 1) figuring out where you need to make a change, and asking in here will often get you pointers to the bit you need and 2) coming up with elaborate workarounds when the thing you want to change is in java and not accessible in lua.
If the figuring out thing is related to unintelligable error messages, don't worry
They're my specialty
You'll fit right in with the zomboid code 😛
Bahaha
My code used to be so unreadable, I got so good at deciphering strange code just trying to refactor
useful non-obvious lua tip if you're coming from other languages: if you see a function named ObjectType:function(arg1, arg2) that is just a quick way to write ObjectType.function(self, arg1, arg2), where "self" is used as a variable passed around so you can fake object-oriented design.
heyy, TeachedRecipes in B42 now must refer to the <recipeID>?
ie, in B41 I have this working:
module FunctionalCarLift {
item CarLiftMag {
DisplayName = Carzone Commodities: Car Lift,
DisplayCategory = SkillBook,
Weight = 0.1,
Type = Literature,
Icon = CarLiftMag,
TeachedRecipes = Craft Car Lift Column; Craft Car Lift Center,
ReplaceOnUse = CarLiftMag,
StaticModel = Magazine,
WorldStaticModel = FunctionalCarLift.MagModel,
}
}
