#mod_development
1 messages ยท Page 289 of 1
Owh.
What? I thought I had to offset it myself lol
Question; Does the name on my object matter? like, does having the file name start with the word "Bag_" matter?
Uhh, how do you guys find the screen coordinates of the item part description for hovering?
Okay. Figured out the issue. THANK YOU! First time I read through the article you posted I missed one of the spoilered sections (Ironically the most important one that had the exact answer to my question) I'll get on that later but I'm now out 16 hours of smashing my face against a brick wall lol
I might be going crazy but, wondering if someone can help figure out my issue
I am trying to add items to a distrubution (zombie generic) with sandbox vars during the OnInitGlobalModData event
However the items appear in LootZed but arent spawning in at all (and I am calling ItemPickerJava.Parse() at the end)
Can post code if needed
no zombie has has the carton on them
Did you start a new game to get new zombies generated?
Well that's all the help I can offer for this. Good luck.
lol yeah its been driving me crazy
at one point I had it working (i think?)
then I changed something and it doesnt
I started turning every mod into a local git repository because of this.
I told myself Ill put it on git once I got it working
So when I say "it used to work!" I can look at what I changed.
I made a fool of myself
maybe im just extremly unlucky and the mod works perfectly
surely thats it
i need ibrus to update tsarslib
Hope ibrus also fixes true music. I appreciate the folks who have tried to port it to B42 but it's buggier than Starship Troopers ๐
Hi so I was tinkering with the overall weight reduction for a while and found out that fish and liquids have different logic for weight. I have solved the fish issue, I handled the weight on fish creation, but I can't solve the liquid. Anyone have idea?
Hey, I guess this is how people get the coordinates of the vehicle part overlays.
Hehe, it works.
Anyone played around with the code in Onbreak.lua?
I'm trying to get a new item to stick in zombies lol.
The code seems to be working, and if I change the item that I'm creating into "Base.LetterOpener" it seems to work correctly.
But my custom item is not showing up. Is there something I have to set up in models? I'm not finding anything specifically.
I'm playing around with adding my models to AttachedWeaponDefinitions. But so far, no dice.
Oh, NM. I figured it out.
What is that, an arrow? ๐ฎ
Crossbow incoming
I'm actually thinking about making a shared "Archery" Library to let other modders add bows in a much easier fashion.
I've seen a few crossbow mods, no idea if any fire actual bolt and have the bolts stick in targets.
Banger after banger after banger
Just me modding away thing that annoy me ๐
MECHANIC OVERLAY DONE, THIS WAS THE MOST TEDIOUS.
I don't like how you also have to add the base image's offset to the coordinates of each part's tooltip.
ISCarMechanicsOverlay.CarList["Base.isg85countach"] = {imgPrefix = "isg85countach_", x=10,y=-20}
```So if your base image's offset is `x=10` and `y=-20`, you literally have to:
```lua
ISCarMechanicsOverlay.PartList["Battery"].vehicles["isg85countach_"] = {x=121,y=50,x2=163,y2=80};
````{x=111+10,y=70-20,x2=153+10,y2=100-20}`
Although you could just find the coordinates first and then tell ChatGPT to add 10 to each x/x2 and subtract 20 from each y/y2.
there's an ingame ui editor. just saying.
-.- I have been asking since I like 3 hours ago...
cuz i tried... you quit listening.
Tried?
i told oyu i made a tool and everything.
You didn't even send any messages 2.5 hours ago.
Your tool only provided me the images and your Blender tool only does outlines.
I vote for an atmosphere that would correspond to 1993 and earlier.
Is there a mod that lets me sharpen katana? Searched the workshop but couldnt find, but I could have sworn that I saw a mod like that before hmm
Check with #mod_support
I made a mod for PZ a few years ago when I played. I'd like to have that mod work in the unstable build 42, but I'm not sure what I have to do in order to make the mod show up in my mod list at the main menu. Any tips or can someone point me at a resource that explains it? I tried looking it up myself, but didn't find anything.
Anyone able to help me with a possible GUID issue? I'm going through the guide i was given and have no errors, but the item is invisible when held. I got it properly rigged to the skeleton and have followed everything to the letter. On possible issues the guide says:
Do bags held in hands need their own entire GUID?
They have them; do they not need their own?
<fileGuidTable>
<files>
<path>media/clothing/clothingItems/Dynn_MakeshiftBodyBag_Plastic</path>
<guid>dynn31b9-1818-4c7d-80e4-6f1d9768e059</guid>
</files>
<files>
<path>media/clothing/clothingItems/Dynn_MakeshiftBodyBag_Plastic_LHand</path>
<guid>dynn0759-8196-44b5-9c2f-e0d58197ae88</guid>
</files>
<files>
<path>media/clothing/clothingItems/Dynn_MakeshiftBodyBag_Plastic_RHand</path>
<guid>dynn14c6-d239-4f01-8391-7e7cdc2dcdf4</guid>
</files>
</fileGuidTable>
I want to get another players inventory in MP. However, the item inventory table is empty. This works fine on your own player. I see no restriction in the Java code such as an authority or 'is own player' check.
Any idea what's going on?
player:getInventory():getItems()
prints: inventory:getItems(): []
20 hours in on this and once again hitting the wall.
And you have an entire xml file for both bodybag_RHand and LHand?
Correct
Eurgh
Left
<clothingItem>
<m_MaleModel>Skinned/BackPacks/Dynn_MakeshiftBodyBag_LHand.fbx</m_MaleModel>
<m_FemaleModel>Skinned/BackPacks/Dynn_MakeshiftBodyBag_LHand.fbx</m_FemaleModel>
<m_GUID>dynn0759-8196-44b5-9c2f-e0d58197ae88</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<m_AttachBone></m_AttachBone>
<textureChoices>Dynn_BodyBagGarbageBag</textureChoices>
</clothingItem>
Right
<clothingItem>
<m_MaleModel>media/models_X/Skinned/BackPacks/Dynn_MakeshiftBodyBag_RHand.fbx</m_MaleModel>
<m_FemaleModel>media/models_X/Skinned/BackPacks/Dynn_MakeshiftBodyBag_RHand.fbx</m_FemaleModel>
<m_GUID>dynn14c6-d239-4f01-8391-7e7cdc2dcdf4</m_GUID>
<m_Static>false</m_Static>
<m_AllowRandomHue>false</m_AllowRandomHue>
<m_AllowRandomTint>false</m_AllowRandomTint>
<m_AttachBone></m_AttachBone>
<textureChoices>Dynn_BodyBagGarbageBag</textureChoices>
</clothingItem>
Maybe the .fbx needs to be re-attached to a different bone?
I'll try that
I believe it was Bip01_Spine1 I used when rigging. I guess I can denote that here
nope, nadda
very nice, having a properly matching mechanics view is really good compared to using a generic one
OH MY GOD. I think I figured it out.
My xml files are generic text files for some reason.
Oh dayumn yeah that'll do it ๐
let me check some stuff and I'll let you know if that was the only issue
mything.xml.txt ?
generic file with no extension
Kinda like my first attempts at mod.info.txt ๐
Better than totallynotavirus.pdf.exe
Still no dice. I wanna scream
Anyone able to identify an issue with my Moduel base?
{
item Dynn_MakeshiftBodyBag_Plastic
{
Type = Container,
WeightReduction = 90,
Weight = 0,
Capacity = 65,
RunSpeedModifier = 2.5,
DisplayName = Makeshift Bodybag (Full),
DisplayCategory = Corpse,
Icon = Dynn_BodyBag_Plastic_Full,
WorldStaticModel = Dynn_MakeshiftBodyBag_PlasticFull,
OpenSound = OpenBag,
CloseSound = CloseBag,
PutInSound = PutItemInBag,
ReplaceInSecondHand = Dynn_MakeshiftBodyBag_Plastic_LHand holdingumbrellaleft,
ReplaceInPrimaryHand = Dynn_MakeshiftBodyBag_Plastic_RHand holdingumbrellaright,
}
}
I'm just at a loss going back and forth over what boils down to a simple handbag
Where's your ClothingItem entry?
I pulled it out to more closely follow the layout of the base game cooler since it made no sense to equip a bodybag on your back
is it possible to add crafting experience via lua?
That's your issue!
oh?
100%
The game can't find the ClothingItem xml if the item script doesn't have a ClothingItem = entry
The ClothingItem entry should be the exact name of the xml file without the .xml part
Still not working even with it...
{
item Dynn_MakeshiftBodyBag_Plastic
{
Type = Container,
ClothingItem = Dynn_MakeshiftBodyBag_Plastic,
WeightReduction = 90,
Weight = 0,
Capacity = 65,
RunSpeedModifier = 2.5,
DisplayName = Makeshift Bodybag (Full),
DisplayCategory = Corpse,
Icon = Dynn_BodyBag_Plastic_Full,
WorldStaticModel = Dynn_MakeshiftBodyBag_PlasticFull,
OpenSound = OpenBag,
CloseSound = CloseBag,
PutInSound = PutItemInBag,
ReplaceInSecondHand = Dynn_MakeshiftBodyBag_Plastic_LHand holdingumbrellaleft,
ReplaceInPrimaryHand = Dynn_MakeshiftBodyBag_Plastic_RHand holdingumbrellaright,
}
}```
okay
lets try again
still nothing'
So my script that has the Mesh&Texture listed. do I need to denote the Left and Right hands there too? I'm presuming not from looking at other mods
bro making a body bag mod. u gunna have them spawn in hospitals? my dude u gotta ads mortuaries XD
Heck yeah I am! I think Mortuaries would be a neat addition too
rollen with the squad in a hearse XD
I wonder if AttachmentReplacement is something you need too?
All the vanilla bags seem to have it
Except for the items that can only be held in your hand like coolers and pistol cases
{
DisplayName = Cooler,
DisplayCategory = Container,
Type = Container,
Weight = 1.5,
Icon = Cooler,
Capacity = 12,
CloseSound = CloseCooler,
MetalValue = 15,
OpenSound = OpenCooler,
PutInSound = StoreItemCooler,
ReplaceInPrimaryHand = Bag_Cooler_RHand holdingbagright,
ReplaceInSecondHand = Bag_Cooler_LHand holdingbagleft,
RunSpeedModifier = 0.9,
WeightReduction = 50,
WorldStaticModel = Cooler_Ground,
}
speaking of- I'm gonna reformat my spaghetti mess to look more like the vanilla format here
You shoulda seen my face when I opened up the B42 gun scripts and noticed they were all neat and alphabetical, instead of the absolute horrifying mess they were in B41 that I had gotten used to. I was shocked, SHOCKED I say.
So here's a way to test this out. I'm going to change what it calls for in the Primary/Secondary to see if that works.
Okay. so we can narrow this issue down to the specific xml files for the LHand and RHand bodybags or the model (although I'm like 90% I did the model right)
not sure if its anything but your guid file had 2 attach bones instead of just one
anyone got a Suburbs Distributions template handy for items?
That just denotes the end of the call- that's fine. any info for the field would go between the two if I had any
did you choose umbrella for a reason
yup
A fellow Resident Evil fan
For the animation
Oh
is the scale of your texture correct
I can get it to spawn any other prop in the holding umbrella animation, meaning the issue is likely the model or .xml
As for the texture, yes. I have it mapped correct and the on-ground version of the bag is properly textured
If a mod changes the name ID of an item, will the save break or will the items with that now broken ID just cease to exist
Sorry if I'm asking bad questions I'm new as well :/
nah nah you're good man
My goal right now is to have those items disappear, not to prevent it from happening lol
For me the item just goes poof
best we can do is brainstorm and troubleshoot
Trying to get this fireman-carry when held in left hand to work has been a nightmare. It's rigged to the proper bones/vertex groups and scaled properly.
Try the equip on back option, see if even that works
oh noooo....
you'll have SO much fun with that.
my carrying mod taught me that hatred of non comforming bones is legit.
"Well, I'm..." checks watch "about 21 hours in on this one issue. Tell me about it!"
the issue you are going to have.... that body hast o e attached to the attachment bone, more so than the hand or shoulder bone.
it will always attach to the attachment bone.
and depending on the animation, that little bastard could be ANYWHERE
Hand or Shoulder. Cool so Spine is a no go then?
Skizot is on the case!
nope the hand attachment bone for the arm you are attaching it to.
Thank god I'm saved haha. Okay. I can work with a bit of jank
that's the ONLY thing it will actually attach to.
Hand or Shoulder
Oh? so Equip Secondary will? not work>?
If I re-rig it to the left shoulder for "Equip Secondary" will that work?
most probably not, but you can try
I normally refuse to play my own mods, but I'm gonna have to start. I playtest things as surface level as possible and then just hope the players figure it out lol
absolutely realistically proportioned cash register
it's the 90s, they were huge.
Damn. nope, rigging to left hand didn't work
Now it's the 2020s, so it's spelled yuge.
Any mod creators willing to chat about a potential project??
You mean a commission ?
Ya
I'm about ready to give up on modding.
Ty
It's been 22 hours of the blind leading the blind
What are you trying to achieve ?
still causing issues?
a bag? or the fireman carry?
It's a bag. held in the left hand. The plan is to just flip it about and use the umbrella animation to get it into the firerman carry position.
That's all i've been trying to do
look I just want to figure out how to get it to work this way because I have functionality features in mind. if we ignore the fact it's a corpse bag and look at it from a technical standpoint all this boils down to is I can't visually hold a bag in my hand.
does it show the bag just in a weird spot? or is it invisible all together?
invisible all together but in the inventory it's equip and it shows up as a prop on the ground when I drop it
okay you are doing it as an ACTUAL bag then?
Correct.
did you base it on an existing bag?
As in the script?
I understand that
there's the prop bag and then the handheld one.
and i will admit, handheld bags are SO stupid to make work.
yes
I feel like I'm starting to sound like a broken record explaining this, but if I change the [ReplaceInPrimaryHand = .XML] to anything else it shows a different prop in the proper place, but not when I use my own model's .xml
The XML is near identical to all the other ones I've looked at, has it's own GUID separate from the other hand and unused backpack/clothing slot, the pathing moves to the proper folders, my guide table reflects this, all my files cross reference, there's no spelling mistakes. I followed the guide on how to import clothing parts sent to me by someone that made a set of bags the other day and it's still not working
Not even pulling another prop out of the game files and replacing the prop with my own works.
okay so that makes me think that there might be a model scale issue.
as world models and held models for some dumb reason have varying scales.
there was a button you couls press that would turn on wireframes....
trying to remember what is was.
i think i did it in the vehicle editor and it reflected in the world.
i am also out of modding for like a year.
so lemme get back into the swing.
i'm hopping ingame to figure that ou.
one sec
anyone messed with wind intensity yet?
print(getClimateManager():getWindIntensity())
this works but setting it throws error
if it was a scaling issue the animation would play but the prop would be unseen woundl't it? The animation doesn't even play
okay try this!
press f7 ingame.
then f12
then back in the bottom left.
you should get that.
it will show your model if it's too big or small.
wait... nothing?
it opens vehicle editor and screenshot
yeah vehicle editor then f12 then back
the car in the editor should go wireframe.
DOH it's w.
not f12
stupid hands are all over the place.
f7, w, f7
and you dont see anything weird when you move around?
nope.
At?
your mod so far?
oh sure.
i mean i will tell you what to fix not fix it if you want.
jusdt a zip of the folder from mods is fine.
can send here if you want.
sent you a message, you can drop it there actually.
ready to sail the b42 waters
https://steamcommunity.com/sharedfiles/filedetails/?id=3403870858
mod for have cat?
By now someone is surely making a cat mod
guys,if i want to change the house alarm to my own music on B42,which document should i edit?
No one has made a custom animal for now
That's probably in the bank file
Stand corrected good Sir! https://steamcommunity.com/sharedfiles/filedetails/?id=3394755161&searchtext=
if i want using the module to change it on my mod,can i change the folder called "media\scripts"
which txt can i use?
I am currently looping through my inventory if item:getCategory() == "Container" I want to get all the items inside that container. Is that possible?
It's not a custom animation, it's only the model which is very easy to do
So no I stand my point, no one has made a proper custom animal, with custom animations and shit
You can probably make a cat rn, but it won't have cat animations and behavior
We all have to go and yell at TIS to fix their gosh darn AnimSet bs
Don't repost the same file as vanilla, make a new one to replace a specific sounds HOWEVER it might be possibly the alarm doesn't define a sound script
Zombie T-Rex plz.
That's another problem in itself 
I wanna see an Umber Hulk bust through a wall
Have a pet umber hulk, that'd be rad as hell
omg,that means I have to check in the vanilla lua for some clue
It's actually probably not in the lua
I'm trying to add animations to my car doors. All the modeling and animation part is done, I need help with the script part, I have defined the models in the main file and also the doors, with the corresponding animations. I think the part that fails is the items, I have created them in a separate file but when I reload the mod, it gives me errors related to the items. Can someone help me?
Another thing someone will be able to dev in with the new projectile system is Mjolnir
And a Captain America shield.
and my axe!
guys, do you know how to fix this?, the doors moves when my chracter moves, and they are not in they correct position as you can see
make sure you have them attached to the right bopne in the script.
how i do it?
model Vehicle_USPSTruck_Hood
{
mesh = vehicles/Vehicle_USPSTruck_anim|Hood,
shader = vehicle,
static = FALSE,
scale = 0.01,
-------> boneWeight = hood 1.0,
}
ok now they dont appear
did you weight each one to it's specific bone?
or just copy and paste my line?
the hood bone in mine is named hood.
yep
yeah i know
Is the shader line the ones that makes custom cars' textures spasm and go all epilepsymode btw?
usually.
any idea @faint jewel ?
not sure. but that's usually the issue.
If you want i can send you my script if you want to see it
I can't tell if that's a cybertruck or a minimal polygon test model to use while you code the mod.
its supposed to be a cybertruck but the trunk door is missing, with other things
Hey guys. I want to make mods. What do I need to know? I guess basic programming and modeling, right? I heard b42 is now written in C# or something like that, do I need to learn that as well as Lua?
Depends entirely on what you want to do.
Want to add a Katana you can make from glue and a sheet of paper? Rad, you'll need one .txt file.
Entirely new stuff? Yeah, 3D modeling is one of the things. Some lua.
No C#. The core game is Java, but you won't be modding that - all code work will be in LUA.
And a lot of text files holding data for things
Do you have a particular idea for something you want to make? Even something really simple just for personal use, like "I want the M9 pistol to do more damage" or "I want a trait that makes me start the game with two katanas"
Thank you! I actually have a lot of ideas, rebalancing traits and adding new stuff
I'd also like to add a song like the ones in the game (I think it's called dynamic music)
any help?
I would recommend starting with your smallest idea first. The learning curve will be steeper if you are also new to programming on top of modding pz
They should add a religious trait where the person is less likely to be hit by sadeness and stress as religious people tend to put the state of the world around them as being a test from god.
Therefor, managing to bounce back from alot of tragic or otherwise, catastrophic situation.
Just look at the Palestinians who manage to bounce back from massive amounts of death through their faith in god.
Proooooobably not a topic you wanna be bringing up here
Right, anyways.
its scientifically proven that religion helps alot to cope with extremely catastrophic situations.
But yeah moodle mods like that are entirely possible. There's boredom mods, panic mods, one of the cool folks here just released a discomfort mod, etc
I just hope someone adds the cigarette whitdrawal and subsequent cure mod.
Make a mod that adds a "pray" action.
Makes no sense that someone who has gone cold turkey on cigarettes for weeks on end should still feel stressed without them.
Spend an hour praying, reduce stress and unhappiness.
Drastically too.
Could be pray/meditate/something similar for multireligious purposes ๐
Add mod options for different forms of worship from different religions.
Start popping off some sick yoga poses and get Fitness & Strength at the same time.
Could also add buffs to certain things like listening to religious broadcast, or reading the bible.
or the coran, or whatev.
With certain broadcasts even giving out certain buffs like brave.
Ooooooh temporary Brave/Desensitized from going full Jim Jones
Real 1993 Kentucky is probably close to 100% Christianity & variants, but a mod made in 2024 can be more inclusive.
Yeah isn't Kentucky literally in the Bible Belt?
There's no formal definition, but pretty sure Kentucky is in there.
one of the bigger protestant state.
Evangelical protestant
But there are degrees to religion.
Some are religious but not all that included in it.
While others are fully immersed within it.
Some may not be able to cope with their situation using religion while fully devoted religious may.
Yeah like Desmond Doss
@bright fog Just woke up and wrote this. Think it'd work?
if you cache the object it is not going to stay in its current state, it is a reference not a copy
What object?
The ones in vehicleParts?
for _, oldPart in pairs(vehicleParts) do
local hood = vehicle:getPartById("EngineDoor")
if oldPart == hood then
local oldCondition = oldPart:getCondition()
local newCondition = hood:getCondition()
local partDamaged = oldCondition < newCondition
```if ``oldPart == hood`` then ``oldPart:getCondition() == hood:getCondition()``
they're the same object
Huh?
Yes, they're the same object but their condition could be different when the check happens, when it does happen then we transfer the damage to the one at the front.
how would they be different? they're the same object and nothing happens between the two checks
When the vehicle crashes.
You're checking every tick so no
Every 10 tick.
Yea indeed, tho I still think that's too much
30?
The question is, do you need to check that often ?
there is no difference between oldPart:getCondition() and hood:getCondition(), the two variables have the exact same value
Imo 1 second is plenty enough at least
i think 10 is good
this affects visuals, it will look bad if you check too infrequently
If you think in terms of optimization, use base-16 numbers. :D
0xF ticks brother
anything above 1 is probably going to be noticeable though
oldPart is the part that gets registered upon entering the vehicle.
So its condition could change while there is still parts in the table.
I feel like people would be too occupied crashing their car than looking at how well their car looks when crashing 
oldPart *is* hood, there is no difference between them
There's no way for me to check the condition changing then?
Is this an issue with misleading fields / API?
you'd have to cache the actual condition value
no, just a misunderstanding with the language itself
Oh ok
How would I know it's the same object though?
just caching condition by part id should be fine
lua never copies objects, when you cache an object you're just saving a pointer to it, so it will change when the 'real' one does (it is the real one, there is no separation)
it you print them together and they have the same numbers next to the name using @ then they're the same object in JVM memory space.
Ohh I see.. So they're confusing pass by reference vs pass by value.
All strings and objects / arrays are pass by reference. They don't deep-clone when reassigned to another variable.
strings aren't
for _, oldPart in pairs(vehicleParts) do
local hood = vehicle:getPartById("EngineDoor")
if oldPart == hood then
local oldCondition = oldPart:getCondition()
local newCondition = hood:getCondition()
local partDamaged = oldCondition < newCondition
if partDamaged then
-- Transfer damage to the front trunk
local frontTrunk = vehicle:getPartById("CountachFrontTrunk")
frontTrunk:setCondition(newCondition)
hood:setCondition(oldCondition)
end
end
end
```This part will not just check the hood though? It'll also check other parts.
yeah, lua pretends strings are values even though they're universally implemented as objects
I don't like that decision, coming from a compiler-based world.
local oldCondition = oldPart:getCondition()
local newCondition = hood:getCondition()
```Oh, so you mean this will always be the same?
yeah, you're just checking the condition on the same object twice, it's not going to be different
.
the way objects work in lua, where a variable might contain a value like 5 or "my string", an object (java object, table, and a couple other weird things that aren't very important) is just a pointer in memory to the actual value
so it doesn't matter when you cached it, all object variables will actively update when the object does (because they just 'point' to the actual value, which is what is actually being changed)
Alright, refactored it.
Hmm that's really good to know actually
Yeah, thanks. That is a really valuable knowledge.
So that could also be used an optimization trick
it's why caching works
You could technically cache it 5 years ago and it'd still point to the same object ๐
some objects do get replaced in certain circumstances but generally you can cache any object and expect it to stay active
Wondering if I can utilize that for my zombies since I cache their data when they get loaded in
Perhaps I can cache some few bits I use later and a lot of times
So even if it gives back a simple value it can act like that ?
only objects
Right yea
Hmm, I may only need to loop through CountachFrontTrunk, Engine, and EngineDoor.
i don't remember who i suggested this to but a way to track a zombie somewhat cheaper could be to cache the object and check the persistent id hasn't changed (in case they were recycled) every time you access it on a new tick
That could allow us to also have an OnZombieUnload or some shit like that ...
That's really good to know
I might see some use for that in the future
Hmm, it's not updating.
ooh actually
their online id becomes -1 immediately when recycled so you should check that instead
saves storing the persistent id
What?
0 you mean ?
wait wasn't that your original suggestion ?
Will this work in lua? "`{variable} hey`" instead of variable.."hey"
oh "hasn't changed" ok I see lol
nah, you can use string.format but it's not as pretty as fstrings or anything
Owh.. I was able to do it in Luau.
-- there's a lot of different % codes, i usually use this cheat sheet i googled
-- https://cheatography.com/ambigious/cheat-sheets/lua-string-format/
string.format("%s hey", variable)
strings are hashes
And hashbrowns are delicious.
it can be cheaper than multiple concatenations when that matters
You don't know the true depths of crazy in programming until you write syntax highlighting in 100% Regex.
You people being all technically proficient with all this coding stuff and here I am, accidentally discovering how to unwrap a texture
I prefer not to use regex
You have chosen /!(death)/g.
In Lua there is str:find(substr,1,true)
Regex isn't natively supported in Lua.
Not a regex
Kahlua has some string function that actually just uses regex, but idr which it is
It's probably supplimented by Kahlua or TIS by proxy.
Yeah, it's Kahlua-specific. I think it might be split
split might be coming from Java but fed through Kahlua.
I'm so used to using things like indexOf() !== 1
That's how most of the Lua builtins work in Kahlua, with the very strange exception of math.max and math.min
regex is always heavy, no matter native or not
Yup. It optimizes in that way.
This is the syntax-highlighter Regex for the VSCode extension for script files: https://github.com/asledgehammer/ZedScript-VSCode/blob/main/syntaxes/zed.tmLanguage.json
but table.concat is cheaper than string.format, isn't it?
e.g. for 100 concatenations
I was thinking about writing an x86 emulator for PCs in PZ.
Would be fun to code inside of PZ back in 1993
Lua is slow as heck so it'd naturally be as slow as 1993 ASM
wake up neo, get access to the host system....
yeah, and string.format doesn't support unknown amount
Hi everyone! quick question- I'm new to modding, though I'm a programmer for my career, and am just poking around the PZ decompiled files hoping to put together a tiny mod in b42-but am having trouble finding fields for items lol
in the java files specifically
InventoryItem
Ah awesome! thank you
It's good idea only if it's implemented as mini game, not as real programming, imho.

Oh but I hail from the lands of ComputerCraft.
It will be televised.
Quick followup- after decompiling the code in VSCode is there a way to check referneces and implementations of various classes and objects? Or is my environment just cooked lmao
My recommendation: use Vineflower as it decompiles complex logic pathways better.
IntelliJ IDEA has a plugin for vineflower and a default one for the older version fernflower.
I'm sure vscode might have one.
Fantastic, thank you!
vscode is not ideal for compiled languages. IntelliJ IDEA Community Edition is free and provides more support for Java works.
Zip up the code in PZ as a zip and renamed it to a .jar file. Import it as a dependency in maven and double-click on references and classes to decompile.
=)
If you want to write java mods, this is the easiest method. You can compile against the game this way.
Ah ok! That's great to know- another quick question (and thanks again for your help) I was under the impression that mods and their scripting logic had to all be written in Lua? If they can be written in java that would be lifesaving since I don't know Lua at all lol
Conventionally mods are Lua and are on the workshop. You can always go Java however the work required for people to install mods and the fragility of this approach is discouraged.
I personally don't give a f--- but most do.
Evil programmer: for loop to concatenate %s n times (without table.concat), unpack into string.format
Bro.
That's great to know-Might be a good way for me to play around a bit with the code
Sometimes we have to feed the beast (bad ideas that pop into our heads)
I'm the gramps of Java modding for PZ, so ask if you are interested in that realm. Otherwise literally everyone else lol
I found out that strings passed in LuaNet have an arbitrarily large char limit.
I solved the problem by string-splitting and rejoining.
Bad thoughts.
hello brothers steamworkshop dosent work with weekone mod can anyone send it to me via file
This channel is about mod development; may want to ask in #pz_b42_chat
cool sorry
We forgive you Rick
No apologies. You're welcome.
@frank elbow Encryption of lua network packets is possible now and public.
There's a framework I wrote for this.
And it supports massive strings, split into string arrays when sent.
i'm making a recipe in 42, i need to use only part of the hunger amount of an OilVegetable, how to do that?
item 1 [Base.OilVegetable],
item 1 [Base.OilVegetable:2], ??
item 1 [Base.OilVegetable;2], ??
iirc this feature is not implemented yet
Nice
I've had an irrational fear of hitting the arbitrary limit since you mentioned it forever ago
Hahaha
Even though I know that's likely unrealistic because I don't find myself needing to send large strings anyway lol
When you're sending entire files of Lua code as encypted text, you'll get there in no time.
What's funnier is that the framework uses async-callback design.
Thank God Kahlua had enough work to support coroutines.
If PZ allowed spawning up Kahlua environments for async calculations this would be a game changer.
Sorry for all the questions, but another (hopefully) quick one- does the decompiled code have the actual files where they define fields of the various in game objects? I'm looking for the properties for the Beer Bottle, and I see it referenced with "Base.BeerBottle" in the code, but have no clue where to find those properties
i'm specifically trying to figure out the logic for checking if a bottle is opened or not when a player goes to drink but I've been spinning in circles for a bit
no, they're defined in 'script' files in media/scripts/
Ahh bummer okay! time to go find a mod that adds a new bottle item and snoop around
you can just look in your game directory, i mean no because it's not in the code and you don't need to decompile it, it's separate
You can honestly just refer to how the vanilla game refers to various items and probably get a good enough idea.
As Albion said, no need to decompile to find the references to it.
media/scripts/items_food_drink.txt B42 version.
item BeerBottle
{
DisplayName = Beer Bottle,
DisplayCategory = Food,
Type = Normal,
Weight = 0.4,
Icon = BeerBottle,
EatType = Bourbon,
StaticModel = BeerBottle,
WorldStaticModel = BeerBottle,
FillFromDispenserSound = GetWaterFromDispenserGlass,
FillFromLakeSound = GetWaterFromLakeBottle,
FillFromTapSound = GetWaterFromTapGlass,
FillFromToiletSound = GetWaterFromToilet,
Tags = Glass;GlassBottle,
component FluidContainer
{
ContainerName = BottleBeer,
capacity = 0.3,
Opened = false,
CustomDrinkSound = DrinkingFromBottleGlass,
Fluids
{
fluid = Beer:1.0,
}
}
}
Whoops- I was looking in my media/script folder in the decompiled code and was seeing nothing, of course. Thank you both!!
Why do you have access to your media folder in the decompiled code ?
Did you just decompile from ProjectZomboid and not zombie ?
This works as expected, thanks @bright fog and @bronze yoke for your help ๐
Finally let's gooo
but to answer the question directly that is exactly what I did ๐ฌ
i mean it's fine to do that, especially if you want to look inside the dependencies
the main reason i don't do that is it recursively scans every workshop item i'm subscribed to lol
If you do that, just decompile the dependencies alongside zombie
But workshop files are not stored in ProjectZomboid ?
look in here
Oh
Windows 98?
i just symlinked it to my actual mods folder
I didn't even knew the game was redownloading mods when hosting
xp themed but windows 10
lol nice
Oh god
that's why Initialising takes forever
and why you can get checksum differences with yourself
Amazing lol
interesting
one of the benefits of limited disk space i suppose is that you never miss something like this
i can't afford to double my workshop size ๐ญ
Does anyone here know how generators work in the game's files? I've been trying to make a small mod that just prevents specifically the premiumtech generator from ever losing condition. I assumed that I just had to change ConditionLowerChanceOneIn to 0, since the different types of generators had their own values here, based on how high quality they are, but it doesn't seem to work.
(for build 42)
hi all, i'm making a recipe in 42, i need to use only part of the hunger amount of an OilVegetable, how to do that?
item 1 [Base.OilVegetable],
item 1 [Base.OilVegetable:2], ??
item 1 [Base.OilVegetable;2], ??
Skinwalker mod when
We can make zomboid run at night maybe we can make deer go feral at night
Can your vehicle's gas tank get damaged from crashing?
i think it can be damaged by driving offroad
It's none of my business then.
I wonder why they have a function that damages it when you hit a character?
It's only 1-3 but still.
Took way longer than I'm willing to admit, but I got ONE of the two hands working with the bag so far.
nice
How do I get a vehicle's overall condition?
Hello, so I take it we have to duplicate all the media folder for B42 or is there some way around this?
you have to duplicate it
The one shown in the mechanics menu it is calculated like this: ```lua
function ISVehicleMechanics:recalculGeneralCondition()
if not self.vehicle then return; end
local generalCondition = 0;
local totalPart = 0;
for i=1,self.vehicle:getPartCount() do
local part = self.vehicle:getPartByIndex(i-1)
local cond = part:getCondition();
-- if we removed the item, condition should be 0
if part:getItemType() and not part:getItemType():isEmpty() and not part:getInventoryItem() then
cond = 0;
end
generalCondition = generalCondition + cond;
totalPart = totalPart + 1;
end
self.generalCondition = round(generalCondition / totalPart, 2);
self.generalCondRGB = self:getConditionRGB(self.generalCondition);
end
I have to calculate it myself?
Is there no public function?
It is saved as generalCondition in ISVehicleMechanics, but has no getter
Buh.
thx
Well, thanks anyway.
Asking here again if someone is able to help with my issue
I am using sandbox vars to edit loot distrubtion tables for zombie loot however added loot isnt appearing on the zombies at all (but is appearing in lootzed)
Function is being called during OnInitGlobalModData event and ItemPickerJava.Parse() is being called at end of function
can show code if needed, but going slightly crazy
I remember someone with such a problem tho I don't remember what causes it
I remember it being a very simple reason
@tranquil kindle was it you who had this issue ?
Last time it was you that had it
You tried add something , i belive scanner to tables, it was in lootzed, but hasn't spawned actually
I don't really mess with loot on zombies, i only add clothing to them.
Simple table insert works for single items, you can try loops for more items.
I think it should be manageable with sandboxvar as its same as you'd just put higher loot in sandbox options when you start vanila game.
Unless?
local lootString = SandboxVars.customizableZedLoot.LootString
--Checking if sandbox vars exist
if string.len(lootString) > 0 then
print("Sandbox Var String has value")
local lootTable = {}
--Splits sandbox var string into array separated by commas
lootTable = split_with_comma(lootString)
local prevItem = false
--Runs through array and adds in loot
for i = 1, #lootTable do
local currentParse = lootTable[i]
print("PARSING", currentParse)
if prevItem == false and type(tonumber(currentParse)) == "nil" then
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, currentParse);
table.insert(SuburbsDistributions["all"]["inventorymale"].items, currentParse);
print("added to first condition")
prevItem = true
elseif prevItem == true and type(tonumber(currentParse)) == "number" then
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, currentParse); --Setting value for previous entry
table.insert(SuburbsDistributions["all"]["inventorymale"].items, currentParse);
print("added to second condition")
prevItem = false
elseif prevItem == true and type(tonumber(currentParse)) == "nil" then
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, 1); --Setting default value for previous
table.insert(SuburbsDistributions["all"]["inventoryfemale"].items, currentParse); --Adding our new value
table.insert(SuburbsDistributions["all"]["inventorymale"].items, 1); --Setting default value for previous
table.insert(SuburbsDistributions["all"]["inventorymale"].items, currentParse); --Adding our new value
print("added third condition")
end
end
ItemPickerJava.Parse()
print("Items parsed")
else
print("No Sandbox Vars found")
end
end
Events.OnInitGlobalModData.Add(addSandboxDistributions)```
most of the code is just a for loop adding items based an input array in sandboxvars
hmmmm, looks fine...?
and input into my sandbox var is
Base.CigaretteCarton,150
and its here so idek
its something with the for loop, simply adding in a item to the zombie pool with itemparse works
hmm
will look into it more
oh it's because you add the chances as strings
i'm shocked lootzed still works, that's weird and annoying
yeah
shared it here
#1070852229654917180 message
When replacing the death SFX, can you add multiple audio options? ik you can with level-up sounds
Anyone know how to put a vehicle image here? Similar to the _base image in mechanic overlay.
media\ui\vehicles\seatui
It's fun watching this mod develop, thanks for sharing.
Thanks.
I do this in almost every community I've been in. It's also great because I can gather feedback and improve the mod while working on it.
I agree, it's so cool watching people do this stuff. I work with game engines but mods still feel kinda tricky to make to me, cus everything is so specific to the one game, it's not like building your own stuff and just knowing how to work with it by default cus of that
I wanna try myself one day when the info is all up to date
For a proper Italian Sports car feeling make repairs take 10x as long and cost 10x as much.
local tex = getTexture("media/ui/vehicles/seatui/" .. props.imgPrefix .. "base_small.png")--this how vanilla gets the image. prefix depends on your vehicle name
For a vehicle, is there a way to limit backward power or speed independently from forward ?
I used to have a boss that collected old (i,e: 1990-ish) Ferraris. He'd joke that they liked the burst into flame spontaneously. Later he said the joke stopped being funny after one of his cars actually burst into flame spontaneously when he was out on a group drive.
I think gear modifies it a bit, though not too much.
I think a lot gets hardcoded into the Java - I use the better vehicle physics mod, and it needs java replacements.
I've tried setting them to 999 but I think the game caps them.
(I think it also ignores the gear ratios set in the vehicle script, because a lot of vehicles don't have those the ones that do have terrible gear ratios.)
When I did the "toggle speed demon" mod I first looked for a way to boost vehicle power somehow but gave up, and just turn the speed demon trait on and off.
Error I get when I try testing whether or not my recipe script will work
the actual error should be lower down, idk exactly what causes that message but it's non-critical
should be within the last 30 or so lines
search stack trace
The error is usually going to be the 'last' error before the one that closes out the game;
It might look something like this;
Go a bit further up, it's going to be something related to one of your recipe .txts above that error. That's the error that closes out the game.
It pointed out that I did get the base code for peaches wrong. Base.Peaches instead of Base.Peach.
oof. Was it really that simple
im so stupid. Ty for directing me to the error
No problem! And now you know how to debug for the future ๐
can you symlink the cloned file for b42 and then upload?
i do this for workshop and mods folders so i guess it might work too..
i don't think symlinks work like that
One more question, maybe yall already know. Can you have multiple death songs? You can have multiple lvl up sounds so I thought it might work.
too bad
tho it does work on workshop for some reason
you could try and stop it from playing and then play your own audio
what allows a mod to show up in the b42 modloader, and allow you to select it?
look at the pinned messages
just put it in a folder labeled 42?
Thirst and hunger values go from 0 to 1, is thirst reversed?
hunger from 0 (not hungry) to 1 (starving)
thirst from 0 (dehydrated) to 1 (not thirsty)?
I would not be suprised.
ive got a note on this but im afk rn and using mobile
How's this as a name for a mod to let yo pick up multiple animals? Too much?

witty
Keep it
Good, just wanted to doublecheck!
alternative idea for the poster:
good job!
perfect
aaaaaaaaaand it didn't work
damnit
trying to update the invisible patches mod
no code, just changes textures
ah blast it
i'll just make em invisible manually
what are yuou trying to do?
I can't find any info on this, how do you make it?
check vanilla ISVehicleSeatUI.lua it is loading the png in the end.
you can also check AutotsarMotorClub mod (B41 version), it has not changed for B42 https://steamcommunity.com/sharedfiles/filedetails/?id=2778576730
OK, thanks.
Can someone familiar with server/client commands please help me figure out whats going on here? Are commands async or non-blocking? I havent had this issue before.
CrossHair.isMatchingKey = false
--isMatchingKey BEFORE: false
print("isMatchingKey BEFORE: " .. tostring(CrossHair.isMatchingKey) )
-- I know 100% isMatchingKey set to true before the AFTER print statement on the next line.
sendClientCommand("remoteInventory", "requestServerItems", { otherPlayerID, keyID })
--isMatchingKey AFTER: false - Should be True
print("isMatchingKey AFTER: " .. tostring(CrossHair.isMatchingKey) )
they're async, if they had to wait for the server to respond they would take an insane amount of time
Bruh, what. I'll have to figure out another way to write my code.
It does seem pretty damn quick for this though, but its crazy i never had this issue
if they were blocking they'd take your ping + the time for the server to process it + your ping again + whatever overhead time to complete
when you keep in mind that it's not unusual for ping to be in the hundreds of milliseconds, and is almost certainly more than one single frame even when good, they would cause insane lag
totally understandable
I only expect this to be in build 43
Spongie, what kind of witchcraft did you do to get clothing to distribute on zombies?
clocking back in to update mods.
this would be nice to know as well lol
you have to make an outfit in clothing.xml and then insert the outfit into the spawn list
making outfits is a total nightmare though because you have to use guids for the clothing items instead of the names
so you need to add comments to everything so you know what youre looking at
I was using outfits prior lol
oh
that should work i think?
maybe try seeing the chance to like 9999 so you can see if theyre spawning
Right
i love this
I'm putting the mod together now.
Something else must be broken since none of the rockers are spawning with them. I'll have to do some more digging. Thanks Spongie
does each outfit have to have it's own guiid?
Note to self: when starting a new game to test a mod, disable Bandits: Day One.
NPCs scared my chickens away!
Then I got shot.
Yeppers
okay gotta add a hat and a satchel as a possibility, though i want the hat to guaranteed.
lol postal zombies!
That would be a fantabulous way of getting recipe magazines and/or skill books ๐
Shoot the freaking mailman lol
oh snap. that means i needs to set the satchels to have mail as a default spawn in them.
no clue how to do that
damn. they have no SHOES either.
Didn't B42 add mail zombies?
A buncha hippies lol
Anyone know what this error means?
welp. they just do NOT want to have shoes it seems
is it safe for a save file to change names of the .xml files of clothes? and like everywhere else, i had something called "red" but i added more colors so it doesn't make any sense now ๐
Already a thing in B42 - postman zombies have mail satchels that contain letters/packages. You can usually find two near a crashed post van.
I still want to figure out how to allow animals to moved into bags/containers, but I'm starting to think it's hardcodded in java in one of the conainer functions.
yay. i still wanna make mine work.
๐
ha! after only like a whole day I managed to make the other ankle holster and align them to my modded shoes, and align a gun to those ๐คฃ ๐ต๐ป
check pins
Lemme try to type out how it goes
Go to your zomboid/workshop/yourmodname/Contents/mods/yourmodname
Create a new folder, and name it 42
Create another new folder, and name it common
You can leave your media folder in this one
Copy and paste your media folder, your mod.info and poster.png into 42
In 42 edit the mod.info to have the following line
versionMin=42.0.0
You should be all set
copy and paste into the folder named 42? As in leave a duplicate of them in my final "yourmodname" folder?
That's if you want to port your mod to B42 but still keep it available for B41
Ah right
If you want to just make it for B42 then you only need the 42 and the common folder, and the mod.info in both the yourmodname folder and 42
So if they make updates, say like 42.9.5 or whatever, it should still be fine?
I don't have to keep updating?
yep
PZ will look for the most compatible one and if you're set just for 42 and minversion 42.0.0 then PZ will always pick that
Oh god, how do I update my mod on the workshop now?
With those files
Been too damn long lmao
ingame, main menu, workshop.
But don't just do that lol. Your scripts and lua will be broken if you don't check 'em first ๐
For some reason it doesn't show a Build 42 tag in the in-game menu, any clue as to why?
eeeeeeeh, well are you using B42 lol
Good evening, zomboid modding people; I have been thinking about doing two things in the modding department:
- A moodle mod where I would doodle some moodles and have them replace the existing ones just for fun; been inpsired to do it after seeing a few do it on their own
- Maybe some sort of magazine, or a custom edit to the catalogues so that they can display a random date like they do with magazines (Month, Year) but as I am searching the soruce code I can't seem to find a part in the game that does this, along with any recorded media in the game's files to do this with the catalogues. A reason why I want to do this is to add a bit of realism to the catalogues, as they have releases in certain months of a season like in real life.
I know I can basically start by doing some work here are there, but I may need some help with 2; I might make it as a first-time modder sort of thing, where I would test it out in the game's environment.
#2 is in Lua/Server/Items/SpecialLootSpawns.lua
#1 is as simple as making the images, naming them the same as the other moodle files
thanks ๐
Having issues with an Animation XML. I'm trying to get it to play Bob_IdleAngleTorch in both hands, but can't even get it to do it in 1 hand when simply using a renamed copy of the vanilla holdingAngleTorchRight.xml
Did you just enter the broken world of AnimSets in B42?
.......Yes
What is clip { event = ""} for? Are they just used to play vanilla sounds?
Yeah B42 can't get custom AnimSets yet. Apparently some folks have been able to make their custom animations work by putting their AnimSets in the old B41 media folder, but I wasted almost two weeks trying and failing to set up one single custom AnimSet, even using that B41 workaround.
yeah
FMOD event reference, events cannot be added by mods
OK, thanks.
In other words; the answer to my question of "How do I do this is...."
"HAH! YOU DON'T!"
I even tried to do some lua functions to get my s*** working but no dice.
I gave up and will wait for the next hotfix, that I hope and pray will include the AnimSet fix
I'll just half ass it with one hand and fix it later when it goes stable
Do you know how to increase the pitch of my engine sound when accelerating?
if there is a way, i don't know it
modded engine sounds just inherently being a lot less dynamic than vanilla ones is a known issue unfortunately
sad.
is it possible to make an entity with the new building menu thing that has multiple sprites on a single square?
I see the row and column options
Damn it, I was excited to work on the sounds.
I guess I'll just use vanilla sounds 
Hello everyone. I need some help. I'm writing a modification and I need to start raining. Does anyone know what method or call I can use to do this?
VFE update peek ๐
B42 is making me redo all the models anyways, so might as well roll out a feature I've been cooking for a while...
What a cool freaking detail!
How about look for answers in other vehicle mods? I have a feeling that many of the questions you are asking here have been solved by other vehicle mods. For example, reverse trunk issue have been solved at Delorean mod. I think there was a mod that focused on engine sound, was it NISSAN SKYLINE? So many of Zomboid's vehicle mods are great creations, and I look forward to seeing your great vehicle released as well. 
I'm also probably going to add an audio queue to jamming as well, they're not communicated that well imo
I always look through mods before coming here.
Oh yeah something needs to tell us when it happens. It's just plain annoying when you have to hit R, hit X, hit R, and still be guessing what's going on
Oh yeah, it's coming together nicely~ The across-carry when in primary, and fireman carry when in secondary so you can run&gun with your dead buddy (25% movement slowdown from holding the body on top of the inventory weight so it's not too OP)
you got them working?
That is excellent
Yes- well mostly. I ended up using the default RAngled torch animation and I'll update it later, but for now it looks okish
Are we cooking with b42 modding
Instructions unclear, modding B42 cooking.
XD
Not to pry or anything, I'm just guessing.
But is that a changeweaponsprite thingie or just another one of your awesome custom functions? ๐
unfortunately one of the worse aspects to mod right now
it's not the vanilla one, if that's the question.
I replaced it with a better version long ago, one that doesn't have the attachments fall off mid animation.
The lua relating to that is actually unchanged from the B41 version. It's just me using it more.
Rad. Good stuff as always ๐
is possible to programmatically play the level up sound?
how hard would it be to make a mod that allows attaching a toolbox to the backpack bottom slot of hiking / large backpack?
I would think that attaching an item is easy enough but maybe a container could be a bit weird? Container + container and all
Not hard
There's a b41 backpack upgrade mod that lets you attack a container to a backpack
If you want it to show on the inventory screen you'll probably need to adjust InventoryPane or InventoryPage
Damn, looking nice.
If you simply want to make a sound, you can do so below.
getSoundManager():playUISound("GainExperienceLevel") -- current sound
getSoundManager():playUISound("levelup") -- old sound
I had to go check the old sound and holy moley it sucks compared to the current one. No banjo at all, smh
i just want it to hang off the back
how about the level up text? is there an easy way to cast it? or do I need to manually drawText
In all of its glued together glory;
https://steamcommunity.com/sharedfiles/filedetails/?id=3404348394
uploading animation + AnimSet mods like it's nobody's business ๐ฎ
I don't know how you want to display it, but the easiest way is to use the Player object's Say method. I suggest you check the vanilla source or other similar mods for these common implement. If you look at the vanilla implementation, you will immediately see how to use the Say method, display your own messages, and for translation.
getPlayer():Say("Hello World")
Hopefully will have another one a few days from now shipping out too but just trying to work out some issues with it. 
Also this looks hella' clean.
Just a lotta' AnimMasks, isn't it? I might be able to give some moderate help there too since I've been using AnimMasks to add carry animations to some of my custom fluid containers for my upcoming mod.
a LOT of them.
Yeah 
a little bit od code to make it work.
models and textures for; Garbage Bag, Burlap, and Tarp Craftable Body Bags. Soon to come is Body Under Sheet, Medical Body Bag, Biohazard Body Bag
Said it before, will say it again. This mod's gonna be rad
Biggest sticking point you might not be aware of; is currently the AnimSet's folder is busted. You need to keep a media folder and AnimSets folder in the format of B41 for any defined xmls you have; then also have it in the B42 file structure.
Can someone help me fix this code?
What is it doing incorrectly/not doing?
you might have to include imports {Base} at the top i think?
like this
It is giving me alot of errors when I enable it and it breaks the main menu for some reaosn
comma after 1st display name
Do I close it with a bracket? I tried it and it didnโt work
its this
So with animal skeleton rigging and AI, is it possible to make monsters now? Things like uhh
Creatures from the mist?
I got the errors to stop working.
Did alot of work too like doing the Translate file
but now the items I added aren't appearing
i dont think the ai stuff is exposed to lua yet so all thats possible rn is reskins of farm animals
You could always do that but you're most definitely forced with the same bones
Please help diagnose doctors. Items added are not appearing in-game
Unfortunate, but understandable. I can't begin to understand how to code, I simply asked as a curiosity rather than a request.
item EmptyBottle is missing a comma for one
Correct. I try to spread this info as much as I can. Itโs also already reported here; #1318920979581501502 message
I wish that worked for me ๐ฆ
Ooooooooh I spotted it, lemme see if I can fix it I'm pretty sure though
Just fixed that issue, still broken
What is it?
k, I spotted that your module imports thingie is missing a { but adding it didn't fix it either
bro, each mod I try to make does this shit with me
Instead of
module AlcoholEmpire
imports {
Base}
Should be
module AlcoholEmpire
{
imports
{
Base,
}
@torn igloo why do you need a function every real life seconds ?
they cant work without a shit ton of bugs that i end up fixing for more hours than i coded that shit lol (i didn't i stole most of the code)
Yea that's been known for a while but I think people should still wait tbf
that didn't fix it right?
probably yeah
otherwise its a waste of effort
b42 mod setup is so damn weird
Nope and now I'm lost lol, I'm trying to set it up exactly like my mods do
maybe im missing a file and the problem is not in the item one
like i didn't add any loot distribution
maybe smthin else is missing/broken
have you checked error logs
Oop, deleting emptybottle stopped the errors
ahh
and allows your items to spawn in
do the { fix too
Body under a sheet
if I can, I want to make it so you have to hold the Sheet version in both hands. That way there's pros and cons to actually crafting the other bodybags
Just they missed some parts bcs they didn't test everything
No no no, you let me go get my pitchfork and don't be excusing them like that
I'm not excusing anyone here, but saying the mod setup is weird is just stupid, it's great but they missed some parts bcs they didn't test it but once they fix those problems it'll be way way better and imo it's already way better than before besides not being able to keep posters in common and animsets being broken
I'm just kidding. ๐ I'm digging B42 but yeah I'll still throw jabs at TIS for some stuff
ํต์ผ๋ก๊ฐ๋๋ค?
A decade of technical debt.
I don't think anyone here will defend the Zomboid mod structure as being a good example of how to setup modding for a game, and it also inherits all the jank from the game itself.
Still better than working with Unreal engine where the only option (if they don't provide proper modding tools) is to replace entire assets, most of which are "cooked" into a format that is near impossible to make sense of/edit.
So i uploaded a mod for b42 only, it turned out out animations were not working, so i copied animsets but also the fbx animations to old structure and it started working. To be prcise, I'm not sure it its the animsets or the anims_x folder that needs to be in old structure
This is not a huge problem once you know this of course
It is a yuge problem because guns won't obey their assigned custom AnimSets ๐ฆ
oh
AnimSets
Anim_X should not need it
Also I saw a screenshot from someone of giant zombies @potent loom
I thought I had told you about it but was most likely someone else but this is because you didn't scale down the animations when exporting and when a zombie is partially loaded it will show the actual scale
So when exporting you need to set to 0.01 the scale
yea, my friend is fixing it for me
Found a way to fix the bottle bug without removing it. Turns out I messed up the empty bottle data
but now I got a new problem
Giant bottles
add a scale = 0.something, to your model entry where mesh and texture are
i don't have a model entry I think lol
hi all, i'm making a recipe in 42, i need to use only part of the hunger amount of an OilVegetable, how to do that?
item 1 [Base.OilVegetable],
item 1 [Base.OilVegetable:2], ??
item 1 [Base.OilVegetable;2], ??
i see
model BeerBottleGround
{
mesh = WorldItems/BeerBottle,
texture = BeerBottle,
scale = 0.4,
}
That's vanilla for emptybottle
damn so the animation fbx is the reason?
this happens to my dog zed
So I don't have to check ticks to count it is 1 second before executing something, so I don't unnecessary block the client with unnecessary jobs. This is pretty much applicable to many mods that run ticks and needlessly block things with their excessive checks.
I have quick question
so to add new version to
a mod
i need to made b "42" folder
fold previous content there
and its all working?
No, you also need the common folder
no.
In the same folder you make 42 at
go into the mod folder where you see tyhe media folder.
make a 42 folder and a common folder.
copy everything that WAS in that folder to the 42 folder.
tada a b42 mod.
yeah by copying it it should work for both 41 and 42
move it and it only works for 42
so for typical user, I need to create new workshop item as a fork to b41?
๐
Literally me 100% of the time when going through my to-do list on my mods lol
I have a question. I want to make a new state for an item like cookability called Fermentation which has three states; Fermenting, Fermented and Ruined.
Is this possible? I want it to apply to certain items that are brewing
and it becomes fermented over time (1-2 weeks) and gets ruined if it's stored in the fridge or oven.
Yep
Body under sheet held in both hands and preventing you from sprinting... CHECK!
finally someone has respect for the zomboid dead
So question. Anyone know how to get nested inventories to show in a bag?
also can I get my old version dowlanded?
Sure, just subscribe to your own mod ๐
Ha! I just leave them all to rot, after a couple of days all bodies just vanish anyway! Why bother? lol
Can clothes be a container for sweat?
socks can be a container... just ask my teenager
he sweats like a longtailed cat in a room full of rocking chairs.
I can :DD
unless you're insane like me and set them to despawn after five years >=D
Can somebody tell me why my new container has Fluid_Container written next to it?
module AlcoholEmpire
{
imports
{
Base,
}
item AlcoholBottle
{
DisplayName = Alcohol Bottle,
DisplayCategory = WaterContainer,
Type = Normal,
Weight = 1,
Icon = EAlcoholBottle,
IconFluidMask = EAlcoholBottle,
StaticModel = AlcoholBottle,
WorldStaticModel = BottleCrafted_Ground,
FillFromDispenserSound = GetWaterFromDispenserGlass,
FillFromLakeSound = GetWaterFromLakeBottle,
FillFromTapSound = GetWaterFromTapGlass,
FillFromToiletSound = GetWaterFromToilet,
Tags = Glass,
component FluidContainer
{
ContainerName = AlcoholBottle,
capacity = 1.0,
CustomDrinkSound = DrinkingFromBottleGlass,
}
}
Also why it completely refuses the model and texture I give it?
You'll need a translate lua
WorldStaticModel = BottleCrafted_Ground,
is different from your model name AlcoholBottle
So WorldStaticModel = AlcoholBottle,
Did all the fixes lemme see if it'll help
No it's bcs of just PZ not using good proportions for the game and everything needs to be scaled down a fuck ton
Ticks%60 (or 50 I never know) and you got your every real life second event
Does not work. Actually spawns the 2D image instead of the 3D model to place
Hmm, maybe you'll need to rename the world model.
I remember having to do this for some of my stuff. Like I'd have ThingX and it would use model = ThingX, but for WorldStaticModel I would have it be ThingXGround
Weird. Maybe look at how PZ does its fluid_container translates?
What is the cause of this problem? I clarify that I have it set up on a dedicated server. The mods are loaded, but I think that those that appear [not found] do not work.
I'm using the cell phone lol
Try here. Question like that should go here anyway:
https://discord.com/channels/136501320340209664/1019767076094758924
Is there a current B42 mod tool that tracks timed events and such?
Also
Would this script work? If not, how can I get it to work? This is ChatGPT's try at my system. It doesn't even look like the code used by the game
Game tick is subjective to how powerful your machine is, there is no absolute number here. To get an average 1s, we simply grab the time and do arithmetic on it. Anyway, that isn't the point. In the java, a similiar time and arithmetic already being done, no reason why we have to do additional time and arithmetic on top of that, that just add extra time complexity.
in my game the icon for my item shows up as aquestion mark what did i do wrong?
Anyone know how I can exclude traits from other mods such as MoreTraits with ProfessionFramework?
for me my icons are in the textures folder, and the icons are named as such: Item_IconEntry.png
IconEntry being what you've set at Icon = IconEntry,
ohhhh so the item_ doesnt get typed into icon = ??? oh my gosh thank you so much
first time someones replied i really apprieciate it ,this is my first time modding
I was right where you are a year ago ๐
dude i ended up deleteing everything but one item to debug why it wont load in at all
been stuck on a loading loop
so now im just adding everything one by one ๐ญ
but does it work?
yes the icon actually shows up now!
so i guess when youre refrencing items in your items.txt you need to put item_ in front of the texture name
Ah so you can copy many
i never knew that i thought people in their other mods i been refrencing to just did that
do it as "placeholer"
if (++ticks < ticksBetweenCheck) return;
and slowly chnage all
Only in lua.
thats what im gonna try, it seems i might've had a problem with my scripts
i was stuck on a literal loading loop after "this is how you die"
well thats a good way to learn how to
some folks have said that icon_texturename.png works too but I've just used item_texturename.png since I know it works ๐
I made ticksBetweenCheck a sandbox option in Slower Discomfort, because if you have a discomfort bar visible it jerks around a lot if you don't check every tick but making it every tick for everyone was excessive.
hell the way you said works so i aint changing any time soon lol
I think it won't even work any diffrent way
my mod is really simple all it adds is a couple items and something that just requires water and another item to be able to use
is plastic bottle one of required items?
any water source, the item just needs to be filled to atleast 250ml
and then requires another one of my custom items
this has got me real fired up something i did actually works
yep yep
what about the xyz being different from 3d softwares?
tho i gues xy make sense when looking at the 2d map
gives me idea whatyadoing
sdiiieett yup
idk if cussing is allowed here
sure it is but yes
thats what im trying to do LMAO
some mods havent been updated to build 42 and i see theres a demand for this category soooooo....
lit the hope up